From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 48C324415C; Wed, 5 Jun 2024 11:32:28 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 32A5F40A82; Wed, 5 Jun 2024 11:32:28 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2069.outbound.protection.outlook.com [40.107.100.69]) by mails.dpdk.org (Postfix) with ESMTP id 198FF40A80 for ; Wed, 5 Jun 2024 11:32:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mK0DLt1Me9O4b0w13Z+1Mdwm5D1eY4CEcMWSy9FcUd3Ui0COf/mmvLBS5lNmNtYWSBrokr3jWTRw1c5PfuJKfF6AIchZfd+beAHCRJxI5JJk0XAU5JFcVWtuOx6BhV45c8DyAWclewrRYEQYu0p5bCjFrJ58odk76Y/y+EQpV0V/aHvOi/oDepg5K47n104RJF8/LKbzv6BUpKk+Br0XNqGAhNaUHCz0hR042NjyPpqk/bpHQjAdX8DkopHoKtYxvF42QHDrJ2FKpG9Pp7de+tW1vMg8puisMJ6F6S9DFAZn8EF4OJBIzEgvkMmROoaCp/ztQE0HCpBxpPs5U3g4OA== 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=DtqdLK138XQLej4LfCpsF37yTsf5XKpWeHW0MKsrV9M=; b=MEHwdguLYmW7J5pEjXbJ8DZqIqS7e+Zi9C2TtApvmvG94sJszM35CBjb2z/ekTINo/SS8SY8ictoOMujVDR7bR6+EfGIbUa1xW3YyZo7BYYS38tOs8POGfftaTE9rbU8qd+k7MhAwZOnonMbWoC+zb5hocXDmrlxt1hVmTDDc2IXI+Psez9OWX6/GJBPqfGMJvG0ykqt5TqzInMeQfLsXyOYJIvs2T6NxG2wYHVgf4hN5Owkb3DtdnhX+xdGRzN6Pc/VclC3nfOIYJZ0tQiZlcl2/S0JDODYzWci/cc9b6mKcK4OdYmqYl0nEHNKFQBjPw43hmpTmMBPj9wxKge4SQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org 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=DtqdLK138XQLej4LfCpsF37yTsf5XKpWeHW0MKsrV9M=; b=GbTil7+oqPW93CG46/nfyfGWxdhe+h+jDnGeWObtfdae+VRXxx0wo9aXWIYuBZbz1pPZ4KOFvSt/isamFeIDTO+icmEJ0r4GxuNuxmRgjQ0OCgQJ7ogIX9gCsyttiia/zOSVA6b8D84unvVWzrzjdEIs4ZIoova0ClitrHi+Fl/Lpxtpk0e7ogIZS7IGrecQrPrFBzVJ5OZuFl2QxhmjU5PpnY2o/CJM+PU0nn69/r+hNOa2ZLJeWrmB8DwuWju9ZB1eOcUIGAqoPvwGIKEuySG42LZXbIp4TYG23Yi/wxZ31REiSrXT0z3660xLbIafJiriQVJJkoHKhiEU5HCXgA== Received: from SJ2PR07CA0013.namprd07.prod.outlook.com (2603:10b6:a03:505::15) by MN0PR12MB5715.namprd12.prod.outlook.com (2603:10b6:208:372::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Wed, 5 Jun 2024 09:32:22 +0000 Received: from CY4PEPF0000EDD0.namprd03.prod.outlook.com (2603:10b6:a03:505:cafe::7a) by SJ2PR07CA0013.outlook.office365.com (2603:10b6:a03:505::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.30 via Frontend Transport; Wed, 5 Jun 2024 09:32:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CY4PEPF0000EDD0.mail.protection.outlook.com (10.167.241.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Wed, 5 Jun 2024 09:32:21 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 5 Jun 2024 02:31:56 -0700 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 5 Jun 2024 02:31:54 -0700 From: Suanming Mou To: Dariusz Sosnowski , Viacheslav Ovsiienko , Ori Kam , Matan Azrad CC: , Subject: [PATCH v2 1/3] net/mlx5: add match with Tx queue item Date: Wed, 5 Jun 2024 17:31:39 +0800 Message-ID: <20240605093141.1826221-1-suanmingm@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240531035034.1731943-1-suanmingm@nvidia.com> References: <20240531035034.1731943-1-suanmingm@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EDD0:EE_|MN0PR12MB5715:EE_ X-MS-Office365-Filtering-Correlation-Id: 3f762baa-a133-4d55-581e-08dc854266c1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|1800799015|82310400017|376005|36860700004; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?anjq11REqgBnyw5xr8pmLaBp3hGC2HMC+sTnfXUu85KwPtVip6P6UYVDY2He?= =?us-ascii?Q?dsskzuQhXtScGry2hfhW4ykAhHnPe6K4H7sEG4SfEUHu7oetqaWyo7YQxUFM?= =?us-ascii?Q?fTpmFjJzMozlxQwT+Y+M0tWk3qLN6ZUgfB80pXlm4YdxBRYEQI3i/7eTPqa0?= =?us-ascii?Q?uyKCKHh9PvdFPBFV6MTjwQZWPYXBvs2nrRxYOf85Fu132lzdnghjQWllDpwm?= =?us-ascii?Q?kRk9BMa1XgXh4Fokk96TfqJsg+6Wn7Bf1VAL2nQyVN+mhmK2O9utgMm0a92j?= =?us-ascii?Q?mKzIVbJACY1whhjaIcDDDmfbL3s5HaRlIDbywb9Va7ic4udERNdIU16w8iKk?= =?us-ascii?Q?ittwN3gG58m9DdQyzngwZ1vNwDP/S9SA/H0gqoa6iRHYmEWPIw5lT+x6ld3e?= =?us-ascii?Q?u1VoC898b21RBk8UrIYf3gUayk3JFiesBu4XEHYHU6IpuubLcGqqsHx+nrDY?= =?us-ascii?Q?GvjOm6v3DcfaWXsTajEHZpe7FpHoP9hQU+sW3whE0nBwynArT1jp94cJqFJ/?= =?us-ascii?Q?vKBODDeBtOD0L0KHPgI9imWTQeeOvzrdYVMZzZONZgs+QxwGlH1U5LRrVBco?= =?us-ascii?Q?W76oepi11Gl/6d4W7FqdS25qu0M72P4S7LhZmwR0nxtfaDX2AAW2SmrvKuFY?= =?us-ascii?Q?Lk6GOarZGakv7ra+ccxiyuR2rObp9AZ5Sx51a4ke+CwHNfmmPFH3VtclVGOL?= =?us-ascii?Q?5K4dQ6075UmUMXjDn5s7ZTD59A2s9S+76Y7Xfo/spvXDxJIF3wGqGGFFqA5I?= =?us-ascii?Q?e3xhbPmRmMdxn+rDY52SjGk4qiHPTr1j2gKUCoBYHLlu01BEk+C2gnJUQ3rR?= =?us-ascii?Q?YiAkXU6+n0j9CYhgfe/cQbkn9JT0AcuJ3zp1WBAmZkZMh6b7xsxy1Hb/HWXp?= =?us-ascii?Q?u+ifbsAA3z4bWffH4nMQhwjaa/w8c6Fvnbn2GTNqZ8RIU8LJqx0g4yc6Ia8F?= =?us-ascii?Q?fL42welvJFZPf6IzPZel3xV5yKWekGFL+WPFLhva5FvF4CLJtUgbchk8x8zl?= =?us-ascii?Q?GGFo8ehe0H14O/+m6Oc0OfDfCrMB6/SLUeaghhemNyyai+Ako52on1sgOete?= =?us-ascii?Q?uC1shRGzweSTFDn3uhkY9AcuOBx2m9A6H6yGfjpxNgieMIZmzfgPFCVwEfSS?= =?us-ascii?Q?ypNS13wYHZt1A4BAIcrlrGiqWi49V8v8P+GVbOYEqybuM9ZW5rsMSaSxZTmG?= =?us-ascii?Q?lqN/ZqqhTpcERfBStkvUXadbZZ7sKULJJC5mqTksUlAIGZ8/65Xkw2NMmoFa?= =?us-ascii?Q?cYPv57BMP7dA/kSMAkV4xX/Qup0wCUMENjHETGvxg3hv2Y2eHj58VXdvz1pd?= =?us-ascii?Q?TNd4GqPwmtB/zk7BorvRl4LatK21XrP+lJW5d1gazcJVEclhiVtZAGkfPiHS?= =?us-ascii?Q?nvZ+LetclTOFRcf0EEGcMzpZSIsn?= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230031)(1800799015)(82310400017)(376005)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2024 09:32:21.6488 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3f762baa-a133-4d55-581e-08dc854266c1 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EDD0.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5715 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 With the item RTE_FLOW_ITEM_TYPE_TX_QUEUE, user will be able to set the Tx queue index and create flow match with that queue index. This commit adds match with RTE_FLOW_ITEM_TX_QUEUE item. Signed-off-by: Suanming Mou Acked-by: Dariusz Sosnowski --- doc/guides/nics/features/mlx5.ini | 1 + doc/guides/rel_notes/release_24_07.rst | 4 ++ drivers/net/mlx5/hws/mlx5dr_definer.c | 50 +++++++++++++++++++ drivers/net/mlx5/mlx5_flow.h | 58 ++++++++++++++++++++++ drivers/net/mlx5/mlx5_flow_dv.c | 69 ++++++++++++++++++++++++++ drivers/net/mlx5/mlx5_flow_hw.c | 1 + 6 files changed, 183 insertions(+) diff --git a/doc/guides/nics/features/mlx5.ini b/doc/guides/nics/features/mlx5.ini index 81a7067cc3..056e04275b 100644 --- a/doc/guides/nics/features/mlx5.ini +++ b/doc/guides/nics/features/mlx5.ini @@ -92,6 +92,7 @@ quota = Y random = Y tag = Y tcp = Y +tx_queue = Y udp = Y vlan = Y vxlan = Y diff --git a/doc/guides/rel_notes/release_24_07.rst b/doc/guides/rel_notes/release_24_07.rst index ffbe9ce051..46efc04eac 100644 --- a/doc/guides/rel_notes/release_24_07.rst +++ b/doc/guides/rel_notes/release_24_07.rst @@ -81,6 +81,10 @@ New Features * Added SSE/NEON vector datapath. +* **Updated NVIDIA mlx5 driver.** + + * Added match with Tx queue. + Removed Items ------------- diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c index dabfac8abc..bc128c7b99 100644 --- a/drivers/net/mlx5/hws/mlx5dr_definer.c +++ b/drivers/net/mlx5/hws/mlx5dr_definer.c @@ -6,6 +6,7 @@ #define GTP_PDU_SC 0x85 #define BAD_PORT 0xBAD +#define BAD_SQN 0xBAD #define ETH_TYPE_IPV4_VXLAN 0x0800 #define ETH_TYPE_IPV6_VXLAN 0x86DD #define UDP_VXLAN_PORT 4789 @@ -878,6 +879,22 @@ mlx5dr_definer_vxlan_gpe_rsvd0_set(struct mlx5dr_definer_fc *fc, DR_SET(tag, rsvd0, fc->byte_off, fc->bit_off, fc->bit_mask); } +static void +mlx5dr_definer_tx_queue_set(struct mlx5dr_definer_fc *fc, + const void *item_spec, + uint8_t *tag) +{ + const struct rte_flow_item_tx_queue *v = item_spec; + uint32_t sqn = 0; + int ret; + + ret = flow_hw_conv_sqn(fc->extra_data, v->tx_queue, &sqn); + if (unlikely(ret)) + sqn = BAD_SQN; + + DR_SET(tag, sqn, fc->byte_off, fc->bit_off, fc->bit_mask); +} + static int mlx5dr_definer_conv_item_eth(struct mlx5dr_definer_conv_data *cd, struct rte_flow_item *item, @@ -1850,6 +1867,35 @@ mlx5dr_definer_conv_item_metadata(struct mlx5dr_definer_conv_data *cd, return 0; } +static int +mlx5dr_definer_conv_item_tx_queue(struct mlx5dr_definer_conv_data *cd, + struct rte_flow_item *item, + int item_idx) +{ + const struct rte_flow_item_tx_queue *m = item->mask; + struct mlx5dr_definer_fc *fc; + + if (!m) + return 0; + + if (m->tx_queue) { + fc = &cd->fc[MLX5DR_DEFINER_FNAME_SOURCE_QP]; + fc->item_idx = item_idx; + fc->tag_mask_set = &mlx5dr_definer_ones_set; + fc->tag_set = &mlx5dr_definer_tx_queue_set; + /* User extra_data to save DPDK port_id. */ + fc->extra_data = flow_hw_get_port_id(cd->ctx); + if (fc->extra_data == UINT16_MAX) { + DR_LOG(ERR, "Invalid port for item tx_queue"); + rte_errno = EINVAL; + return rte_errno; + } + DR_CALC_SET_HDR(fc, source_qp_gvmi, source_qp); + } + + return 0; +} + static int mlx5dr_definer_conv_item_sq(struct mlx5dr_definer_conv_data *cd, struct rte_flow_item *item, @@ -3150,6 +3196,10 @@ mlx5dr_definer_conv_items_to_hl(struct mlx5dr_context *ctx, ret = mlx5dr_definer_conv_item_vxlan(&cd, items, i); item_flags |= MLX5_FLOW_LAYER_VXLAN; break; + case RTE_FLOW_ITEM_TYPE_TX_QUEUE: + ret = mlx5dr_definer_conv_item_tx_queue(&cd, items, i); + item_flags |= MLX5_FLOW_ITEM_SQ; + break; case MLX5_RTE_FLOW_ITEM_TYPE_SQ: ret = mlx5dr_definer_conv_item_sq(&cd, items, i); item_flags |= MLX5_FLOW_ITEM_SQ; diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index dd5b30a8a4..357267e0c3 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -19,6 +19,7 @@ #include "mlx5.h" #include "rte_pmd_mlx5.h" #include "hws/mlx5dr.h" +#include "mlx5_tx.h" /* E-Switch Manager port, used for rte_flow_item_port_id. */ #define MLX5_PORT_ESW_MGR UINT32_MAX @@ -1945,6 +1946,63 @@ struct flow_hw_port_info { extern struct flow_hw_port_info mlx5_flow_hw_port_infos[RTE_MAX_ETHPORTS]; +/* + * Get sqn for given tx_queue. + * Used in HWS rule creation. + */ +static __rte_always_inline int +flow_hw_get_sqn(struct rte_eth_dev *dev, uint16_t tx_queue, uint32_t *sqn) +{ + struct mlx5_txq_ctrl *txq; + + /* Means Tx queue is PF0. */ + if (tx_queue == UINT16_MAX) { + *sqn = 0; + return 0; + } + txq = mlx5_txq_get(dev, tx_queue); + if (unlikely(!txq)) + return -ENOENT; + *sqn = mlx5_txq_get_sqn(txq); + mlx5_txq_release(dev, tx_queue); + return 0; +} + +/* + * Convert sqn for given rte_eth_dev port. + * Used in HWS rule creation. + */ +static __rte_always_inline int +flow_hw_conv_sqn(uint16_t port_id, uint16_t tx_queue, uint32_t *sqn) +{ + if (port_id >= RTE_MAX_ETHPORTS) + return -EINVAL; + return flow_hw_get_sqn(&rte_eth_devices[port_id], tx_queue, sqn); +} + +/* + * Get given rte_eth_dev port_id. + * Used in HWS rule creation. + */ +static __rte_always_inline uint16_t +flow_hw_get_port_id(void *dr_ctx) +{ +#if defined(HAVE_IBV_FLOW_DV_SUPPORT) || !defined(HAVE_INFINIBAND_VERBS_H) + uint16_t port_id; + + MLX5_ETH_FOREACH_DEV(port_id, NULL) { + struct mlx5_priv *priv; + + priv = rte_eth_devices[port_id].data->dev_private; + if (priv->dr_ctx == dr_ctx) + return port_id; + } +#else + RTE_SET_USED(dr_ctx); +#endif + return UINT16_MAX; +} + /* * Get metadata match tag and mask for given rte_eth_dev port. * Used in HWS rule creation. diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 06f5427abf..14cdd4468d 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -8025,6 +8025,7 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, return ret; last_item = MLX5_FLOW_ITEM_TAG; break; + case RTE_FLOW_ITEM_TYPE_TX_QUEUE: case MLX5_RTE_FLOW_ITEM_TYPE_SQ: last_item = MLX5_FLOW_ITEM_SQ; break; @@ -12199,6 +12200,52 @@ flow_dv_translate_create_counter(struct rte_eth_dev *dev, return counter; } +/** + * Add Tx queue matcher + * + * @param[in] dev + * Pointer to rte_eth_dev structure. + * @param[in, out] key + * Flow matcher value. + * @param[in] item + * Flow pattern to translate. + * @param[in] key_type + * Set flow matcher mask or value. + * + * @return + * 0 on success otherwise -errno and errno is set. + */ +static int +flow_dv_translate_item_tx_queue(struct rte_eth_dev *dev, void *key, + const struct rte_flow_item *item, uint32_t key_type) +{ + const struct rte_flow_item_tx_queue *queue_m; + const struct rte_flow_item_tx_queue *queue_v; + void *misc_v = MLX5_ADDR_OF(fte_match_param, key, misc_parameters); + uint32_t tx_queue; + uint32_t sqn = 0; + int ret; + + MLX5_ITEM_UPDATE(item, key_type, queue_v, queue_m, &rte_flow_item_tx_queue_mask); + if (!queue_m || !queue_v) + return -EINVAL; + if (key_type & MLX5_SET_MATCHER_V) { + tx_queue = queue_v->tx_queue; + if (key_type == MLX5_SET_MATCHER_SW_V) + tx_queue &= queue_m->tx_queue; + ret = flow_hw_get_sqn(dev, tx_queue, &sqn); + if (unlikely(ret)) + return -ret; + } else { + /* Due to tx_queue to sqn converting, only fully masked value support. */ + if (queue_m->tx_queue != rte_flow_item_tx_queue_mask.tx_queue) + return -EINVAL; + sqn = UINT32_MAX; + } + MLX5_SET(fte_match_set_misc, misc_v, source_sqn, sqn); + return 0; +} + /** * Add SQ matcher * @@ -14169,6 +14216,14 @@ flow_dv_translate_items(struct rte_eth_dev *dev, flow_dv_translate_mlx5_item_tag(dev, key, items, key_type); last_item = MLX5_FLOW_ITEM_TAG; break; + case RTE_FLOW_ITEM_TYPE_TX_QUEUE: + ret = flow_dv_translate_item_tx_queue(dev, key, items, key_type); + if (ret) + return rte_flow_error_set(error, -ret, + RTE_FLOW_ERROR_TYPE_ITEM, NULL, + "invalid tx_queue item"); + last_item = MLX5_FLOW_ITEM_SQ; + break; case MLX5_RTE_FLOW_ITEM_TYPE_SQ: flow_dv_translate_item_sq(key, items, key_type); last_item = MLX5_FLOW_ITEM_SQ; @@ -14399,6 +14454,20 @@ flow_dv_translate_items_sws(struct rte_eth_dev *dev, wks.last_item = tunnel ? MLX5_FLOW_ITEM_INNER_FLEX : MLX5_FLOW_ITEM_OUTER_FLEX; break; + case RTE_FLOW_ITEM_TYPE_TX_QUEUE: + ret = flow_dv_translate_item_tx_queue(dev, match_value, items, + MLX5_SET_MATCHER_SW_V); + if (ret) + return rte_flow_error_set(error, -ret, + RTE_FLOW_ERROR_TYPE_ITEM, NULL, + "invalid tx_queue item spec"); + ret = flow_dv_translate_item_tx_queue(dev, match_mask, items, + MLX5_SET_MATCHER_SW_M); + if (ret) + return rte_flow_error_set(error, -ret, + RTE_FLOW_ERROR_TYPE_ITEM, NULL, + "invalid tx_queue item mask"); + break; case MLX5_RTE_FLOW_ITEM_TYPE_SQ: flow_dv_translate_item_sq(match_value, items, MLX5_SET_MATCHER_SW_V); diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index 63194935a3..cf698b3ec8 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -8018,6 +8018,7 @@ flow_hw_pattern_validate(struct rte_eth_dev *dev, case RTE_FLOW_ITEM_TYPE_MPLS: case RTE_FLOW_ITEM_TYPE_GENEVE: case MLX5_RTE_FLOW_ITEM_TYPE_SQ: + case RTE_FLOW_ITEM_TYPE_TX_QUEUE: case RTE_FLOW_ITEM_TYPE_GRE: case RTE_FLOW_ITEM_TYPE_GRE_KEY: case RTE_FLOW_ITEM_TYPE_GRE_OPTION: -- 2.34.1