From patchwork Wed Jul 13 09:19:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 12916326 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 548D8C43334 for ; Wed, 13 Jul 2022 09:19:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232153AbiGMJTj (ORCPT ); Wed, 13 Jul 2022 05:19:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235001AbiGMJTi (ORCPT ); Wed, 13 Jul 2022 05:19:38 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60047.outbound.protection.outlook.com [40.107.6.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5D5B65D40 for ; Wed, 13 Jul 2022 02:19:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z7l51EExKX7zn7yX5mO38bvbT33H6yeap9CwD8cFuFXk4F+R0PoZWruLXjsiUXsJDxrfkYBb3AM4jPkYMmRWx83BWgEMoh2ftiZZLmpU+mGAO/w9+rouVQlQAjLg+k/qNHJulES9/5w+gKsZrjosMgxW0QqeKVhF2apQKvkvfypthObEWurqPCQPsh7tSu06X0d4w4jms1Y0o7yhkX6QOxXNx7oMqJGdzT1fg9ihBnYo7/4ja7T5UgXkO3nPmAdRxlzS20D9iepapxq/dw3Ib4mZQls9erkmvAjHPDT1XuNdVurp/LvBKZQ+tf4nfnGj0t6VzoZJXv55V4F/b5wKVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vhtVsjJvr1mt+FAEVzCyU+1pVcikUQd+0/H1IYoovTs=; b=k/XlSXaAqLCzqbucaxGuFhT/UJ0iZAWI5OgrppXj6cXkw5lGi0ieL5KwBo8cfzc7D/lexkTrEUeMFmPI74ACQAXPUGOqLfCu27Tku0qCrxDWNJ79UIeQKkAmxFH1q+tCbyDltZ8ZgESl5mOcV8wT0nbxHyM/Pv1GV0LKrLrTVbY5ULFBeiM7NeyBrSF1HDTyBVJ8JkuyinC8985PkPMr8K56F0+uoLxchEPKs0pb3DbLl+AiTYotP0RlE0R5OH31EJ8CmkqYCgEGgRwgWaigROrGpvIjLWU89Ek+efHmoV7nsO2BbJKxZ5FQmp9EPDYo0rmhTOBX5ArEwkxvHTKtWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vhtVsjJvr1mt+FAEVzCyU+1pVcikUQd+0/H1IYoovTs=; b=2WW7X5B44yMfeOw+JVSMNqzPdc847jM7sRPVu7qxws8meHC2m2tXL2dErVeKvMbl09HnqAp01RTTSyq72+bHCQrrkCM1zaHFl5h8XBFbphonIfb5Cs16RDEAC6ciOjbAAq4lulkdTSLerdqoC2+65zDU6cxWO1fFZVwZFfSVdmNOFcuNXkNdznVWRypEydJhSDDcT8Il47l9j0Le+xAYX/vvgulcHCQuv30AYTuQp7Ky7lri5c12POiApZxsCGh6yZZk5XdY/swiFh5h2VZ/mIvE9isP45e91TS+Itox2eJhZlgZ91RRtBDntf0ySsJvvn3MHuQy5ZxgAKEMIX3Jcg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) by AM6PR04MB6248.eurprd04.prod.outlook.com (2603:10a6:20b:bf::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.26; Wed, 13 Jul 2022 09:19:34 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::60ad:4d78:a28a:7df4]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::60ad:4d78:a28a:7df4%4]) with mapi id 15.20.5417.025; Wed, 13 Jul 2022 09:19:34 +0000 Message-ID: <16fea59d-6e61-4554-8198-24973e1300ef@suse.com> Date: Wed, 13 Jul 2022 11:19:33 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: [PATCH net-next 1/2] xen-netfront: remove leftover call to xennet_tx_buf_gc() Content-Language: en-US From: Jan Beulich To: "netdev@vger.kernel.org" , "xen-devel@lists.xenproject.org" Cc: Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko References: <7fca0e44-43b5-8448-3653-249d117dc084@suse.com> In-Reply-To: <7fca0e44-43b5-8448-3653-249d117dc084@suse.com> X-ClientProxiedBy: FR0P281CA0084.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1e::23) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1cd962c2-8f36-4401-9725-08da64b0ccf5 X-MS-TrafficTypeDiagnostic: AM6PR04MB6248:EE_ X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QjqA5UPNKnvSDeV+Ujj1DPUF6oYp2NHFbLQvMWFwrbcyJX5nvLR4Ye2YQcod31jRrDUZtED29aGZjdUBEa7p0dqAs5bjSwpPuTBZginC8TA6axSRbu2pgGAmU2uBYaA6u2j8sSkjWhbEc+O0BFnw9bIYbjPAdlbK+d4CIaspOpUT/LYROT8jH64Yo5TTNwWABdRoGZgSxwqiWZzwXqUySOYS70ne7FzQQ8ZVCjBdbSM2ssk9bnMeNCBQ3uX5+HvkCV7qNi0D0LyFElh6xo9j5jaZEtRuRs7LfcqisFzeiGG241keI5SvcYpVNhFA9mSK3jBgFilQz8SQtmlvAELWfrlxKX+yj2Af2ILYfQ4WQ50LBxR2VGBTS+qqeaQp4Xp8ZgE6W5UwbhZnBehzayWRY3G6eyHgZQyj+dj2gFNjkmNR3pPzGoN0/qCevGSsFboLJYsi8dsh1HJ/ACyY9GACziIiTiLbzqlxBUOAAmHFhYtONEwOwqOt/8L9gyrS13/oQiPZgwiuiXyrjLxWYqft+Un5fzlmQ5RaqCZE3mqjIhsxbvZIwRQa7aI2eGMkLWRqvCBUK/muU0N2MdJv85SNQVXcf4i2PDDb4NoTzq5YdA6gfkLjrYybfIImQhRkPsV8GEJ7KXDthFdpJOb3Ooi3xOX+/tAoXp788p/7B8kUOg2Xonlltct7ct/vvYzPSpqXvqLjXOeVVCxVuRzkF+TbioOUKIN8BoQKHDUxXDoYVzttHB/84NMQZFsB5GGnpLo6TY0d3SdBO+1Kyg0wp1N+nGHEQp6XPPDpGgVjD/A8DET69D5JQ8DRRDht9jHPoD8MxtXsyFacTipgbjxEEsdMw5Mej6qNWhbul5sMamQ0+DI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6560.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(346002)(376002)(396003)(366004)(136003)(39860400002)(2906002)(4744005)(5660300002)(8936002)(83380400001)(31686004)(2616005)(38100700002)(478600001)(6486002)(86362001)(6506007)(110136005)(8676002)(54906003)(4326008)(31696002)(66476007)(316002)(186003)(66556008)(26005)(6512007)(36756003)(41300700001)(66946007)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?pgxDgtqNT7aIIVHMJ8P1vJUc/rEH?= =?utf-8?q?dexKiVd7L0JDXDNndMJTEb9m4bBylVhzp7+m/sTHiFW2V+bTfn+p+2lMe/4vnUbi8?= =?utf-8?q?xlGL62huVZWYxBzrV+UULwzpsksFQdGJ40QIg3crmPNOk/vStr3yCpRpC5sAvnEGo?= =?utf-8?q?w2hcB9tnPMTn5xj2WlIpou3Ju2l2j+6sKXuWJ3HjPk3nxQEDarB33MNP6iap5ol5/?= =?utf-8?q?ncz8QodpxyxM5TTuC9of7NXVxX7mCFftRSMbtfXQ1KQCsb65BjofJ2hUmY6UHids7?= =?utf-8?q?22iaO9WfdK5hJzM0+75hhbaexyQljuxF2Ud9hs/gj2dhUX9p6fXby7u1ymO2STT/7?= =?utf-8?q?FJdVGtnNUBJ3sGqmWonM8hoxTAb2G6LFD9thv+WoHpYhwYH2qjJoZ2WvkFjRW2JbI?= =?utf-8?q?cv+4QXW7BWdg1a6OY6IXiAdC6nikxYyR17ceyuINT3xB42odNFtDY4TzQm+20Bo70?= =?utf-8?q?JFzvJjYHye0I4lA3LHUpf0MdSi5UpfZ+6z00flbrzbytv3RLpmqovfDteVpkxmDYB?= =?utf-8?q?n/MvXcMeTyEJs4cNXYWXQREldIzvxXkmFypSCXSp/haV/mssh6jAVt88bsjGNw2ht?= =?utf-8?q?nYAiJDovXLrLCZhCPPx1QOMC9Z2P+7HIviHYsCm/uDDaRZ/SWEd465McKSBfoWNtQ?= =?utf-8?q?qWWJlbhVRHnKzRlpw7p3PKt/uTlE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g: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1cd962c2-8f36-4401-9725-08da64b0ccf5 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2022 09:19:34.3733 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Re99TmEfUYuJ690Vobvvi41+hlirjrAU0zWiZCqcX63JSfn/A0SNnlP6DbLkIwTYIlaUEl67GjZ9CtarnZFSSA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB6248 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org In talk_to_netback(), called earlier from xennet_connect(), queues and shared rings were just re-initialized, so all this function call could result in is setting ->broken (again) right away in case any unconsumed responses were found. Signed-off-by: Jan Beulich --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c @@ -2464,10 +2464,6 @@ static int xennet_connect(struct net_dev if (queue->tx_irq != queue->rx_irq) notify_remote_via_irq(queue->rx_irq); - spin_lock_irq(&queue->tx_lock); - xennet_tx_buf_gc(queue); - spin_unlock_irq(&queue->tx_lock); - spin_lock_bh(&queue->rx_lock); xennet_alloc_rx_buffers(queue); spin_unlock_bh(&queue->rx_lock); From patchwork Wed Jul 13 09:19:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 12916327 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68388C43334 for ; Wed, 13 Jul 2022 09:20:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234638AbiGMJUC (ORCPT ); Wed, 13 Jul 2022 05:20:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234696AbiGMJUA (ORCPT ); Wed, 13 Jul 2022 05:20:00 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60086.outbound.protection.outlook.com [40.107.6.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5410DA5A4 for ; Wed, 13 Jul 2022 02:19:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LfqdRDT7Dxfb6znB7xA8Q0dnBLYEs5/Z24Wzr5CH2cpLNzUkPY3kKy+/IH7Qcetr7yq8slPOX10ZSQ962GKcQ7qCqhlyoK3E7NrJBsnM8KR7QjO5ZRm/H4eYDjw53dk2y197Z2bz4OX7uT7heXuqI3Y/+WBpr9uS4Go57Ch5X99wqJ+g23SshoTynoYzD/Zr5bPELvqIeymK507NreiHCzf9W1xsh9dUbGALv42iz7H2YtX6Mf05mNuY9XCKWxGR6EZil72qWk8SOZ7g9DpYrdfJ0ql3GgxNMXc6h+l2L7ws37seAJMD0/7IyymYWcp/xvV7vEMq5hZWKr4tyRN6KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WEzlgyoqktpBUwg5qI3Cs3eLw+k3O3PDbgsVFU2rvWw=; b=VgveumqRArUODB/DBd1QI/dmJJczlsXRsvuDwkKS+1kFaqHx6uEXeFtsU4cnW50o/oD8mEYExued+AXLlBAtQjP5kq+sQvpQYvrvq4Q/HDBQZiY8hjQ/Y6rIDNVA7IKLEx20vfethYT5n0ttCQZxV8o6/1wTeuIIabSSa+FqT2Ygg9nQMv3WHge+z6TXAthgTDv+T3d4x+NJMgnLpFdlLgdwQjZj3YnCzy/i3u7aeSzOvkcw3tMN38kMB5bbqqMZDqa5Pu1SxU4o2y2Q9u1RQeEjKcu2Ur2kX8IwY3sewRmPdRNFOK7n4OW8E1a+bipNcGFpCInMRxPlqvq9ZD3HwA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WEzlgyoqktpBUwg5qI3Cs3eLw+k3O3PDbgsVFU2rvWw=; b=rsoQ7UM28NSh93C8G5ghGNcO6lpZQDDrvZ3Kmvr3ijZz/cYvQpaj5ch3RlHZxQosRN0d4o8z0tazvNMWaWd7Z75nSRAavJeuoDGI7pT5Uqi4JAxcokDjcH+LlCTDauy0DmkZzwHd7PhlE1/6iywE2lpsz9nsn5jkZAT1vFnuMnacefdPvH21PpMNRyhWCVavCnvRKbZQrZJvO3XVSKTP/46GLMWsZAQL9beGVFCfTU4I5k0XHj1UQsDb7qhaphtPGX6JhetSb0t2CmRP/buG1siv3oPyA7wPAvRs9vhPMuzgRpRLC2tHXD0LqYl+lBr0bdtNXl0pgj1mtwXC1MuwQQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) by AM6PR04MB6248.eurprd04.prod.outlook.com (2603:10a6:20b:bf::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.26; Wed, 13 Jul 2022 09:19:57 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::60ad:4d78:a28a:7df4]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::60ad:4d78:a28a:7df4%4]) with mapi id 15.20.5417.025; Wed, 13 Jul 2022 09:19:57 +0000 Message-ID: <743b3ff3-896c-bfc9-e187-6d50da88f103@suse.com> Date: Wed, 13 Jul 2022 11:19:55 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: [PATCH net-next 2/2] xen-netfront: re-order error checks in xennet_get_responses() Content-Language: en-US From: Jan Beulich To: "netdev@vger.kernel.org" , "xen-devel@lists.xenproject.org" Cc: Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko References: <7fca0e44-43b5-8448-3653-249d117dc084@suse.com> In-Reply-To: <7fca0e44-43b5-8448-3653-249d117dc084@suse.com> X-ClientProxiedBy: FR0P281CA0078.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1e::17) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9b73baaa-af5e-4ce8-baae-08da64b0dac2 X-MS-TrafficTypeDiagnostic: AM6PR04MB6248:EE_ X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Fdppvxoy6fB7RzXwbN/jS/vA8fxOlMEaUpyLP9848ljFdMZBByjfXmbaTRY/ukPv/hFbtq4ZfuAEXZDLkiqdsTgiqQ/LgG+9ADZ732NVIhjCdv8NKgXW42bEGi3NikKxfeRMPoNCACLaLMT6cdkDU6FI/vS1xcZcnAPx39UnXY9GUfJQWQ/FFxAXwBYkyZwzk11Hmeesl4jz+R2kB4QDL73Uxywr6/ujdGAOMecToJwdodPyr+Vq1ioSkX8mKrSPkZ32UJm3qETNBPSJx/3Z7gft5RV0c8ZeOAurSSsOoA0ApigL/eTv/B2ty4uwxa9+FnaDibWqn8HrBPsOSiJjQc6ywQCGGTauAe9fDXA03DS6KejCEXQyGQAXjwips4gz3JC5klyPgZegD+9hNMvgTELTWIdXTfSSN07WOIhnuLPk0iDDYQMUG5zOZX5byu1plaIh+4TmoBnFCrUbnFcl+BwhnQb1T/1nXcAR+mTrUMNWhFONdhK3h8OZvJQH/mVUCuYC6X6T/xU3C59Z2hEKIdI3VA8JRCRDQV+hEbTI19F5up/YCjaJa9b4VBygRZ4JLIivnBzE7pjfiNv7S5G8yb5usPxDxzLUibBnld0yHDK6QCuTcEoSndq/F8JPW7dtRvdXQjd4vldOctuXqeBtdHHDwZIDSBse13jM4UW43f26xedFs7zQ0Tv3TuGzvQU5W7fANQb2J09EHQrFYbPSLfmRKSKBrvuIDtysKw5OJ6pkU/uY3UvvkNB6i1PkkedQzpvjXic3hXtoHyMxNsCAKy7nVuFHVQvIAJz5VPaMB77yqGRgD9KdrIvnaoUwjQfbYQs69NPb7xZgPDi1ZgSx8V+LE5TYvNLnEqAOVSmA9IeMm0ziTwieMt2kzThY4akx X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6560.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(346002)(376002)(396003)(366004)(136003)(39860400002)(2906002)(5660300002)(8936002)(83380400001)(31686004)(2616005)(38100700002)(478600001)(6486002)(86362001)(6506007)(110136005)(8676002)(54906003)(4326008)(31696002)(66476007)(316002)(186003)(66556008)(26005)(6512007)(36756003)(41300700001)(66946007)(169823001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSp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Oy8b?= =?utf-8?q?AbkdD3oq1El88xYDmFa5kS8aG47sFqfsSbe8fyHSaK+7pniFu92/FtrIWAz/c2It6?= =?utf-8?q?t9RpoD6zkiyvn8tfGYI1cOjdwNvdlW4Xd7UL6c0EHqRtxZUi4twvSKENbX8wGjZb4?= =?utf-8?q?oplZPykQSzbdvqsgKhNGHoma4DEvUEYxmY+d2ofiOrsd+3hVDiW3+AGN2q9m+htUr?= =?utf-8?q?H7t6JcKHADEkJv9InSgHOBwsl1aBtK7MtzZV+awNXIAB19XK7uTScHGM/NJ+JXTgo?= =?utf-8?q?lnUdoFb4Lpx+KOTUNUWjRIsOcfCJ9oKXOmuWjyPPW1bMzKNNGIYkoD+ArkDmBNPzO?= =?utf-8?q?qnFup2OScpXZhe/t3DY0DFx04bSaaP961TdLZAjuVEA4FnhxgRXK0ATYn5p8cvxt+?= =?utf-8?q?t0Fi/jX9NZtZQlAv2/75ySsJT06rxkUYAh2KTCaDIsLKoLy1NY/yMgqTpMUpiu0GB?= =?utf-8?q?2Ux5HY+M+ogh8EudHyl6vt5HaS/Dgfix8P1ZhEqQeOQPrXfz2RR8UckyCDa2EQwA+?= =?utf-8?q?Chy88UNmzObneO1O2EODJV5z6zhHwyCJRfIhtMXjyZeuSdKKfsJunc5RdPGLlhXCs?= =?utf-8?q?VeCwPPub+F01aH4vGVNeZGPiHNiWlx8Px/ie6rlx/T6azQ/aHPol8QL0DJtRp0LPz?= =?utf-8?q?RGm2WWduiCqDKHO5+AFiKXnGT/AOQfi0Oxv5d1TxE/yyOlGRj5ZWFWHWGxOrCvE8T?= =?utf-8?q?YavwwMRjjIK1?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9b73baaa-af5e-4ce8-baae-08da64b0dac2 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2022 09:19:57.4656 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZyFvZzwNx4CpfTdtb6VsaBnE4Vk5+fz5JJsjQ5r1T8WKHaubReph7QJsOd2OppTfJP4qYS1ESOcQFTMjBKChAw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB6248 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Check the retrieved grant reference first; there's no point trying to have xennet_move_rx_slot() move invalid data (and further defer recognition of the issue, likely making diagnosis yet more difficult). Signed-off-by: Jan Beulich --- I question the log message claiming a bad ID (which is how I read its wording): rx->id isn't involved in determining ref. I don't see what else to usefully log, though, yet making the message just "Bad rx response" also doesn't look very useful. --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c @@ -1043,16 +1043,6 @@ static int xennet_get_responses(struct n } for (;;) { - if (unlikely(rx->status < 0 || - rx->offset + rx->status > XEN_PAGE_SIZE)) { - if (net_ratelimit()) - dev_warn(dev, "rx->offset: %u, size: %d\n", - rx->offset, rx->status); - xennet_move_rx_slot(queue, skb, ref); - err = -EINVAL; - goto next; - } - /* * This definitely indicates a bug, either in this driver or in * the backend driver. In future this should flag the bad @@ -1065,6 +1055,16 @@ static int xennet_get_responses(struct n err = -EINVAL; goto next; } + + if (unlikely(rx->status < 0 || + rx->offset + rx->status > XEN_PAGE_SIZE)) { + if (net_ratelimit()) + dev_warn(dev, "rx->offset: %u, size: %d\n", + rx->offset, rx->status); + xennet_move_rx_slot(queue, skb, ref); + err = -EINVAL; + goto next; + } if (!gnttab_end_foreign_access_ref(ref)) { dev_alert(dev,