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 25DF8A0548 for ; Wed, 10 Nov 2021 07:56:01 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 21844410FE; Wed, 10 Nov 2021 07:56:01 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2069.outbound.protection.outlook.com [40.107.244.69]) by mails.dpdk.org (Postfix) with ESMTP id 6A7D1410F2 for ; Wed, 10 Nov 2021 07:55:59 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j+zjaFNXNaTyB/BC4D1RGHBm2QjZE0xNTpCceI+5LfJICBOeZlmGZxF4ojH5aBLrhez8I2fajBLMhvSY5KhbstrlpytlPYAd/9LCspH5FNtKoj7Tug6jTOkvUfFtY/8yZTy0kAWuLyBQrv0/D3WhTiIGPJrQAsXXWT+Kf3q3qozP6sXxKh2RBhjzEnpNDH+aRQpEugWMCLf9ee79szNa9a6xNqRVHrlgE3tcJLOVOjiuYtBi1fWui3uySdleN6rXiJMGlPe2FcwkAzFVLS0iMRPpLib4M0+V4mQLBlfq18/0iELTi3o3/AV7jjp2fIWnUm3+ghsFQ8RqZpmgBmCgOA== 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=itr9Y0y3BSliIPx7wvABF7bJVXxV76oA0vBW8D+CoAw=; b=XLZNOQdNwT/fbKsgzNc18gB9XYlcsJdGexkATCbY0s5oXRRnIKCd/keN+QVcnYo/R6fIDewp/TN4BwU1LqmWT4hto+ozlJ4o1vyVYwR7KQAuBSmzwaQbEFYNgCnv97RYzv9/2lMiuugPz43E7BbX0Z8tI4O3QqrCrowEtn0SkjWfDkkjADH3C9vrxHqDKqGWScgFpQqGmdA75kaiEWPcgYkAUnVD7QaU+JCwIiSwbam8LhuSIJCysMm+HgBobaK9Wfe+nQmJFRPxv9mz/TKRpNXT9XGNtM9IF67XSU7T+B53V7mPG9U5IzOStea4xLazrV9/wP/4TIMaeIfvE9jowQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=itr9Y0y3BSliIPx7wvABF7bJVXxV76oA0vBW8D+CoAw=; b=rIjxzof5hsVa6BDJn/Ip7M9v6GFC290UEmXtuB3h26MaBfHk0cPoUmERXub/Fdao0RMe3rsM26/JcAwF18l4YJVEtuTxOvlP2WUbGDAAm0T7o+ivrTYWSLjoqzPDZ7LT1f6Snmcu1KSIfbhdrRc/kmY3UBp7XPY7dsU5HNNAUDNU3iER8OHyo6qXplZwbANp0RReDZdURMIBOgtymwhtp50sVOlQwvvB/KYk9RYa3RYxrvRfhW/Kz+Fj+rBuksKCiSmByLSoI+fk8VLwF8W8HtyfhrsX4vSrJFdGzQCWp96QAnidOTOyp3RW1J6J7Mi3wrDjSw1ZHQDwo3ASyz/XxA== Received: from DS7PR03CA0256.namprd03.prod.outlook.com (2603:10b6:5:3b3::21) by DM6PR12MB4842.namprd12.prod.outlook.com (2603:10b6:5:1fe::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Wed, 10 Nov 2021 06:55:57 +0000 Received: from DM6NAM11FT063.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b3:cafe::90) by DS7PR03CA0256.outlook.office365.com (2603:10b6:5:3b3::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.16 via Frontend Transport; Wed, 10 Nov 2021 06:55:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT063.mail.protection.outlook.com (10.13.172.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 10 Nov 2021 06:55:57 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:55:55 +0000 From: Xueming Li To: Dapeng Yu CC: Luca Boccassi , Qi Zhang , dpdk stable Date: Wed, 10 Nov 2021 14:31:36 +0800 Message-ID: <20211110063216.2744012-213-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cfd3b286-b7a3-4de0-0f00-08d9a41725b9 X-MS-TrafficTypeDiagnostic: DM6PR12MB4842: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IWtTfQuK+lixL7LlOylGFcnTc4Z/dbOi5lBGgqFXvMCkQhPJOupRddbt3wVMtJ3dw/NFF0xlul53YYaROJ7egHuZBaG+Hfx66FwOocrNcGT8t4CulivEf/LO5NTVWDcM/OtfdhoY519BbaGVaOcfQISRcWHLNns8ePEBW8MkNjsSa1N/4iie9xSQbfNdg3GhHxB4gRAF0atSgkYxSjo8WZyYnjI0oxCSjpjs13JLWhdTqVqPNt0RIYB59PHLIex9+7aGSwZl6dlMlj+QcFrnSSyaL0ji+RhUlp4jMibRRvesMX1oZITuKZWaKqRQIqRgJXgyHB2nbECNcevZjmFtB+jvbr4IDbnCcBq1bCdbinnf9mZnhtpT8+Hy4eGdiNUDZv88TPNDY7gULV/MFJ2t/BeUP5ZgDD9Oro+6/asPQ07SlwlY3KNBhnr2c6ojpHo55ceb+iPpB7NFYQSPraPOoBjg7bggyk3V8r19J+Gk8tcGVC7w9RtLfhn6HfRWq8W4OQC3Uv1POvT2/fCb55kOYKo6wAPmP1XqgnEubh8FAmjwsGc0ctmOMFTXBCp8mKhvmnjJp13w9U/9iceil1ZBZIH7K80sQRYepsc4I2yEAU/4JRbEt+ieekiKA8S3Sg4Nm8TI4HXIZDpdLcEXF0fqwU4+LEDrxbhoGJ9YAfbGTp0FUiaMEkOknanYaQrbzH6PE+z0TfXgCuT5F6bqw1pIe1MrX9cdKf39pVIOJsq+Gw12Ej40flvczHg2D+thfbYIc8mFIhb/LyK4CGTGeMo4+PyyUcS0fcfvOXaV9CPsEuhB1XnNSxvu7ekBUtsYXmwXmROdublMjhSV1ImSOY2mtA== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(966005)(2616005)(54906003)(8936002)(86362001)(7696005)(26005)(186003)(316002)(36860700001)(36756003)(53546011)(508600001)(336012)(4326008)(83380400001)(70206006)(4001150100001)(426003)(6666004)(70586007)(1076003)(6916009)(16526019)(47076005)(55016002)(356005)(2906002)(7636003)(8676002)(6286002)(5660300002)(82310400003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:55:57.2534 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cfd3b286-b7a3-4de0-0f00-08d9a41725b9 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT063.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4842 Subject: [dpdk-stable] patch 'net/iavf: fix shared data in multi-process' has been queued to stable release 20.11.4 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/12/21. 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 rebasing (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/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/762161e2091ccae7c3ff637427398ac59c201e30 Thanks. Xueming Li --- >From 762161e2091ccae7c3ff637427398ac59c201e30 Mon Sep 17 00:00:00 2001 From: Dapeng Yu Date: Wed, 27 Oct 2021 16:28:39 +0800 Subject: [PATCH] net/iavf: fix shared data in multi-process Cc: Xueming Li [ upstream commit 627b3c5a39eb5c5461bdf0f0013817c34be98944 ] The shared pointer is initialized to a static local array defined in the primary process and it shall not be accessed in the secondary process. This patch copies the local data to shared data, to avoid data access violation. Fixes: 040b44551f77 ("net/iavf: unify Rx packet type table") Signed-off-by: Dapeng Yu Acked-by: Qi Zhang --- drivers/net/iavf/iavf.h | 2 +- drivers/net/iavf/iavf_ethdev.c | 2 +- drivers/net/iavf/iavf_rxtx.c | 17 ++++++++++++++--- drivers/net/iavf/iavf_rxtx.h | 2 +- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index a8b0649745..09bf7f850e 100644 --- a/drivers/net/iavf/iavf.h +++ b/drivers/net/iavf/iavf.h @@ -201,7 +201,7 @@ struct iavf_adapter { /* For vector PMD */ bool rx_vec_allowed; bool tx_vec_allowed; - const uint32_t *ptype_tbl; + uint32_t ptype_tbl[IAVF_MAX_PKT_TYPE] __rte_cache_min_aligned; bool stopped; uint16_t fdir_ref_cnt; struct iavf_devargs devargs; diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 7d676c0279..0d026ab56f 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -2002,7 +2002,7 @@ iavf_dev_init(struct rte_eth_dev *eth_dev) } /* set default ptype table */ - adapter->ptype_tbl = iavf_get_default_ptype_table(); + iavf_set_default_ptype_table(eth_dev); /* copy mac addr */ eth_dev->data->mac_addrs = rte_zmalloc( diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index b475aa0cc5..555551008b 100644 --- a/drivers/net/iavf/iavf_rxtx.c +++ b/drivers/net/iavf/iavf_rxtx.c @@ -2680,8 +2680,8 @@ iavf_dev_tx_desc_status(void *tx_queue, uint16_t offset) return RTE_ETH_TX_DESC_FULL; } -const uint32_t * -iavf_get_default_ptype_table(void) +static inline uint32_t +iavf_get_default_ptype(uint16_t ptype) { static const uint32_t ptype_tbl[IAVF_MAX_PKT_TYPE] __rte_cache_aligned = { @@ -3216,5 +3216,16 @@ iavf_get_default_ptype_table(void) /* All others reserved */ }; - return ptype_tbl; + return ptype_tbl[ptype]; +} + +void __rte_cold +iavf_set_default_ptype_table(struct rte_eth_dev *dev) +{ + struct iavf_adapter *ad = + IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); + int i; + + for (i = 0; i < IAVF_MAX_PKT_TYPE; i++) + ad->ptype_tbl[i] = iavf_get_default_ptype(i); } diff --git a/drivers/net/iavf/iavf_rxtx.h b/drivers/net/iavf/iavf_rxtx.h index 6bf6a44b77..2eb214373c 100644 --- a/drivers/net/iavf/iavf_rxtx.h +++ b/drivers/net/iavf/iavf_rxtx.h @@ -484,7 +484,7 @@ int iavf_txq_vec_setup_avx512(struct iavf_tx_queue *txq); uint8_t iavf_proto_xtr_type_to_rxdid(uint8_t xtr_type); -const uint32_t *iavf_get_default_ptype_table(void); +void iavf_set_default_ptype_table(struct rte_eth_dev *dev); static inline void iavf_dump_rx_descriptor(struct iavf_rx_queue *rxq, -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:11.273130913 +0800 +++ 0212-net-iavf-fix-shared-data-in-multi-process.patch 2021-11-10 14:17:02.024078169 +0800 @@ -1 +1 @@ -From 627b3c5a39eb5c5461bdf0f0013817c34be98944 Mon Sep 17 00:00:00 2001 +From 762161e2091ccae7c3ff637427398ac59c201e30 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 627b3c5a39eb5c5461bdf0f0013817c34be98944 ] @@ -13 +15,0 @@ -Cc: stable@dpdk.org @@ -25 +27 @@ -index 12f541f539..8f795f2bed 100644 +index a8b0649745..09bf7f850e 100644 @@ -28 +30 @@ -@@ -265,7 +265,7 @@ struct iavf_adapter { +@@ -201,7 +201,7 @@ struct iavf_adapter { @@ -38 +40 @@ -index f892306f18..7a151975dc 100644 +index 7d676c0279..0d026ab56f 100644 @@ -41 +43 @@ -@@ -2332,7 +2332,7 @@ iavf_dev_init(struct rte_eth_dev *eth_dev) +@@ -2002,7 +2002,7 @@ iavf_dev_init(struct rte_eth_dev *eth_dev) @@ -51 +53 @@ -index 52d919ca1b..a8ad7a0977 100644 +index b475aa0cc5..555551008b 100644 @@ -54 +56 @@ -@@ -2885,8 +2885,8 @@ iavf_dev_tx_desc_status(void *tx_queue, uint16_t offset) +@@ -2680,8 +2680,8 @@ iavf_dev_tx_desc_status(void *tx_queue, uint16_t offset) @@ -65 +67 @@ -@@ -3465,5 +3465,16 @@ iavf_get_default_ptype_table(void) +@@ -3216,5 +3216,16 @@ iavf_get_default_ptype_table(void) @@ -84 +86 @@ -index 84351011f1..6d1429081d 100644 +index 6bf6a44b77..2eb214373c 100644 @@ -87 +89 @@ -@@ -519,7 +519,7 @@ int iavf_txq_vec_setup_avx512(struct iavf_tx_queue *txq); +@@ -484,7 +484,7 @@ int iavf_txq_vec_setup_avx512(struct iavf_tx_queue *txq);