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 18D35A034F 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 045E540142; Wed, 10 Nov 2021 07:56:01 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2079.outbound.protection.outlook.com [40.107.237.79]) by mails.dpdk.org (Postfix) with ESMTP id 1D0FC40E28 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=EEH8S+oRy2Vi5mT6wVs+d2lGax8GaGgs+mcg3KQV2b1vN00/JKs7cbQTt4/lAGGJUrGearTKDH83R2BWWX60ApcEstF0KcHonjw/Ng2SMyvBMqsRnP8CozFd33E5mg3JvwZRzfKj2jJ7HgexnqTg9JZaGWT3lUbDHKaVvn82z73l4ITZmhbrYzXYCBpliPK0lMegIhhzPozZ0ymFL83MJx2c0rUO0JhUDlH31nnyDVF7a3h4oEfV5yXnHzVGJpoaPdP2Ari+6mFjVDfVJf4AUdb218Qxq1fV5sFU4pxx4EWK9gYyfiSISQhkpNbkRmNbLo9awYuEWuJc7YMAaDSTLA== 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=FtdKUkmYiNE+Pc6RIaktjf9ButtnDo3Aw6Z6GQsBse4=; b=S234gMbq3x4K7Nk0PbpAm0fsEEoM5EJ43OXt7qh50gu0x2ugPkZo1B9PV4QCbQuvhOEaEN0aWIEUtZTyTbsnR4rAtuYwJXtSgsaEw4KArbIzbojNWwiBw+xPmA++gN4OAeQCQzfmGf2u+9/2lQ7F1xtZHwXsuwSG2f6SMEaqU3uFDYzC6U3RovAccX3uh5BjV4MHM2+DbP9eCHN2k2iezxju4F36avsCEyc7fKtUglWTd5e1bgrpDCTepms2zL2gx/7BQz1HfpH3k2f0ePmBvmPNhgoYRc2fXazdws2dH2bQXNUwIzzJIymUaUobiNK6Kl0poKq0OSK8TnVkwh8jKQ== 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=FtdKUkmYiNE+Pc6RIaktjf9ButtnDo3Aw6Z6GQsBse4=; b=gsWxLIKStDH9RC3RkC2157h11V/csRZmhoL+MlmTdKAu5WP6Q+QXs9JtyQFlcO8Nrz/gq4j5mJ2ujnbeEcOFTiVgbLP4MCkQxhvmS8feYxAD0ZWADBFq5s3ZNzc2LR0BW0svSscCFt8dKTlyCHTP0peO7PX3nMOe4bOkbTBdUCWVhIJ0wjq86akAvsZNDEwOom6qHcMj/ep/eaPHMD8ylywF2Wp4Szn8t+/kaJcQFM6VXd+MSck41dv71BBmb1VrCbH6xSLBvsC3W4YqbontLrjR2nMi0czGHVvzMC/EX5fpQ1CiPv563bvxxfJ0xLNm3LxMKRZBcZPJPjxB7Z9f1g== Received: from DS7PR03CA0265.namprd03.prod.outlook.com (2603:10b6:5:3b3::30) by CY4PR12MB1414.namprd12.prod.outlook.com (2603:10b6:903:3a::23) 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:56 +0000 Received: from DM6NAM11FT063.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b3:cafe::2b) by DS7PR03CA0265.outlook.office365.com (2603:10b6:5:3b3::30) 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:56 +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:56 +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:53 +0000 From: Xueming Li To: Dapeng Yu CC: Luca Boccassi , Haiyue Wang , dpdk stable Date: Wed, 10 Nov 2021 14:31:35 +0800 Message-ID: <20211110063216.2744012-212-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: 0940b254-aeb9-41c3-9283-08d9a4172527 X-MS-TrafficTypeDiagnostic: CY4PR12MB1414: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NMpBM2fETIka090IJeylb8OJ+JIVhvmYutHgwFcfxwLBP9Zaq8c+bWlFDH2r9+h74NVJpkGjeJa8MnKbzYqjXX3b22ppg1Ecodk+tz5wMOKj8RiIK3mxZmMN0P1FUtCoRw+BtKhZ2e3P88Vluu3r3/S+KKN7oToUtex4wh/qJdkaQDs4jFSxwyeFzKx9zQXkkdu8oOzZ0iCN6FOYolQ8u1cIgzI75ie4DnDWcDIsb5Pl87/cUPECVysLOGMZDPC+D+w2i0qsMcHl6F7D3zfDh4Wi27jOaFLw6K04VkSHfsOesaO2lCh9h9oSPWHkTE8OgsrOeJEUnEv6RVl/sUQrWJhszQvE2W/EnVlnQogty3cojk2GjAE8tOqOHMganp5Vrz2KufwEuLIyRln8GsAJgd0ltfOuDqq3khFNas7O9pApK+E3rFSHqZARQ8bw/VSRm+2tTsDydeiYF03VynOGr29VOUDsHZFs6ynwZIMvfjbk8xwlNdUvFeOWrMII2gLCwzSPocF7yF2OP9Li0pCUF6KCfSbiCHZAZ5vkD1Jen2vBUPLLCp57GDhDzQLm/PH8wCWOChARGF5bSzQTNX4eJbiZaWmDDz0leGByPe/JzzKNE221+BUnSGxPImDpgDW5l9iyzKuohxPKZOQj9h52B1S4paJjenDnfkGFKKDsRqyIvPeR2sRdqoBwYEbcrHhR24oEBdGUiViB5gzgZlPh3NdJQUFMenax4WI7CMky6NaOAriIDG16kdcfSbEGsAswuK4ZR5X2L0dGmVxx5SRGfxAkKHeXImSQl2IpISIFfAcf/MyJdpYsoF/s8WvGY47tpT8jnMs1aRY9N752koc2Rg== 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)(46966006)(36840700001)(55016002)(1076003)(16526019)(86362001)(336012)(6666004)(426003)(53546011)(356005)(4001150100001)(966005)(54906003)(2616005)(7696005)(8676002)(2906002)(7636003)(36756003)(8936002)(5660300002)(6916009)(70586007)(70206006)(316002)(82310400003)(36860700001)(508600001)(47076005)(186003)(4326008)(6286002)(26005)(83380400001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:55:56.3069 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0940b254-aeb9-41c3-9283-08d9a4172527 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: CY4PR12MB1414 Subject: [dpdk-stable] patch 'net/ice: fix function pointer 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/62ad28d888e291d10a59c4218bc4d2deeeb96c5a Thanks. Xueming Li --- >From 62ad28d888e291d10a59c4218bc4d2deeeb96c5a Mon Sep 17 00:00:00 2001 From: Dapeng Yu Date: Tue, 26 Oct 2021 09:55:42 +0800 Subject: [PATCH] net/ice: fix function pointer in multi-process Cc: Xueming Li [ upstream commit 20b631efe785819eb77aabbf500b3352e5731bdb ] This patch uses the index value to call the function, instead of the function pointer assignment to save the selection of Receive Flex Descriptor profile ID. Otherwise the secondary process will run with wrong function address from primary process. Fixes: 7a340b0b4e03 ("net/ice: refactor Rx FlexiMD handling") Signed-off-by: Dapeng Yu Acked-by: Haiyue Wang --- drivers/net/ice/ice_rxtx.c | 32 ++++++++++++++++++-------------- drivers/net/ice/ice_rxtx.h | 2 +- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index 906fca15b0..e16ec5be64 100644 --- a/drivers/net/ice/ice_rxtx.c +++ b/drivers/net/ice/ice_rxtx.c @@ -170,51 +170,55 @@ ice_rxd_to_pkt_fields_by_comms_aux_v2(struct ice_rx_queue *rxq, #endif } +static const ice_rxd_to_pkt_fields_t rxd_to_pkt_fields_ops[] = { + [ICE_RXDID_COMMS_AUX_VLAN] = ice_rxd_to_pkt_fields_by_comms_aux_v1, + [ICE_RXDID_COMMS_AUX_IPV4] = ice_rxd_to_pkt_fields_by_comms_aux_v1, + [ICE_RXDID_COMMS_AUX_IPV6] = ice_rxd_to_pkt_fields_by_comms_aux_v1, + [ICE_RXDID_COMMS_AUX_IPV6_FLOW] = ice_rxd_to_pkt_fields_by_comms_aux_v1, + [ICE_RXDID_COMMS_AUX_TCP] = ice_rxd_to_pkt_fields_by_comms_aux_v1, + [ICE_RXDID_COMMS_AUX_IP_OFFSET] = ice_rxd_to_pkt_fields_by_comms_aux_v2, + [ICE_RXDID_COMMS_GENERIC] = ice_rxd_to_pkt_fields_by_comms_generic, + [ICE_RXDID_COMMS_OVS] = ice_rxd_to_pkt_fields_by_comms_ovs, +}; + void ice_select_rxd_to_pkt_fields_handler(struct ice_rx_queue *rxq, uint32_t rxdid) { + rxq->rxdid = rxdid; + switch (rxdid) { case ICE_RXDID_COMMS_AUX_VLAN: rxq->xtr_ol_flag = rte_net_ice_dynflag_proto_xtr_vlan_mask; - rxq->rxd_to_pkt_fields = ice_rxd_to_pkt_fields_by_comms_aux_v1; break; case ICE_RXDID_COMMS_AUX_IPV4: rxq->xtr_ol_flag = rte_net_ice_dynflag_proto_xtr_ipv4_mask; - rxq->rxd_to_pkt_fields = ice_rxd_to_pkt_fields_by_comms_aux_v1; break; case ICE_RXDID_COMMS_AUX_IPV6: rxq->xtr_ol_flag = rte_net_ice_dynflag_proto_xtr_ipv6_mask; - rxq->rxd_to_pkt_fields = ice_rxd_to_pkt_fields_by_comms_aux_v1; break; case ICE_RXDID_COMMS_AUX_IPV6_FLOW: rxq->xtr_ol_flag = rte_net_ice_dynflag_proto_xtr_ipv6_flow_mask; - rxq->rxd_to_pkt_fields = ice_rxd_to_pkt_fields_by_comms_aux_v1; break; case ICE_RXDID_COMMS_AUX_TCP: rxq->xtr_ol_flag = rte_net_ice_dynflag_proto_xtr_tcp_mask; - rxq->rxd_to_pkt_fields = ice_rxd_to_pkt_fields_by_comms_aux_v1; break; case ICE_RXDID_COMMS_AUX_IP_OFFSET: rxq->xtr_ol_flag = rte_net_ice_dynflag_proto_xtr_ip_offset_mask; - rxq->rxd_to_pkt_fields = ice_rxd_to_pkt_fields_by_comms_aux_v2; break; case ICE_RXDID_COMMS_GENERIC: - rxq->rxd_to_pkt_fields = ice_rxd_to_pkt_fields_by_comms_generic; - break; - + /* fallthrough */ case ICE_RXDID_COMMS_OVS: - rxq->rxd_to_pkt_fields = ice_rxd_to_pkt_fields_by_comms_ovs; break; default: /* update this according to the RXDID for PROTO_XTR_NONE */ - rxq->rxd_to_pkt_fields = ice_rxd_to_pkt_fields_by_comms_ovs; + rxq->rxdid = ICE_RXDID_COMMS_OVS; break; } @@ -1552,7 +1556,7 @@ ice_rx_scan_hw_ring(struct ice_rx_queue *rxq) mb->packet_type = ptype_tbl[ICE_RX_FLEX_DESC_PTYPE_M & rte_le_to_cpu_16(rxdp[j].wb.ptype_flex_flags0)]; ice_rxd_to_vlan_tci(mb, &rxdp[j]); - rxq->rxd_to_pkt_fields(rxq, mb, &rxdp[j]); + rxd_to_pkt_fields_ops[rxq->rxdid](rxq, mb, &rxdp[j]); mb->ol_flags |= pkt_flags; } @@ -1845,7 +1849,7 @@ ice_recv_scattered_pkts(void *rx_queue, first_seg->packet_type = ptype_tbl[ICE_RX_FLEX_DESC_PTYPE_M & rte_le_to_cpu_16(rxd.wb.ptype_flex_flags0)]; ice_rxd_to_vlan_tci(first_seg, &rxd); - rxq->rxd_to_pkt_fields(rxq, first_seg, &rxd); + rxd_to_pkt_fields_ops[rxq->rxdid](rxq, first_seg, &rxd); pkt_flags = ice_rxd_error_to_pkt_flags(rx_stat_err0); first_seg->ol_flags |= pkt_flags; /* Prefetch data of first segment, if configured to do so. */ @@ -2247,7 +2251,7 @@ ice_recv_pkts(void *rx_queue, rxm->packet_type = ptype_tbl[ICE_RX_FLEX_DESC_PTYPE_M & rte_le_to_cpu_16(rxd.wb.ptype_flex_flags0)]; ice_rxd_to_vlan_tci(rxm, &rxd); - rxq->rxd_to_pkt_fields(rxq, rxm, &rxd); + rxd_to_pkt_fields_ops[rxq->rxdid](rxq, rxm, &rxd); pkt_flags = ice_rxd_error_to_pkt_flags(rx_stat_err0); rxm->ol_flags |= pkt_flags; /* copy old mbuf to rx_pkts */ diff --git a/drivers/net/ice/ice_rxtx.h b/drivers/net/ice/ice_rxtx.h index 4bea2bc2be..a74c4b3492 100644 --- a/drivers/net/ice/ice_rxtx.h +++ b/drivers/net/ice/ice_rxtx.h @@ -86,7 +86,7 @@ struct ice_rx_queue { bool rx_deferred_start; /* don't start this queue in dev start */ uint8_t proto_xtr; /* Protocol extraction from flexible descriptor */ uint64_t xtr_ol_flag; /* Protocol extraction offload flag */ - ice_rxd_to_pkt_fields_t rxd_to_pkt_fields; /* handle FlexiMD by RXDID */ + uint32_t rxdid; /* Receive Flex Descriptor profile ID */ ice_rx_release_mbufs_t rx_rel_mbufs; const struct rte_memzone *mz; }; -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:11.228558485 +0800 +++ 0211-net-ice-fix-function-pointer-in-multi-process.patch 2021-11-10 14:17:02.020744864 +0800 @@ -1 +1 @@ -From 20b631efe785819eb77aabbf500b3352e5731bdb Mon Sep 17 00:00:00 2001 +From 62ad28d888e291d10a59c4218bc4d2deeeb96c5a Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 20b631efe785819eb77aabbf500b3352e5731bdb ] @@ -14 +16,0 @@ -Cc: stable@dpdk.org @@ -24 +26 @@ -index e7217661dd..c3cad2fbbb 100644 +index 906fca15b0..e16ec5be64 100644 @@ -27 +29 @@ -@@ -204,51 +204,55 @@ ice_rxd_to_pkt_fields_by_comms_aux_v2(struct ice_rx_queue *rxq, +@@ -170,51 +170,55 @@ ice_rxd_to_pkt_fields_by_comms_aux_v2(struct ice_rx_queue *rxq, @@ -94 +96 @@ -@@ -1608,7 +1612,7 @@ ice_rx_scan_hw_ring(struct ice_rx_queue *rxq) +@@ -1552,7 +1556,7 @@ ice_rx_scan_hw_ring(struct ice_rx_queue *rxq) @@ -100,4 +102,4 @@ - #ifndef RTE_LIBRTE_ICE_16BYTE_RX_DESC - if (rxq->offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) { - ts_ns = ice_tstamp_convert_32b_64b(hw, -@@ -1925,7 +1929,7 @@ ice_recv_scattered_pkts(void *rx_queue, + + mb->ol_flags |= pkt_flags; + } +@@ -1845,7 +1849,7 @@ ice_recv_scattered_pkts(void *rx_queue, @@ -110,3 +112,3 @@ - #ifndef RTE_LIBRTE_ICE_16BYTE_RX_DESC - if (rxq->offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) { -@@ -2356,7 +2360,7 @@ ice_recv_pkts(void *rx_queue, + first_seg->ol_flags |= pkt_flags; + /* Prefetch data of first segment, if configured to do so. */ +@@ -2247,7 +2251,7 @@ ice_recv_pkts(void *rx_queue, @@ -119,2 +121,2 @@ - #ifndef RTE_LIBRTE_ICE_16BYTE_RX_DESC - if (rxq->offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) { + rxm->ol_flags |= pkt_flags; + /* copy old mbuf to rx_pkts */ @@ -122 +124 @@ -index e1c644fb63..146dc1f95d 100644 +index 4bea2bc2be..a74c4b3492 100644 @@ -125 +127 @@ -@@ -89,7 +89,7 @@ struct ice_rx_queue { +@@ -86,7 +86,7 @@ struct ice_rx_queue { @@ -132,2 +134,2 @@ - uint64_t offloads; - uint32_t time_high; + const struct rte_memzone *mz; + };