get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 126177,
    "url": "http://patches.dpdk.org/api/patches/126177/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230417092540.2617450-5-rongweil@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": "<20230417092540.2617450-5-rongweil@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230417092540.2617450-5-rongweil@nvidia.com",
    "date": "2023-04-17T09:25:36",
    "name": "[v1,4/8] net/mlx5: sample the srv6 last segment",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "98f8553838c3426ab95fc767a1db3962427297f6",
    "submitter": {
        "id": 2223,
        "url": "http://patches.dpdk.org/api/people/2223/?format=api",
        "name": "Rongwei Liu",
        "email": "rongweil@nvidia.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230417092540.2617450-5-rongweil@nvidia.com/mbox/",
    "series": [
        {
            "id": 27737,
            "url": "http://patches.dpdk.org/api/series/27737/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27737",
            "date": "2023-04-17T09:25:32",
            "name": "add IPv6 extension push remove",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/27737/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/126177/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/126177/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 E0C054296B;\n\tMon, 17 Apr 2023 11:26:41 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A91BF42D31;\n\tMon, 17 Apr 2023 11:26:25 +0200 (CEST)",
            "from NAM12-MW2-obe.outbound.protection.outlook.com\n (mail-mw2nam12on2040.outbound.protection.outlook.com [40.107.244.40])\n by mails.dpdk.org (Postfix) with ESMTP id 2E1FE42D17\n for <dev@dpdk.org>; Mon, 17 Apr 2023 11:26:24 +0200 (CEST)",
            "from MW4PR03CA0311.namprd03.prod.outlook.com (2603:10b6:303:dd::16)\n by PH0PR12MB5647.namprd12.prod.outlook.com (2603:10b6:510:144::5)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Mon, 17 Apr\n 2023 09:26:20 +0000",
            "from CO1NAM11FT053.eop-nam11.prod.protection.outlook.com\n (2603:10b6:303:dd:cafe::18) by MW4PR03CA0311.outlook.office365.com\n (2603:10b6:303:dd::16) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.46 via Frontend\n Transport; Mon, 17 Apr 2023 09:26:19 +0000",
            "from mail.nvidia.com (216.228.117.161) by\n CO1NAM11FT053.mail.protection.outlook.com (10.13.175.63) with Microsoft SMTP\n Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.6319.19 via Frontend Transport; Mon, 17 Apr 2023 09:26:19 +0000",
            "from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com\n (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Mon, 17 Apr 2023\n 02:26:04 -0700",
            "from nvidia.com (10.126.231.37) 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.986.37; Mon, 17 Apr\n 2023 02:26:02 -0700"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=MCZwYd8Oi8SBd97DTUpBqNt2tomdz8oZxl9/8CJLjnacnFST39DLj1Hohin41ej172YHwVADqZMnggQL/jTA/JOA9Un9/rlv+P/0yQUFSgKmF02BFwqvijo+3ZAYDAigNEKkm6DkfVPPf+6lnVZqcP4Y4yAogYQbkrG63qmV0YN8AmWW93lGyCWC1UdWOLX82hTPtU/a5CxnjEk6+sD3VAQslGiQegDRSUZpmnf/ckJhvXqOcnvpGBWm6xDjhptBrEHAWjP4+Q3wJpDAUVuBkrnpjyvBp8HMGLSMpCfGO8rIrCI6oTRL8cF3s0x9Y05gdYzDoqbze4oHzq/gr1DHpA==",
        "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=KQoDK4GyQm64RO8cLI/ZAEbsmWAdC+fNkZeYtpnc3UU=;\n b=ZcEJq3CrbVremTZGPLGDBl0s3owE5Fvj6PH5qP8icSTQvFZt/yuAF3TT+Si9GyUrc4yol3jS61UgmOUOXypBuoTg0XHOljXIQpCygizDnTtdWbyA1Guy9qaJPOZ0+WF3RV+CAhGZBxz8TfixGQ+kO+tZaCwMtZ8j0cbYrVWz5qgcPUNF4QnsQJoLi8B6t/MphusZqgOmMOUL+7kr0YUH4ZEsMVcvYkIhuTIVl0ttrz+t8Corz0ZLpLBMPrJvLOLV0ZkU+uISyBMVI4Bt68pHqX//laHYeB7c+5Ljt1J7RTEeYLFrPeeee8apMs9BXO7Idx2hmyZUZw8W5IzGJ+6IRg==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 216.228.117.161) 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",
        "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=KQoDK4GyQm64RO8cLI/ZAEbsmWAdC+fNkZeYtpnc3UU=;\n b=mAE0s7eB9fy73BS+wb736n1N88sYOUZ4+V7cHpH5Mvzz26TXNR8Hksr5RoLt3nBJ55b4XVnx1BktlvH6P/CgFaelrE1XXPCL243FofI0ERmYHXEx2u9PVKFNoY6fvaHNYcKSH2qKi/2vDmvGhaHOP3xJmnup5HqyD1Xc9Z4i0NyfGUdThnjkK4yQOIeC1NviDNarRK/+WtH15PaAdhvY0FD8aZig4DtzVOowUfN706sAUYhT2Eo2/TfnL64HGHHLFsfAppb38yWRrE1FSfkkaQytdQa90WobMb/LlFm5LwLug7GKlaVf/pZIvoujBMG4AuHll4cajH/qavk5GYaH2Q==",
        "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 216.228.117.161)\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.161 as permitted sender) receiver=protection.outlook.com;\n client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C",
        "From": "Rongwei Liu <rongweil@nvidia.com>",
        "To": "<dev@dpdk.org>, <matan@nvidia.com>, <viacheslavo@nvidia.com>,\n <orika@nvidia.com>, <thomas@monjalon.net>",
        "Subject": "[PATCH v1 4/8] net/mlx5: sample the srv6 last segment",
        "Date": "Mon, 17 Apr 2023 12:25:36 +0300",
        "Message-ID": "<20230417092540.2617450-5-rongweil@nvidia.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20230417092540.2617450-1-rongweil@nvidia.com>",
        "References": "<20230417092540.2617450-1-rongweil@nvidia.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.126.231.37]",
        "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": "CO1NAM11FT053:EE_|PH0PR12MB5647:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "e94013e3-fbc0-4bef-c529-08db3f25cd6d",
        "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;",
        "X-Microsoft-Antispam-Message-Info": "\n H1j6RfX8Ue1W1CxAZTZz5BDozfWyF8G7N2Wcewk3CB5Sc82ioVkXNmxagN5ydwHtNMfFNV5rBlkOAhFtxveV01ljxqxk4MRKhIw3yGEE898LgyyHW0QusLZzhdiEZ0AVn7cmzXqxGSCCIH314Y3m5F8OGf0cq6V4OYhzFyK/PWF0UGthE1lq36nVLrFRydeeMgpbT9S9uUlWzC6hNfovTKpvWbeYwrKW4+l6caz/QEdI3HGBAy65bBSaK5ujUujzTbezSeYyj5SCsN8o73LAm9qwmn8/4a07yatSPw6Ec1lJZn/xR4fxlWHPU/oPD1+DNPZc60/+qRHjsVLHPfT339BTxjjJM7uJOKAVMGiQQcxT8pgejJbp4B39DhxgJFUjQrvC9jbiK/uMNdBk3XaYMLkkebTcQ9ay6PddgEtNfy2f+qOGSeW79bEPGx9FWtgLJpi07SKr5EgjyF7ePWfjk+1Agaj+AIJ2XOFtz5xJ8y2x59yKX/TktSK98sdTdHPJ6vDQU9GYMpcpWOxGXFYJCP4mPWMgkhMZoYFtfjDnUqKRBw8ZXTORGJ7z2VUg/isRLMBuoOFMVU1X5ZLg+bmVfnHPrVB3egcCTUoqYzW3aI1IIeW+HXvHh2LQNM/44KSyCfVVsL1fJks2AGLQcyQmRToMfFclEjnO3M71WgOlux8c5QZQzD0evGiLYcNlhcjQXY1FADkecf3w0UF4zuSNuvwjf7pK71ZhYJcr2R1RYYjr/XJWR2gGDRYUNbO4r9qX9TNUTSRn2+z0mlFAGCcEhX24l8DXqlGHMjxSnHP0Wsc=",
        "X-Forefront-Antispam-Report": "CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1;\n SRV:;\n IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE;\n SFS:(13230028)(4636009)(346002)(376002)(39860400002)(396003)(136003)(451199021)(40470700004)(46966006)(36840700001)(40460700003)(8676002)(36860700001)(426003)(47076005)(83380400001)(336012)(34020700004)(1076003)(110136005)(2616005)(7696005)(16526019)(478600001)(6286002)(6666004)(26005)(186003)(82740400003)(36756003)(5660300002)(82310400005)(316002)(7636003)(70586007)(70206006)(356005)(41300700001)(55016003)(8936002)(86362001)(2906002)(40480700001);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "Nvidia.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "17 Apr 2023 09:26:19.4514 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n e94013e3-fbc0-4bef-c529-08db3f25cd6d",
        "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.161];\n Helo=[mail.nvidia.com]",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n CO1NAM11FT053.eop-nam11.prod.protection.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "PH0PR12MB5647",
        "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": "When removing the IPv6 routing extension header from the\npackets, the destination address should be updated to the\nlast one in the segment list.\n\nEnlarge the hardware sample scope to cover the last segment.\n\nSigned-off-by: Rongwei Liu <rongweil@nvidia.com>\n---\n drivers/net/mlx5/mlx5.c      | 42 +++++++++++++++++++++++++-----------\n drivers/net/mlx5/mlx5.h      |  1 +\n drivers/net/mlx5/mlx5_flow.h | 15 +++++++++++++\n 3 files changed, 46 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex f24e20a2ef..1418ffdea7 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -1054,7 +1054,7 @@ mlx5_alloc_srh_flex_parser(struct rte_eth_dev *dev)\n \tstruct mlx5_devx_graph_node_attr node = {\n \t\t.modify_field_select = 0,\n \t};\n-\tuint32_t ids[MLX5_GRAPH_NODE_SAMPLE_NUM];\n+\tuint32_t i, ids[MLX5_GRAPH_NODE_SAMPLE_NUM];\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n \tstruct mlx5_common_dev_config *config = &priv->sh->cdev->config;\n \tvoid *fp = NULL, *ibv_ctx = priv->sh->cdev->ctx;\n@@ -1084,10 +1084,18 @@ mlx5_alloc_srh_flex_parser(struct rte_eth_dev *dev)\n \tnode.next_header_field_size = 0x8;\n \tnode.in[0].arc_parse_graph_node = MLX5_GRAPH_ARC_NODE_IP;\n \tnode.in[0].compare_condition_value = IPPROTO_ROUTING;\n-\tnode.sample[0].flow_match_sample_en = 1;\n-\t/* First come first serve no matter inner or outer. */\n-\tnode.sample[0].flow_match_sample_tunnel_mode = MLX5_GRAPH_SAMPLE_TUNNEL_FIRST;\n-\tnode.sample[0].flow_match_sample_offset_mode = MLX5_GRAPH_SAMPLE_OFFSET_FIXED;\n+\t/* Final IPv6 address. */\n+\tfor (i = 0; i <= 4 && i < MLX5_GRAPH_NODE_SAMPLE_NUM; i++) {\n+\t\tnode.sample[i].flow_match_sample_en = 1;\n+\t\tnode.sample[i].flow_match_sample_offset_mode =\n+\t\t\t\t\tMLX5_GRAPH_SAMPLE_OFFSET_FIXED;\n+\t\t/* First come first serve no matter inner or outer. */\n+\t\tnode.sample[i].flow_match_sample_tunnel_mode =\n+\t\t\t\t\tMLX5_GRAPH_SAMPLE_TUNNEL_FIRST;\n+\t\tnode.sample[i].flow_match_sample_field_base_offset =\n+\t\t\t\t\t(i + 1) * sizeof(uint32_t); /* in bytes */\n+\t}\n+\tnode.sample[0].flow_match_sample_field_base_offset = 0;\n \tnode.out[0].arc_parse_graph_node = MLX5_GRAPH_ARC_NODE_TCP;\n \tnode.out[0].compare_condition_value = IPPROTO_TCP;\n \tnode.out[1].arc_parse_graph_node = MLX5_GRAPH_ARC_NODE_UDP;\n@@ -1100,8 +1108,8 @@ mlx5_alloc_srh_flex_parser(struct rte_eth_dev *dev)\n \t\tgoto error;\n \t}\n \tpriv->sh->srh_flex_parser.flex.devx_fp->devx_obj = fp;\n-\tpriv->sh->srh_flex_parser.flex.mapnum = 1;\n-\tpriv->sh->srh_flex_parser.flex.devx_fp->num_samples = 1;\n+\tpriv->sh->srh_flex_parser.flex.mapnum = 5;\n+\tpriv->sh->srh_flex_parser.flex.devx_fp->num_samples = 5;\n \n \tret = mlx5_devx_cmd_query_parse_samples(fp, ids, priv->sh->srh_flex_parser.flex.mapnum,\n \t\t\t\t\t\t&priv->sh->srh_flex_parser.flex.devx_fp->anchor_id);\n@@ -1109,12 +1117,22 @@ mlx5_alloc_srh_flex_parser(struct rte_eth_dev *dev)\n \t\tDRV_LOG(ERR, \"Failed to query sample IDs.\");\n \t\tgoto error;\n \t}\n-\tret = mlx5_devx_cmd_match_sample_info_query(ibv_ctx, ids[0],\n-\t\t\t\t&priv->sh->srh_flex_parser.flex.devx_fp->sample_info[0]);\n-\tif (ret) {\n-\t\tDRV_LOG(ERR, \"Failed to query sample id information.\");\n-\t\tgoto error;\n+\tfor (i = 0; i <= 4 && i < MLX5_GRAPH_NODE_SAMPLE_NUM; i++) {\n+\t\tret = mlx5_devx_cmd_match_sample_info_query(ibv_ctx, ids[i],\n+\t\t\t\t\t&priv->sh->srh_flex_parser.flex.devx_fp->sample_info[i]);\n+\t\tif (ret) {\n+\t\t\tDRV_LOG(ERR, \"Failed to query sample id %u information.\", ids[i]);\n+\t\t\tgoto error;\n+\t\t}\n+\t}\n+\tfor (i = 0; i <= 4 && i < MLX5_GRAPH_NODE_SAMPLE_NUM; i++) {\n+\t\tpriv->sh->srh_flex_parser.flex.devx_fp->sample_ids[i] = ids[i];\n+\t\tpriv->sh->srh_flex_parser.flex.map[i].width = sizeof(uint32_t) * CHAR_BIT;\n+\t\tpriv->sh->srh_flex_parser.flex.map[i].reg_id = i;\n+\t\tpriv->sh->srh_flex_parser.flex.map[i].shift =\n+\t\t\t\t\t\t(i + 1) * sizeof(uint32_t) * CHAR_BIT;\n \t}\n+\tpriv->sh->srh_flex_parser.flex.map[0].shift = 0;\n \treturn 0;\n error:\n \tif (fp)\ndiff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex 9eae692037..3fbec4db9e 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -1323,6 +1323,7 @@ struct mlx5_flex_pattern_field {\n \tuint16_t shift:5;\n \tuint16_t reg_id:5;\n };\n+\n #define MLX5_INVALID_SAMPLE_REG_ID 0x1F\n \n /* Port flex item context. */\ndiff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h\nindex 1d116ea0f6..821c6ca281 100644\n--- a/drivers/net/mlx5/mlx5_flow.h\n+++ b/drivers/net/mlx5/mlx5_flow.h\n@@ -2666,4 +2666,19 @@ flow_hw_get_srh_flex_parser_byte_off_from_ctx(void *dr_ctx __rte_unused)\n #endif\n \treturn UINT32_MAX;\n }\n+\n+static __rte_always_inline void *\n+flow_hw_get_dev_from_ctx(void *dr_ctx)\n+{\n+\tuint16_t port;\n+\tstruct mlx5_priv *priv;\n+\n+\tMLX5_ETH_FOREACH_DEV(port, NULL) {\n+\t\tpriv = rte_eth_devices[port].data->dev_private;\n+\t\tif (priv->dr_ctx == dr_ctx)\n+\t\t\treturn &rte_eth_devices[port];\n+\t}\n+\treturn NULL;\n+}\n+\n #endif /* RTE_PMD_MLX5_FLOW_H_ */\n",
    "prefixes": [
        "v1",
        "4/8"
    ]
}