From patchwork Sun Jul 7 10:25:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Itamar Gozlan X-Patchwork-Id: 142173 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3A4AA455B6; Sun, 7 Jul 2024 12:25:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2175A402CF; Sun, 7 Jul 2024 12:25:50 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2084.outbound.protection.outlook.com [40.107.236.84]) by mails.dpdk.org (Postfix) with ESMTP id 848C84029F for ; Sun, 7 Jul 2024 12:25:48 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M4AmRTz2QHEHjomMmcu3lgbv/rr+QXYKc19nJ2PCM9EDAwyeeyy44omXn95fF8iDZikSIDZmuyEAwBuCnW5Eefy4BU4Flkn3rJm0inRJE5r+k2i2Z54A1h3QASEawLRNp2Si2VZu5S8UxlMv0a0PVz0gy93XnH9L3nVVSMjTu1mu9+6V8JZlufnJ4UrUrUVdZ9amJTkl64XxRAEV/T0mf4Sd9bf3ePI6EyjOW3CMJ2C6m2Qcw5WSbyjqykqtqXvC/AMNLKD+QzyKnXpkhrr46zUxIipbaBd3KXslcolTvy9WnXL7UfU9Kprd0+vw1biSkGcku9I/5yCnHmEP8ZEW0w== 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=ytU+gRmBytqHVGAqNaIuB66Ck9pd/pfDrlBbxCPdcnU=; b=AWWcFGujpKe2XzLtlz3dnRk08FBebgT4j6zp7V1TaBUomScSjhNzSXOXUrzJzuYOgNoKvlu/VDjjvsCLCvUr4TWg4+xcLyeZCztlfuRlaPnGT/PdknyHmTGV19WacYb322cUDfg2PaHN9UCnuHUtr68+Qs8H5dZ0M9Xe/3m+BdHjL2iFjDk4+q4GBpulRy6e5xwWnAirxjU8kkcmuLsksfnQjm+sbj9TTX0KkaR381BpIo7ardminmGCS0Ty0Nn604/2C1Kws2eM7piXavddID5xaYHjx4j0EvyBnddreslwNFxCAZNgumV1g1l0IO6enQ6nl/sf5mOfQ7T+dSKGmg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) 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=ytU+gRmBytqHVGAqNaIuB66Ck9pd/pfDrlBbxCPdcnU=; b=k0L4tiJ4vXz+47m1hEKJdIhQQWccANeNpUHOKbGMF9llg782TcMxs6c1GOIU+fHHL1fQXKlWOriz+fAyt5nb3Fp537oMM7BNOQftb/h8PIyJxjj8Jy/lGyYgo1P/6cwZQ0e2yD7qzfVj2MHgQKpo3IE9U0NANT3rZG+W52VtAQn+RAtyDC6hmbGYdd/1868Rp0KJLOVjmrAV/RmCQp+1ZJgbRf7pe2C3scxbvLZ/x9jJXzQhVcW30IRnVSGOekHciOYZBsZa9ZwaI4KvWFTFc5AR50eDc6Idpl4lUrEuO98Syp5RowhXJmE1cPbEfMfTm33DHI7n289sLQw7EPLIDQ== Received: from BL1PR13CA0210.namprd13.prod.outlook.com (2603:10b6:208:2be::35) by CH3PR12MB7690.namprd12.prod.outlook.com (2603:10b6:610:14e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.34; Sun, 7 Jul 2024 10:25:42 +0000 Received: from BL6PEPF0001AB53.namprd02.prod.outlook.com (2603:10b6:208:2be:cafe::58) by BL1PR13CA0210.outlook.office365.com (2603:10b6:208:2be::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.18 via Frontend Transport; Sun, 7 Jul 2024 10:25:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) 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.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by BL6PEPF0001AB53.mail.protection.outlook.com (10.167.241.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Sun, 7 Jul 2024 10:25:42 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 7 Jul 2024 03:25:42 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 7 Jul 2024 03:25:41 -0700 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4 via Frontend Transport; Sun, 7 Jul 2024 03:25:37 -0700 From: Itamar Gozlan To: , , , , , , , , Dariusz Sosnowski , Bing Zhao , Ori Kam , Matan Azrad , Anatoly Burakov CC: , Shani Peretz Subject: [PATCH 01/10] net/mlx5: add hairpin out of buffer counter Date: Sun, 7 Jul 2024 13:25:22 +0300 Message-ID: <20240707102532.2045942-1-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB53:EE_|CH3PR12MB7690:EE_ X-MS-Office365-Filtering-Correlation-Id: ac5ebefe-a143-427a-2531-08dc9e6f27d1 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|36860700013|82310400026|921020; X-Microsoft-Antispam-Message-Info: ifhJZ6B4fO3X3yg24n5D0WiezeaBrrpIyDoXeA8+oHVUrhZFCLl45KN/TINCHlw+48JJeUvBnVVSrrd/nqz6Tc+RWH2OGTBGPiLCxXtU9mD7mykwj19mPDeriqfIqVpkKrVxZ7D3MNOBi7fudBGgRJZl9rmiDs3GNkL//IR6228JFCWSp9giD72UDPEvDYQa8LQtTKEdQCLpCWOkTZqsNtnWPigiWiZzz3sEePukMjLYTEJnFGNgsni9bRwcISeOpyG0zmUIfAsm2DIVjQydY7R1cGzjv312zkU1N0lZavdaA1CJiqpIvRpFGcoF3SOkln1Y1L67XN5lG0QeKMsLPzGfA6m5bP/UJWuzrrY5fZAU0vb4LzuLndDEfiIzmUXLBG5BnA2jSZlZkg8Y0JuOnoOdu3RoppbR6Y8oCQhKaR2wsuQ8vCt1P3RpUPiDagWxhFbDqOvl40lJMsl7Y+W3tKmKP2XxzO4lj91+x6M2I9ELn8NAd8skgL6bNRr7V1X+BgWQ+8nNqzEjeKOggt1xugrtPJVWG1X6iBCE40CvO2WQEUfjPsLOwjLp5yY7Bt+AU0nVICEvCrHx7M8ZhOXsQLKvp18jrZ0IIDuARQALC4ZCmt14VsYbajmaB3qF4TCFYvS2Or5K0sP/xGz9OV0nm+9tRjIEUw36/kv8BVGs31l3NLRH0hcb+JbVAZyzhTege9Gmt+vcowubeubAQPh4vE/+NL72u6r5PrfJVV+GoAg1sBWkFZ6ZOt9Jiye7y//2udZMi78DPnQeang7mR4SK8SlQtfFCch94uFZucrAJaorw8gcxqt3fNjE6qAIi3z4mcp+q3mEh5eQvfxLfY/TPwoulAa8fCao2dMqB+x8dUsuEzJODYi9DywcUC3E4adfFir85uV9wYG6bCryHy73KNVC5oDHIdAI/KGKd/14+DBbd3MhkBWkmwI8NFxsXaYD07Q4Pzwrny+pmCaQYVArmPWis/igY5XoQkFQeSupyH51ODkj2PjOkzaES1FIHaC8lucFYvEHhmBNQio+cn4XrP38fEluvLaGCvOYll/MpIWPseeuqamb+n1RRGv0dP+JPQAwr7L2lZxH3iJ/9nxKjL5ZAckZKgulimtz1DYMjllIlo++0hUp1RoFmxjLEy0k4MIw4SkRTAwBEVFLDrwTr+rv9OeMjMIqolSRhqGPtrKhE2Gm5ihDJxt/ZPkBBLdee+8ber4gvL6EWTHXtdFaidbyp8G2oJmxVXHeBY4WtAXrWTIX1mQZlABxk6S+0WNP4cPk6zgoMSO21ZgLDRt3lShDCyC1S80YaV/D8yRtsCSEgvt0YyYNHIigVR8S+uQmLwhRjDzJT+rwlg2OCqJvewqKQl8Q8G1HbyHrUknlji4moQXBbFmhi2dSxR1qEG+Ei9TEyG8HLcNGOO3so2z87iexgz+JhFJgG2vwSYclkBTOm4g1X46f3Q2XtAcOQjaf6NLSsR2/El/sUI7bfWsMAQ== X-Forefront-Antispam-Report: CIP:216.228.118.232; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge1.nvidia.com; CAT:NONE; SFS:(13230040)(1800799024)(376014)(36860700013)(82310400026)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2024 10:25:42.4469 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ac5ebefe-a143-427a-2531-08dc9e6f27d1 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.232]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB53.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7690 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Shani Peretz Currently mlx5 PMD exposes rx_out_of_buffer counter that tracks packets dropped when Rx queue was full. To provide more granular statistics, this patch splits the `rx_out_of_buffer` counter into two separate counters: 1. hairpin_out_of_buffer - This counter specifically tracks packets dropped by the device's hairpin Rx queues. 2. rx_out_of_buffer - This counter tracks packets dropped by the device's Rx queues, excluding the hairpin Rx queues. Two hardware counter objects will be created per device, and all the Rx queues will be assigned to these counters during the configuration phase. The `hairpin_out_of_buffer` counter will be created only if there is at least one hairpin Rx queue present on the device. Signed-off-by: Shani Peretz Acked-by: Dariusz Sosnowski --- doc/guides/nics/mlx5.rst | 3 ++ doc/guides/rel_notes/release_24_07.rst | 1 + drivers/net/mlx5/linux/mlx5_ethdev_os.c | 5 +++ drivers/net/mlx5/linux/mlx5_os.c | 14 ++++++- drivers/net/mlx5/mlx5.c | 4 ++ drivers/net/mlx5/mlx5.h | 4 ++ drivers/net/mlx5/mlx5_devx.c | 54 ++++++++++++++++++++++++- drivers/net/mlx5/windows/mlx5_os.c | 1 + 8 files changed, 84 insertions(+), 2 deletions(-) diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst index 304c6770af..caacc9f62d 100644 --- a/doc/guides/nics/mlx5.rst +++ b/doc/guides/nics/mlx5.rst @@ -750,6 +750,9 @@ Limitations - Hairpin between two ports could only manual binding and explicit Tx flow mode. For single port hairpin, all the combinations of auto/manual binding and explicit/implicit Tx flow mode could be supported. - Hairpin in switchdev SR-IOV mode is not supported till now. + - "out_of_buffer" statistics are not available on: + - NICs older than ConnectX-7. + - DPUs older than BlueField-3. - Quota: diff --git a/doc/guides/rel_notes/release_24_07.rst b/doc/guides/rel_notes/release_24_07.rst index 700c29d8c6..29c77deb03 100644 --- a/doc/guides/rel_notes/release_24_07.rst +++ b/doc/guides/rel_notes/release_24_07.rst @@ -101,6 +101,7 @@ New Features * Added match with E-Switch manager. * Added flow item and actions validation to async flow API. * Added global out of buffer counter for hairpin queues. + * Added port out of buffer counter for hairpin queues. * **Updated TAP driver.** diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c index 7995ac6bbc..82f651f2f3 100644 --- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c +++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c @@ -1420,6 +1420,11 @@ static const struct mlx5_counter_ctrl mlx5_counters_init[] = { .ctr_name = "out_of_buffer", .dev = 1, }, + { + .dpdk_name = "hairpin_out_of_buffer", + .ctr_name = "hairpin_out_of_buffer", + .dev = 1, + }, { .dpdk_name = "dev_internal_queue_oob", .ctr_name = "dev_internal_queue_oob", diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index 50f4810bff..5e950e9be1 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -964,6 +964,8 @@ mlx5_queue_counter_id_prepare(struct rte_eth_dev *dev) DRV_LOG(DEBUG, "Port %d queue counter object cannot be created " "by DevX - fall-back to use the kernel driver global " "queue counter.", dev->data->port_id); + priv->q_counters_allocation_failure = 1; + /* Create WQ by kernel and query its queue counter ID. */ if (cq) { wq = mlx5_glue->create_wq(ctx, @@ -3037,13 +3039,23 @@ mlx5_os_read_dev_stat(struct mlx5_priv *priv, const char *ctr_name, if (priv->q_counters != NULL && strcmp(ctr_name, "out_of_buffer") == 0) { if (rte_eal_process_type() == RTE_PROC_SECONDARY) { - DRV_LOG(WARNING, "Devx out_of_buffer counter is not supported in the secondary process"); + DRV_LOG(WARNING, "DevX out_of_buffer counter is not supported in the secondary process"); rte_errno = ENOTSUP; return 1; } return mlx5_devx_cmd_queue_counter_query (priv->q_counters, 0, (uint32_t *)stat); } + if (priv->q_counters_hairpin != NULL && + strcmp(ctr_name, "hairpin_out_of_buffer") == 0) { + if (rte_eal_process_type() == RTE_PROC_SECONDARY) { + DRV_LOG(WARNING, "DevX out_of_buffer counter is not supported in the secondary process"); + rte_errno = ENOTSUP; + return 1; + } + return mlx5_devx_cmd_queue_counter_query + (priv->q_counters_hairpin, 0, (uint32_t *)stat); + } MKSTR(path, "%s/ports/%d/hw_counters/%s", priv->sh->ibdev_path, priv->dev_port, diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index e482f7f0e5..8d266b0e64 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -2394,6 +2394,10 @@ mlx5_dev_close(struct rte_eth_dev *dev) mlx5_devx_cmd_destroy(priv->q_counters); priv->q_counters = NULL; } + if (priv->q_counters_hairpin) { + mlx5_devx_cmd_destroy(priv->q_counters_hairpin); + priv->q_counters_hairpin = NULL; + } mlx5_mprq_free_mp(dev); mlx5_os_free_shared_dr(priv); #ifdef HAVE_MLX5_HWS_SUPPORT diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index bd149b43e5..75a1e170af 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -1986,8 +1986,12 @@ struct mlx5_priv { LIST_HEAD(fdir, mlx5_fdir_flow) fdir_flows; /* fdir flows. */ rte_spinlock_t shared_act_sl; /* Shared actions spinlock. */ uint32_t rss_shared_actions; /* RSS shared actions. */ + /* If true, indicates that we failed to allocate a q counter in the past. */ + bool q_counters_allocation_failure; struct mlx5_devx_obj *q_counters; /* DevX queue counter object. */ uint32_t counter_set_id; /* Queue counter ID to set in DevX objects. */ + /* DevX queue counter object for all hairpin queues of the port. */ + struct mlx5_devx_obj *q_counters_hairpin; uint32_t lag_affinity_idx; /* LAG mode queue 0 affinity starting. */ rte_spinlock_t flex_item_sl; /* Flex item list spinlock. */ struct mlx5_flex_item flex_item[MLX5_PORT_FLEX_ITEM_NUM]; diff --git a/drivers/net/mlx5/mlx5_devx.c b/drivers/net/mlx5/mlx5_devx.c index f23eb1def6..7db271acb4 100644 --- a/drivers/net/mlx5/mlx5_devx.c +++ b/drivers/net/mlx5/mlx5_devx.c @@ -496,6 +496,56 @@ mlx5_rxq_create_devx_cq_resources(struct mlx5_rxq_priv *rxq) return 0; } +/** + * Create a global queue counter for all the port hairpin queues. + * + * @param priv + * Device private data. + * + * @return + * The counter_set_id of the queue counter object, 0 otherwise. + */ +static uint32_t +mlx5_set_hairpin_queue_counter_obj(struct mlx5_priv *priv) +{ + if (priv->q_counters_hairpin != NULL) + return priv->q_counters_hairpin->id; + + /* Queue counter allocation failed in the past - don't try again. */ + if (priv->q_counters_allocation_failure != 0) + return 0; + + if (priv->pci_dev == NULL) { + DRV_LOG(DEBUG, "Hairpin out of buffer counter is " + "only supported on PCI device."); + priv->q_counters_allocation_failure = 1; + return 0; + } + + switch (priv->pci_dev->id.device_id) { + /* Counting out of buffer drops on hairpin queues is supported only on CX7 and up. */ + case PCI_DEVICE_ID_MELLANOX_CONNECTX7: + case PCI_DEVICE_ID_MELLANOX_CONNECTXVF: + case PCI_DEVICE_ID_MELLANOX_BLUEFIELD3: + case PCI_DEVICE_ID_MELLANOX_BLUEFIELDVF: + + priv->q_counters_hairpin = mlx5_devx_cmd_queue_counter_alloc(priv->sh->cdev->ctx); + if (priv->q_counters_hairpin == NULL) { + /* Failed to allocate */ + DRV_LOG(DEBUG, "Some of the statistics of port %d " + "will not be available.", priv->dev_data->port_id); + priv->q_counters_allocation_failure = 1; + return 0; + } + return priv->q_counters_hairpin->id; + default: + DRV_LOG(DEBUG, "Hairpin out of buffer counter " + "is not available on this NIC."); + priv->q_counters_allocation_failure = 1; + return 0; + } +} + /** * Create the Rx hairpin queue object. * @@ -541,7 +591,9 @@ mlx5_rxq_obj_hairpin_new(struct mlx5_rxq_priv *rxq) unlocked_attr.wq_attr.log_hairpin_num_packets = unlocked_attr.wq_attr.log_hairpin_data_sz - MLX5_HAIRPIN_QUEUE_STRIDE; - unlocked_attr.counter_set_id = priv->counter_set_id; + + unlocked_attr.counter_set_id = mlx5_set_hairpin_queue_counter_obj(priv); + rxq_ctrl->rxq.delay_drop = priv->config.hp_delay_drop; unlocked_attr.delay_drop_en = priv->config.hp_delay_drop; unlocked_attr.hairpin_data_buffer_type = diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c index 98022ed3c7..0ebd233595 100644 --- a/drivers/net/mlx5/windows/mlx5_os.c +++ b/drivers/net/mlx5/windows/mlx5_os.c @@ -83,6 +83,7 @@ mlx5_queue_counter_id_prepare(struct rte_eth_dev *dev) DRV_LOG(ERR, "Port %d queue counter object cannot be created " "by DevX - imissed counter will be unavailable", dev->data->port_id); + priv->q_counters_allocation_failure = 1; return; } priv->counter_set_id = priv->q_counters->id; From patchwork Sun Jul 7 10:25:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Itamar Gozlan X-Patchwork-Id: 142174 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 38093455B6; Sun, 7 Jul 2024 12:25:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2989C40658; Sun, 7 Jul 2024 12:25:55 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2048.outbound.protection.outlook.com [40.107.223.48]) by mails.dpdk.org (Postfix) with ESMTP id 527AC4029F for ; Sun, 7 Jul 2024 12:25:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A0WmYLO+7NhuMbXRp9ctbc3zlIIK9qv2o0wBLTE1YqkNZEie8xwnJGol4dvOlOSbTMo1FlaZkpQKORoQQy5gtz3/QVqSga1f8bSEQktdU6zPUVd9nzqdoyPn6Sz9HJHdpxIgWtOViXrNgbhNXkhrA37bnXQFdT6IGgYw9e8LgsUrIOHR/QyhUlCjYy7202zfviBhcDPV9D/H+kfobHl3zFiOCfFjUbVN2iGxw6YOlQrvLTydJ0UTv1r44jVO6FOrBmd891gtgNDHj79Gm5E3iAkjXCUIZ8I07wtJnwxuD+bFOecfGddlkHfNCwWYM2t2gTLHPvQjOp/rxikWOMpNvw== 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=Z0uPj1A1Pt9tCu88xKuMK7quNtVwxTtsHMH805vxelc=; b=k0N5+d/nFAFx1Z8urZa06HUtdlHMv923wTZFqyT9VC8WHt+u40ZpOZg6YuS5TzfHYuhckrMM/ylau9m6wgBP06oE1DeGD4oO0h9qMKt1yN+lVTKp71+bp1YffHLBQHzOXtTIE7vUETlhK1Rcv76Hp0XNpDrWExjanKWxbM2Rj/v1fZ4T/Y7x+VlBGIhBRkfqtSJPIlakDbtCCN4oks1XeldMBwmxG8eiH9Z0On2EbJdvrIV2HTUNHVVFlvthYWaauJWruyCt3UMVjjIBu7NqzZ6QoUDoVVW81KPNPYBy/4RCzlNkzK5NcT5AHanN9fHwwlIA1MKk5v8l0DnSJTPhuA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) 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=Z0uPj1A1Pt9tCu88xKuMK7quNtVwxTtsHMH805vxelc=; b=DLksixNsbIKN3bwLZiHIn+cTrPEHzLrI0bH87Kowf+9bhoWnuwYkotRLFn/YSPf463vkiWLE/Nj8EHfGeJ/WeMa2sTf/FtFRKhCfGNTNNpRql9VIS3cMatHAXf3fzhQcHdgH41XqJbZWVETxy5uXV1s5vZjQOp+JGFyYjQjPgmCgs9+VfsUtQNiGuoLlbEdAuCOVQmamGAyK14UBoZ8qA45MevMdwHADtlXGRRQs/Xen6jC5a5sFd48PKdaVGCOIyDd+HrNbneh1g5V5IaHbCqJoPVURQnRrsQFOL6VtcCE5WXYMQC+4yr2Z3C2w01VRARmljoV0V7PFUzY/DLgndA== Received: from BL1PR13CA0208.namprd13.prod.outlook.com (2603:10b6:208:2be::33) by MN2PR12MB4173.namprd12.prod.outlook.com (2603:10b6:208:1d8::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.34; Sun, 7 Jul 2024 10:25:49 +0000 Received: from BL6PEPF0001AB53.namprd02.prod.outlook.com (2603:10b6:208:2be:cafe::df) by BL1PR13CA0208.outlook.office365.com (2603:10b6:208:2be::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Sun, 7 Jul 2024 10:25:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) 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.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by BL6PEPF0001AB53.mail.protection.outlook.com (10.167.241.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Sun, 7 Jul 2024 10:25:49 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 7 Jul 2024 03:25:46 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 7 Jul 2024 03:25:46 -0700 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4 via Frontend Transport; Sun, 7 Jul 2024 03:25:42 -0700 From: Itamar Gozlan To: , , , , , , , , Dariusz Sosnowski , Bing Zhao , Ori Kam , Matan Azrad , Maayan Kashani CC: , Mahmoud Maatuq Subject: [PATCH 02/10] net/mlx5: fix matcher object memory leak Date: Sun, 7 Jul 2024 13:25:23 +0300 Message-ID: <20240707102532.2045942-2-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240707102532.2045942-1-igozlan@nvidia.com> References: <20240707102532.2045942-1-igozlan@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB53:EE_|MN2PR12MB4173:EE_ X-MS-Office365-Filtering-Correlation-Id: 57527ec1-5376-4114-a66b-08dc9e6f2be0 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|376014|82310400026|921020; X-Microsoft-Antispam-Message-Info: glyTCmUKXd7CkgKDJ14Q9/8fKzfILQTmc5PZMWwITeeJEn3U5gmR8vBk1e/2PLBOzUK6MtXk3T0XnVsyVW9OF+meGWnnQrMe8BiwFcpjZfhA06+j63SRZWoUwqbzNpq9Z1HY8TzFCEX8icaflQAdzWOtWjsVNjZJa/gZ0LFnFWFs6mFYLtERQFNQaxeEGQ+PxYModwsHAbSvmMYbV0UkpecouITgfvvCUPHbGMOoLr69hkevtKXkJVKpcxShRheUcTGTyWduf1xtRNN6ZQu/M/rzJyKbKhjw6WZgVxPQSYP2HMMiSvS0i/O0LO+aDLQVsYHuXU7LwDXWVsR6wANCnkhFax7G7YG2r5RoIcLUvUfqj6yXatq1B7X5KRW0PFz+Z04LWtei2ybRzCrQ1Ky0mzkTtLPAowdyXywMTsnOwwzDJfjPbUNwVUyHjaVr1cNs9z++su1PvOViV9l1hizWwPUP9dyXVdCJmMz+Dki4STsiWGD03hpJjTF9XSfeLBXr8eRjIVN+YjCGth8guqvD7soJajJM+sSzfFsYSk7/68YsUcjVgF7GIHcZlp3+iC2Xt6vzJz8Ls03uwIHds52RdDXG4e1Irueb3GqdHCKYUXEdRW5DgVOYrr+KxdbCSWv2NjMYdV94B0piF6+RW0DaBVkWgcUaP0+SjWl+LpUkbsu5zYj1N0K7G+InEjYUSENs4xMarQCfIoVVA3OohbfahmZetBAYsiWLBx4KoCb6woVfPFUs9s3xlZan4YKUj+i4kgVliLVtCnivWG3XdvHoseFGdyfeVKnL6Wcc0ea/Qit5ZcCK7asWxhIvCZlEY0lrdmiCVVoZ4xPAkBNkBsDz9+ZKs7Ez/Vdcr9zpzJ/ZGpMpEMzaXyYthhoAgsbZlKA1po5/u3dTySJ1bZvAaqq1I79YKS47cvGvRqKVFygbwpAvT9KkgqiRGSR9yfpDs7ibSEQLO9d8OE2GAogPmzFm49MTtp5KUoUmEQXWF/Lu65tV4HZ7yKCUPdqCF+toH1Tg8xYvOVofLL7H8zEOyfKmE6rK25rB4g7b7lPK6faiaVlHtz3WYeV4IvUl2osOpp35EOKgmhyDyOZx4mgO2DOxz1r9w9fxjRr0JRvdPC0ppiC8TGfKbH0W9JaqkTicCqwFITgEtTdRVAFkufE1fqOCmuKmeAtezSD3sji+QTUA+IOFkckdeg72faQPF9DGCICL0nvBsv66cubv07rlDuHvsVp/IWOaauqzrsRQyeSnBH5m4HNz4HUIDAqhJajFtnyi1lx4vmh+rJtEzYmzMF2Cp6GPwlFYbOfQdQq61g8bmord6MGT/SUSdGwCf24AnOSK6jW6Wnnd/1t8e3CggN7907/yVMnN0QzbF+jQnEv9Q54L8PIFvASdBc0hdzhNhYz9QRsgABZTGEzeEyNN+yntJ083iQd08iqKXOqZjyA+FQV7cAL+2iSrVRzHrN6O9mEkooY6w1fvhONvBqFZHypWLA== X-Forefront-Antispam-Report: CIP:216.228.118.232; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge1.nvidia.com; CAT:NONE; SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2024 10:25:49.2594 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 57527ec1-5376-4114-a66b-08dc9e6f2be0 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.232]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB53.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4173 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Mahmoud Maatuq This makes sure that the allocated matcher object is freed for all branches that return NULL. Coverity issue: 426424 Fixes: 27d171b88031 ("net/mlx5: abstract flow action and enable reconfigure") Signed-off-by: Mahmoud Maatuq Acked-by: Bing Zhao Acked-by: Dariusz Sosnowski --- drivers/net/mlx5/mlx5_flow_dv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index d46beffd4c..8a0d58cb05 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -12010,9 +12010,12 @@ flow_matcher_create_cb(void *tool_ctx, void *cb_ctx) items = *((const struct rte_flow_item **)(ctx->data2)); resource->matcher_object = mlx5dr_bwc_matcher_create (resource->group->tbl, resource->priority, items); - if (!(resource->matcher_object)) + if (!resource->matcher_object) { + mlx5_free(resource); return NULL; + } #else + mlx5_free(resource); return NULL; #endif } From patchwork Sun Jul 7 10:25:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Itamar Gozlan X-Patchwork-Id: 142175 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0CFDC455B6; Sun, 7 Jul 2024 12:26:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B2F994065D; Sun, 7 Jul 2024 12:25:58 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2049.outbound.protection.outlook.com [40.107.244.49]) by mails.dpdk.org (Postfix) with ESMTP id 4A8A04065D for ; Sun, 7 Jul 2024 12:25:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=koT0StlfP68kyuqGrfZNPWsRQ0Rg8069+YhCgsldUUvk1FO8cVz64i4Nh49Mq7FAgri8I54jRfe+ApjD/6BNFXkmbuT8OQ5D/PliTNtpxmH1zcqcP8swz6QDeUvmbLLqovd+RbL112LIZ8/jGQQJzeRLX1AS2hlN4zhi0ZsodunhI+ojWFzCfEM65dV0nxkuYXhImY9qScofybWx6DNFQg7nE4Sw5GjUBjikXpwkgHFuZDEvHKhxrr1nkbfmJ9kYQ9IUhB6aM0VZcc7JGZ7+KbZJZS3A4CWYm2x+Y4F5wgRnx4gN1U6wUV4Nu9sg5wbKIaMOa1zU+cjt36zCNBIShQ== 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=/lpLtmxvvL8kAbHpcg9z48/oN3VQyKW6PUHIIwQBpUY=; b=FSO8VUtArlDxqzcwiPGMvMR16WKuHVQEL8BoI3UR6JGyuAJaq3MMTUTV3kh7L/qCXxSpMlD+39Iy8045HciAcdo/VP8v3R47lJVJEfQ+JXv1JmraVT6jz/0q57Yl9M64Ph3vHvb09lHpJb4uNTkSEG1T/0W513u8PS/BeTsXQKrEkNMySdLTW+sH+scrxzjn/8LeeCNXO+8jgxS4vZiLmlabctk315LjGmU4wQlG6pmqEO0CgUqCkkoM07lIk1E4QDMEAc3MqpCj3qeOEbBEIgOJQcniAf3ybvj+b+87RDkhIe5uVjQJ7SNniOw4EaGPDqLKysXcbV9q6EeFAjm9xg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) 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=/lpLtmxvvL8kAbHpcg9z48/oN3VQyKW6PUHIIwQBpUY=; b=B6/NcTtzSZmqNoBlR32x2w6WR/xlk1a3ojHhJe0kKgTIjg4v8hhbJA8kxcAgQzgZlQBP2urX/ku1fcKXNdEUYvkACXSXUvYiTtEZg/VQI+C3xiPKyvCnF+UKBB9nV8CtMqCORkY2bsQD9qOYN4ofKO+YaX0qTTd2HO2zceMRN5C1meRddkvsaq/ggSfzF7ROfNJgkhbXJhDFiKAh08UR/CqqU+HzbaNRvJeotd+5U1QmIwVc0CscPh3VP5rY5UJbD+uYqwT9MTdAMDnNcE6jkPDNRaRksIdyaSTGUDibxCREr5FIJxf2O75l1WIznVJQ56cEzYNXdggkmmQRqQCRrg== Received: from SN7PR04CA0225.namprd04.prod.outlook.com (2603:10b6:806:127::20) by DM4PR12MB8523.namprd12.prod.outlook.com (2603:10b6:8:18e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.34; Sun, 7 Jul 2024 10:25:52 +0000 Received: from SN1PEPF0002BA51.namprd03.prod.outlook.com (2603:10b6:806:127:cafe::2c) by SN7PR04CA0225.outlook.office365.com (2603:10b6:806:127::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.34 via Frontend Transport; Sun, 7 Jul 2024 10:25:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SN1PEPF0002BA51.mail.protection.outlook.com (10.167.242.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Sun, 7 Jul 2024 10:25:51 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 7 Jul 2024 03:25:50 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 7 Jul 2024 03:25:50 -0700 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4 via Frontend Transport; Sun, 7 Jul 2024 03:25:46 -0700 From: Itamar Gozlan To: , , , , , , , , Dariusz Sosnowski , Bing Zhao , Ori Kam , Matan Azrad CC: Subject: [PATCH 03/10] net/mlx5/hws: set eswitch owner vhc ID valid accordingly Date: Sun, 7 Jul 2024 13:25:24 +0300 Message-ID: <20240707102532.2045942-3-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240707102532.2045942-1-igozlan@nvidia.com> References: <20240707102532.2045942-1-igozlan@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA51:EE_|DM4PR12MB8523:EE_ X-MS-Office365-Filtering-Correlation-Id: 1608531b-f1c4-4333-1bbc-08dc9e6f2d40 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|376014|82310400026|921020; X-Microsoft-Antispam-Message-Info: R6ECfSkz84UIRExEwVyOH2cfGck7sBRPJGCeiqTGSk9PxrXTivboIWMTjGV1C1xpOyOkzJQqPM45IWTXtEL3UsgdMGiEZBEp2ojZZEM+Vr6ADqAVfQ7zGgn/I9NpokrNKUBldgY2sbl9+BIH9QFdc5ik8RchLWex/Dxap3pgWxlMfwUU0Fzfr74MM9d40wY+fD3F2Oqg1KkgkHgrx9nRO+aT8gU0sSzM8KS55Me9LIQ98kEvbUQ3b738Zri+q110ou2vl/FN4BU0g1DZGAXGE20co6etYsQ3hXtsLhSZeMxSh2Dz8HcrI4DGsvRdLTDGfGB/WkU25V0iTiwoa9SMcr30J5+4oabPW2E5CltmAtcpr3E+UtNDZLbT5gF12+0CdtcKhr2C6+PmdwrbdiFEZ5pkJxv8ZH1onFKj4lkgGgNgjvUtc9cMBLGbzW1f2SBG9Mq5yR43e5VqJl07eBDp5tPBz+54bksOtG/K5lnbVgG3/vKQGUbWIbyMTFrAF8MVpNpSiYm/6gksBWKsKS+5zDSlCButME8mbji0eVWl8PVcPDwHjbKz+YZut2lhhLeLubxPlhXa65H5asScFfiVeCYQAnN9tYWh/w/ooEX7u7IaJnmYjfzKYGi3O/kW2r8gSSmCIGuKaboPPD/q/25UWVm2OuOHOC9eUr5oo/DQCzcm7L4sB69ozGVaClQKbB+dNoPlWPMz/EExZZ6DPF4Ipm++W4D7ZfO7U8eLFk4GXn7aTcet7Bcgmqs0EJ3zPSIOFJhuZIFXD7fXSagZY9dkDODEzH7EE658zJFZ3J2nlMn0SBSHLMCEABubA7JsUIHGrhV6IN+g185Jn+ga4JPVY6CQPFszXwAsZep9/1yhfhNeNQDgG14PF9SjsV9pwLgxiT3ks8DSIyu6wQnESNrTiTF2Zjm0DFqLFSLuIq5g49AoLmZo/+zS3dTT3HFllZ+mHQuNjhp6V6EDkcSPhaxQRXeZkBvY35SedZEVth+E+NMDbqr4taF+vAtqwrZML/lmPeQIsoqqR44Epdx1yqrML6VeVntwKsZOZXCTBtzqdtiwJln3m4c96Q4jGvdkpwn1ongEyZXduHRlLa1xwUVPgsluveSQpXrlOiQde0cE0scdnks0QlFrl5487Qb17JlDn/18looE3pCVjZjXAbfTYeNPwbYBdwjuK81t/PPvMgDT3MnWRVSdEF+bA1ICaavHC2etDMir9Nm9DZJqNiyeCgKrrZXCn7bn+70KKYyr26LuNn7oIZ2Akxot2V9O9pO14UoA2HsGPc+v+Qo4giqyhHqvCvZX7vCiEoJ1dBIsHWpvmcgsW/nQ33Qq9XgOaFlvhzXva0uJD2FbhdL/Rk233/iWOlwOgfN5JubJ1jq5687SFC35p/KerNvQLT2L7fL6U5u4riC6YEJ8cj15hbnUfAiHW0IZ2hDS/zBHpJaBQmVYhBwtiOLXnf+f4DI/2wgXIxUv9NNY1wY3s34y8/lrnA== X-Forefront-Antispam-Report: CIP:216.228.118.233; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge2.nvidia.com; CAT:NONE; SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2024 10:25:51.5783 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1608531b-f1c4-4333-1bbc-08dc9e6f2d40 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.233]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002BA51.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB8523 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Erez Shitrit eswitch_owner_vhca_id_valid value should be set to 1 only on merged-eswitch device. Signed-off-by: Erez Shitrit Acked-by: Matan Azrad --- drivers/net/mlx5/hws/mlx5dr_action.c | 12 ++++++++++++ drivers/net/mlx5/hws/mlx5dr_cmd.c | 3 ++- drivers/net/mlx5/hws/mlx5dr_cmd.h | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c index 90f2f17bd0..03c3683f71 100644 --- a/drivers/net/mlx5/hws/mlx5dr_action.c +++ b/drivers/net/mlx5/hws/mlx5dr_action.c @@ -680,6 +680,8 @@ mlx5dr_action_fixup_stc_attr(struct mlx5dr_context *ctx, fixup_stc_attr->stc_offset = stc_attr->stc_offset; fixup_stc_attr->vport.esw_owner_vhca_id = ctx->caps->vhca_id; fixup_stc_attr->vport.vport_num = ctx->caps->eswitch_manager_vport_number; + fixup_stc_attr->vport.eswitch_owner_vhca_id_valid = + ctx->caps->merged_eswitch; use_fixup = true; } break; @@ -700,6 +702,8 @@ mlx5dr_action_fixup_stc_attr(struct mlx5dr_context *ctx, fixup_stc_attr->stc_offset = stc_attr->stc_offset; fixup_stc_attr->vport.vport_num = 0; fixup_stc_attr->vport.esw_owner_vhca_id = stc_attr->vport.esw_owner_vhca_id; + fixup_stc_attr->vport.eswitch_owner_vhca_id_valid = + ctx->caps->merged_eswitch; } use_fixup = true; break; @@ -1429,6 +1433,14 @@ static int mlx5dr_action_create_dest_vport_hws(struct mlx5dr_context *ctx, action->vport.vport_num = vport_caps.vport_num; action->vport.esw_owner_vhca_id = vport_caps.esw_owner_vhca_id; + if (!ctx->caps->merged_eswitch && + action->vport.esw_owner_vhca_id != ctx->caps->vhca_id) { + DR_LOG(ERR, "Not merged-eswitch (%d), not allowed to send to other vhca_id (%d)", + ctx->caps->vhca_id, action->vport.esw_owner_vhca_id); + rte_errno = ENOTSUP; + return rte_errno; + } + ret = mlx5dr_action_create_stcs(action, NULL); if (ret) { DR_LOG(ERR, "Failed creating stc for port %d", ib_port_num); diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.c b/drivers/net/mlx5/hws/mlx5dr_cmd.c index 666d678b42..72fc9e3d91 100644 --- a/drivers/net/mlx5/hws/mlx5dr_cmd.c +++ b/drivers/net/mlx5/hws/mlx5dr_cmd.c @@ -515,7 +515,8 @@ mlx5dr_cmd_stc_modify_set_stc_param(struct mlx5dr_cmd_stc_modify_attr *stc_attr, stc_attr->vport.vport_num); MLX5_SET(stc_ste_param_vport, stc_param, eswitch_owner_vhca_id, stc_attr->vport.esw_owner_vhca_id); - MLX5_SET(stc_ste_param_vport, stc_param, eswitch_owner_vhca_id_valid, 1); + MLX5_SET(stc_ste_param_vport, stc_param, eswitch_owner_vhca_id_valid, + stc_attr->vport.eswitch_owner_vhca_id_valid); break; case MLX5_IFC_STC_ACTION_TYPE_DROP: case MLX5_IFC_STC_ACTION_TYPE_NOP: diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.h b/drivers/net/mlx5/hws/mlx5dr_cmd.h index ea5d346d8e..54840ec445 100644 --- a/drivers/net/mlx5/hws/mlx5dr_cmd.h +++ b/drivers/net/mlx5/hws/mlx5dr_cmd.h @@ -133,6 +133,7 @@ struct mlx5dr_cmd_stc_modify_attr { struct { uint16_t vport_num; uint16_t esw_owner_vhca_id; + uint8_t eswitch_owner_vhca_id_valid; } vport; struct { struct mlx5dr_pool_chunk ste; From patchwork Sun Jul 7 10:25:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Itamar Gozlan X-Patchwork-Id: 142176 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1F56E455B6; Sun, 7 Jul 2024 12:26:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 772144067E; Sun, 7 Jul 2024 12:26:02 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2042.outbound.protection.outlook.com [40.107.212.42]) by mails.dpdk.org (Postfix) with ESMTP id 52F9340671; Sun, 7 Jul 2024 12:26:00 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Haa6JBhrRFepIuTe+0nQNd6e56lrcqkZOOpSKi5acvIcYftexEEvUMUSLbFkTOUNxENOtLHsjvjD2stZQUZyl08lDvEjS+ZnIe3uHv1Jm7sWgNZUSHLkFwkB87xkWK6f2dFSdAK1QV2OPep6f/vZPMWqCO1co6KN8XJRc/Nul80+Rqk3YuvAQ5KOydWsLlm6zjghIR5oFtrdi40wpGNystarhiMtZ3DsXeDYP/q2y4l244sBw8wUJ/o/5IeNTlPwwNo81pqevt62WYCuJ0JLK/lrA6x6nRAJo2vUv9ANp4J/biR1/oUXYnmuVKWekE8W9BK0vVaYWNoE7aTJupdiZA== 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=mQPMxZetFHL4jAQX41f2xDbeaeuHp7OBURe3PIcZ1Vo=; b=SwhS402HPgG9kpIi+nPg8pOnwp4gVTTV8zsnRTnug8SPbnBYel54fm81qxWMQI/QunMNy1fZJrUCmgOW/S4aOBUL2QGgaWTDgZOCOGxYkRThGFgM0j6xJp5pY73CY2ZjRjTlboXa5gZhNedHdAc3YQrTrzJcHbM7BfzHZsiIPnEK4oMyJ/Rcut67b26j9AT/Z7pphs3mr6prft32EV0QvnK0RPSvmy4LhPChnxUhUoD+IxzgthBJIfKLohQ8fUXbHxFZBIDg5cBYYmV/KDSbPQTFEVXJf4NQLJWMMiCfs/HAYBzpTeijeZXLGJpWtyo8T3fG68bebCai7j5HShsFsg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) 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=mQPMxZetFHL4jAQX41f2xDbeaeuHp7OBURe3PIcZ1Vo=; b=EDgSXz7I0nmsEVCKr4A/Qzpwk7nPympDHHJFojLkJPRBDDqMGPEI5PY42OfXIoETX3vTVjHtBRIcb3KtV3QCsMJ0LxZIyTooOyWYF3mcBhyJYFEqXORb9mutz2u0HNM/yR4L4GRWIu96lZGzYmbxDjfOWmtOJOqo1l7+4NnH7L4sI/zhw41kk0kvTe1YIZjVo6EPYMRHc2pTDcr3vouUBXqAw7lLX8fJtirBLBfD3lcmB1Vu91fdVKC9U4n2WAHsfBLHjW5mLQAro3WT4zByE386G7/BZnKzep5+DzgPa8mVNNwpcjCA41SR6GldtM9O1VCvYd1sxaiOmbCsnXfCgg== Received: from MN2PR05CA0001.namprd05.prod.outlook.com (2603:10b6:208:c0::14) by CY5PR12MB6479.namprd12.prod.outlook.com (2603:10b6:930:34::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35; Sun, 7 Jul 2024 10:25:56 +0000 Received: from BL6PEPF0001AB52.namprd02.prod.outlook.com (2603:10b6:208:c0:cafe::9f) by MN2PR05CA0001.outlook.office365.com (2603:10b6:208:c0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.15 via Frontend Transport; Sun, 7 Jul 2024 10:25:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) 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.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by BL6PEPF0001AB52.mail.protection.outlook.com (10.167.241.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Sun, 7 Jul 2024 10:25:55 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 7 Jul 2024 03:25:55 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 7 Jul 2024 03:25:54 -0700 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4 via Frontend Transport; Sun, 7 Jul 2024 03:25:51 -0700 From: Itamar Gozlan To: , , , , , , , , Dariusz Sosnowski , Bing Zhao , Ori Kam , Matan Azrad CC: , Subject: [PATCH 04/10] net/mlx5/hws: fix memory leak in modify header free Date: Sun, 7 Jul 2024 13:25:25 +0300 Message-ID: <20240707102532.2045942-4-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240707102532.2045942-1-igozlan@nvidia.com> References: <20240707102532.2045942-1-igozlan@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB52:EE_|CY5PR12MB6479:EE_ X-MS-Office365-Filtering-Correlation-Id: 00ed22dd-beb5-4329-c00b-08dc9e6f2fc2 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|376014|1800799024|36860700013|921020; X-Microsoft-Antispam-Message-Info: wR5nQH55bLEss160cOmtT0JU9EtjR2tpWtC444ow7YkJJfxbUO7FywEYfCqC4bNW+hEBoY1nO6IiFzdmeL9HG2VEhkhruxhlMeoouEjfvF8iAODuZS+CvUaFK9XT3dYu04qwK3V7TX7cmZ93J8pzE5BgeHkjgnOP3kuIE5x+Fac2r+rdNQgibQWOmA4bBTBUeui7aQ+sosk3swBEnrZhQg49s4wsO5EmjVp4UVAh02V69edn1E4TRWcpu+X4ONeNbYwt2AA5FlVKoiL6N2XmIXCewOe6h6iKEDM8P4z4bLdCI7D41RalfNU22GGP03SOtYZ56PD6YdmVqntmOE9ssCVwYuEKJe1K4EJPjo33Lt1Co/1zm8mVWJrNDI0UtiGl3T/DFw4YijBwQ6ksoNxNZT3qztR0eNPiwZBY+iOrw/LimKpxUCcKjcOOZYGD39oWAPjjlnLeDJ1lxx5h6g+g1iJLskvYWz2MTlsck/xKR9XB2fYN/KwCCTEW62X7c0ccsO5AzFN/yzm52UTnizLaHrtZ9Qxhxpjx1yV7+1vaCP4OtUftWthMxdaDC7Gara/a/NtBrfDwdBeRN/Wv/2kSpEYD43+mzGdBLWt13PQAQxTMFQPfiM+OKlzut6/qUI+OQGfux9Hmddh1YHm3aIVQKXgU2agZNoQHStO03T1ZthfA9pycZNjxPCJMNhVhAkr6tW/YTBnqXnAwsbY1Bm/njqs6kYyT+lohflQPZ8v11d4rwIvTYHaCJNAObv5CzNUullWJnVFjvbqmNvVFj2ZaWg6qa9hEcx/BdTugHjH7e1ZgLLwped87fpT7Ylk9FSqwAwjAZmkeHVRAj3ySRUQI6wpFn+klaQGtIDkVAdInMCZ1nFjJIX0okc4UuTXzE3GEembFpdFVar7fiL9ik6McdGfvEDSHeoCr6VBvXU2Y+Oh/+eApS9eAR5//Wy0CygWzahVF8F6nkLtC3LMZ+OsU+QSTtTy0Ey3P3WjmxgsxQQ9yLQX/1TnhUgoGLn/3lf21hY/rujnlyQLqi3SaHW5Ibh0ilYsugnfcKu2e84Uagl5A79Css6WFm1yvvF9UZLgMMyu5Urk6Qaux0bGCi9hEzZaRacuuwZz9tW9K63vqhzrlUYy0b4bjikBPINgGzUX202jHHFXSdoz5annPnHAuhN/k9q4gHvvt/chwPEI3CyRh1It3g9yxMnyFOqBKWU1dUe/o3M9rbau2Qe9Mygcoj6TBuZ0JfCqRENjsMxg/emstih1TA7BXMqWxCpjaiaVdYlz3Twq+m0vaU65VWCQ3fg0ed/oq5xXjxaEJ7EsR00q171SZnkPlhLXWwRqxoK8/WWsyErheM+YJSbqGLNi/Rhwyu4WohzDfoCsg1w5d2yODHzjAWPXqtulUhisAAAsfHVhBZ1K+2MQZCXA1wGWQg/Nll3pgTUSya1aaN+rvnOXX41UBa32Lmw5xOvv4qaQ/quy8KV0i84nJ0DTz/Ph2SA== X-Forefront-Antispam-Report: CIP:216.228.118.232; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge1.nvidia.com; CAT:NONE; SFS:(13230040)(82310400026)(376014)(1800799024)(36860700013)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2024 10:25:55.7743 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 00ed22dd-beb5-4329-c00b-08dc9e6f2fc2 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.232]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB52.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6479 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Erez Shitrit When creating action from type MLX5DR_ACTION_TYP_REFORMAT_TNL_L3_TO_L2 we use modify-header object, we support few of that type at the same time over this action depends on the number of headers. Now when destroying the modify-header object we run over the number_of_patterns, this variable was not set in the creation of that action. Fixes: 3a6c50215c07 ("net/mlx5/hws: support multi-pattern") Cc: valex@nvidia.com Cc: stable@dpdk.org Signed-off-by: Erez Shitrit Acked-by: Matan Azrad --- drivers/net/mlx5/hws/mlx5dr_action.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c index 03c3683f71..b90f18df8a 100644 --- a/drivers/net/mlx5/hws/mlx5dr_action.c +++ b/drivers/net/mlx5/hws/mlx5dr_action.c @@ -1820,6 +1820,7 @@ mlx5dr_action_handle_tunnel_l3_to_l2(struct mlx5dr_action *action, action[i].modify_header.max_num_of_actions = num_of_actions; action[i].modify_header.num_of_actions = num_of_actions; + action[i].modify_header.num_of_patterns = num_of_hdrs; action[i].modify_header.arg_obj = arg_obj; action[i].modify_header.pat_obj = pat_obj; action[i].modify_header.require_reparse = From patchwork Sun Jul 7 10:25:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Itamar Gozlan X-Patchwork-Id: 142177 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F0702455B6; Sun, 7 Jul 2024 12:26:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E054840B9A; Sun, 7 Jul 2024 12:26:07 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2057.outbound.protection.outlook.com [40.107.223.57]) by mails.dpdk.org (Postfix) with ESMTP id D6FA640A76; Sun, 7 Jul 2024 12:26:06 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ua0PtMXANvRU/5w8/fmDK6riHfMn+bpHrlz3V2mQI73iL2baBsYeBcWFs6WI8Pe3KZwKChWaGxCfX6soJ6U5+84Se4x6qr4dRVvzyZa9xj8KCHfhRfouk79gEAnKJwkkqtiFOSKuDr8XfeMWUcubTxUJDIAzcspvGYqROfVS/VSnzO7gpLxv143r0fEBHA/r8zA1qaKSyVoESqUpy6XdmPA4sDvhTFejamtUOyH1ybJBfCtAnUwG+YBktcJNtr49CRbdTjgm6CwRNOSFEM1oGgc3d/dc0RnH0wKEFgQzDUFGQqTTt8I2zs3f2wzU+OE96fWDg7YxlrMJMOQEwjfHrA== 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=DTI1rpiSfVQeT9hxOukXF+R4Sdvk3wayOd4+BDnriZI=; b=dEtzUaXYXyi0EymAxG6p1XJaTG8+tZ4MeXMafPaZMckpHna5x5THs2dw1w3ehaKyOQjBuFO0lrETk8aZdxfx0GU6um56GOh+0vlwYet5TPKw2KJGJ1zNUB5pkeQ1Yql+j6A24rC78cqanY2k5DPPy/Idbx6Zbmgu8ISeUroVUSnaWRRXX/UhJtq8S5WKbWTeHAxi6nN4PEw7MqPw4au1JeSfLt422gkUFmV94WklDvy8oIH09qkx7s+6SfG62IcUm4l9wh4hIRq2q7S8d72ZOcaW/Cmury/m4TeDQAwqYNreTl8V+OSlUsqWOtCUhTzZiTAnm8oa8lTQJEjWo9+QNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) 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=DTI1rpiSfVQeT9hxOukXF+R4Sdvk3wayOd4+BDnriZI=; b=tw2i28/rooA32Jq0Iln5m0mz1UPMa2nYgjPIgEACFwc1pSo27XwJGM5xZ9V0qp9szLgFWs6zvYq2E9VfkhMQlvXj+J30GyDIYr7Xip0K/dZrIHRzYLWM9ecnjdSwdeAgxiLOw0jLHU1lJTPSLise9Uibg8/fiKgoVRvq/0Qv1LSPuOyeOIiUPT0bZ4qhb8b7qCHJFb9HrAWmEC61k9qr3T2jct8uBOcX6/+obmjLOz1nV33zyRrrmB6CrkljBarZWtJU6XjcJDXKKfYN57S+I2Z0PEnXiCPXFXljc5GiuHGxUsNFOsBlEhm5u0p6CvkhMv0dW9ou8B9Ju2WHcLb02A== Received: from PH8PR07CA0041.namprd07.prod.outlook.com (2603:10b6:510:2cf::29) by LV2PR12MB5943.namprd12.prod.outlook.com (2603:10b6:408:170::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.34; Sun, 7 Jul 2024 10:26:02 +0000 Received: from SN1PEPF0002BA4C.namprd03.prod.outlook.com (2603:10b6:510:2cf:cafe::c2) by PH8PR07CA0041.outlook.office365.com (2603:10b6:510:2cf::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.34 via Frontend Transport; Sun, 7 Jul 2024 10:26:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SN1PEPF0002BA4C.mail.protection.outlook.com (10.167.242.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Sun, 7 Jul 2024 10:26:01 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 7 Jul 2024 03:25:59 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 7 Jul 2024 03:25:58 -0700 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4 via Frontend Transport; Sun, 7 Jul 2024 03:25:55 -0700 From: Itamar Gozlan To: , , , , , , , , Dariusz Sosnowski , Bing Zhao , Ori Kam , Matan Azrad CC: , Subject: [PATCH 05/10] net/mlx5/hws: strictly range templates check fix Date: Sun, 7 Jul 2024 13:25:26 +0300 Message-ID: <20240707102532.2045942-5-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240707102532.2045942-1-igozlan@nvidia.com> References: <20240707102532.2045942-1-igozlan@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA4C:EE_|LV2PR12MB5943:EE_ X-MS-Office365-Filtering-Correlation-Id: e0f9abe8-5b62-4ade-aa6e-08dc9e6f32fd X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|82310400026|36860700013|921020; X-Microsoft-Antispam-Message-Info: JD+arQ54pZeBQt/v4Q6LLWQHkdfoq4yD5VTYvOxHxZkXNfogMA6qFnuZVnCEL1+UQhQbFeVd4YqQHL1EkkMSdGhhSKuHlVSR1/5Onge0F8uVweb1rzWq1WfWu0ZAPdV8VSHG7ObvEAQk0Per4sdyMsLTZlrZzOvSIa/ntCM77UlzeN6OJa/x9dOi8XwNLIDf4ywSvwC3vhyc4iQlrJIDcwSvW6bNJqY4Mb5nLx1rF+02m2+gVZlijKc+UqclBmmLwunLoxbrN7oKAyJnT1hx0KRINdTeWYneT4rB9pQl5WFHGU3RnvhI2s+NuNgZvgkSpo2VhPH1Ek2bkIyWOAIIt4wSNRlcV/pqbSogFjhpf874Gv0Xfuox45o5nR1iBRb+3YE6udq4P1vzG+uUEGMCSuiM6HD8yil4NWtpnMHNo46hwhsCchbrkbtcgKYtWEbiAvcRCLg9hB+aPX5ZCayLZyLx5WDN4oy/Ek5kX/q4/fplw64b0+rRegZIrNRQzrMKKheEUEOdcrLFueJFe8cAv5ElU0k2FI7l3Rp3z1jaHnFM+4B4DJSkTHm3a8W+Mui688AXsey88xVAWtEbmptDm2xhQfx2iF7lSdrU3AIcy4fEc+UxACzLDuLuLxQ683GAbeBFtbs2SO/m0wFPKEZMzrLCQEvjGsUUvS2FCd+eDpmudkK8qJHB8S4zUnjrlFp4Q09DpmDvxqhFsBfkl2UjqYjJw1T+YXVv7SGaRjwosvwvl7RFkqgZRcgVRAw43dTXnBka7MRS7yrsNDOd6GWBOFCTvWYdzkxkBzyi+VSyDdBwZSO2d3XLht5Tc01WdJiYP0qfKlVS5997olp2+CC6SB6k2lIZ1lQLEj25DrOKkEN/Y0o8vRLlJpUzFqznXYyqR9LJDzbLPkn+YgPdfMOVzTHAuz3XR7GMPTY3IHnbx7aeDHPsqDpSpkehRI/GxJ07HAsSNu6P88YTaGIdGwenlOTkOHHNvgHnMxkamdrYzxhZFcc0QgqzHmlI42Qh6wtJLdF6cTFF4jfEGG2C0RYD1HiPGRG4n99lBW7zJWn9OvRdMhf2OO3fnCsKqOZhJ2vyo34klMX9RU+fZSnJ1HOp8jKgFux/QzTal4O4dO3FCWf3854TgLDqXMm5S58yHHDh4R1Dp+qbFGvf8jUxsw9uel+UQaEo1871LOIJa4g2U0JnwNLLEZTKV76wQx6BjMitDBSXu5x3RiM+SihbUAP4GtcdpSzwo4Wcn3QsRIAvp7+Axq6cyZqxqQaUHKh7kv6ceN40ql1N8uC5v2fZFSsGy7x3wQlcGn+6yquEVStyMJhVhl1JSUEV4YUyBDEmxsnJCUFFVGaBr30fl1aZEZZ9Vm5GhUbQduUGHc9/4hH7lSF5SKgijNKmLM0O8K3p3iuMy8Rp3HZ2XSeB1N3kvFICr0Uxau7Sm+pBEFe8Ekc+6mSbNrOs6xDj/oxWns5t6XkIjgUC+soRTtmI8TTD7AAc2Q== X-Forefront-Antispam-Report: CIP:216.228.118.233; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge2.nvidia.com; CAT:NONE; SFS:(13230040)(376014)(1800799024)(82310400026)(36860700013)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2024 10:26:01.2561 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e0f9abe8-5b62-4ade-aa6e-08dc9e6f32fd X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.233]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002BA4C.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5943 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Using range and non range templates is not allowed, and in HWS there is a check that enforce that limitation with constantly check that, in a loop, if the current template defined as range, the last one should also be defined as range. But, in the case where there are two templates in the following order: (1) template with range, and (2) template without range. The existing checks will not cover this case. This commit fixes that hole by maintain the invariant that if a template without a range exist, all the previous match template are also. Fixes: 9732ffe13bd6 ("net/mlx5/hws: add range definer creation") Cc: valex@nvidia.com Cc: stable@dpdk.org Signed-off-by: Itamar Gozlan Acked-by: Matan Azrad --- drivers/net/mlx5/hws/mlx5dr_definer.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c index 9ebda9267d..51a3f7be4b 100644 --- a/drivers/net/mlx5/hws/mlx5dr_definer.c +++ b/drivers/net/mlx5/hws/mlx5dr_definer.c @@ -4041,15 +4041,18 @@ mlx5dr_definer_matcher_range_init(struct mlx5dr_context *ctx, /* Create optional range definers */ for (i = 0; i < matcher->num_of_mt; i++) { - if (!mt[i].fcr_sz) - continue; - /* All must use range if requested */ - if (i && !mt[i - 1].range_definer) { + bool is_range = !!mt[i].fcr_sz; + bool has_range = matcher->flags & MLX5DR_MATCHER_FLAGS_RANGE_DEFINER; + + if (i && ((is_range && !has_range) || (!is_range && has_range))) { DR_LOG(ERR, "Using range and non range templates is not allowed"); goto free_definers; } + if (!mt[i].fcr_sz) + continue; + matcher->flags |= MLX5DR_MATCHER_FLAGS_RANGE_DEFINER; /* Create definer without fcr binding, already binded */ mt[i].range_definer = mlx5dr_definer_alloc(ctx, From patchwork Sun Jul 7 10:25:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Itamar Gozlan X-Patchwork-Id: 142178 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 594BE455B6; Sun, 7 Jul 2024 12:26:26 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 94F9040E42; Sun, 7 Jul 2024 12:26:11 +0200 (CEST) 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 AF15040673; Sun, 7 Jul 2024 12:26:09 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LrjGgUkXeBsj0nY2d6JHpmWsXreLsqr7bIDMSRU5TCKE9kGVzKuISoHoq+7BylhAr3JUm979v6l0Ma8l3VPOArdDtUs7FnD0IpATAq5VatSb1MzGayU75es/3zRk0yDQT84JxZSjOCA7QyRqZbV7yge8wFqVjsSS6OuGwYU80E++LYuRNh879bSjv81oXubozmFwt/z3uODvu6G9zcWBhov/wZFawb2cLBI7lKIac9DyhP90JhlaWuXRBOGNH3IY5OH+OZVWC9VUORFz2w44cTkurktgHXrGhNifCRXB1LlAD+esuf9QxXzjuIJYCyqHovO3dSZ0RX/tisVhvxadVQ== 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=dwxrYioBUkCKgYAbwE+NRB1M1s97xu84WR6YAID/Bvw=; b=JJV33QOfrRzaCAdJsVauNcBzoNCNt/ZnFOQk+azWaKsR5wQDUOVUHci26+ORcblsIha+v0KGmeoUjgDz4IDGuqP1XYrhasFexV7Naj5sH384aPqF8iRYpwdB2xnlx4f4gHBlv8OESAc2S1OEzCqYQEj2gB/B9eMW2NlNctDoXLO3Ad3X3aF/loWg+5Cdjkgp7GKidKw/TGKEyCbe4NqlWFC+hh4gQ1w/AwdH4xdP1YWQoc+j/jtXRTAESXjswESC/xYQb88H+JxUtDY1zYfzGLuV51w8O5iMA3UxZsxoV1/2am13jSAYXDCm2EAQL5tdCF/qom0SfaXeT1ewICQAuQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) 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=dwxrYioBUkCKgYAbwE+NRB1M1s97xu84WR6YAID/Bvw=; b=jC6Xw9trlN/zKqmPNcYPLroa5Dpd5fMFMsxz++0K3a9LQSokO34hBi83FnP4wiXSefnkTow7A3erGRzXjSvMMfzjgBBkj7ucgDaBP7LyttHsj0OT8h50ATa4UYCcoPkon3sWhoTu9Dbwvd86tdi0oE1meUIFjTOfAxHKdtTLaXKAsIIh6BhKD6A8W3UuLsomeaFy5xVg2fjpao42DO+k4a8D1Zfzon1mTS9Lw006v69mrztqoO1uEFiPQhLK/7XJnJpYj9CLznyXA/c3hqKaHBDX6JJx18Tpc1YJmo7P1saMB9vfXIGWsby5FuwqjlUFbAybKa5WBSwUwB14eZerIg== Received: from BL1PR13CA0184.namprd13.prod.outlook.com (2603:10b6:208:2be::9) by DS7PR12MB6358.namprd12.prod.outlook.com (2603:10b6:8:95::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.34; Sun, 7 Jul 2024 10:26:07 +0000 Received: from BL6PEPF0001AB53.namprd02.prod.outlook.com (2603:10b6:208:2be:cafe::1) by BL1PR13CA0184.outlook.office365.com (2603:10b6:208:2be::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Sun, 7 Jul 2024 10:26:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) 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.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by BL6PEPF0001AB53.mail.protection.outlook.com (10.167.241.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Sun, 7 Jul 2024 10:26:06 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 7 Jul 2024 03:26:03 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 7 Jul 2024 03:26:03 -0700 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4 via Frontend Transport; Sun, 7 Jul 2024 03:25:59 -0700 From: Itamar Gozlan To: , , , , , , , , Dariusz Sosnowski , Bing Zhao , Ori Kam , Matan Azrad CC: , Subject: [PATCH 06/10] net/mlx5/hws: fix deletion of action vport Date: Sun, 7 Jul 2024 13:25:27 +0300 Message-ID: <20240707102532.2045942-6-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240707102532.2045942-1-igozlan@nvidia.com> References: <20240707102532.2045942-1-igozlan@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB53:EE_|DS7PR12MB6358:EE_ X-MS-Office365-Filtering-Correlation-Id: 0b1b30e9-32f1-4643-eeef-08dc9e6f366d X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|376014|82310400026|921020; X-Microsoft-Antispam-Message-Info: kv53Fw9cF5YEk7arAJ41Yss9cueTLH34tYOq2o+35o+Juqds1h8xkdm/v0UZ3COgTuZKJhkNZoifNfUCH853ET86c42fAXKscrk0ReOMiONlT+PWJ7MyBQxyBarOqTOjtgcq/FXu15YToP4i9fF+RE+tZ2lBB5llrvBpkn9IKlV8ospab2+fd1dF0YBx7C9y7a+B/8Oy7g81XLGl4kzmeOmOiqdyX7CDNWqNCnQVKuzj/5MHk727n6kq3xL7fIH150D0PC9nezuZCY+Tlpo62inrU1u6CbtOQr1UcB4smwwFnBrE9ewpmMpkryio1zODo/cbS3/UyUJMnCS0URLYVkf7KSDfngxiFJEDMAE12IMfpD3iW5mOlRkRimaI2oLnHOEB6JGSlTQtgk6r71WDJSu2rSFye1qf6Lj4dxynpMdZ4yp84NgUhXKcUwNuie8jUDP4caNWCCMAzGPiPdR+Y6LS9qO9rqkwHLY90BcTw41rM2zirtcGZNcgX6EcfRlEju08QtSK73TsPWFFRapwyqxeFQ4NDRfaDtp8QX0B7Axs1Vz43reiZNGIHY/YJ9SAdee//c9AvwtUx6KxYYzlDVm1zdzpgnXrC++SX4+GL4S3iuD+LEj7S8DparfdweH2GdJrwVqmNdWhALJhUb7do0rmKvyHqdrAm0vbBloPX2fXLCUvD34DNKikIJlTnpmAQ+eDbxwZ2f6P6TLsUUyIzdA7xQ/h2AZmCfOosRNgElqxjXT22KoymrztCoVU0f4+xwLdi0RCIm4ynl9PkBQb/PJ7e6ntgFmqOywRLM6ces8SyNSCOeHny5dwVSaDRcZpUdvxVtLZIFVdaZ53EM2krAJQgF4SIqezlNlGb7uz8jVtZAUXvWPZoPwXJGDblmsd2s8uJJyYhWE1f3a5AEhKjZy37RSb7yj4BQKS3rfPzeJh7gt6u526/lw8QbKUPN0LhHxNbSQS1/4KpVKE5yPytlwCSCI0vvtVxWElUYAScq3Py4pAarO2Zlc+SsL5CxnYGI2zPM/PFyjZygz4loi3WK1CDOkM11QQIRmxJeg5NeFtmJb7qyCRhvhGoNsrN7Ultmw3HHUNqVF9j0Qnr5CEO4dqYSdVOwx3DXr+ob6U7TBIq99VxoLy0tlz07yAm+T4mmYTQwwRqRcMgbW62sUxQZdLNIkgah9MQSXBFs+sTwMjxQlyAyzomzzqgl3Qh5bRhhPEzf/BZqUplhp76viZrlDWC4ChIbMsM2LwaXWRKwq+g5TAq1hPq/MGH5o0O9CJlMknIOdyd/pDJ+d779p8jK+yBiOiSiiXbgu4qmSSmFfbwjhbvpGg1Tuj/2GQ4aHhie0If9c/2wsVdBFhyR+iC7yC94DIeTxXhs1Wwll03t8/+Htt9bOQCy5d9n7VtxERN8Ahw7KEg1hM3thG3xtb8d3KlKIdYyjRWqD0JfBBkkAHU4Zp5dWb2zWHWuFrLnYrajTiAe2L2CEooIzdt6ksIA== X-Forefront-Antispam-Report: CIP:216.228.118.232; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge1.nvidia.com; CAT:NONE; SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2024 10:26:06.9625 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0b1b30e9-32f1-4643-eeef-08dc9e6f366d X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.232]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB53.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6358 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Erez Shitrit No more ignoring this action while destroying it. Fixes: f8c8a6d8440d ("net/mlx5/hws: add action object") Cc: erezsh@nvidia.com Cc: stable@dpdk.org Signed-off-by: Erez Shitrit Acked-by: Matan Azrad --- drivers/net/mlx5/hws/mlx5dr_action.c | 4 ++++ drivers/net/mlx5/hws/mlx5dr_cmd.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c index b90f18df8a..0d90280a7d 100644 --- a/drivers/net/mlx5/hws/mlx5dr_action.c +++ b/drivers/net/mlx5/hws/mlx5dr_action.c @@ -2968,6 +2968,7 @@ static void mlx5dr_action_destroy_hws(struct mlx5dr_action *action) case MLX5DR_ACTION_TYP_ASO_CT: case MLX5DR_ACTION_TYP_PUSH_VLAN: case MLX5DR_ACTION_TYP_REMOVE_HEADER: + case MLX5DR_ACTION_TYP_VPORT: mlx5dr_action_destroy_stcs(action); break; case MLX5DR_ACTION_TYP_DEST_ROOT: @@ -3027,6 +3028,9 @@ static void mlx5dr_action_destroy_hws(struct mlx5dr_action *action) break; case MLX5DR_ACTION_TYP_LAST: break; + default: + DR_LOG(ERR, "Not supported action type: %d", action->type); + assert(false); } } diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.c b/drivers/net/mlx5/hws/mlx5dr_cmd.c index 72fc9e3d91..a4f778a8a4 100644 --- a/drivers/net/mlx5/hws/mlx5dr_cmd.c +++ b/drivers/net/mlx5/hws/mlx5dr_cmd.c @@ -1033,7 +1033,8 @@ int mlx5dr_cmd_generate_wqe(struct ibv_context *ctx, ret = mlx5_glue->devx_general_cmd(ctx, in, sizeof(in), out, sizeof(out)); if (ret) { - DR_LOG(ERR, "Failed to write GTA WQE using FW"); + DR_LOG(ERR, "Failed to write GTA WQE using FW (syndrome: %#x)", + mlx5dr_cmd_get_syndrome(out)); rte_errno = errno; return rte_errno; } From patchwork Sun Jul 7 10:25:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Itamar Gozlan X-Patchwork-Id: 142179 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7560A455B6; Sun, 7 Jul 2024 12:26:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DA5D240ECF; Sun, 7 Jul 2024 12:26:17 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2052.outbound.protection.outlook.com [40.107.220.52]) by mails.dpdk.org (Postfix) with ESMTP id 5FA3940BA2; Sun, 7 Jul 2024 12:26:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pt0MCOWer/Ikg8M23wNe5W6yPJJP7hR+h7Kr3d81fRN0zW8xp2H9iKnpNpe/h4ISWTYYmf7nWheH732tkMINpvBJv3HipH0t8s6SBAxb1njUWNbr8nSsFz8rd/1fz1b7mGRNIJkt9ikl4leEWqeSpWA9EAKtOIdza27dlVK1mdolaV/VyDD+fleWP+TeYzaI666b0bQ3wrur6TsQ3fn0sufx/+T1DnppegW0aF29A9Kcx9OYcnvsn+ewDqWtD02Q/TRI5/A7HWtUxtjiKQJMkUbZZ3TcZYwLkm6r12lOd917NcIDGbE22rIGpNpW8cMUSbECvHbKWVpHX1TXVzXYVg== 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=lh0JzjEswFsxkTTE/KqualtgXsT9NXs9lNmZKbgrwxs=; b=EK4uFjb3xFH/Sf38+lG21KUnePicx8O4mj7v04Q8/LQhcmd7tSCFkTdFXiKKCiYdZCrnuEQhk7tIOdT8lgPKTzQsdqcMd8CuunDlk+/DvmtAF2CJUNseyMM7XnBRxRhMF2ke41ahoUNQrAGaus/MGxnzXRr1valI57sT64v5ys8FPtKvjWs1EE1OcFHjCmYuakifu6Ps9yzPUEibWq1KY673jPq5bd8lnW+EZf1uCUO1cY1F0TTj+LGMYZSm5/MOsXRmsxWErArXZDawwj292gyiLE8KoK5OKzgbYr+mHDW9ok676LRTv6JmjFpcwOJ4zDPDI47dSgRYvYI/vj3BtQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) 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=lh0JzjEswFsxkTTE/KqualtgXsT9NXs9lNmZKbgrwxs=; b=mVVC7f/sDW9KB2ejt0Cem7+IhDsiUf3KmydjZ8BGbZxywYwz7HvaCy3/ow2rYSCuu9a+k6l+3JJa7falawh6k4smJMcdbkbd8NM4RgItChdAnThNKEZXZWezVNvDVVyq4VE+YIow7OV3o354Wpf4o5VeNXM8eyHNQ8KXWAyKMwkOIZqgmqbUKFmEsM1kHKzYBhXmUXZz+BHc8hcDcv4IdnUjbDpjthFKhEPiIxHx0AJhWG9k20hRETNpDwHgtUAoObEV10cXFFmQGZzJobsJBnKD51UmD1GyGt3g31LJNHnPNNLkT7a2QgSGYbUOEh8VPrsDKoqS2E5huDfO8lSCDA== Received: from SN7PR04CA0237.namprd04.prod.outlook.com (2603:10b6:806:127::32) by DS0PR12MB7632.namprd12.prod.outlook.com (2603:10b6:8:11f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.34; Sun, 7 Jul 2024 10:26:13 +0000 Received: from SN1PEPF0002BA51.namprd03.prod.outlook.com (2603:10b6:806:127:cafe::17) by SN7PR04CA0237.outlook.office365.com (2603:10b6:806:127::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.34 via Frontend Transport; Sun, 7 Jul 2024 10:26:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SN1PEPF0002BA51.mail.protection.outlook.com (10.167.242.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Sun, 7 Jul 2024 10:26:13 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 7 Jul 2024 03:26:08 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 7 Jul 2024 03:26:07 -0700 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4 via Frontend Transport; Sun, 7 Jul 2024 03:26:03 -0700 From: Itamar Gozlan To: , , , , , , , , Dariusz Sosnowski , Bing Zhao , Ori Kam , Matan Azrad CC: , Subject: [PATCH 07/10] net/mlx5/hws: fix incorrect port ID on root item convert Date: Sun, 7 Jul 2024 13:25:28 +0300 Message-ID: <20240707102532.2045942-7-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240707102532.2045942-1-igozlan@nvidia.com> References: <20240707102532.2045942-1-igozlan@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA51:EE_|DS0PR12MB7632:EE_ X-MS-Office365-Filtering-Correlation-Id: a0103388-0fe9-40db-3299-08dc9e6f3a45 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|82310400026|1800799024|36860700013|921020; X-Microsoft-Antispam-Message-Info: ++uz/Z2g+YJLdB8Rmc5FNy7yzox8AZyFArU2Epnx7OcTsY0tDvOCxLOp8GkdozF4tOKtcGmcQETJCyUFme7JrrzuQfMELW229to3GYhJRRyJHVrhHJc1e/XOESJzkgmbqUO3hgHA+205C8Mkjp4FWgNqg7o4tVlDeLLcAbPD9o6mAZIe6D04BKWvEVKxM1g3O3/am54jmccUOE5HW3XHwcJlEZXOnTlBbocYd2K5dTxs0m72hsgnxYyjZmdNZ2Zi57VQn5WiPyjHavDopwDgOSDNSoKuDPa9sbWh2m2Ryyo3wY+0uyF30OP8AY+1tbatpY69sDbl4gLrA9XOFCr7fza/DjnB/ZJb2xP5Q639bOmdJq4IJYDMRPFImA2AJrL7G32r0vm+x+0Dl/RnsJnX6/hEVxcaSYyeLZMa4nDpuw9tgPD8JJk8hk4TxyWSE3EpE/ZTL1RgQLjhPwP+C++mrzoXx53/2Xs4zxWdslvUFCaxHZ+v8LjEBM/OED9g6+M3TivR3YRSiwt8uMOGUtNw0ChoBIooKzlGjk7U0VjL8j+yXpYA6Scv+1wUqgBABOawuH9W/vVlOmeqIQKsrmNaH2t629WJtdyr7ugqwp5G5bP6/JhX5jHu/T8q1q3UNMPEEXOhoQTLxfB/BCdxh2VdNWgVU+rweHU54UD3T5coXvebSyUD+py1rf6alk6/d8t6FaLqg7LxQgGq38+fJMzjERySJjExTiFhVm9kfrPZFDkMf4AYLxGUJ/R2JPfgX2MbXIJYsxy+lWTO65LkcUcOtHDCRrYgSOh6/IwuS1W3/Ur8OxxByF34ysKZ6LW8PlrIZw5wlJY9hCC2ObnVPlHa4eE+XTOUgRuWdv4WFYqaPZ+6/dbc2Fo3myTfGHrKYlWkOD5jmzVxOt3DvJnjBkDKscMw68E0Nm8KdYcTo4l/kvWB1DxT/+SpZfWM4Ctqh2dKUNMB93zJse70gT1tP5qvKbFUJqqKhmNUrYepU2EYHKHrJ2TN7YQe0dRnUeH+nbDRObWa7rVt8atgvJrO24uE25ygobJJFy7vWCGqlg3uJvY8RYBbHL89OE3cRHtCfH86/kqk0oD8BDvrieRURqFKw4M/ORQ61u8GKmeP5Irtg0Kbw79mzND8Tr9LwB/wu2PMJtMGzsyoG2MDORvugZESBX3+3Z4AUiCuapnbEX7K6YLL7u1agJPZWcNBAOs8h58D2e+pSzcKoB7P3VTOL6/M2pXk6jwf3XgUn8L79EKfMpU2OkJUwb5hLCX2teIcaVR6kw1l8F4UhW4w8jmPJs7egkeRejKjvHbr3Bwt9B8yszJ7Bst0SZ7uHjGcZdVN2ird2I8R5kaczwieE3rN90fPpuK5SQDNVDhk5MFFgodBEvVbwnoinwbaA3cISvmL341i8l85JoVARvRar1sYa9vyKS1DDbvj6ddcD5kdKiPIKVtYsMpu1OrJfNrRo9eskdWq X-Forefront-Antispam-Report: CIP:216.228.118.233; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge2.nvidia.com; CAT:NONE; SFS:(13230040)(376014)(82310400026)(1800799024)(36860700013)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2024 10:26:13.4689 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a0103388-0fe9-40db-3299-08dc9e6f3a45 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.233]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002BA51.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7632 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Alex Vesker When calling item convert function we need to pass the port_id in the attributes. This value should be passed not only for cases that match on PORT related items, to resolve we will always pass it. Fixes: 572fe9ef2f46 ("net/mlx5/hws: fix port ID for root table") Cc: erezsh@nvidia.com Cc: stable@dpdk.org Signed-off-by: Alex Vesker Acked-by: Matan Azrad --- drivers/net/mlx5/hws/mlx5dr_matcher.c | 20 +++++--------------- drivers/net/mlx5/hws/mlx5dr_rule.c | 22 ++++++---------------- 2 files changed, 11 insertions(+), 31 deletions(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_matcher.c b/drivers/net/mlx5/hws/mlx5dr_matcher.c index 6a939eb031..dfa2cd435c 100644 --- a/drivers/net/mlx5/hws/mlx5dr_matcher.c +++ b/drivers/net/mlx5/hws/mlx5dr_matcher.c @@ -1231,7 +1231,6 @@ static int mlx5dr_matcher_init_root(struct mlx5dr_matcher *matcher) struct mlx5dv_flow_match_parameters *mask; struct mlx5_flow_attr flow_attr = {0}; struct rte_flow_error rte_error; - struct rte_flow_item *item; uint8_t match_criteria; int ret; @@ -1260,20 +1259,11 @@ static int mlx5dr_matcher_init_root(struct mlx5dr_matcher *matcher) return rte_errno; } - /* We need the port id in case of matching representor */ - item = matcher->mt[0].items; - while (item->type != RTE_FLOW_ITEM_TYPE_END) { - if (item->type == RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR || - item->type == RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT) { - ret = flow_hw_get_port_id_from_ctx(ctx, &flow_attr.port_id); - if (ret) { - DR_LOG(ERR, "Failed to get port id for dev %s", - ctx->ibv_ctx->device->name); - rte_errno = EINVAL; - return rte_errno; - } - } - ++item; + ret = flow_hw_get_port_id_from_ctx(ctx, &flow_attr.port_id); + if (ret) { + DR_LOG(ERR, "Failed to get port id for dev %s", ctx->ibv_ctx->device->name); + rte_errno = EINVAL; + return rte_errno; } mask = simple_calloc(1, MLX5_ST_SZ_BYTES(fte_match_param) + diff --git a/drivers/net/mlx5/hws/mlx5dr_rule.c b/drivers/net/mlx5/hws/mlx5dr_rule.c index 06d8e66f63..1edb7eac74 100644 --- a/drivers/net/mlx5/hws/mlx5dr_rule.c +++ b/drivers/net/mlx5/hws/mlx5dr_rule.c @@ -694,29 +694,19 @@ int mlx5dr_rule_create_root_no_comp(struct mlx5dr_rule *rule, struct mlx5dr_rule_action rule_actions[]) { struct mlx5dv_flow_matcher *dv_matcher = rule->matcher->dv_matcher; + struct mlx5dr_context *ctx = rule->matcher->tbl->ctx; struct mlx5dv_flow_match_parameters *value; struct mlx5_flow_attr flow_attr = {0}; struct mlx5dv_flow_action_attr *attr; - const struct rte_flow_item *cur_item; struct rte_flow_error error; uint8_t match_criteria; int ret; - /* We need the port id in case of matching representor */ - cur_item = items; - while (cur_item->type != RTE_FLOW_ITEM_TYPE_END) { - if (cur_item->type == RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR || - cur_item->type == RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT) { - ret = flow_hw_get_port_id_from_ctx(rule->matcher->tbl->ctx, - &flow_attr.port_id); - if (ret) { - DR_LOG(ERR, "Failed to get port id for dev %s", - rule->matcher->tbl->ctx->ibv_ctx->device->name); - rte_errno = EINVAL; - return rte_errno; - } - } - ++cur_item; + ret = flow_hw_get_port_id_from_ctx(ctx, &flow_attr.port_id); + if (ret) { + DR_LOG(ERR, "Failed to get port id for dev %s", ctx->ibv_ctx->device->name); + rte_errno = EINVAL; + return rte_errno; } attr = simple_calloc(num_actions, sizeof(*attr)); From patchwork Sun Jul 7 10:25:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Itamar Gozlan X-Patchwork-Id: 142180 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 565E6455B6; Sun, 7 Jul 2024 12:26:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6224A41611; Sun, 7 Jul 2024 12:26:23 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2045.outbound.protection.outlook.com [40.107.243.45]) by mails.dpdk.org (Postfix) with ESMTP id AEB8240E2F; Sun, 7 Jul 2024 12:26:20 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hUzlQ0UxzIcrzS25OiK2v5aMvR3+mTU9DS9UXtES1YqNFsPX2LWd9CTqUYkq/BFJ5jqP7nujE20Eb3WzzFfYQLSZ89wfdDPggJikw9LpNGMeloKDopR1dX5EG+tFrac1qlH4hcwIEza5IMkjdYe7QumiCNvGRBNswPJvb49j5mSmClla0ogLpsOb4JdxO/R8AZCHCvCHNfs4R/eGjpfKCRqB2IdXRbrWBWGDSh8snf4WOHsJ/glx7PHfq1abiG/qNL0jPW2e2wFMHgB76FWUeCiTm/t2Hu5+w+rcX14o/TOIqss13HIW71s2XsY89cjTPAhHW82/+jt7s5x14l4gog== 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=mzS2s4/T3FfeyHX29Jb9jrVBcxIDicpIUMQk/63qR/o=; b=Z5AgUd0uK23uM9+ejwUAjdQBO8VIdTdCuRRn/gJ188fYeWNQu4dBRMvh7MsMDq+xFfWLB3kTQltcDfxLv55Ke/s/VDSmjEbEcEQsu7UBH3QlZSwd7KWeFOdLQzlY4xO/Y7Oun2nHSfvxsr1WulFqO8WjICFCjfrhj8if+8HSx9+qTMXMPnfvO3oebIPuqnf/XuPf5ukW/sRFLiYpGSp/kC1BNCCngP0Ab+myovl4UzolY3SuxA2nEMVxYgs4BNxzQ6GDpwR3/w0yvRlttYDE4XoDjSy9oiJ/Bsr4RzQiOsKpcKPQo1IfvxhZAAr1yGQp3G3RJY9QR73f/Y3OtNthkg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) 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=mzS2s4/T3FfeyHX29Jb9jrVBcxIDicpIUMQk/63qR/o=; b=jB34nAOaO8y3eID19tFvnH39mbaety23qlGyho0nmiS0EZ9dZ4OqmsS78opUwzN3EaDfpWtHid6SzznkqrotnTqCttp3R26vxm6Afz6v6gjiUQ5s8oL3GSQ+Bh7UyOJa/pc8FwBVFs/D+LFHWt4YbDiUDh1CEDnwzLOWBk7kchDjaXLdNbbhWqCzQZyxzvgNOUtgNQ7nhtp8oLcyAJ6c7f99TSskCfy66o7652hMjN7KzbBHRIIHPYYQv1GV43+n+fdDm3XP3h6wyJrFcYn7wYpX3GHzjRLH1NRZ4OrarnoTwn+HhDlV26i70cGzzKOu6Fy8Bq50SSWDrJiE1HTHWA== Received: from SN7PR04CA0226.namprd04.prod.outlook.com (2603:10b6:806:127::21) by DM4PR12MB7574.namprd12.prod.outlook.com (2603:10b6:8:10e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.33; Sun, 7 Jul 2024 10:26:16 +0000 Received: from SN1PEPF0002BA51.namprd03.prod.outlook.com (2603:10b6:806:127:cafe::ae) by SN7PR04CA0226.outlook.office365.com (2603:10b6:806:127::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35 via Frontend Transport; Sun, 7 Jul 2024 10:26:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SN1PEPF0002BA51.mail.protection.outlook.com (10.167.242.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Sun, 7 Jul 2024 10:26:16 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 7 Jul 2024 03:26:12 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 7 Jul 2024 03:26:11 -0700 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4 via Frontend Transport; Sun, 7 Jul 2024 03:26:08 -0700 From: Itamar Gozlan To: , , , , , , , , Dariusz Sosnowski , Bing Zhao , Ori Kam , Matan Azrad CC: , Subject: [PATCH 08/10] net/mlx5/hws: take out not needed variable Date: Sun, 7 Jul 2024 13:25:29 +0300 Message-ID: <20240707102532.2045942-8-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240707102532.2045942-1-igozlan@nvidia.com> References: <20240707102532.2045942-1-igozlan@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA51:EE_|DM4PR12MB7574:EE_ X-MS-Office365-Filtering-Correlation-Id: 7392c7d5-9897-4cf1-42c6-08dc9e6f3c3c X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700013|376014|1800799024|921020; X-Microsoft-Antispam-Message-Info: ZfJ5CF0rdhJGu4PWNT+MetinQwFFRXcN1/GiW+Y0y5HQwqPi3KTpT3qDbxDWZ6z2BN/WwJKLMl0okaU6Jwe89KmJb85G6Q3SHiPBCQM+j9wUGTdVenxwwHIdqgdVvodpNvD5oululjcLdGKNFEi38RvFkP8lq/lIhOp5GJX84e8QD4s68IoEq1Ww/AJYf2399ywNut94UGofwzLkkUZ9ECxfYkpCdXZynEIVsFIG7hnt+k0bkWGcV2ddZnR+4N2dx3fMwgaCp6rYYgmoj9b5byEDfk7g46RIaO8xhBYgsz0G0XCuTtRd8WvpjEOF/cguhPnMVDZildyHsUv6/udp6KRbmj3JbKtp3qaRj21Z1ygNOIfoal2MKPD3vuQZE3Gbq2vEXR0D8EaHi2cjUSpkmJweiXpxVKf3G02SCfpKwZh9X3JYh6AmxIz4NOMhlFtRiANdeNKcVlRUbddZ3mXKJ9NXmrd4AwKmSXJJzdEkAHNGzCg/AHpWF/9CpTrlzHPwpWI/cJCR+whxJpf8EhfalHYfTDhv2MBRILTtVl27hBr2JVg33w1FLf+7I4XjGrBJAjaeAP8DCQ+kVs9xMjzbdyGnHGle7aLmAeVM1b1r9u5XVxsdq+nMX8bTMVT03WAokHKCgHWp48aOzCGuzMaymSEYc5iyadbTTOZNq5sjeMr0dKg5fTJjUCb5nRFPAybB2PimuI0rgAD3u2wioufuNg4uiYCI6aJqtfBQzqvOy1glgwth1Eh9M/62Isht119mw5TTu6DMuTFlQg5PF6FP6frVhXeST3LN1Vka5vC8ODTlivnyxeoPpFg4N3vhLp3NCq5ooCMihd2KdVtYHNoRrNFZW8VFFA6R24u7umHEvCdizzowZmNWCe7KvLRvGNKilyc70qe9bJuLpOdegzKsbiTWdgLRnrFpH5E91xWGfbacgOUut5QAkUJqDYOzy04mJjJgxwQ84WevGAjpZXaZkDxhzELg9YSw9P7Ycn1Qj3qydMKp6cgUxSiLdJvbvukScjHsar7W8Xui4oDZgp1lBKMVeSZd8cuftqAHfIPG7QTDLcbPWhL+0hAIdDu/iDICoxYG/x2NJkXHvxUc6PwSpnOs9xpA3EDioHoJ9vUkR2CqlnpVlD4RWxsvc0EDiXbJgqc3NxEvU29kbX0sqRSM1OOeuxWHZrqD56TL9yzOGWQgi+bCWmvxJomfLwIRbFF1Fsl+9PUCrHYRVORaplaC8oqmYWRyxIr3mjo9EoOcxJVvhdNmbftV6TTJHRw4tUyCyJ9ipc7BJ4VZdcXNCRJWiIVmQA6ScOHScX9uYYi/OAB5S0UwOpVYJyUtOQP5v8VjnDE5QPM3DQ5Rl1wKuehcnEX58Zs5VGTkMy4Hbk7zTL80t/u3dZolEKma2XdiH8RwG88f9RXEsja/k1Og4wLV5RxtvrRJ/jtRiAU1dsmhLbPhsZxhgvjIJNJGQQIbsWm/Cof4+a+UnOSdZzIhdfwcQA== X-Forefront-Antispam-Report: CIP:216.228.118.233; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge2.nvidia.com; CAT:NONE; SFS:(13230040)(82310400026)(36860700013)(376014)(1800799024)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2024 10:26:16.7658 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7392c7d5-9897-4cf1-42c6-08dc9e6f3c3c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.233]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002BA51.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7574 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Erez Shitrit Removing a redundant variable. Was there from day 1, not in use. Fixes: f8c8a6d8440d ("net/mlx5/hws: add action object") Cc: erezsh@nvidia.com Cc: stable@dpdk.org Signed-off-by: Erez Shitrit Acked-by: Matan Azrad --- drivers/net/mlx5/hws/mlx5dr_pat_arg.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_pat_arg.h b/drivers/net/mlx5/hws/mlx5dr_pat_arg.h index bbe313102f..c4e0cbc843 100644 --- a/drivers/net/mlx5/hws/mlx5dr_pat_arg.h +++ b/drivers/net/mlx5/hws/mlx5dr_pat_arg.h @@ -30,7 +30,6 @@ struct mlx5dr_pattern_cache { struct mlx5dr_pattern_cache_item { struct { struct mlx5dr_devx_obj *pattern_obj; - struct dr_icm_chunk *chunk; uint8_t *data; uint16_t num_of_actions; } mh_data; From patchwork Sun Jul 7 10:25:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Itamar Gozlan X-Patchwork-Id: 142181 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8FCE9455B6; Sun, 7 Jul 2024 12:26:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D140E40676; Sun, 7 Jul 2024 12:26:28 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2087.outbound.protection.outlook.com [40.107.236.87]) by mails.dpdk.org (Postfix) with ESMTP id 5615440664; Sun, 7 Jul 2024 12:26:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WyygEg+ELqryAPw0nA6A5M+QacguyCGvOeLtMi6NG82vrwNsdAliwwieLf2jmBYRS2WO5JEy9I9J7XuR6GXl+BZQF8FB5RpIDhfci5l+KidBIwcM26nDSL5fN3Ehtk7BazTQC8w4Dh83gH8dVubPaVd4bGv9NNkUpFWBp8YtYnRLrW23hkmP9S4J+A1RoiZNjR8jEy1AX+dkLSShadcT7Pv4TLlsMll/2+OwR2ey5tDWkMFRf+kwQPnWUBO5A69YafmVnvJRg/sFNxiVZzMhFAJUMR/SovutUoN4LcRVjy4yEKAMqGDFh3fu55dJVCqeYNxivGkdebo+q4LHnQqJCA== 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=Lpfcgf40tfD+BqRj0urH3tSGTzbo+PqEYNrCZLn2+b0=; b=OSGoPq57/RDbXNpQYTTemUt5gUPOBSjrojTnk5wUjOW1iz300eCI7YkihTwE4wkBxcOJqzulthYgZ1fwbIZj1NesysKOLCVxDzDCU5lbolrqojSBvBTOvqhvB6CkBD6AAqRwKbzV3r7pbPFX9UqBOkvf1gVNrdGIWXjQT57C3elScoVINP1W6rGiFnTxiPf5LdgdMZ3VnlIdHUBjLZjVbshB1tRB9owqlvSIJKMyjYr67Qi98oIvRbe/9V9KK+hq5X3FEbJBo7kwhvheY0ODtX/XtpqLWWWTScqeU/+pWbZ0mARhdpTwOTGWcF9zE3Fy77Tlk5iujf+6D4takn3dnQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) 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=Lpfcgf40tfD+BqRj0urH3tSGTzbo+PqEYNrCZLn2+b0=; b=Di/avEpKm5euK62MKZH9JF16+iRd0E/iJ63dVpvzG2L83dVGLwL7uhq9Rd8j1a74Vyj/Cz06bPPZAyPJnZ2tRmRza9YpwBsVTeznBFpCe3EHKK6ebNNEW20wRJO6imDrSx4ewYIOLdSRwF2C6jNB3Otz46SrCaS0v7GDluCteUN2kp/VybPW5XOUZm5jepoyUTko97cm5OLzwDFJDzwfh+TUtNKdeVKLbjaDSBbYFbyf1e348xwdfAoFwEPzSmHQzVDFGUFfBjV/bh8YdbILNySabVj5i4iZOm526FT9ZN+5Aap2z0tszx/MzEHxGlPMdDNxwi1/S/rABkjUwBRFAg== Received: from MN2PR15CA0042.namprd15.prod.outlook.com (2603:10b6:208:237::11) by DS0PR12MB6534.namprd12.prod.outlook.com (2603:10b6:8:c1::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.34; Sun, 7 Jul 2024 10:26:24 +0000 Received: from BL6PEPF0001AB59.namprd02.prod.outlook.com (2603:10b6:208:237:cafe::e3) by MN2PR15CA0042.outlook.office365.com (2603:10b6:208:237::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.34 via Frontend Transport; Sun, 7 Jul 2024 10:26:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) 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.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by BL6PEPF0001AB59.mail.protection.outlook.com (10.167.241.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Sun, 7 Jul 2024 10:26:24 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 7 Jul 2024 03:26:16 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 7 Jul 2024 03:26:16 -0700 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4 via Frontend Transport; Sun, 7 Jul 2024 03:26:12 -0700 From: Itamar Gozlan To: , , , , , , , , Dariusz Sosnowski , Bing Zhao , Ori Kam , Matan Azrad CC: , Subject: [PATCH 09/10] net/mlx5/hws: fix NAT64 csum issue Date: Sun, 7 Jul 2024 13:25:30 +0300 Message-ID: <20240707102532.2045942-9-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240707102532.2045942-1-igozlan@nvidia.com> References: <20240707102532.2045942-1-igozlan@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB59:EE_|DS0PR12MB6534:EE_ X-MS-Office365-Filtering-Correlation-Id: 0c550f72-a18d-40c6-4266-08dc9e6f40a9 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|36860700013|1800799024|82310400026|921020; X-Microsoft-Antispam-Message-Info: 8COJjIQEgcltKhe5DkfnVo7sKYl7MvFzfxp8uGCakLW5rO7p89SNDVVcADczJwcZc2NQisFR4uhQVUVxlNUUDbptfP/o2Gm5YFvZ8BL56qF4X0Kb6BXlPLOu/PRSbazjlAgimoAJkAReE4CyYKmYU0QdZ+EUPBd8K7DeudNYsrKVMMr7qZbw7NBJrl3BouCrNdR618/xrODXpOKlazq81XdBSLnELUcgAK2NLkozEWEKDBc9OWULI92VrSpefyRxDxIFh1dwCDRd8r4lktwXmbYP/ikPUDBQKrvGvUQBkrMECPPPseMoG3jhjpg5Uwcnxbw7XFaMV42GylKvsNepiBPPWdZG25jVeKxpr4D1nl9GBE47rAKt8jZy0dPadI0xJ5f1byr+D9Nz0S48xsBcdizpkLXiz/a22ycb1RuKEpvClwGXuGTGwU/bgUVFOUeLcEpGuqvbDSdNKNgYpTU2xOp2coKIe/Yywy3BahDbURAlWMz196Z43B77F1qPiX3eFCcl9Z65qLSfkTV3xxzir2H+Z84FIFenvPb3cK0rDMKoy/ekrb9pnqP4hdj+786rgfQiQn2Kawf1T13ffOrm862BysJZbXk1H6QKjd/o2sOWEG3tI6fa7TAF6RqQ1FSD9FidcqmynLZv78wLsuPQ0aHl9zPq3XI2JPefKz7rLRPjFu4nDqZALOBKsG8lfvXp5bOjDAz8BSepwO/qnkHd+oPRNjqdOncC9ZUpoaOEr5l+ic46s656owbpg7oeVGogm0UnQRDgQ0S2OmVv+7k8B4XOLqbVK+B8Wb94LxenJI3jDMir577A53+96nW2sQKnvrpRV8j5U3Sa5Sn1ay0/xSccpyPHPkdjUisp3LrAefPXhRQhxMHDRVNx7i02rHWYhj/40R5ZA+kocXn6WPIesTXbXYYa5OiTfjhWUd8E2rwUooE0Wkb4i/knC0xue/Qe/kzlyXCgRQzeUqrJlfNRkZM1ymVLQOjBoYfhPOkqjCEQzd9EEOvSZM3Z5n3OI5p63vmHDP8u7/6b7lQ9EUnvFWdhh68jpwHw46n8my3oJ2u9kCILFGCB9ZXorw73aeu/fn9I664qpvNs06Xorbs3WYkP/tSspw70WDXwM2IDAlhRAFALVf+QLwY8VUPgac057F9oihFqmH/moJul/h1mf25kwhEydkVh0VwLQzXxnUeS3YRGuf3+1ibR9Vo5Qm425WuSygaXXPNpQ60lgOTgZtIMNKlIl/rRJlUslkUDWQc94fZMdq8XV+3wOpQPaHPyJoF8sOaRAiH+CkUlR0YWKhYq3/ciUAAS3LYvR+dWF6BHC74Sh37+Q9zQR6igJwiqvpha604cUk0+mO9MBcL81/7ti106uJ7NLM97uxeGscoKWh0INsjh1IVPG3ASpYB4piZj/riyVWBXXb5pizrIzZjyTUeinMsjpHv/+L4X18E7HIaanojesU1uaZtlM/CpdOXOAU4VaLt8eURFAcoQjw== X-Forefront-Antispam-Report: CIP:216.228.118.232; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge1.nvidia.com; CAT:NONE; SFS:(13230040)(376014)(36860700013)(1800799024)(82310400026)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2024 10:26:24.1285 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0c550f72-a18d-40c6-4266-08dc9e6f40a9 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.232]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB59.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB6534 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Erez Shitrit Due to HW limitation we got two csum's that were not correct, udp and ip, both of them were not calculated correctly by the HW. By adding the next W/A we allow the HW to collect it well: Separate the protocol field and zero all the addresses before fixed the UDP csum. We saw that the IP csum by the HW didn't take the ipv4 version as part of the csum because the way it was inserted into the packet, in order to solve that we added a prefix that takes into account the real csum for the ip version and from that point the HW calculating the csum correctly. Fixes: 06d969a8c5b8 ("net/mlx5/hws: support NAT64 flow action") Cc: erezsh@nvidia.com Cc: stable@dpdk.org Signed-off-by: Erez Shitrit Acked-by: Matan Azrad --- drivers/net/mlx5/hws/mlx5dr_action.c | 136 ++++++++++++++++++++++----- drivers/net/mlx5/hws/mlx5dr_action.h | 15 ++- 2 files changed, 123 insertions(+), 28 deletions(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c index 0d90280a7d..8d3d0033e5 100644 --- a/drivers/net/mlx5/hws/mlx5dr_action.c +++ b/drivers/net/mlx5/hws/mlx5dr_action.c @@ -249,6 +249,62 @@ static void mlx5dr_action_put_shared_stc(struct mlx5dr_action *action, mlx5dr_action_put_shared_stc_nic(ctx, stc_type, MLX5DR_TABLE_TYPE_FDB); } +static void +mlx5dr_action_create_nat64_zero_all_addr(uint8_t **action_ptr, bool is_v4_to_v6) +{ + if (is_v4_to_v6) { + MLX5_SET(set_action_in, *action_ptr, action_type, MLX5_MODIFICATION_TYPE_SET); + MLX5_SET(set_action_in, *action_ptr, field, MLX5_MODI_OUT_SIPV4); + MLX5_SET(set_action_in, *action_ptr, data, 0); + *action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; + + MLX5_SET(set_action_in, *action_ptr, action_type, MLX5_MODIFICATION_TYPE_SET); + MLX5_SET(set_action_in, *action_ptr, field, MLX5_MODI_OUT_DIPV4); + MLX5_SET(set_action_in, *action_ptr, data, 0); + *action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; + } else { + MLX5_SET(set_action_in, *action_ptr, action_type, MLX5_MODIFICATION_TYPE_SET); + MLX5_SET(set_action_in, *action_ptr, field, MLX5_MODI_OUT_SIPV6_127_96); + MLX5_SET(set_action_in, *action_ptr, data, 0); + *action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; + + MLX5_SET(set_action_in, *action_ptr, action_type, MLX5_MODIFICATION_TYPE_SET); + MLX5_SET(set_action_in, *action_ptr, field, MLX5_MODI_OUT_SIPV6_95_64); + MLX5_SET(set_action_in, *action_ptr, data, 0); + *action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; + + MLX5_SET(set_action_in, *action_ptr, action_type, MLX5_MODIFICATION_TYPE_SET); + MLX5_SET(set_action_in, *action_ptr, field, MLX5_MODI_OUT_SIPV6_63_32); + MLX5_SET(set_action_in, *action_ptr, data, 0); + *action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; + + MLX5_SET(set_action_in, *action_ptr, action_type, MLX5_MODIFICATION_TYPE_SET); + MLX5_SET(set_action_in, *action_ptr, field, MLX5_MODI_OUT_SIPV6_31_0); + MLX5_SET(set_action_in, *action_ptr, data, 0); + *action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; + + MLX5_SET(set_action_in, *action_ptr, action_type, MLX5_MODIFICATION_TYPE_SET); + MLX5_SET(set_action_in, *action_ptr, field, MLX5_MODI_OUT_DIPV6_127_96); + MLX5_SET(set_action_in, *action_ptr, data, 0); + *action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; + + MLX5_SET(set_action_in, *action_ptr, action_type, MLX5_MODIFICATION_TYPE_SET); + MLX5_SET(set_action_in, *action_ptr, field, MLX5_MODI_OUT_DIPV6_95_64); + MLX5_SET(set_action_in, *action_ptr, data, 0); + *action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; + + MLX5_SET(set_action_in, *action_ptr, action_type, MLX5_MODIFICATION_TYPE_SET); + MLX5_SET(set_action_in, *action_ptr, field, MLX5_MODI_OUT_DIPV6_63_32); + MLX5_SET(set_action_in, *action_ptr, data, 0); + *action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; + + MLX5_SET(set_action_in, *action_ptr, action_type, MLX5_MODIFICATION_TYPE_SET); + MLX5_SET(set_action_in, *action_ptr, field, MLX5_MODI_OUT_DIPV6_31_0); + MLX5_SET(set_action_in, *action_ptr, data, 0); + *action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; + } +} + static struct mlx5dr_action * mlx5dr_action_create_nat64_copy_state(struct mlx5dr_context *ctx, struct mlx5dr_action_nat64_attr *attr, @@ -329,17 +385,7 @@ mlx5dr_action_create_nat64_copy_state(struct mlx5dr_context *ctx, action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; /* set sip and dip to 0, in order to have new csum */ - if (is_v4_to_v6) { - MLX5_SET(set_action_in, action_ptr, action_type, MLX5_MODIFICATION_TYPE_SET); - MLX5_SET(set_action_in, action_ptr, field, MLX5_MODI_OUT_SIPV4); - MLX5_SET(set_action_in, action_ptr, data, 0); - action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; - - MLX5_SET(set_action_in, action_ptr, action_type, MLX5_MODIFICATION_TYPE_SET); - MLX5_SET(set_action_in, action_ptr, field, MLX5_MODI_OUT_DIPV4); - MLX5_SET(set_action_in, action_ptr, data, 0); - action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; - } + mlx5dr_action_create_nat64_zero_all_addr(&action_ptr, is_v4_to_v6); pat[0].data = modify_action_data; pat[0].sz = (action_ptr - (uint8_t *)modify_action_data); @@ -383,9 +429,14 @@ mlx5dr_action_create_nat64_repalce_state(struct mlx5dr_context *ctx, memcpy(address_prefix, nat64_well_known_pref, MLX5DR_ACTION_NAT64_HEADER_MINUS_ONE * sizeof(uint32_t)); } else { + /* In order to fix HW csum issue, make the prefix ready */ + uint32_t ipv4_pref[] = {0x0, 0xffba0000, 0x0, 0x0, 0x0}; + header_size_in_dw = MLX5DR_ACTION_NAT64_IPV4_HEADER; ip_ver = MLX5DR_ACTION_NAT64_IPV4_VER; eth_type = RTE_ETHER_TYPE_IPV4; + memcpy(address_prefix, ipv4_pref, + MLX5DR_ACTION_NAT64_IPV4_HEADER * sizeof(uint32_t)); } memset(modify_action_data, 0, sizeof(modify_action_data)); @@ -441,6 +492,46 @@ mlx5dr_action_create_nat64_repalce_state(struct mlx5dr_context *ctx, return action; } +static struct mlx5dr_action * +mlx5dr_action_create_nat64_copy_proto_state(struct mlx5dr_context *ctx, + struct mlx5dr_action_nat64_attr *attr, + uint32_t flags) +{ + __be64 modify_action_data[MLX5DR_ACTION_NAT64_MAX_MODIFY_ACTIONS]; + struct mlx5dr_action_mh_pattern pat[2]; + struct mlx5dr_action *action; + uint8_t *action_ptr; + + memset(modify_action_data, 0, sizeof(modify_action_data)); + action_ptr = (uint8_t *)modify_action_data; + + MLX5_SET(copy_action_in, action_ptr, action_type, MLX5_MODIFICATION_TYPE_COPY); + MLX5_SET(copy_action_in, action_ptr, src_field, + attr->registers[MLX5DR_ACTION_NAT64_REG_CONTROL]); + MLX5_SET(copy_action_in, action_ptr, dst_field, + MLX5_MODI_OUT_IP_PROTOCOL); + MLX5_SET(copy_action_in, action_ptr, src_offset, 16); + MLX5_SET(copy_action_in, action_ptr, dst_offset, 0); + MLX5_SET(copy_action_in, action_ptr, length, 8); + action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; + + MLX5_SET(copy_action_in, action_ptr, action_type, MLX5_MODIFICATION_TYPE_NOP); + action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; + + pat[0].data = modify_action_data; + pat[0].sz = action_ptr - (uint8_t *)modify_action_data; + + action = mlx5dr_action_create_modify_header_reparse(ctx, 1, pat, 0, flags, + MLX5DR_ACTION_STC_REPARSE_ON); + if (!action) { + DR_LOG(ERR, "Failed to create action: action_sz: %zu, flags: 0x%x\n", + pat[0].sz, flags); + return NULL; + } + + return action; +} + static struct mlx5dr_action * mlx5dr_action_create_nat64_copy_back_state(struct mlx5dr_context *ctx, struct mlx5dr_action_nat64_attr *attr, @@ -490,16 +581,6 @@ mlx5dr_action_create_nat64_copy_back_state(struct mlx5dr_context *ctx, MLX5_SET(copy_action_in, action_ptr, action_type, MLX5_MODIFICATION_TYPE_NOP); action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; - MLX5_SET(copy_action_in, action_ptr, action_type, MLX5_MODIFICATION_TYPE_COPY); - MLX5_SET(copy_action_in, action_ptr, src_field, - attr->registers[MLX5DR_ACTION_NAT64_REG_CONTROL]); - MLX5_SET(copy_action_in, action_ptr, dst_field, - MLX5_MODI_OUT_IP_PROTOCOL); - MLX5_SET(copy_action_in, action_ptr, src_offset, 16); - MLX5_SET(copy_action_in, action_ptr, dst_offset, 0); - MLX5_SET(copy_action_in, action_ptr, length, 8); - action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; - MLX5_SET(copy_action_in, action_ptr, action_type, MLX5_MODIFICATION_TYPE_NOP); action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; @@ -2051,7 +2132,7 @@ mlx5dr_action_create_modify_header_hws(struct mlx5dr_action *action, return rte_errno; } -static struct mlx5dr_action * +struct mlx5dr_action * mlx5dr_action_create_modify_header_reparse(struct mlx5dr_context *ctx, uint8_t num_of_patterns, struct mlx5dr_action_mh_pattern *patterns, @@ -2927,17 +3008,24 @@ mlx5dr_action_create_nat64(struct mlx5dr_context *ctx, DR_LOG(ERR, "Nat64 failed creating replace state"); goto free_copy; } + action->nat64.stages[MLX5DR_ACTION_NAT64_STAGE_COPY_PROTOCOL] = + mlx5dr_action_create_nat64_copy_proto_state(ctx, attr, flags); + if (!action->nat64.stages[MLX5DR_ACTION_NAT64_STAGE_COPY_PROTOCOL]) { + DR_LOG(ERR, "Nat64 failed creating copy protocol state"); + goto free_replace; + } action->nat64.stages[MLX5DR_ACTION_NAT64_STAGE_COPYBACK] = mlx5dr_action_create_nat64_copy_back_state(ctx, attr, flags); if (!action->nat64.stages[MLX5DR_ACTION_NAT64_STAGE_COPYBACK]) { DR_LOG(ERR, "Nat64 failed creating copyback state"); - goto free_replace; + goto free_copy_proto; } return action; - +free_copy_proto: + mlx5dr_action_destroy(action->nat64.stages[MLX5DR_ACTION_NAT64_STAGE_COPY_PROTOCOL]); free_replace: mlx5dr_action_destroy(action->nat64.stages[MLX5DR_ACTION_NAT64_STAGE_REPLACE]); free_copy: diff --git a/drivers/net/mlx5/hws/mlx5dr_action.h b/drivers/net/mlx5/hws/mlx5dr_action.h index 57e059a572..faea6bb1f4 100644 --- a/drivers/net/mlx5/hws/mlx5dr_action.h +++ b/drivers/net/mlx5/hws/mlx5dr_action.h @@ -11,9 +11,6 @@ /* Max number of internal subactions of ipv6_ext */ #define MLX5DR_ACTION_IPV6_EXT_MAX_SA 4 -/* Number of MH in NAT64 */ -#define MLX5DR_ACTION_NAT64_STAGES 3 - enum mlx5dr_action_stc_idx { MLX5DR_ACTION_STC_IDX_CTRL = 0, MLX5DR_ACTION_STC_IDX_HIT = 1, @@ -88,7 +85,10 @@ enum { enum mlx5dr_action_nat64_stages { MLX5DR_ACTION_NAT64_STAGE_COPY = 0, MLX5DR_ACTION_NAT64_STAGE_REPLACE = 1, - MLX5DR_ACTION_NAT64_STAGE_COPYBACK = 2, + MLX5DR_ACTION_NAT64_STAGE_COPY_PROTOCOL = 2, + MLX5DR_ACTION_NAT64_STAGE_COPYBACK = 3, + /* Number of MH in NAT64 */ + MLX5DR_ACTION_NAT64_STAGES = 4, }; /* Registers for keeping data from stage to stage */ @@ -256,6 +256,13 @@ int mlx5dr_action_alloc_single_stc(struct mlx5dr_context *ctx, void mlx5dr_action_free_single_stc(struct mlx5dr_context *ctx, uint32_t table_type, struct mlx5dr_pool_chunk *stc); +struct mlx5dr_action * +mlx5dr_action_create_modify_header_reparse(struct mlx5dr_context *ctx, + uint8_t num_of_patterns, + struct mlx5dr_action_mh_pattern *patterns, + uint32_t log_bulk_size, + uint32_t flags, uint32_t reparse); + static inline void mlx5dr_action_setter_default_single(struct mlx5dr_actions_apply_data *apply, From patchwork Sun Jul 7 10:25:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Itamar Gozlan X-Patchwork-Id: 142182 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 698B8455B6; Sun, 7 Jul 2024 12:26:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C28014270A; Sun, 7 Jul 2024 12:26:38 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2047.outbound.protection.outlook.com [40.107.92.47]) by mails.dpdk.org (Postfix) with ESMTP id F32A940654; Sun, 7 Jul 2024 12:26:36 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FgOO4JCGId97GrEYF/hVWl6rHeQEtiC6Pe4s239+ydPDqZOUbPLxrA5+50HF9uYnOruSJMy39acgTKo0BAyqTAkqaaP95gwrqjYCwHBmktF83OiOevI4LrBgbR8UIwx7qRXEKgtwxm4yEyryh3heAaS5dfdIT3OG3pt9xWkLORvW7TVrwR7ebq4tSLdP+POP5CC6vII41sJBx9Da6HD6wqXcPScynoj/+d89vKU+rJHD+4XZbHh0goJ5UmXnsQP6YRui+Gpp3vNuftaSKjQo+AB8pC8P0ayqdT65DQ55AsvrvYUpvVQ9fJZyhFXH7pBJT+PMTbJF0CrIxW4zqW3pxQ== 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=/JcZuVh+ROhGrYOwKcnnZuXzkxZiLTx8biBj+A0s2E8=; b=UUJDEhdk+K9S+V4KscQjBA345r1p3BQFa71YNmwOrfR6IUX9nujYaOCgEXraDFhLGHoL2cNXEGJ4nKCtcjhrshlbU3yqLLdckboxM4EZacW/AlxyptbVlsBnB2Q9olARMTS7IQY2eGnfW+LjdjWBZM7sU71Z69Hd0wmsCp9QrJJKYzTw1DXDUsXRYIyoiNwkLA+sOpGBLQ94u8jwxipyTRVEN/2kSiEODcsULSEiUgOLeUzta+3U08FRwCeQTcRcNb9oOj6m4oTcGdA49Bs8ooauRdMC3Om5b+ZYJfPrJzTcmGLEDfkA9wKA4H0ojaOJJygJ5qtY6KcYAme+azTuBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) 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=/JcZuVh+ROhGrYOwKcnnZuXzkxZiLTx8biBj+A0s2E8=; b=FGRQ2l5klPwbkSz4f1DC2ahe3KlzI5s7A0oSbtzPN/9wT/sN+whot1rIfegnaItYxGlQhuHjp/pclfiPm2FHwvZgvmkaBIqWviChmylb8mP2j0dfdooLSZWKCOOaCrcTPIzwRz7fc6udGhtq8UqaYjljQ4bYtFluxPwKZ8tnmaXmPDTDQ7Z/b2zsICpihXMxOjXNpe07nsg1D29lo3BV6Dhu0LJRxST7ZYOC8XIyslS8/CCcWyzK+LK3+rCW5FUp18W7KyBgBNwtB/hW0EPcu5uv4ej+8N9xsEiOZ+fvV97xZu+1Pnbcl+KT4/vNYP8EM9K5z6bG9gMYeIjjyGBnxQ== Received: from SA0PR11CA0210.namprd11.prod.outlook.com (2603:10b6:806:1bc::35) by MN2PR12MB4093.namprd12.prod.outlook.com (2603:10b6:208:198::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.34; Sun, 7 Jul 2024 10:26:33 +0000 Received: from SN1PEPF0002BA52.namprd03.prod.outlook.com (2603:10b6:806:1bc:cafe::41) by SA0PR11CA0210.outlook.office365.com (2603:10b6:806:1bc::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35 via Frontend Transport; Sun, 7 Jul 2024 10:26:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SN1PEPF0002BA52.mail.protection.outlook.com (10.167.242.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Sun, 7 Jul 2024 10:26:28 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 7 Jul 2024 03:26:20 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 7 Jul 2024 03:26:20 -0700 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4 via Frontend Transport; Sun, 7 Jul 2024 03:26:16 -0700 From: Itamar Gozlan To: , , , , , , , , Dariusz Sosnowski , Bing Zhao , Ori Kam , Matan Azrad CC: , Subject: [PATCH 10/10] net/mlx5/hws: fix NA64 copy TOS field instead of TTL Date: Sun, 7 Jul 2024 13:25:31 +0300 Message-ID: <20240707102532.2045942-10-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240707102532.2045942-1-igozlan@nvidia.com> References: <20240707102532.2045942-1-igozlan@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA52:EE_|MN2PR12MB4093:EE_ X-MS-Office365-Filtering-Correlation-Id: f832d92d-86fc-4c7d-5311-08dc9e6f430a X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|376014|36860700013|921020; X-Microsoft-Antispam-Message-Info: lsYxT199jHssh+KzuAmnpsUoA146eAy7xZrj4mglAM1wQLeQMqB28d6QKsDP23cNGoaGAvHC7HZ2oZWkZvbfYxk/k5ktRSWU4nbEpO35Hn/zhTDycpR9+xQuU/dgAAdUf+1t+ItFRDPjaOUiYW1WyYtUPMcRvxJJIK3bZlUcMb7L64vvlBSiyeh1m0P0e8enN8GICxs351ncOz00GeFN+zyYrqGYhU+AhV5tPBeQ2gU24WJUsP8xI7/8QdNbvBWrBrsqc5yv6nDPwdrPZDp4cGcd9qYHpONTT5Rp2Ry6M0tP7IrSmLwAvDtisn9h1otRYfLsAaimE9vNv2lVfDn/0SlIa3Tv8GP9gdesUZnaLqgvD8QzX+zV4dSJFr625Q/Gf4enpqYhgZLKf/Ik/sdmlkQPt6b3h27oahW+1imPqlbZAr3KITxrubbUI1eQ+UXw0BVrO4MSWLYU6IcKPiCixDPKvB76Gm4OmovZoRA3adMov96UZ3RWJbvZT1B4Ok5tr5M+jpezyo/98NMQnOf8UXqaRDmjQ8X6h6EnSYLOV8SKakd0x8y5fu/fNiNP+6fTl1kZAvYPuDKEPU4HKVkT16O4sjjIoPgu+L78j9tsgUQGm0qW/UgHOeLhZdBlHOZPGVQvlII+X9vLrnX3K8CNmpReLPIO2hyUbdu+C6EaAcwKcarVCK6I27yAmDOZuPcMQTHNG/AxMjsrXpGMW8rxzniXgy7VYlofq3D6R9IhnohXp/qIHpEXsp8lW8PeMTz741b9bTT1wFqNb5vup1e5loCNSlpD1e9CHQ4d7QiKhtZ0fA4Ke9mtEIHvba03qCGmkxpHGmuWM4eEvVMKd8AeRitWo8orW0DMZuyBezaWepUYostNI4p15WBaURJIm+ZvQ3kVjDgJzC98mmvIePOqAtrrPYRKkUv1KqbvhLlqGKjOaC2jPajjlY+xxsK5vzesYdzxfH7XiU/+9xPwDW7yqmNvAnDd01o2cUOT0BaYk5bpc4bvqaS2aRl8gNlUzvwGRuL1/gTztZx+i6/BIvkLSwe2J+dt403sV2wAb26/EAef8Ae/E87Glr42Vz+ZanPUopKHclYGRJ5cTJRYdCV2gMsZM1MiXTrBBPv0u+HnD1SNmlAEZJ4tnp2Sk8pxEiKa2yvQ4q/fRakvsbwntsy0EamNK7V3ipdxHJiNUG8+0lahhslZnpsch1Xo6MT8Ttw+Cr7hxXLAG9MmeFTl7aVko+fjPDMS9YehYnPJh3viWe5aaV04e0H8Le/cvjuEb5mIowz+SQ+P6Ae8COBsSTo3slF4BeKad0e27DBBL57gU/FTo3OrPtGUJGodrCd97opZjqwd3O7W+Ra0dxPvAUUDh+KC5gOuwCgk2KAaqrSeeljOgxnWqRsPta1HnXmx6fw/W5S5WUwJrs0GM6Hk+THypYfAaKfFowHhyoE6VJHfeW3aYl739UaLAJ5o8QM4usGxtqnE0U/S6dv6U9hy1uONBQ== X-Forefront-Antispam-Report: CIP:216.228.118.233; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge2.nvidia.com; CAT:NONE; SFS:(13230040)(82310400026)(1800799024)(376014)(36860700013)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2024 10:26:28.1826 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f832d92d-86fc-4c7d-5311-08dc9e6f430a X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.233]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002BA52.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4093 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Erez Shitrit We don't have enough registers to copy TTL and TOS, so we will set TTL to be the default value (64) and will copy TOS. Fixes: 06d969a8c5b8 ("net/mlx5/hws: support NAT64 flow action") Cc: erezsh@nvidia.com Cc: stable@dpdk.org Signed-off-by: Erez Shitrit Acked-by: Matan Azrad --- drivers/net/mlx5/hws/mlx5dr_action.c | 66 +++++++++++++++++++++++----- drivers/net/mlx5/hws/mlx5dr_action.h | 2 + 2 files changed, 56 insertions(+), 12 deletions(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c index 8d3d0033e5..8f6be37818 100644 --- a/drivers/net/mlx5/hws/mlx5dr_action.c +++ b/drivers/net/mlx5/hws/mlx5dr_action.c @@ -315,21 +315,27 @@ mlx5dr_action_create_nat64_copy_state(struct mlx5dr_context *ctx, struct mlx5dr_action *action; uint32_t packet_len_field; uint8_t *action_ptr; - uint32_t ttl_field; + uint32_t tos_field; + uint32_t tos_size; uint32_t src_addr; uint32_t dst_addr; bool is_v4_to_v6; + uint32_t ecn; is_v4_to_v6 = attr->flags & MLX5DR_ACTION_NAT64_V4_TO_V6; if (is_v4_to_v6) { packet_len_field = MLX5_MODI_OUT_IPV4_TOTAL_LEN; - ttl_field = MLX5_MODI_OUT_IPV4_TTL; + tos_field = MLX5_MODI_OUT_IP_DSCP; + tos_size = 6; + ecn = MLX5_MODI_OUT_IP_ECN; src_addr = MLX5_MODI_OUT_SIPV4; dst_addr = MLX5_MODI_OUT_DIPV4; } else { packet_len_field = MLX5_MODI_OUT_IPV6_PAYLOAD_LEN; - ttl_field = MLX5_MODI_OUT_IPV6_HOPLIMIT; + tos_field = MLX5_MODI_OUT_IPV6_TRAFFIC_CLASS; + tos_size = 8; + ecn = 0; src_addr = MLX5_MODI_OUT_SIPV6_31_0; dst_addr = MLX5_MODI_OUT_DIPV6_31_0; } @@ -352,7 +358,7 @@ mlx5dr_action_create_nat64_copy_state(struct mlx5dr_context *ctx, } /* | 8 bit - 8 bit - 16 bit | - * | ttl - protocol - packet-len | + * | TOS - protocol - packet-len | */ MLX5_SET(copy_action_in, action_ptr, action_type, MLX5_MODIFICATION_TYPE_COPY); MLX5_SET(copy_action_in, action_ptr, src_field, packet_len_field); @@ -377,12 +383,25 @@ mlx5dr_action_create_nat64_copy_state(struct mlx5dr_context *ctx, action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; MLX5_SET(copy_action_in, action_ptr, action_type, MLX5_MODIFICATION_TYPE_COPY); - MLX5_SET(copy_action_in, action_ptr, src_field, ttl_field); + MLX5_SET(copy_action_in, action_ptr, src_field, tos_field); MLX5_SET(copy_action_in, action_ptr, dst_field, attr->registers[MLX5DR_ACTION_NAT64_REG_CONTROL]); MLX5_SET(copy_action_in, action_ptr, dst_offset, 24); - MLX5_SET(copy_action_in, action_ptr, length, 8); + MLX5_SET(copy_action_in, action_ptr, length, tos_size); action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; + /* in ipv4 TOS = {dscp (6bits) - ecn (2bits) }*/ + if (ecn) { + MLX5_SET(copy_action_in, action_ptr, action_type, MLX5_MODIFICATION_TYPE_NOP); + action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; + + MLX5_SET(copy_action_in, action_ptr, action_type, MLX5_MODIFICATION_TYPE_COPY); + MLX5_SET(copy_action_in, action_ptr, src_field, ecn); + MLX5_SET(copy_action_in, action_ptr, dst_field, + attr->registers[MLX5DR_ACTION_NAT64_REG_CONTROL]); + MLX5_SET(copy_action_in, action_ptr, dst_offset, 24 + tos_size); + MLX5_SET(copy_action_in, action_ptr, length, MLX5DR_ACTION_NAT64_ECN_SIZE); + action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; + } /* set sip and dip to 0, in order to have new csum */ mlx5dr_action_create_nat64_zero_all_addr(&action_ptr, is_v4_to_v6); @@ -543,10 +562,13 @@ mlx5dr_action_create_nat64_copy_back_state(struct mlx5dr_context *ctx, uint32_t packet_len_field; uint32_t packet_len_add; uint8_t *action_ptr; + uint32_t tos_field; uint32_t ttl_field; + uint32_t tos_size; uint32_t src_addr; uint32_t dst_addr; bool is_v4_to_v6; + uint32_t ecn; is_v4_to_v6 = attr->flags & MLX5DR_ACTION_NAT64_V4_TO_V6; @@ -557,6 +579,9 @@ mlx5dr_action_create_nat64_copy_back_state(struct mlx5dr_context *ctx, ttl_field = MLX5_MODI_OUT_IPV6_HOPLIMIT; src_addr = MLX5_MODI_OUT_SIPV6_31_0; dst_addr = MLX5_MODI_OUT_DIPV6_31_0; + tos_field = MLX5_MODI_OUT_IPV6_TRAFFIC_CLASS; + tos_size = 8; + ecn = 0; } else { packet_len_field = MLX5_MODI_OUT_IPV4_TOTAL_LEN; /* ipv4 len is including 20 bytes of the header, so add 20 over ipv6 len */ @@ -564,6 +589,9 @@ mlx5dr_action_create_nat64_copy_back_state(struct mlx5dr_context *ctx, ttl_field = MLX5_MODI_OUT_IPV4_TTL; src_addr = MLX5_MODI_OUT_SIPV4; dst_addr = MLX5_MODI_OUT_DIPV4; + tos_field = MLX5_MODI_OUT_IP_DSCP; + tos_size = 6; + ecn = MLX5_MODI_OUT_IP_ECN; } memset(modify_action_data, 0, sizeof(modify_action_data)); @@ -578,20 +606,34 @@ mlx5dr_action_create_nat64_copy_back_state(struct mlx5dr_context *ctx, MLX5_SET(copy_action_in, action_ptr, length, 16); action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; - MLX5_SET(copy_action_in, action_ptr, action_type, MLX5_MODIFICATION_TYPE_NOP); - action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; - - MLX5_SET(copy_action_in, action_ptr, action_type, MLX5_MODIFICATION_TYPE_NOP); + MLX5_SET(set_action_in, action_ptr, action_type, MLX5_MODIFICATION_TYPE_SET); + MLX5_SET(set_action_in, action_ptr, field, ttl_field); + MLX5_SET(set_action_in, action_ptr, length, 8); + MLX5_SET(set_action_in, action_ptr, data, MLX5DR_ACTION_NAT64_TTL_DEFAULT_VAL); action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; + /* copy TOS */ MLX5_SET(copy_action_in, action_ptr, action_type, MLX5_MODIFICATION_TYPE_COPY); MLX5_SET(copy_action_in, action_ptr, src_field, attr->registers[MLX5DR_ACTION_NAT64_REG_CONTROL]); - MLX5_SET(copy_action_in, action_ptr, dst_field, ttl_field); + MLX5_SET(copy_action_in, action_ptr, dst_field, tos_field); MLX5_SET(copy_action_in, action_ptr, src_offset, 24); - MLX5_SET(copy_action_in, action_ptr, length, 8); + MLX5_SET(copy_action_in, action_ptr, length, tos_size); action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; + if (ecn) { + MLX5_SET(copy_action_in, action_ptr, action_type, MLX5_MODIFICATION_TYPE_NOP); + action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; + + MLX5_SET(copy_action_in, action_ptr, action_type, MLX5_MODIFICATION_TYPE_COPY); + MLX5_SET(copy_action_in, action_ptr, src_field, + attr->registers[MLX5DR_ACTION_NAT64_REG_CONTROL]); + MLX5_SET(copy_action_in, action_ptr, dst_field, ecn); + MLX5_SET(copy_action_in, action_ptr, src_offset, 24 + tos_size); + MLX5_SET(copy_action_in, action_ptr, length, MLX5DR_ACTION_NAT64_ECN_SIZE); + action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; + } + MLX5_SET(copy_action_in, action_ptr, action_type, MLX5_MODIFICATION_TYPE_NOP); action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; diff --git a/drivers/net/mlx5/hws/mlx5dr_action.h b/drivers/net/mlx5/hws/mlx5dr_action.h index faea6bb1f4..ba4ce55228 100644 --- a/drivers/net/mlx5/hws/mlx5dr_action.h +++ b/drivers/net/mlx5/hws/mlx5dr_action.h @@ -79,6 +79,8 @@ enum { MLX5DR_ACTION_NAT64_IPV4_HEADER = 5, MLX5DR_ACTION_NAT64_IPV6_VER = 0x60000000, MLX5DR_ACTION_NAT64_IPV4_VER = 0x45000000, + MLX5DR_ACTION_NAT64_TTL_DEFAULT_VAL = 64, + MLX5DR_ACTION_NAT64_ECN_SIZE = 2, }; /* 3 stages for the nat64 action */