From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 257A5A051A; Fri, 17 Jan 2020 03:08:52 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EF0F11D535; Fri, 17 Jan 2020 03:08:50 +0100 (CET) Received: from m176115.mail.qiye.163.com (m176115.mail.qiye.163.com [59.111.176.115]) by dpdk.org (Postfix) with ESMTP id 03A4B1D52E; Fri, 17 Jan 2020 03:08:48 +0100 (CET) Received: from localhost.localdomain (unknown [113.110.231.244]) by m176115.mail.qiye.163.com (Hmail) with ESMTPA id 14F57661277; Fri, 17 Jan 2020 10:08:43 +0800 (CST) From: Fang TongHao To: ferruh.yigit@intel.com, thomas@monjalon.net, arybchenko@solarflare.com Cc: dev@dpdk.org, stable@dpdk.org, jia.guo@intel.com, cunming.liang@intel.com, qi.z.zhang@intel.com, jungle845943968@outlook.com, jerinj@marvell.com, Fang TongHao Date: Fri, 17 Jan 2020 10:08:04 +0800 Message-Id: <20200117020804.1290-1-fangtonghao@sangfor.com.cn> X-Mailer: git-send-email 2.24.1.windows.2 In-Reply-To: <20200113050312.1506-1-fangtonghao@sangfor.com.cn> References: <20200113050312.1506-1-fangtonghao@sangfor.com.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZSlVKSU1LS0tPS09ITkxCSllXWShZQU hPN1dZLVlBSVdZCQ4XHghZQVk1NCk2OjckKS43PlkG X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6Ngg6DAw4Pjg0MRA9DS4zLT9J MR4wCTpVSlVKTkxCSUlNQklOTktMVTMWGhIXVR0aFRwPFBUcExoUOwgaFRwdFAlVGBQWVRgVRVlX WRILWUFZSkpIVUpKS1VJSEpVSU9PWVdZCAFZQUlDTUk3Bg++ X-HM-Tid: 0a6fb14281949373kuws14f57661277 Subject: [dpdk-dev] [PATCH v3] Fixes: ethdev: secondary process change shared memory X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fixes the secondary process changed shared memory in "rte_eth_copy_pci_info" function.In that function only primary can update the value of "eth_dev->data" which shared by primary and secondary. Signed-off-by: Fang TongHao --- lib/librte_ethdev/rte_ethdev_pci.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/librte_ethdev/rte_ethdev_pci.h b/lib/librte_ethdev/rte_ethdev_pci.h index ccdbb46ec..e7dae0545 100644 --- a/lib/librte_ethdev/rte_ethdev_pci.h +++ b/lib/librte_ethdev/rte_ethdev_pci.h @@ -60,14 +60,16 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, eth_dev->intr_handle = &pci_dev->intr_handle; - eth_dev->data->dev_flags = 0; - if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC) - eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC; - if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_RMV) - eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_RMV; - - eth_dev->data->kdrv = pci_dev->kdrv; - eth_dev->data->numa_node = pci_dev->device.numa_node; + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { + eth_dev->data->dev_flags = 0; + if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC) + eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC; + if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_RMV) + eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_RMV; + + eth_dev->data->kdrv = pci_dev->kdrv; + eth_dev->data->numa_node = pci_dev->device.numa_node; + } } static inline int -- 2.24.1.windows.2