From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 05912A034C; Tue, 2 Aug 2022 04:16:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DB2B340141; Tue, 2 Aug 2022 04:16:29 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id D1474400D7; Tue, 2 Aug 2022 04:16:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659406588; x=1690942588; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=ieT4OapI0RXI/KQrB8PNVDcFrD5CXZYlHwib6Lxu+mw=; b=e4wmg701AZ6RvolNwLtw4YFPqhHCN9sx3JgGcWb4xD6Hr7KtxRxzu65M OfSFtCfkXZcvvVWfVd9S7thRPVShGRcpjkygYbhoBK+LD3BJNrqvPbb1t ZfW8X9n88haK7oEpxcHHWvgSbn8ELdirh+9DwB4jtHtkahvZtohbtJCl+ JeEvQgUQGw92HkSTdo83hqkkUkVI8lYp5U566m8V/oLN+j2HRAlnEelpB YGs+ZL3FMSXAS8jSZGP8Zy3zZu5EXCTOhAprlPPk3ITkEx23DypTh3lPo IH5mzNkZC9+/1W1hC3PnP4a7H8mZJvahaG/JAgO6NVHRUg4NdBjB1V/l1 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10426"; a="290513334" X-IronPort-AV: E=Sophos;i="5.93,209,1654585200"; d="scan'208";a="290513334" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Aug 2022 19:16:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,209,1654585200"; d="scan'208";a="728664103" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga004.jf.intel.com with ESMTP; 01 Aug 2022 19:16:26 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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.28; Mon, 1 Aug 2022 19:16:26 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28 via Frontend Transport; Mon, 1 Aug 2022 19:16:26 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.173) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.28; Mon, 1 Aug 2022 19:16:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ib57i+4xbccsI8wIro5Z2hcsldc4+V/KZ41kZbnmuoQkFkeQmsTrKN3CRRIHnqFCU7WpNx9lNynEqhszpbUnaWxOeMIX2np4FpxtJW+cqIDGP8EOzeKxz7laJQdHDkNsYwfi+6r0YTsnGoaHvdn06ntWd8QuHsx0SmFX7Kas4bLPC2GRspRPUn01bIZp/hzMi8RVlnfzfcvIV28+jx/V8JsvHl3FYwGGc8rylhm7pmxjyMbOj30d509IOrPWFvZG2PrDYS2oDEJx0UC19pr7gVA5xM9aPQrXdnV8C0OKr1uEnhfDaA1Y0LbAgF1M6TfqEfa7TquqTqMKIHtz5ysOXg== 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=2gPkZbC+GjRkP4WOsqf0HncPR2JKDIxHPhA4N/Phe2M=; b=WTFj76dYlgpYIDYgrdR1dyG2zK+AP9jhSv0FeFWrZMCXFTQVvO34idVKKRdqbkVQ12S0K4UohFFILbaj5CJWJF1cDQoMlRVvRpFB0hbd7YCScI/F56OTLbQtze6kJtX7aJCdo9pNBQm13yjEMvyW7Zzk+3aBQP7o26kDwTU+IHNsOm/ntPEWbo4TR9a18UfSuupCSufWn2Xx6BRSn2uXJCq8AS2dDYBjusZUeROlPkq81J+o4iHIke7J7veS5jaPVUSEEgkXzKdc3sRsPd/8lHM7HTJe1FjBEyt6K943xLtju9hDj6vWcDPD4/1jNCczq64xIR6PFCi3teg/lJB1Bw== 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 DM6PR11MB3516.namprd11.prod.outlook.com (2603:10b6:5:72::13) by DM6PR11MB4300.namprd11.prod.outlook.com (2603:10b6:5:1dc::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.13; Tue, 2 Aug 2022 02:16:25 +0000 Received: from DM6PR11MB3516.namprd11.prod.outlook.com ([fe80::7442:739d:1474:4ef5]) by DM6PR11MB3516.namprd11.prod.outlook.com ([fe80::7442:739d:1474:4ef5%7]) with mapi id 15.20.5482.016; Tue, 2 Aug 2022 02:16:24 +0000 From: "Zhang, Yuying" To: "Zhang, Ke1X" , "thomas@monjalon.net" , "Xing, Beilei" , "ferruh.yigit@xilinx.com" , "Zhou, YidingX" , "dev@dpdk.org" CC: "stable@dpdk.org" Subject: RE: [PATCH v4] net/i40e: fix the issue caused by PF and VF release order Thread-Topic: [PATCH v4] net/i40e: fix the issue caused by PF and VF release order Thread-Index: AQHYmCr6jkI+2+/D1UmIm/e/FlWBhK2a8X/A Date: Tue, 2 Aug 2022 02:16:24 +0000 Message-ID: References: <20220713071112.6182-1-ke1x.zhang@intel.com> <20220715090359.76538-1-ke1x.zhang@intel.com> In-Reply-To: <20220715090359.76538-1-ke1x.zhang@intel.com> 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-office365-filtering-correlation-id: f5d22df3-ba95-4ebb-a0ea-08da742cffe1 x-ms-traffictypediagnostic: DM6PR11MB4300:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Ux6FkzGeHcQSOTFwocVA3bt8M/3+BFFZjoXGyOdYJstnLS4PKggoxl4QdGiGkrDAhmqaMz6H9reCHK2DzukaNBwIV+wbEc1wvQbW90r65U6KLhvKJ9IzQi+fpID1hXJIEIEQ+zDZX9iHqJJkAiZRpBn4TzNrRciHI+kzWG4bwdSuc6thiPLv7yvtOsC5mMKcl4m4f8uO8rHsTbmx4u8ueZAVpj0ihSkKYzVETpIuRytWTMl9ZdoAd1JswH0bCV6np+Bhi/WpBr2KHOidpr33GLGdgkGQsUl0dr2A6SYCffJ30IxNfRs8ytvyZ73EOLrnHl8BKpQHA777jI1LdBB/mGg9t5RNul00rkvEcWfOWLK0dpF9C3hUWioz94wS8A1D+a2tGo5SGq9f3UyvE2ezO9soR58yhb7J06RsjNECO8uKA3CrsGXOzj9EC2SiG0VKEtjILWdYMc5igGSnV9D+vGWYtKv4wA6d06FrUXrDZErW9JnOYykSBuPMGcMZeuxRblGt9vWipQVzFzBjzSQEks4/i9pYlsCZU3/THf1Yg3i1eT/cVKncmjM7lGAGoxwJLUo2ZSdpPehOGBvXk04OphO+2UAclQ1nFcQDmiYrIVb07QHmVHuu9lI4fePolC6rcygOesHOeRzQW9LMib920ucSkLyioM8mFtQ1Iic5+rRgO2MXcV8mpK3V6AHvO+pkGBeYfUjVr98Ajl2GPG6v0X1gNN1JqRzjkUHCUZQ/5ALcr2fpc/xXOwp3YgyT3zCHoPl+w9j/hAH//mBar1EGtDIjBz+7uxZxTLrzno+qY7ueYfGr3eSOGO6brY0RNFEv x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB3516.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(366004)(346002)(136003)(376002)(396003)(39860400002)(6506007)(7696005)(26005)(9686003)(82960400001)(122000001)(53546011)(33656002)(38100700002)(38070700005)(5660300002)(76116006)(186003)(83380400001)(52536014)(478600001)(71200400001)(66946007)(86362001)(55016003)(8676002)(4326008)(66556008)(66476007)(66446008)(64756008)(41300700001)(8936002)(316002)(2906002)(110136005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?HfJ+5kMQSR2aoGzxmUZtMvnwmMz+SdQpcKv24bIhjWq7vQhS/YBqRoQ5U503?= =?us-ascii?Q?ki/SyfkIJSLc1r/tYX4vxlceAoxLXiCUZcRcczT29h4LLBdfFdIVGZ4XXRvi?= =?us-ascii?Q?JlJNcLgvCt9yChnyCqY+CaPq/wr1vL2qBBfGLQ9BgiUaTMKeKlVqV12Fz1bg?= =?us-ascii?Q?JE3T1btC8WrlWdcKVvMOlOUDxKeckXtIgfhzB4MALzyXpMkNyt4Tgy2bJl7T?= =?us-ascii?Q?70Fe1nQSs2qLYBl3CTEPYUd/V+KA45k1hu6Ef3SfwbRzwALmMOReR5O833dO?= =?us-ascii?Q?RnAlInyqI7McSd5jl7aWXeT1d1FuT8r1V3118aDNYf4TwY4RI1EAgXC8MEOV?= =?us-ascii?Q?b+RoIoBbEu1pablCXxKkQUDAtgldrPsLHLRgk2LHwn2TXqYEiagH01rCiMnX?= =?us-ascii?Q?ASmaf25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8XK93tsIb69P7c7mM?= =?us-ascii?Q?3o1BCwNMwxzblXr3uK+9J9xZFkM5hBeIS2VsYGjJ7x97c6ACqx8XYKykIxgz?= =?us-ascii?Q?52Q4FxfPOKhmuWSK8hXBWCcnBB1PqDK+SG1TpOOGpjTY1lx3Ltk9UuC7vyXk?= =?us-ascii?Q?Q5P58efhfT9mhooUxwl3fvoP3QxYAhYTQnBCmipMmw1H0DcGeiUFZ3phS4Gr?= =?us-ascii?Q?NOnNRKH55Ei4287z72BGfY8TBU/O9ZgRg7XODmWQNCvuaYFkO5pMGq989ssY?= =?us-ascii?Q?WOlCC+JdlizZbqO4JWfmGvjL3yCj31t1q7to1gPY?= 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: DM6PR11MB3516.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f5d22df3-ba95-4ebb-a0ea-08da742cffe1 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2022 02:16:24.6081 (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: 3vFyeeVDtsR7d6DJ36OX+48E6da2g+IN8AIaWl+9O+0KHFe4ojkjGoLDltkyVnxvuZxA+wlBzpGfSuCUcTqFNw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4300 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Ke, Please update commit log. LGTM. > -----Original Message----- > From: Zhang, Ke1X > Sent: Friday, July 15, 2022 5:04 PM > To: thomas@monjalon.net; Zhang, Yuying ; Xing, > Beilei ; ferruh.yigit@xilinx.com; Zhou, YidingX > ; dev@dpdk.org > Cc: Zhang, Ke1X ; stable@dpdk.org > Subject: [PATCH v4] net/i40e: fix the issue caused by PF and VF release o= rder >=20 > A segmentation fault occurs when testpmd exit. >=20 > This is due to fetching the device name from PF, PF is freed firstly and = then VF > representor is called later. >=20 > This commit fixes the bug by fetching the device name from VF representor > not PF. instead of PF >=20 > Fixes: e391a7b7f815 ("net/i40e: fix multi-process shared data") > Cc: stable@dpdk.org >=20 > Signed-off-by: Ke Zhang Acked-by: Yuying Zhang >=20 > --- > v4: Update the commit log > v3: Change the design and fix code in driver > v2: Change the testpmd code to fix this issue > --- > --- > drivers/net/i40e/i40e_vf_representor.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) >=20 > diff --git a/drivers/net/i40e/i40e_vf_representor.c > b/drivers/net/i40e/i40e_vf_representor.c > index 7f8e81858e..bcd445bcdd 100644 > --- a/drivers/net/i40e/i40e_vf_representor.c > +++ b/drivers/net/i40e/i40e_vf_representor.c > @@ -29,8 +29,6 @@ i40e_vf_representor_dev_infos_get(struct rte_eth_dev > *ethdev, > struct rte_eth_dev_info *dev_info) > { > struct i40e_vf_representor *representor =3D ethdev->data- > >dev_private; > - struct rte_eth_dev_data *pf_dev_data =3D > - representor->adapter->pf.dev_data; >=20 > /* get dev info for the vdev */ > dev_info->device =3D ethdev->device; > @@ -104,7 +102,7 @@ i40e_vf_representor_dev_infos_get(struct > rte_eth_dev *ethdev, > }; >=20 > dev_info->switch_info.name =3D > - rte_eth_devices[pf_dev_data->port_id].device->name; > + rte_eth_devices[ethdev->data->port_id].device->name; > dev_info->switch_info.domain_id =3D representor->switch_domain_id; > dev_info->switch_info.port_id =3D representor->vf_id; >=20 > -- > 2.25.1