get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/137508/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 137508,
    "url": "http://patches.dpdk.org/api/patches/137508/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20240229160505.630586-2-getelson@nvidia.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20240229160505.630586-2-getelson@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240229160505.630586-2-getelson@nvidia.com",
    "date": "2024-02-29T16:05:03",
    "name": "[1/2] net/mlx5: remove code duplications",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "5355c1d96f4d23bcf51d8d56d90ec0ac67f30581",
    "submitter": {
        "id": 1882,
        "url": "http://patches.dpdk.org/api/people/1882/?format=api",
        "name": "Gregory Etelson",
        "email": "getelson@nvidia.com"
    },
    "delegate": {
        "id": 3268,
        "url": "http://patches.dpdk.org/api/users/3268/?format=api",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": "rasland@nvidia.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20240229160505.630586-2-getelson@nvidia.com/mbox/",
    "series": [
        {
            "id": 31303,
            "url": "http://patches.dpdk.org/api/series/31303/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31303",
            "date": "2024-02-29T16:05:02",
            "name": "fix IP-in-IP tunnels recognition",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/31303/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/137508/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/137508/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "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])\n\tby inbox.dpdk.org (Postfix) with ESMTP id C8FFC43C3B;\n\tThu, 29 Feb 2024 17:06:06 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id BC13B42DFB;\n\tThu, 29 Feb 2024 17:06:06 +0100 (CET)",
            "from NAM12-BN8-obe.outbound.protection.outlook.com\n (mail-bn8nam12on2048.outbound.protection.outlook.com [40.107.237.48])\n by mails.dpdk.org (Postfix) with ESMTP id 35DAE42E1A;\n Thu, 29 Feb 2024 17:05:59 +0100 (CET)",
            "from BN9PR03CA0059.namprd03.prod.outlook.com (2603:10b6:408:fb::34)\n by DS0PR12MB9424.namprd12.prod.outlook.com (2603:10b6:8:1b4::6) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.41; Thu, 29 Feb\n 2024 16:05:56 +0000",
            "from BN3PEPF0000B072.namprd04.prod.outlook.com\n (2603:10b6:408:fb:cafe::e6) by BN9PR03CA0059.outlook.office365.com\n (2603:10b6:408:fb::34) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.32 via Frontend\n Transport; Thu, 29 Feb 2024 16:05:56 +0000",
            "from mail.nvidia.com (216.228.117.160) by\n BN3PEPF0000B072.mail.protection.outlook.com (10.167.243.117) with Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.7292.25 via Frontend Transport; Thu, 29 Feb 2024 16:05:55 +0000",
            "from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com\n (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 29 Feb\n 2024 08:05:26 -0800",
            "from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com\n (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Thu, 29 Feb\n 2024 08:05:22 -0800"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=JT8gMVAMw1lmkZo4vMRuO0R8xQADNelyZPp/TtnkYm/JU2/Bu5ObMDGW4fEFV6K4GXAzpH7dwVSqlKceOhEzqxt9ksDOKCdWgkE29CSWroIux0RYgAl6Pc3Cu8VED9oF+24mRiNesQq4VOAVluPo0E0stXld2szwVspj6xVdSW/tS1ukpN3hRL+kuSbZnriso1b1uDv1dEDSo5WWFtjcBtJO+lhDfB+aldlan2mV2Rls+oXR5tjiXrJQX3SPwcs8uOCpCwT7cMS7O+G5YP6xPHONVUkfZO39zf86QO+kqLFWJo4fr2rgnrbH2mHYdE6NvJT//SIC4FoMJHcPbACjCw==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n 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;\n bh=hLndn30o/GsF1QL6j0COKOFtpdURgO11dUs3jEQcVt4=;\n b=Lj/AANqA3SmFqP5ytdYGYhFCuMzd1G9Tta0JmohgwIGB795AZb9RSly22q29A0NJe77LCRBu7tYw2IjaXuZGrhi6X3KCIdpRAK7snG/zuqYrbYV6ceKyyS0Rvw7+ddya+pUv27GGXyYP8RZxKjpL5NVne8iHsCVdVx8SHY9uzGbFN++qkAkZ1c5dWEHzZSxuJBDBPt3L77iBV2RzmvrXBdpjpFAcg/pX49gW4r4H5UQqhcsZ2FoAIBrS3g+ELhIH8lXLtWT/4T1xpgYeYtEYejrU4cdkTytDuCu7bksv5GDEY+tQiy6hjpvujD4Cpow+JOXo9TTW7OuuqpbdvCfNHQ==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 216.228.117.160) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com;\n dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com;\n dkim=none (message not signed); arc=none (0)",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;\n s=selector2;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=hLndn30o/GsF1QL6j0COKOFtpdURgO11dUs3jEQcVt4=;\n b=UwCeOLcj66veCuhHGeg0ljN6EXwDDxLLssWFixkc3ag11zWt7ZTWLNi+7LuGU9BKJvwjsDSp8zq2Aa9EoMw95MOK0rUqJt8wbz9MWd3a7dGHVFDBxJVzRoX045D6OXJ8eFv/IQLh2vQ87rAiH1TusBPhBD8K1xblzBvLv7RweJub1+B2+/jkesbBF9541ji2bphhmmVnfP0NciBlmOwkU31mVXT3KzT0M/6pNIiaFcr2X3WQLFGXuZxBnF4CFhIIZgJo7jR6wlznvoSO+UZ/0Uvlr9I8vA+11eIqHyu0SEqKgfBTSuBKjl+Dj1FgOaAxDgvRIw3CRRqiWK37R+U7rw==",
        "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 216.228.117.160)\n smtp.mailfrom=nvidia.com;\n dkim=none (message not signed)\n header.d=none;dmarc=pass action=none header.from=nvidia.com;",
        "Received-SPF": "Pass (protection.outlook.com: domain of nvidia.com designates\n 216.228.117.160 as permitted sender) receiver=protection.outlook.com;\n client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C",
        "From": "Gregory Etelson <getelson@nvidia.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<getelson@nvidia.com>, <mkashani@nvidia.com>, <rasland@nvidia.com>,\n <stable@dpdk.org>, Ori Kam <orika@nvidia.com>, Dariusz Sosnowski\n <dsosnowski@nvidia.com>, Viacheslav Ovsiienko <viacheslavo@nvidia.com>,\n Suanming Mou <suanmingm@nvidia.com>, Matan Azrad <matan@nvidia.com>,\n \"Yongseok Koh\" <yskoh@mellanox.com>, Shahaf Shuler <shahafs@nvidia.com>",
        "Subject": "[PATCH 1/2] net/mlx5: remove code duplications",
        "Date": "Thu, 29 Feb 2024 18:05:03 +0200",
        "Message-ID": "<20240229160505.630586-2-getelson@nvidia.com>",
        "X-Mailer": "git-send-email 2.39.2",
        "In-Reply-To": "<20240229160505.630586-1-getelson@nvidia.com>",
        "References": "<20240229160505.630586-1-getelson@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\n rnnvmail201.nvidia.com (10.129.68.8)",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-TrafficTypeDiagnostic": "BN3PEPF0000B072:EE_|DS0PR12MB9424:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "1e9aa168-aa68-4153-57be-08dc39404fd3",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n 6qeAbCDKOXONNU6XjgziHP1G9slnv6EZq4TRBGOIRqVQsUsLs5s6Tx0lspT9Mb57h51A0Q/5lz3QhWst3uzQmyJY7nYThzFanag9BBYxuZo+3UIb2KGLlawCBKiUo7ku7ciwmB3iFNWUVLaKIxQQEJQACmkf0T5gIEGkQv1azBWk5J3UD7d74PcpaEe2YlhtTnSTzVJ5EuU1PE31S8b9+EKF2KinJXu/3SSiQIyQyNZlVzLtSQFYWSUEDQIYSw0BDGMvRzhvOnLab2E678hOmubLcXTlRYgVYR2m6hPwjGKBYzvWKtTuS01qfhlM3DUNq2R6DI2i9ttb0eWV3l65DkQzlWdeYIK7p+vjdFZ+Yv3+fsAknCelmOIASkSb8rarocvpqBDUvN3/OTa/14/AiWQj+AFzYlV7/IqlB3u9yv1z2RhaVLGwMo/aYMRvVfpYQAWlm8DCIDxKPUIICceA1s1G67cM+4BXDCd+7SvC5t28g2Y9cp8WpnLGcV6eIdAlmGoZKaVwR4fS9ATJL2Lyz4JnvM7C96hHkVvBxYia6WPsilA5cQQB+/QxFCB8N5YT7pvvHKe+/2x4/FzicuIl2K0xfonmI5Jfhrfbm5GqWs948SLO00z+vB1i9W/iWEkZg/mf3cDfOlAteGr0MFuKF6Pw1QQ+TfIZD0fbVIaA3ygVnAl1YTgpOoA91xfTkO78/vCyKls3QYWdPySHNo79TyMhim5xfXdUEy4WJX+2Jx6cQ+R2SSu/OmeiQSj6JnIL",
        "X-Forefront-Antispam-Report": "CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1;\n SRV:;\n IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE;\n SFS:(13230031)(36860700004)(82310400014); DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "Nvidia.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "29 Feb 2024 16:05:55.7833 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 1e9aa168-aa68-4153-57be-08dc39404fd3",
        "X-MS-Exchange-CrossTenant-Id": "43083d15-7273-40c1-b7db-39efd9ccc17a",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160];\n Helo=[mail.nvidia.com]",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n BN3PEPF0000B072.namprd04.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "DS0PR12MB9424",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "Remove code duplications in DV L3 items validation translation.\n\nFixes: 3193c2494eea (\"net/mlx5: fix L4 protocol validation\")\n\nCc: stable@dpdk.org\n\nSigned-off-by: Gregory Etelson <getelson@nvidia.com>\nAcked-by: Ori Kam <orika@nvidia.com>\n---\n drivers/net/mlx5/mlx5_flow_dv.c | 151 +++++++++-----------------------\n 1 file changed, 43 insertions(+), 108 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex 18f09b22be..fe0a06f364 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -7488,6 +7488,40 @@ flow_dv_validate_item_flex(struct rte_eth_dev *dev,\n \treturn 0;\n }\n \n+static __rte_always_inline uint8_t\n+mlx5_flow_l3_next_protocol(const struct rte_flow_item *l3_item,\n+\t\t\t   enum MLX5_SET_MATCHER key_type)\n+{\n+#define MLX5_L3_NEXT_PROTOCOL(i, ms)                                            \\\n+\t((i)->type == RTE_FLOW_ITEM_TYPE_IPV4 ?                                  \\\n+\t((const struct rte_flow_item_ipv4 *)(i)->ms)->hdr.next_proto_id :       \\\n+\t(i)->type == RTE_FLOW_ITEM_TYPE_IPV6 ?                                  \\\n+\t((const struct rte_flow_item_ipv6 *)(i)->ms)->hdr.proto :               \\\n+\t(i)->type == RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT ?                         \\\n+\t((const struct rte_flow_item_ipv6_frag_ext *)(i)->ms)->hdr.next_header :\\\n+\t0xff)\n+\n+\tuint8_t next_protocol;\n+\n+\tif (l3_item->mask != NULL && l3_item->spec != NULL) {\n+\t\tnext_protocol = MLX5_L3_NEXT_PROTOCOL(l3_item, spec);\n+\t\tif (next_protocol)\n+\t\t\tnext_protocol &= MLX5_L3_NEXT_PROTOCOL(l3_item, mask);\n+\t\telse\n+\t\t\tnext_protocol = 0xff;\n+\t} else if (key_type == MLX5_SET_MATCHER_HS_M && l3_item->mask != NULL) {\n+\t\tnext_protocol =  MLX5_L3_NEXT_PROTOCOL(l3_item, mask);\n+\t} else if (key_type == MLX5_SET_MATCHER_HS_V && l3_item->spec != NULL) {\n+\t\tnext_protocol =  MLX5_L3_NEXT_PROTOCOL(l3_item, spec);\n+\t} else {\n+\t\t/* Reset for inner layer. */\n+\t\tnext_protocol = 0xff;\n+\t}\n+\treturn next_protocol;\n+\n+#undef MLX5_L3_NEXT_PROTOCOL\n+}\n+\n /**\n  * Validate IB BTH item.\n  *\n@@ -7770,19 +7804,8 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,\n \t\t\t\treturn ret;\n \t\t\tlast_item = tunnel ? MLX5_FLOW_LAYER_INNER_L3_IPV4 :\n \t\t\t\t\t     MLX5_FLOW_LAYER_OUTER_L3_IPV4;\n-\t\t\tif (items->mask != NULL &&\n-\t\t\t    ((const struct rte_flow_item_ipv4 *)\n-\t\t\t     items->mask)->hdr.next_proto_id) {\n-\t\t\t\tnext_protocol =\n-\t\t\t\t\t((const struct rte_flow_item_ipv4 *)\n-\t\t\t\t\t (items->spec))->hdr.next_proto_id;\n-\t\t\t\tnext_protocol &=\n-\t\t\t\t\t((const struct rte_flow_item_ipv4 *)\n-\t\t\t\t\t (items->mask))->hdr.next_proto_id;\n-\t\t\t} else {\n-\t\t\t\t/* Reset for inner layer. */\n-\t\t\t\tnext_protocol = 0xff;\n-\t\t\t}\n+\t\t\tnext_protocol = mlx5_flow_l3_next_protocol\n+\t\t\t\t(items, (enum MLX5_SET_MATCHER)-1);\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ITEM_TYPE_IPV6:\n \t\t\tmlx5_flow_tunnel_ip_check(items, next_protocol,\n@@ -7796,22 +7819,8 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,\n \t\t\t\treturn ret;\n \t\t\tlast_item = tunnel ? MLX5_FLOW_LAYER_INNER_L3_IPV6 :\n \t\t\t\t\t     MLX5_FLOW_LAYER_OUTER_L3_IPV6;\n-\t\t\tif (items->mask != NULL &&\n-\t\t\t    ((const struct rte_flow_item_ipv6 *)\n-\t\t\t     items->mask)->hdr.proto) {\n-\t\t\t\titem_ipv6_proto =\n-\t\t\t\t\t((const struct rte_flow_item_ipv6 *)\n-\t\t\t\t\t items->spec)->hdr.proto;\n-\t\t\t\tnext_protocol =\n-\t\t\t\t\t((const struct rte_flow_item_ipv6 *)\n-\t\t\t\t\t items->spec)->hdr.proto;\n-\t\t\t\tnext_protocol &=\n-\t\t\t\t\t((const struct rte_flow_item_ipv6 *)\n-\t\t\t\t\t items->mask)->hdr.proto;\n-\t\t\t} else {\n-\t\t\t\t/* Reset for inner layer. */\n-\t\t\t\tnext_protocol = 0xff;\n-\t\t\t}\n+\t\t\tnext_protocol = mlx5_flow_l3_next_protocol\n+\t\t\t\t\t(items, (enum MLX5_SET_MATCHER)-1);\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT:\n \t\t\tret = flow_dv_validate_item_ipv6_frag_ext(items,\n@@ -7822,19 +7831,8 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,\n \t\t\tlast_item = tunnel ?\n \t\t\t\t\tMLX5_FLOW_LAYER_INNER_L3_IPV6_FRAG_EXT :\n \t\t\t\t\tMLX5_FLOW_LAYER_OUTER_L3_IPV6_FRAG_EXT;\n-\t\t\tif (items->mask != NULL &&\n-\t\t\t    ((const struct rte_flow_item_ipv6_frag_ext *)\n-\t\t\t     items->mask)->hdr.next_header) {\n-\t\t\t\tnext_protocol =\n-\t\t\t\t((const struct rte_flow_item_ipv6_frag_ext *)\n-\t\t\t\t items->spec)->hdr.next_header;\n-\t\t\t\tnext_protocol &=\n-\t\t\t\t((const struct rte_flow_item_ipv6_frag_ext *)\n-\t\t\t\t items->mask)->hdr.next_header;\n-\t\t\t} else {\n-\t\t\t\t/* Reset for inner layer. */\n-\t\t\t\tnext_protocol = 0xff;\n-\t\t\t}\n+\t\t\tnext_protocol = mlx5_flow_l3_next_protocol\n+\t\t\t\t(items, (enum MLX5_SET_MATCHER)-1);\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ITEM_TYPE_TCP:\n \t\t\tret = mlx5_flow_validate_item_tcp\n@@ -13997,28 +13995,7 @@ flow_dv_translate_items(struct rte_eth_dev *dev,\n \t\twks->priority = MLX5_PRIORITY_MAP_L3;\n \t\tlast_item = tunnel ? MLX5_FLOW_LAYER_INNER_L3_IPV4 :\n \t\t\t\t     MLX5_FLOW_LAYER_OUTER_L3_IPV4;\n-\t\tif (items->mask != NULL &&\n-\t\t    items->spec != NULL &&\n-\t\t\t((const struct rte_flow_item_ipv4 *)\n-\t\t\t items->mask)->hdr.next_proto_id) {\n-\t\t\tnext_protocol =\n-\t\t\t\t((const struct rte_flow_item_ipv4 *)\n-\t\t\t\t (items->spec))->hdr.next_proto_id;\n-\t\t\tnext_protocol &=\n-\t\t\t\t((const struct rte_flow_item_ipv4 *)\n-\t\t\t\t (items->mask))->hdr.next_proto_id;\n-\t\t} else if (key_type == MLX5_SET_MATCHER_HS_M &&\n-\t\t\t   items->mask != NULL) {\n-\t\t\tnext_protocol =  ((const struct rte_flow_item_ipv4 *)\n-\t\t\t\t\t(items->mask))->hdr.next_proto_id;\n-\t\t} else if (key_type == MLX5_SET_MATCHER_HS_V &&\n-\t\t\t   items->spec != NULL) {\n-\t\t\tnext_protocol =  ((const struct rte_flow_item_ipv4 *)\n-\t\t\t\t\t(items->spec))->hdr.next_proto_id;\n-\t\t} else {\n-\t\t\t/* Reset for inner layer. */\n-\t\t\tnext_protocol = 0xff;\n-\t\t}\n+\t\tnext_protocol = mlx5_flow_l3_next_protocol(items, key_type);\n \t\tbreak;\n \tcase RTE_FLOW_ITEM_TYPE_IPV6:\n \t\tmlx5_flow_tunnel_ip_check(items, next_protocol,\n@@ -14028,56 +14005,14 @@ flow_dv_translate_items(struct rte_eth_dev *dev,\n \t\twks->priority = MLX5_PRIORITY_MAP_L3;\n \t\tlast_item = tunnel ? MLX5_FLOW_LAYER_INNER_L3_IPV6 :\n \t\t\t\t     MLX5_FLOW_LAYER_OUTER_L3_IPV6;\n-\t\tif (items->mask != NULL &&\n-\t\t    items->spec != NULL &&\n-\t\t\t((const struct rte_flow_item_ipv6 *)\n-\t\t\t items->mask)->hdr.proto) {\n-\t\t\tnext_protocol =\n-\t\t\t\t((const struct rte_flow_item_ipv6 *)\n-\t\t\t\t items->spec)->hdr.proto;\n-\t\t\tnext_protocol &=\n-\t\t\t\t((const struct rte_flow_item_ipv6 *)\n-\t\t\t\t items->mask)->hdr.proto;\n-\t\t} else if (key_type == MLX5_SET_MATCHER_HS_M &&\n-\t\t\t   items->mask != NULL) {\n-\t\t\tnext_protocol =  ((const struct rte_flow_item_ipv6 *)\n-\t\t\t\t\t(items->mask))->hdr.proto;\n-\t\t} else if (key_type == MLX5_SET_MATCHER_HS_V &&\n-\t\t\t   items->spec != NULL) {\n-\t\t\tnext_protocol =  ((const struct rte_flow_item_ipv6 *)\n-\t\t\t\t\t(items->spec))->hdr.proto;\n-\t\t} else {\n-\t\t\t/* Reset for inner layer. */\n-\t\t\tnext_protocol = 0xff;\n-\t\t}\n+\t\tnext_protocol = mlx5_flow_l3_next_protocol(items, key_type);\n \t\tbreak;\n \tcase RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT:\n \t\tflow_dv_translate_item_ipv6_frag_ext\n \t\t\t\t\t(key, items, tunnel, key_type);\n \t\tlast_item = tunnel ? MLX5_FLOW_LAYER_INNER_L3_IPV6_FRAG_EXT :\n \t\t\t\t     MLX5_FLOW_LAYER_OUTER_L3_IPV6_FRAG_EXT;\n-\t\tif (items->mask != NULL &&\n-\t\t    items->spec != NULL &&\n-\t\t\t((const struct rte_flow_item_ipv6_frag_ext *)\n-\t\t\t items->mask)->hdr.next_header) {\n-\t\t\tnext_protocol =\n-\t\t\t((const struct rte_flow_item_ipv6_frag_ext *)\n-\t\t\t items->spec)->hdr.next_header;\n-\t\t\tnext_protocol &=\n-\t\t\t((const struct rte_flow_item_ipv6_frag_ext *)\n-\t\t\t items->mask)->hdr.next_header;\n-\t\t} else if (key_type == MLX5_SET_MATCHER_HS_M &&\n-\t\t\t   items->mask != NULL) {\n-\t\t\tnext_protocol =  ((const struct rte_flow_item_ipv6_frag_ext *)\n-\t\t\t\t\t(items->mask))->hdr.next_header;\n-\t\t} else if (key_type == MLX5_SET_MATCHER_HS_V &&\n-\t\t\t   items->spec != NULL) {\n-\t\t\tnext_protocol =  ((const struct rte_flow_item_ipv6_frag_ext *)\n-\t\t\t\t\t(items->spec))->hdr.next_header;\n-\t\t} else {\n-\t\t\t/* Reset for inner layer. */\n-\t\t\tnext_protocol = 0xff;\n-\t\t}\n+\t\tnext_protocol = mlx5_flow_l3_next_protocol(items, key_type);\n \t\tbreak;\n \tcase RTE_FLOW_ITEM_TYPE_TCP:\n \t\tflow_dv_translate_item_tcp(key, items, tunnel, key_type);\n",
    "prefixes": [
        "1/2"
    ]
}