Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1096531rwb; Wed, 9 Nov 2022 12:48:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf7YsnAOYMfyYFjzC6Z1dlGJhVHowSMbmj05mbHNX94Sm5mwprgIClb17OQ8ThUNHEAWvk7p X-Received: by 2002:a17:902:7145:b0:187:2356:c29d with SMTP id u5-20020a170902714500b001872356c29dmr779096plm.154.1668026912985; Wed, 09 Nov 2022 12:48:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668026912; cv=pass; d=google.com; s=arc-20160816; b=AoW0LnnWVdX1pz5YDQ850CFIvSplQEH2yfoxKdrJtcZ0Do8t5Tw57AcpWHCSVhjxwL 8LYutXDPTu9CQk13qHvQYmnMOjHgyJ79LJd4KouyHBqSxPGNDUcF2K9/gpF1kNTn9+ON Wc+Re5UDtZz2o+2lqVD/cVuLgDaq48LV6oiF6kscJFDyea7aAnxFV9gMpsTyK6Qs8xQ0 3CHTtV5s1/+LZMEVqO/rTsAAiVqCk0E1q0v71I/3v3GbA6XGltrdvOMWhY6lnO7rsN/0 rYz0b+prAgYY0LlQIF5gp4MdsDkIPJxz15zCcFTZ31nFNQaMXOxyO1IizohYchUEs/2D YrIQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=nPyxgkqIyCyVa+/q2W0kyqJfcLpfTM2Ih0N44JCfbVQ=; b=XdvVzLdLX3rc1WuBH5F0QKSc5baZIdsx76aa7vsQAAgKsvzt4im03e02KD59YnsUqQ +AkMfogX+ihIl5ixF3aELkqk7WyxwZAGQGgfgS/riU7/D54G0+GtLiXReh7ANH3WqNPO X01ICScyDdKt5WuX+CFIVaaS9pGxcicMpD2GJzikXy9vYZEBTaApO4k/RcAUr5lsqkPM EkLAtQsSGTwpYOnym3TgRnwZoFuKHNhJ+gO11sqGK4wEZX2uDr+BUufUGofc7R43hOVi HBC+zlVFWVIzwU1WWsIKLekytIWOIS9etTTqgS+xEf0oavQ08DtTP/KIYB/+7WtnbcZK pUGw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iLTJiJwB; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b15-20020a63d80f000000b0046f583c8c4asi18547668pgh.315.2022.11.09.12.48.21; Wed, 09 Nov 2022 12:48:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iLTJiJwB; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231375AbiKIUMD (ORCPT + 93 others); Wed, 9 Nov 2022 15:12:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229806AbiKIUMC (ORCPT ); Wed, 9 Nov 2022 15:12:02 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE6FF12095; Wed, 9 Nov 2022 12:12:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668024720; x=1699560720; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=DxElPa4Noa7Xtxpm7tEWbm/Qzn7EzpE92yRYpLbMOe0=; b=iLTJiJwBYAiVD0DCcr92K1T2xZGcOJ9vPxMmE9YIDzvKCxauzQMXCuuD vJwB3vXTZd4Z/MmeCdxI8viFCraw6jiJbjvnBR8wTubz+OEGsm4DfatHd XNR3LKlairA/4IwuB1nW+ctar5ZYJy7dEsCT/3dpRbuiPgmNKptwyMqxG iDtBR502cAN6HXwqOi4MiPx85TrtPI8mxWeKzEUNivCqVBqsRI2ZYaGGk /20TDMDtbLdGU0I+ML7KyOW4Qc9WhBsqhbKXfwGjejBKSf5plM63AVPHX 3gDuumhwqVkC8uT7Xyz8R+JqoBYBUnTVodLxGmDvGA0u5Jd2Ef77FVLfM g==; X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="290811191" X-IronPort-AV: E=Sophos;i="5.96,151,1665471600"; d="scan'208";a="290811191" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2022 12:12:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="811768118" X-IronPort-AV: E=Sophos;i="5.96,151,1665471600"; d="scan'208";a="811768118" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga005.jf.intel.com with ESMTP; 09 Nov 2022 12:12:00 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 9 Nov 2022 12:11:59 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Wed, 9 Nov 2022 12:11:59 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.169) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Wed, 9 Nov 2022 12:11:59 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PI7uAWi0N5H6W5wuChXsQQVIlaqJgGzc5gShpVdxGbMfbohQnAfUD4S4wzDYqq5H3+ZJ848qA/t+UfKtDOOeLiIFs4wOvAcWUsqNd3I4qo67z768xPF+d1Hm/tJx4jmxhHkBStOM8VQvMVmvA5iKZ+qROM81I6jOYQTZdYC1sRal7us0up64gO232LBR3a1TNEkqASAEO6w0BmUzZJZQaiQzY8MBGSgCWFV/Cu/zlS69wgdw2Cq9D4YmxzEQzSO2y3qIWieuXXn04K+dF7I8VDxZyDS4h9zVK08zKt6X6jRoPUB+niXMt5Ds0xrzBBatLtk8eo9n6pI4g60KLp7CBA== 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=nPyxgkqIyCyVa+/q2W0kyqJfcLpfTM2Ih0N44JCfbVQ=; b=EHuN5oXyUMTyqcfMEBvNpkVJ5HiYMg0GhcS8rnAxuEtnKQiewr0A1VQNx+Qwv5aIclET19B1yOQf+JebCXwCgMIusqraN19MLaixrIHVpt46lNMBhUD6cRDiLND7tFhF3hdDjhSE/lYlbyE6YB45Oe8Q0bSPHiN7jCWmlpPATUrVSvlYJgMI0AAw+aU/V3g6wq0E3PJtbeAFt6pEd4EFQQIHPuhhenv3pUgyfNEzw1X6yHEAc+QEEnMURpUELITdQDjfcDaw+u2/1EBHF7hl92GGCYrhG8b7KN28VNwNiuhViRWpSsi9/M31Hk7nEHNVw8iBwrZmHpmTJJOyhITcuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from CO1PR11MB5089.namprd11.prod.outlook.com (2603:10b6:303:9b::16) by CY5PR11MB6162.namprd11.prod.outlook.com (2603:10b6:930:29::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.12; Wed, 9 Nov 2022 20:11:55 +0000 Received: from CO1PR11MB5089.namprd11.prod.outlook.com ([fe80::9e54:f368:48d1:7a28]) by CO1PR11MB5089.namprd11.prod.outlook.com ([fe80::9e54:f368:48d1:7a28%3]) with mapi id 15.20.5791.027; Wed, 9 Nov 2022 20:11:55 +0000 From: "Keller, Jacob E" To: Leon Romanovsky , ivecera CC: "netdev@vger.kernel.org" , "sassmann@redhat.com" , "Piotrowski, Patryk" , SlawomirX Laba , "Brandeburg, Jesse" , "Nguyen, Anthony L" , "David S. Miller" , "Eric Dumazet" , Jakub Kicinski , Paolo Abeni , "moderated list:INTEL ETHERNET DRIVERS" , open list Subject: RE: [PATCH net] iavf: Do not restart Tx queues after reset task failure Thread-Topic: [PATCH net] iavf: Do not restart Tx queues after reset task failure Thread-Index: AQHY81xt1U/+TsWFeEauMLnzqEhDea426S2AgAAeHmA= Date: Wed, 9 Nov 2022 20:11:55 +0000 Message-ID: References: <20221108102502.2147389-1-ivecera@redhat.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CO1PR11MB5089:EE_|CY5PR11MB6162:EE_ x-ms-office365-filtering-correlation-id: 50dd5b19-9b41-41ad-f98e-08dac28ea648 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GWzCvd3lv6GJNlh39SqFPIl9UTGUPtayoUzA0KUM/90O9qlP4mGO+kB24IYq/jyV1ockWmCvYepIm/VVRRdvukk3gFs9Lg+hVCn8LCBDBiH6KFg8GdL6IpJHR8+dW6Snw6H9V88KQry0SD6ylaruZCfxyTbv0QimmiHRbMv5lTr0Sqa5Tu0MQgRFjveutBSzM2vgk0Vz81Vv3q2+LLvJBBbWMieiyMqC00ggMQjcPuGqCscQk5V3Q5H8auHrIPaTv/8ZwKAhq8brglFQm7xfekey9Kh51lT8a7Hqmw8LwY1dNEjH0Y8o9Elx/cYzriC2jBr//DRyDVJ9sLAKORHMLADcV79PRbRd6XKbVH7DRX7vHFp51WzQSCpXYMdH7mTAAQydseeDBOIV/n8ySf4KQvpcqCvCLCiBqlKdvVB06oF2qcpxPeeRgMNPn+sKHQeCg6824p4NMC/fO1GkG4m9qmjzEHF6N71W2rfrFnwv+gc8tLasWGUjb4L7B4BEm1af7y2fYGSUrpKT5h+L/QZYDCvef8Ey4NFUuQbhz3MIP6O1nDX4SP7lyEFsBaVvuCj/HXRkqCLt/tGcsC5zVELBzw6EkyQW42WboVE2UN9k0zY9qWtsDEhp7tvOkgZ4CjvOcn6QWGCMToPhtXZdtx7bqREOATY7S5c6+4+7Piscdzc1f0bIU7FdBJLdDP2UkrL1UDZ3A0NtfpNVZF//4jqPsfuZzDBw83XSJ+LbQDVvMsFK4ubtfnwcWI9YCXVg9Yej7LsA8E3uRZM3UJp2LacW8g== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR11MB5089.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(366004)(39860400002)(396003)(136003)(376002)(346002)(451199015)(41300700001)(122000001)(110136005)(66476007)(66446008)(66946007)(54906003)(66556008)(64756008)(76116006)(316002)(4326008)(52536014)(8936002)(8676002)(82960400001)(86362001)(38100700002)(5660300002)(33656002)(83380400001)(38070700005)(478600001)(55016003)(6506007)(7696005)(9686003)(71200400001)(26005)(7416002)(53546011)(186003)(2906002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?fnlHVcN8eV/46759UB55KbjxiUhtmbui3ygUDNpvaOqEAUjWCb7W/dCCHjD6?= =?us-ascii?Q?gPy0PWHgWBXnArf61/ECzpR+ySnl7HA8aunnhR3YQJ+/zosYlylPpQPXqVlR?= =?us-ascii?Q?s9tZfqkKCmHaQ2pYYZyDPnBjgc0hgIuGqSWnVdeWwPHt4X0oU8Z9hppddpAY?= =?us-ascii?Q?uQN2n8wqAbNSX+eYLRiUloXpLQME3mU7v6mwRS8yPC6DfsqMAbFxi70flVdr?= =?us-ascii?Q?MSe2Ls7bfg6kyxahpALhvL3GA5Idm1Yp/pP2ilWolhBJn02Q+ITH1ZvuJZcI?= =?us-ascii?Q?1AjcQO7kd01e6cm6JKs08SCxRCUnlfkEwKiCBDh5qpsLKSKI6MiQcRtFmJ2U?= =?us-ascii?Q?PKkum9yCFItiqOwp5k1sFmuQmSu+GwHq8c79sySWtZ8EvlcgB/r/seTPKpn6?= =?us-ascii?Q?kATobN4L9/NnEUDvMgfTLYqXTU4kfiLXXQfvIDjdkkJvL6Az9Ar6s8cTHZeo?= =?us-ascii?Q?NUqflxug2ihGTGGrLpl9N/aZSnv7B24W2djdG+u1bMLomGGjV89L7m1hEnaY?= =?us-ascii?Q?V05/1DaBNj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?= =?us-ascii?Q?s4YfMX3a4+pXz1uv6BEwVC1zBgx5oPYPvJpg7MBu1kkF56bgNlrSdImHHgip?= =?us-ascii?Q?I1s4HwPCa47DCueZU/RvRCHzGGjmSKCm/ufvX8yEKBNcIisFOYpRcAlanune?= =?us-ascii?Q?0JibIdw+8UB4T1/Wz9b8QpTQNjC8egptHY+oU0l57C5gvxkQJ1+VHGMHq/bo?= =?us-ascii?Q?yg=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB5089.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 50dd5b19-9b41-41ad-f98e-08dac28ea648 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Nov 2022 20:11:55.6666 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ZyBrWLB8B6oAiryiHnwuOAoQVFtZ9H+dMeJka8dd4m4G60izxl6B45QX9dWbM+x56pikXuIcPsc95aeAbMsSHXUiCCBpVEgojhrKVSSmmLQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR11MB6162 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Leon Romanovsky > Sent: Wednesday, November 9, 2022 10:21 AM > To: ivecera > Cc: netdev@vger.kernel.org; sassmann@redhat.com; Keller, Jacob E > ; Piotrowski, Patryk ; > SlawomirX Laba ; Brandeburg, Jesse > ; Nguyen, Anthony L > ; David S. Miller ; Eric > Dumazet ; Jakub Kicinski ; Paolo > Abeni ; moderated list:INTEL ETHERNET DRIVERS wired-lan@lists.osuosl.org>; open list > Subject: Re: [PATCH net] iavf: Do not restart Tx queues after reset task = failure >=20 > On Tue, Nov 08, 2022 at 11:25:02AM +0100, Ivan Vecera wrote: > > After commit aa626da947e9 ("iavf: Detach device during reset task") > > the device is detached during reset task and re-attached at its end. > > The problem occurs when reset task fails because Tx queues are > > restarted during device re-attach and this leads later to a crash. >=20 > <...> >=20 > > + if (netif_running(netdev)) { > > + /* Close device to ensure that Tx queues will not be started > > + * during netif_device_attach() at the end of the reset task. > > + */ > > + rtnl_lock(); > > + dev_close(netdev); > > + rtnl_unlock(); > > + } >=20 > Sorry for my naive question, I see this pattern a lot (including RDMA), > so curious. Everyone checks netif_running() outside of rtnl_lock, while > dev_close() changes state bit __LINK_STATE_START. Shouldn't rtnl_lock() > placed before netif_running()? Yes I think you're right. A ton of people check it without the lock but I t= hink thats not strictly safe. Is dev_close safe to call when netif_running = is false? Why not just remove the check and always call dev_close then. Thanks, Jake >=20 > Thanks >=20 > > + > > dev_err(&adapter->pdev->dev, "failed to allocate resources during > reinit\n"); > > reset_finish: > > rtnl_lock(); > > -- > > 2.37.4 > >