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 5A070A034F for ; Wed, 10 Nov 2021 07:50:46 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4D0344014D; Wed, 10 Nov 2021 07:50:46 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2083.outbound.protection.outlook.com [40.107.243.83]) by mails.dpdk.org (Postfix) with ESMTP id 34A2F40142 for ; Wed, 10 Nov 2021 07:50:45 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eB+0XNYAaec76Ocq7vtU0ANr5qxN7poRyFxxZQOj+A62Z8Iy2cc5kK+axde/mJv4PFEir4PglTqB0FK/AluwLZcHv+pgie4Ug/sAWRFLwk/sCmek7gh+ngCEIf0sruix8g4wy1ii6UlP+TcqCjlMN4w7UxaCltPhJDoSj/+FZ06niavChfY/Sf4/fCm6aPWtRzMjEPXUD/VNZlKKmRbbyzn1xMDnc2pXajdb5QE124/QS8gIm1bmK6hHGtJ7q8JVLYtIsYIDowM1kShGhSqKhsJLV02DjsKj2/JbuxPI0QXFYicEYhegp4OyZW1sfNk5w/B3paORGDp+VrdMkJ/JUA== 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=AS08yG6Y8LgX+1xQwB7fAi7/LtGdDS7bqlcTXMPceY4=; b=dYOyKp9Zv6Dv0lfa29/DmWPUiri54mqhf4m7pEQ/jPOkmfFpz7izq+FrRERYJd+o5Zjzwgv0Pmv0IqWYvs6oME7lyPk6cCyNNVj5CzMD/+/k105mA51d8b91utpF+Gmkpc+Rd73mBfuxI4Zo4hFkNiQCww/PScLsvqBGiwlKMpkcwpKNu/8eTwyGBFfj39LRtVSX9pUASsoq6wIuhnEtfHEdW4MWie7qKyqkkFfiGxAEJBgXUs/XxZj8IrI9xvjlsZAoNtHL7Q+FFcVzImWl8Hk+3NTtcTQgSRu+8gOzWXViSfDQfGSQsv8FuN7T5v3trZvqdJ0Ox+ZesQHN73aIlQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=amazon.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=AS08yG6Y8LgX+1xQwB7fAi7/LtGdDS7bqlcTXMPceY4=; b=sSSnS2R0d6bXmXFBsEvdFJ7U5l2nSpjl9/88qg/RcKnMDIlSYJ1FLSQf+GrLIP6h5MGyEk94nRNpbk//NQWaCB0xVPyilTIPUh0GYgnFNp2GeXSG4CL2yuyU+BaMNxsLyw0zPAbDoIOWj4mun7L7Jr1MjuHtaZMrICNcKwOqA4iQJJzA4ggKcDRbNFQ43iFfjp8McnnvXrnmfiX3KJAKldPG3/JxiC1Zpq5UeWIWw4pjbDSrsIIyiT4qgJM3zrn/XRzzclU6R3TTT+vf/sIUEASJz3xlm0W27qvCg45o2WvqT1ottN/UmB4NYzV9dnRbzknF0M2pcNmMxvgw29BrmQ== Received: from BN8PR04CA0065.namprd04.prod.outlook.com (2603:10b6:408:d4::39) by BN6PR12MB1780.namprd12.prod.outlook.com (2603:10b6:404:107::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.16; Wed, 10 Nov 2021 06:50:43 +0000 Received: from BN8NAM11FT052.eop-nam11.prod.protection.outlook.com (2603:10b6:408:d4:cafe::13) by BN8PR04CA0065.outlook.office365.com (2603:10b6:408:d4::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:50:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;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 BN8NAM11FT052.mail.protection.outlook.com (10.13.177.210) 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:50:42 +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:50:26 +0000 From: Xueming Li To: Michal Krawczyk CC: Luca Boccassi , Igor Chauskin , Shai Brandes , dpdk stable Date: Wed, 10 Nov 2021 14:30:44 +0800 Message-ID: <20211110063216.2744012-161-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: d9a21b09-9fd6-423c-b7a0-08d9a4166a50 X-MS-TrafficTypeDiagnostic: BN6PR12MB1780: 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: IW1blfDs6nEho1s4NFcWZvqLciYnKj3Axi75Ovmo5We++KCtp/fsM3rQutpuBaAQ3HIcqV7qdgAHyCdleCdlSmb/MUctZdx1jlnIGn/eTbVvW2cVd58MPANhkkbVrVdq+9nRc5zf80pg26UkDhqeFG+k7RK4rzMBPA4/SZGEIHkFmoS689xEIe8/JNofly7/PTC/JwebyJhRxugPdeXsOr2oqYD09om8N6fRY0mhHmKogNMzh6fuRbXrtpsFXMmWlwPGR03EGKiYNWe1uWNrLv/1JzqZrkjPdrl8EA5KSwwKTK3LmWzj4Ub2DQ2MDTH36Ur0Z2lSnHjYv2C6+iCvGMaFrTmNQq+yzY0iVrvhvmGA27/DMKBTHUCpdc1IGTyuU0hsz+wWpdKcEK7rT1tBr2vs24QZAtvP30KkjiUruZGR/MtN0I2HXlsP8NqFDTfIODwMTfl7eM9ih32mubxsdZ2YF2prEVtDrhw/uUKtwMmgBZ2WOr1IsXtaRhtsfJpVx9/XZzcIZNVPVLjA3NcT1xapqlytdMrFWtu1/4YdYJAS1FxbF6ewgt7Y/CKsKPjCfAO6em221nYyuZuwU5hAX0S1JEMd3DHULDidn7//9LdYIsm87Uh8av5DvDDeVVO7UNeFW5xZ1i165hMTOy7BpkWRlVX2WcOsK4I+XojrO8GNzU7msIF++YSevih6sdjyazix8qYrbj2PHIwxhFi11cRdQiOVZ8EhjvFrovLXGCy7beQ9y4WtfGSc/UIt99qIBHan2vyjJ/pt6/O73NwWyERxGUGkn8y5T5WR+ZV0HQz6Chgx7HdJZzN4doYkNNrLibznvj1yR615kV3MW5CcrA== 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)(70586007)(36756003)(36860700001)(70206006)(966005)(86362001)(508600001)(83380400001)(6666004)(6286002)(55016002)(7636003)(82310400003)(1076003)(356005)(6916009)(53546011)(7696005)(4001150100001)(186003)(16526019)(26005)(54906003)(47076005)(36906005)(316002)(40140700001)(2616005)(8936002)(8676002)(5660300002)(4326008)(2906002)(336012)(426003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:50:42.7887 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d9a21b09-9fd6-423c-b7a0-08d9a4166a50 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: BN8NAM11FT052.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1780 Subject: [dpdk-stable] patch 'net/ena: fix per-queue offload capabilities' 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/8200e4d11e02341bfde65debcd4703038b3d1402 Thanks. Xueming Li --- >From 8200e4d11e02341bfde65debcd4703038b3d1402 Mon Sep 17 00:00:00 2001 From: Michal Krawczyk Date: Tue, 19 Oct 2021 12:56:25 +0200 Subject: [PATCH] net/ena: fix per-queue offload capabilities Cc: Xueming Li [ upstream commit 3a822d79c5da8ed65fd08a8188b9b7d4c35fe199 ] As ENA currently doesn't support offloads which could be configured per-queue, only per-port flags should be set. In addition, to make the code cleaner, parsing appropriate offload flags is encapsulated into helper functions, in a similar matter it's done by the other PMDs. [1] https://doc.dpdk.org/guides/prog_guide/ poll_mode_drv.html?highlight=offloads#hardware-offload Fixes: 7369f88f88c0 ("net/ena: convert to new Rx offloads API") Fixes: 56b8b9b7e5d2 ("net/ena: convert to new Tx offloads API") Signed-off-by: Michal Krawczyk Reviewed-by: Igor Chauskin Reviewed-by: Shai Brandes --- drivers/net/ena/ena_ethdev.c | 90 ++++++++++++++++++++++++------------ 1 file changed, 60 insertions(+), 30 deletions(-) diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index 16ba729989..f4e26927a4 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -237,6 +237,10 @@ static int ena_queue_start(struct ena_ring *ring); static int ena_queue_start_all(struct rte_eth_dev *dev, enum ena_ring_type ring_type); static void ena_stats_restart(struct rte_eth_dev *dev); +static uint64_t ena_get_rx_port_offloads(struct ena_adapter *adapter); +static uint64_t ena_get_tx_port_offloads(struct ena_adapter *adapter); +static uint64_t ena_get_rx_queue_offloads(struct ena_adapter *adapter); +static uint64_t ena_get_tx_queue_offloads(struct ena_adapter *adapter); static int ena_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info); static int ena_rss_reta_update(struct rte_eth_dev *dev, @@ -2053,12 +2057,63 @@ static void ena_init_rings(struct ena_adapter *adapter, } } +static uint64_t ena_get_rx_port_offloads(struct ena_adapter *adapter) +{ + uint64_t port_offloads = 0; + + if (adapter->offloads.rx_offloads & ENA_L3_IPV4_CSUM) + port_offloads |= DEV_RX_OFFLOAD_IPV4_CKSUM; + + if (adapter->offloads.rx_offloads & + (ENA_L4_IPV4_CSUM | ENA_L4_IPV6_CSUM)) + port_offloads |= + DEV_RX_OFFLOAD_UDP_CKSUM | DEV_RX_OFFLOAD_TCP_CKSUM; + + if (adapter->offloads.rx_offloads & ENA_RX_RSS_HASH) + port_offloads |= DEV_RX_OFFLOAD_RSS_HASH; + + return port_offloads; +} + +static uint64_t ena_get_tx_port_offloads(struct ena_adapter *adapter) +{ + uint64_t port_offloads = 0; + + if (adapter->offloads.tx_offloads & ENA_IPV4_TSO) + port_offloads |= DEV_TX_OFFLOAD_TCP_TSO; + + if (adapter->offloads.tx_offloads & ENA_L3_IPV4_CSUM) + port_offloads |= DEV_TX_OFFLOAD_IPV4_CKSUM; + if (adapter->offloads.tx_offloads & + (ENA_L4_IPV4_CSUM_PARTIAL | ENA_L4_IPV4_CSUM | + ENA_L4_IPV6_CSUM | ENA_L4_IPV6_CSUM_PARTIAL)) + port_offloads |= + DEV_TX_OFFLOAD_UDP_CKSUM | DEV_TX_OFFLOAD_TCP_CKSUM; + + port_offloads |= DEV_TX_OFFLOAD_MULTI_SEGS; + + return port_offloads; +} + +static uint64_t ena_get_rx_queue_offloads(struct ena_adapter *adapter) +{ + RTE_SET_USED(adapter); + + return 0; +} + +static uint64_t ena_get_tx_queue_offloads(struct ena_adapter *adapter) +{ + RTE_SET_USED(adapter); + + return 0; +} + static int ena_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { struct ena_adapter *adapter; struct ena_com_dev *ena_dev; - uint64_t rx_feat = 0, tx_feat = 0; ena_assert_msg(dev->data != NULL, "Uninitialized device\n"); ena_assert_msg(dev->data->dev_private != NULL, "Uninitialized device\n"); @@ -2077,33 +2132,11 @@ static int ena_infos_get(struct rte_eth_dev *dev, ETH_LINK_SPEED_50G | ETH_LINK_SPEED_100G; - /* Set Tx & Rx features available for device */ - if (adapter->offloads.tx_offloads & ENA_IPV4_TSO) - tx_feat |= DEV_TX_OFFLOAD_TCP_TSO; - - if (adapter->offloads.tx_offloads & ENA_L3_IPV4_CSUM) - tx_feat |= DEV_TX_OFFLOAD_IPV4_CKSUM; - if (adapter->offloads.tx_offloads & - (ENA_L4_IPV4_CSUM_PARTIAL | ENA_L4_IPV4_CSUM | - ENA_L4_IPV6_CSUM | ENA_L4_IPV6_CSUM_PARTIAL)) - tx_feat |= DEV_TX_OFFLOAD_UDP_CKSUM | DEV_TX_OFFLOAD_TCP_CKSUM; - - if (adapter->offloads.rx_offloads & ENA_L3_IPV4_CSUM) - rx_feat |= DEV_RX_OFFLOAD_IPV4_CKSUM; - if (adapter->offloads.rx_offloads & - (ENA_L4_IPV4_CSUM | ENA_L4_IPV6_CSUM)) - rx_feat |= DEV_RX_OFFLOAD_UDP_CKSUM | DEV_RX_OFFLOAD_TCP_CKSUM; - - rx_feat |= DEV_RX_OFFLOAD_JUMBO_FRAME; - tx_feat |= DEV_TX_OFFLOAD_MULTI_SEGS; - /* Inform framework about available features */ - dev_info->rx_offload_capa = rx_feat; - if (adapter->offloads.rx_offloads & ENA_RX_RSS_HASH) - dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_RSS_HASH; - dev_info->rx_queue_offload_capa = rx_feat; - dev_info->tx_offload_capa = tx_feat; - dev_info->tx_queue_offload_capa = tx_feat; + dev_info->rx_offload_capa = ena_get_rx_port_offloads(adapter); + dev_info->tx_offload_capa = ena_get_tx_port_offloads(adapter); + dev_info->rx_queue_offload_capa = ena_get_rx_queue_offloads(adapter); + dev_info->tx_queue_offload_capa = ena_get_tx_queue_offloads(adapter); dev_info->flow_type_rss_offloads = ETH_RSS_IP | ETH_RSS_TCP | ETH_RSS_UDP; @@ -2116,9 +2149,6 @@ static int ena_infos_get(struct rte_eth_dev *dev, dev_info->max_tx_queues = adapter->max_num_io_queues; dev_info->reta_size = ENA_RX_RSS_TABLE_SIZE; - adapter->tx_supported_offloads = tx_feat; - adapter->rx_supported_offloads = rx_feat; - dev_info->rx_desc_lim.nb_max = adapter->max_rx_ring_size; dev_info->rx_desc_lim.nb_min = ENA_MIN_RING_DESC; dev_info->rx_desc_lim.nb_seg_max = RTE_MIN(ENA_PKT_MAX_BUFS, -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:09.051321564 +0800 +++ 0160-net-ena-fix-per-queue-offload-capabilities.patch 2021-11-10 14:17:01.967411966 +0800 @@ -1 +1 @@ -From 3a822d79c5da8ed65fd08a8188b9b7d4c35fe199 Mon Sep 17 00:00:00 2001 +From 8200e4d11e02341bfde65debcd4703038b3d1402 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 3a822d79c5da8ed65fd08a8188b9b7d4c35fe199 ] @@ -18 +20,0 @@ -Cc: stable@dpdk.org @@ -24,2 +26,2 @@ - drivers/net/ena/ena_ethdev.c | 89 ++++++++++++++++++++++++------------ - 1 file changed, 60 insertions(+), 29 deletions(-) + drivers/net/ena/ena_ethdev.c | 90 ++++++++++++++++++++++++------------ + 1 file changed, 60 insertions(+), 30 deletions(-) @@ -28 +30 @@ -index fe9bac8888..655c53b525 100644 +index 16ba729989..f4e26927a4 100644 @@ -31 +33 @@ -@@ -223,6 +223,10 @@ static int ena_queue_start(struct rte_eth_dev *dev, struct ena_ring *ring); +@@ -237,6 +237,10 @@ static int ena_queue_start(struct ena_ring *ring); @@ -41,2 +43,2 @@ - static void ena_interrupt_handler_rte(void *cb_arg); -@@ -1947,12 +1951,63 @@ static void ena_init_rings(struct ena_adapter *adapter, + static int ena_rss_reta_update(struct rte_eth_dev *dev, +@@ -2053,12 +2057,63 @@ static void ena_init_rings(struct ena_adapter *adapter, @@ -107 +109 @@ -@@ -1971,32 +2026,11 @@ static int ena_infos_get(struct rte_eth_dev *dev, +@@ -2077,33 +2132,11 @@ static int ena_infos_get(struct rte_eth_dev *dev, @@ -127,0 +130 @@ +- rx_feat |= DEV_RX_OFFLOAD_JUMBO_FRAME; @@ -142,3 +145,3 @@ - dev_info->flow_type_rss_offloads = ENA_ALL_RSS_HF; - dev_info->hash_key_size = ENA_HASH_KEY_SIZE; -@@ -2012,9 +2046,6 @@ static int ena_infos_get(struct rte_eth_dev *dev, + dev_info->flow_type_rss_offloads = ETH_RSS_IP | ETH_RSS_TCP | + ETH_RSS_UDP; +@@ -2116,9 +2149,6 @@ static int ena_infos_get(struct rte_eth_dev *dev,