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 E273AA054C for ; Fri, 14 Feb 2020 18:04:28 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DABF0F72; Fri, 14 Feb 2020 18:04:28 +0100 (CET) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 030B1F72 for ; Fri, 14 Feb 2020 18:04:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581699867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sPinp59KgvRKKHT+oTj3PkU98fTL+BdeJF0r2FViocs=; b=EzaCYUQ4HFTG8faW5hN24g/lB9qHr9U+HJGPVXu7VWiQIOr3MfpkGn6vbEjp5xgFT9JKgB msYXcisiusbE3o7EHHgfXqA7BYgq8dEzkA0h0MoQOiQKJJG4JcA2BpXEMB0rHBkYeaY0rl 17ZKfiJbhAL17o6wXkS2/qmcB397NdM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-26-lY56pXRZOeu-CG-mTBi3-A-1; Fri, 14 Feb 2020 12:04:23 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 069E910753FB; Fri, 14 Feb 2020 17:04:22 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 359038AC46; Fri, 14 Feb 2020 17:04:19 +0000 (UTC) From: Kevin Traynor To: Fang TongHao Cc: Andrew Rybchenko , Ferruh Yigit , dpdk stable Date: Fri, 14 Feb 2020 17:03:01 +0000 Message-Id: <20200214170337.25093-7-ktraynor@redhat.com> In-Reply-To: <20200214170337.25093-1-ktraynor@redhat.com> References: <20200214170337.25093-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: lY56pXRZOeu-CG-mTBi3-A-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'ethdev: fix secondary process memory overwrite' has been queued to LTS release 18.11.7 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/20/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasi= ng (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/ab4272aefa97c8a92f= c07fe8e653b979a99e46d1 Thanks. Kevin. --- >From ab4272aefa97c8a92fc07fe8e653b979a99e46d1 Mon Sep 17 00:00:00 2001 From: Fang TongHao Date: Fri, 17 Jan 2020 10:08:04 +0800 Subject: [PATCH] ethdev: fix secondary process memory overwrite [ upstream commit 99ef90317da69a5e6ecc831ad05c6d2053e2b065 ] Avoid overwriting device flags and other information in device data stored in shared memory when a secondary process probes PCI device. Fixes: 494adb7f63f2 ("ethdev: add device fields from PCI layer") Signed-off-by: Fang TongHao Reviewed-by: Andrew Rybchenko Reviewed-by: Ferruh Yigit --- lib/librte_ethdev/rte_ethdev_pci.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/librte_ethdev/rte_ethdev_pci.h b/lib/librte_ethdev/rte_eth= dev_pci.h index ccdbb46ec0..cca94ec864 100644 --- a/lib/librte_ethdev/rte_ethdev_pci.h +++ b/lib/librte_ethdev/rte_ethdev_pci.h @@ -43,4 +43,6 @@ /** * Copy pci device info to the Ethernet device data. + * Shared memory (eth_dev->data) only updated by primary process, so it is= safe + * to call this function from both primary and secondary processes. * * @param eth_dev @@ -61,12 +63,14 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, =09eth_dev->intr_handle =3D &pci_dev->intr_handle; =20 -=09eth_dev->data->dev_flags =3D 0; -=09if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC) -=09=09eth_dev->data->dev_flags |=3D RTE_ETH_DEV_INTR_LSC; -=09if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_RMV) -=09=09eth_dev->data->dev_flags |=3D RTE_ETH_DEV_INTR_RMV; +=09if (rte_eal_process_type() =3D=3D RTE_PROC_PRIMARY) { +=09=09eth_dev->data->dev_flags =3D 0; +=09=09if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC) +=09=09=09eth_dev->data->dev_flags |=3D RTE_ETH_DEV_INTR_LSC; +=09=09if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_RMV) +=09=09=09eth_dev->data->dev_flags |=3D RTE_ETH_DEV_INTR_RMV; =20 -=09eth_dev->data->kdrv =3D pci_dev->kdrv; -=09eth_dev->data->numa_node =3D pci_dev->device.numa_node; +=09=09eth_dev->data->kdrv =3D pci_dev->kdrv; +=09=09eth_dev->data->numa_node =3D pci_dev->device.numa_node; +=09} } =20 --=20 2.21.1 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092020-02-14 17:02:37.450599160 +0000 +++ 0007-ethdev-fix-secondary-process-memory-overwrite.patch=092020-02-14 1= 7:02:36.932408335 +0000 @@ -1 +1 @@ -From 99ef90317da69a5e6ecc831ad05c6d2053e2b065 Mon Sep 17 00:00:00 2001 +From ab4272aefa97c8a92fc07fe8e653b979a99e46d1 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 99ef90317da69a5e6ecc831ad05c6d2053e2b065 ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org