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 85ABAA00C4 for ; Wed, 13 Jul 2022 09:18:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7FFD742B70; Wed, 13 Jul 2022 09:18:44 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 9AA4942836; Wed, 13 Jul 2022 09:18:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657696722; x=1689232722; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7ZWJgKjxMCEofHHJwoS22sFCCJgmO8aqkjfLu1LUh+o=; b=CGL7MNIwY6kkoFAaLqZnm1zw8Lr21swMKZ/kTc+P1VTYk5YXfunCWfEH 9g7J785xRvRAEabWNYZjfLcWJoLfbydSgFGbuMzjbrLclWPgddEgr7Mtl rYfZ4HLuyjS7EPxPSwZZKzliKcxfPVW7SoTEl1sAMgu5+K3zJ9xbqXMVp xZUAoz/47jUH+A1MdV9KPsoh1IitCDkuS/nU7sFlOLyPdJ9mIq55WoYgu rNku6e+egC9TSZsiBZF1BwZXHGbMGpjsdyunItwgOg8yUpa0ZBZyTLk9z l/HcztKVoOEo5f9thjV26oJdhHckXthvp6jJGbCwrsw0DvptN6J9M4jNo Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10406"; a="346815023" X-IronPort-AV: E=Sophos;i="5.92,267,1650956400"; d="scan'208";a="346815023" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2022 00:18:41 -0700 X-IronPort-AV: E=Sophos;i="5.92,267,1650956400"; d="scan'208";a="653253971" Received: from unknown (HELO localhost.localdomain) ([10.239.252.104]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2022 00:18:39 -0700 From: Ke Zhang To: thomas@monjalon.net, yuying.zhang@intel.com, beilei.xing@intel.com, ferruh.yigit@xilinx.com, dev@dpdk.org Cc: Ke Zhang , stable@dpdk.org Subject: [PATCH v3] app/testpmd: fix quit testpmd with vfs and pf Date: Wed, 13 Jul 2022 15:11:12 +0800 Message-Id: <20220713071112.6182-1-ke1x.zhang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220621092453.185583-1-ke1x.zhang@intel.com> References: <20220621092453.185583-1-ke1x.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org A segmentation fault occurs when testpmd exit. This is due to fetching the device name from PF , PF is freed firstly and then VF representor is called later. This commit fixes the bug by fetching the device name from vf representor not PF. Fixes: e391a7b7f815 ("net/i40e: fix multi-process shared data") Cc: stable@dpdk.org Signed-off-by: Ke Zhang --- 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(-) 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 = ethdev->data->dev_private; - struct rte_eth_dev_data *pf_dev_data = - representor->adapter->pf.dev_data; /* get dev info for the vdev */ dev_info->device = ethdev->device; @@ -104,7 +102,7 @@ i40e_vf_representor_dev_infos_get(struct rte_eth_dev *ethdev, }; dev_info->switch_info.name = - 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 = representor->switch_domain_id; dev_info->switch_info.port_id = representor->vf_id; -- 2.25.1