get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 138661,
    "url": "http://patchwork.dpdk.org/api/patches/138661/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20240321142414.1573453-2-kliteyn@nvidia.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20240321142414.1573453-2-kliteyn@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240321142414.1573453-2-kliteyn@nvidia.com",
    "date": "2024-03-21T14:24:14",
    "name": "[2/2] net/mlx5/hws: fix port ID for root table",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2f1032794b2c096c9f2db81c5fe4f407551a752d",
    "submitter": {
        "id": 2925,
        "url": "http://patchwork.dpdk.org/api/people/2925/?format=api",
        "name": "Yevgeny Kliteynik",
        "email": "kliteyn@nvidia.com"
    },
    "delegate": {
        "id": 3268,
        "url": "http://patchwork.dpdk.org/api/users/3268/?format=api",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": "rasland@nvidia.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20240321142414.1573453-2-kliteyn@nvidia.com/mbox/",
    "series": [
        {
            "id": 31587,
            "url": "http://patchwork.dpdk.org/api/series/31587/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=31587",
            "date": "2024-03-21T14:24:13",
            "name": "[1/2] net/mlx5/hws: fix rule resize status check",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/31587/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/138661/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/138661/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 76DB243D16;\n\tThu, 21 Mar 2024 15:25:15 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6496042DCE;\n\tThu, 21 Mar 2024 15:25:15 +0100 (CET)",
            "from NAM11-DM6-obe.outbound.protection.outlook.com\n (mail-dm6nam11on2056.outbound.protection.outlook.com [40.107.223.56])\n by mails.dpdk.org (Postfix) with ESMTP id 3A23042DBD;\n Thu, 21 Mar 2024 15:25:13 +0100 (CET)",
            "from BN9PR03CA0781.namprd03.prod.outlook.com (2603:10b6:408:13f::6)\n by DM4PR12MB6109.namprd12.prod.outlook.com (2603:10b6:8:ae::11) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.30; Thu, 21 Mar\n 2024 14:25:08 +0000",
            "from BN1PEPF00004689.namprd05.prod.outlook.com\n (2603:10b6:408:13f:cafe::85) by BN9PR03CA0781.outlook.office365.com\n (2603:10b6:408:13f::6) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.26 via Frontend\n Transport; Thu, 21 Mar 2024 14:25:07 +0000",
            "from mail.nvidia.com (216.228.117.161) by\n BN1PEPF00004689.mail.protection.outlook.com (10.167.243.134) with Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.7409.10 via Frontend Transport; Thu, 21 Mar 2024 14:25:07 +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.41; Thu, 21 Mar\n 2024 07:24:47 -0700",
            "from nvidia.com (10.126.230.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, 21 Mar\n 2024 07:24:43 -0700"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=UmXJvSXY2BGKG2zTh4EfxvXtE78KVebryvC//66dB6lnTstj6lblhRafsXsqx6bcohs7OVupC6R0tcbwdHZH42Mty0oXTqCqkfrQw/QNgm8ikD9nkMZabaKKD8Me5HP8krXV+LLgulMya2/7K6UbzXfZ9+I9ROCgplSC06a6+m9NWRBNyO+AkPuE6toMUgbpcUMpN9S0UpzT6mo0Jmf1mfw5w3xFsq0Zf2IUqSLQBD4OlCshK2BRbR2Ynpt3kgZAt5Sh6FE+hJ8mVZ8VhrO5pWX/XrTv2udj623wB9LpF0Tld11mvdVIGK50iZJai8c+EGq4VsrVELqRsz3tHPwrnA==",
        "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=E2hwI9vz4YePMtcDmuPFfCCVDdKGIhGRw7G01G4ZHWI=;\n b=SuNMlpPFCe+elJJyPDywZuvSXfzMDSGlVQzwurtXL6yIozU0cCy4sKAPM+bGsGYk58lmUwsonQjLnhjA3hbyTxKqtvk+NM8g1CxG6JQTT1xintHrgVXP9WfBt46GPt926uAi4fpBmCWEXbJmyKGuIMVqZyia1hSPpQsTuShKU8cgrizNL/egKCK3IviXdUahCc1uzwzagyKEPJ2bHwZ6ShsQ6cfEe0xVPIBHFLpkrvhC5k9WGUyJPs2clvioNvawa3YrYNwQawbfQ1pSX3SL+m9kXgjSfV/rvYMxjgtFb/jy8AFE/G5mk3eLPHiIChKPGgdPZkG+uEzdJyMOx+cFeA==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 216.228.117.161) smtp.rcpttodomain=monjalon.net 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=E2hwI9vz4YePMtcDmuPFfCCVDdKGIhGRw7G01G4ZHWI=;\n b=aVLl0j1KNRTqffyND+OqTFO5DrdJqSjR5ajC+OhVAg671Zwke70oJ2N/2MuwbeI0BZ8dnL5c7Ii7q19NzfMZNVeEcAJmp4xL5bujN5hA9f38CEr80K72jq/+H5jCjm0xcfjEm6h6357NNsFJ0Nk9xWA6H4nHE2N77q4QU0XBI58k+P4beW3E2R0hJ5iES43a6yq/inBkIwzkKSM08w+gAL/IagEqaK45k85G9+PxHTXOFjIB+sm129EXnf6Cg1L2LgkuF+ikOPjlxTVWjwMHLtDyPiR67YNGnR/nr2gBxKhKp0eXPDLIopG5NSQIXM1YvyhpgIa2y+dvgg3imqbDFA==",
        "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": "Yevgeny Kliteynik <kliteyn@nvidia.com>",
        "To": "<kliteyn@nvidia.com>, <viacheslavo@nvidia.com>, <thomas@monjalon.net>,\n <suanmingm@nvidia.com>, Dariusz Sosnowski <dsosnowski@nvidia.com>, Ori Kam\n <orika@nvidia.com>, Matan Azrad <matan@nvidia.com>, Erez Shitrit\n <erezsh@nvidia.com>, Alex Vesker <valex@nvidia.com>",
        "CC": "<dev@dpdk.org>, <igozlan@nvidia.com>, <stable@dpdk.org>",
        "Subject": "[PATCH 2/2] net/mlx5/hws: fix port ID for root table",
        "Date": "Thu, 21 Mar 2024 16:24:14 +0200",
        "Message-ID": "<20240321142414.1573453-2-kliteyn@nvidia.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20240321142414.1573453-1-kliteyn@nvidia.com>",
        "References": "<20240321142414.1573453-1-kliteyn@nvidia.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.126.230.35]",
        "X-ClientProxiedBy": "rnnvmail202.nvidia.com (10.129.68.7) To\n rnnvmail201.nvidia.com (10.129.68.8)",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-TrafficTypeDiagnostic": "BN1PEPF00004689:EE_|DM4PR12MB6109:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "c5a15ada-8904-40ce-3a60-08dc49b2b552",
        "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 NbaG8Is/b1mPq10yyk4Exr4/ZKw/kwjvpmg6knt4hIYWV+m6N3i7tVOccmWZuwoM9kMFtsFwkprE/U6hkk/30NoDL26bFrLqC0Ac0zUIgxBcfG02wqNut2ZqC3VqrbDoFgkn6lOefXnjFBThjymH5pUgVQ4KLimcebai/TQzVmTwyaSnDdziLjxDS/z2mf/PgzbH4QNKuY93vFPVU7wJh9Ix5yKbphwnq2eD9GsLkKEdbTy15QLFWSptco1IPqyMtveKfr9b1HPYwmE+GljQovYXYaC2riHrGNwwMBsLLpGyJ0bSx8L7p8lcmn2G7fF6Rqyi14ZeJ/uFbXlRR2ZpF3eDlEuPQgwDRDFtNN/sPUPi7Hd+UBdw+y/WFD+knzEfbDUqaq1iB0RSwm3vTc6+CTmZTKjl8PSbhxBPo+uTTdJkydWPYmFnq28NOfi5H0HfIxE98QlAeE/gWpUheeWzyouHx91E5WtAMgx7lJu7zn2x4a6FtZyWuOrtQo9tahXiDgGIdCE0KvPdfJbxg4IP+zIpYk0ZREfj1mU1WmU6c2CVsm6BaDTCmJ+Q2/8Ld5XKQiJfU3fUl4vMMyFG49ydPlZgOdAWwdwichKBfz3YY8tKjbXb8+0ybTfN2gecmb6ke/G7+vvBdMMfRa77E/T/du5bJTCYFkqe5HBHCjwa/XHAyc3/IarXANvTQUvTTJnhRVtz34aZ1pQF4DybYaFHhTtwMCWT+CeiH+rumNpWxkBlKd4ShzrRSaA9zLaB8g2k",
        "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:(13230031)(1800799015)(82310400014)(376005)(36860700004); DIR:OUT;\n SFP:1101;",
        "X-OriginatorOrg": "Nvidia.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "21 Mar 2024 14:25:07.2651 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n c5a15ada-8904-40ce-3a60-08dc49b2b552",
        "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 BN1PEPF00004689.namprd05.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "DM4PR12MB6109",
        "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": "From: Erez Shitrit <erezsh@nvidia.com>\n\nIn root tables matcher and rule need to have their port-id, otherwise\nthe translate function that done in dpdk layer will not get the right\nattributes.\nFor that whenever the matcher is matching the source-port we need to get\nthe relevant port-id before calling the translate function.\n\nFixes: 405242c52dd5 (\"net/mlx5/hws: add rule object\")\nCc: stable@dpdk.org\n\nSigned-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>\nSigned-off-by: Erez Shitrit <erezsh@nvidia.com>\nAcked-by: Matan Azrad <matan@nvidia.com>\nSigned-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>\n---\n drivers/net/mlx5/hws/mlx5dr_matcher.c | 17 +++++++++++++++++\n drivers/net/mlx5/hws/mlx5dr_rule.c    | 18 ++++++++++++++++++\n drivers/net/mlx5/mlx5_flow.h          | 22 ++++++++++++++++++++++\n 3 files changed, 57 insertions(+)",
    "diff": "diff --git a/drivers/net/mlx5/hws/mlx5dr_matcher.c b/drivers/net/mlx5/hws/mlx5dr_matcher.c\nindex 1c64abfa57..aeff300467 100644\n--- a/drivers/net/mlx5/hws/mlx5dr_matcher.c\n+++ b/drivers/net/mlx5/hws/mlx5dr_matcher.c\n@@ -1220,6 +1220,7 @@ static int mlx5dr_matcher_init_root(struct mlx5dr_matcher *matcher)\n \tstruct mlx5dv_flow_match_parameters *mask;\n \tstruct mlx5_flow_attr flow_attr = {0};\n \tstruct rte_flow_error rte_error;\n+\tstruct rte_flow_item *item;\n \tuint8_t match_criteria;\n \tint ret;\n \n@@ -1248,6 +1249,22 @@ static int mlx5dr_matcher_init_root(struct mlx5dr_matcher *matcher)\n \t\treturn rte_errno;\n \t}\n \n+\t/* We need the port id in case of matching representor */\n+\titem = matcher->mt[0].items;\n+\twhile (item->type != RTE_FLOW_ITEM_TYPE_END) {\n+\t\tif (item->type == RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR ||\n+\t\t    item->type == RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT) {\n+\t\t\tret = flow_hw_get_port_id_from_ctx(ctx, &flow_attr.port_id);\n+\t\t\tif (ret) {\n+\t\t\t\tDR_LOG(ERR, \"Failed to get port id for dev %s\",\n+\t\t\t\t       ctx->ibv_ctx->device->name);\n+\t\t\t\trte_errno = EINVAL;\n+\t\t\t\treturn rte_errno;\n+\t\t\t}\n+\t\t}\n+\t\t++item;\n+\t}\n+\n \tmask = simple_calloc(1, MLX5_ST_SZ_BYTES(fte_match_param) +\n \t\t\t     offsetof(struct mlx5dv_flow_match_parameters, match_buf));\n \tif (!mask) {\ndiff --git a/drivers/net/mlx5/hws/mlx5dr_rule.c b/drivers/net/mlx5/hws/mlx5dr_rule.c\nindex 784f614d87..022263eb1d 100644\n--- a/drivers/net/mlx5/hws/mlx5dr_rule.c\n+++ b/drivers/net/mlx5/hws/mlx5dr_rule.c\n@@ -687,10 +687,28 @@ static int mlx5dr_rule_create_root(struct mlx5dr_rule *rule,\n \tstruct mlx5dv_flow_match_parameters *value;\n \tstruct mlx5_flow_attr flow_attr = {0};\n \tstruct mlx5dv_flow_action_attr *attr;\n+\tconst struct rte_flow_item *cur_item;\n \tstruct rte_flow_error error;\n \tuint8_t match_criteria;\n \tint ret;\n \n+\t/* We need the port id in case of matching representor */\n+\tcur_item = items;\n+\twhile (cur_item->type != RTE_FLOW_ITEM_TYPE_END) {\n+\t\tif (cur_item->type == RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR ||\n+\t\t    cur_item->type == RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT) {\n+\t\t\tret = flow_hw_get_port_id_from_ctx(rule->matcher->tbl->ctx,\n+\t\t\t\t\t\t\t   &flow_attr.port_id);\n+\t\t\tif (ret) {\n+\t\t\t\tDR_LOG(ERR, \"Failed to get port id for dev %s\",\n+\t\t\t\t       rule->matcher->tbl->ctx->ibv_ctx->device->name);\n+\t\t\t\trte_errno = EINVAL;\n+\t\t\t\treturn rte_errno;\n+\t\t\t}\n+\t\t}\n+\t\t++cur_item;\n+\t}\n+\n \tattr = simple_calloc(num_actions, sizeof(*attr));\n \tif (!attr) {\n \t\trte_errno = ENOMEM;\ndiff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h\nindex 34b5e0f45b..0065727a67 100644\n--- a/drivers/net/mlx5/mlx5_flow.h\n+++ b/drivers/net/mlx5/mlx5_flow.h\n@@ -2001,6 +2001,28 @@ flow_hw_get_reg_id(struct rte_eth_dev *dev,\n #endif\n }\n \n+static __rte_always_inline int\n+flow_hw_get_port_id_from_ctx(void *dr_ctx, uint32_t *port_val)\n+{\n+#if defined(HAVE_IBV_FLOW_DV_SUPPORT) || !defined(HAVE_INFINIBAND_VERBS_H)\n+\tuint32_t port;\n+\n+\tMLX5_ETH_FOREACH_DEV(port, NULL) {\n+\t\tstruct mlx5_priv *priv;\n+\t\tpriv = rte_eth_devices[port].data->dev_private;\n+\n+\t\tif (priv->dr_ctx == dr_ctx) {\n+\t\t\t*port_val = port;\n+\t\t\treturn 0;\n+\t\t}\n+\t}\n+#else\n+\tRTE_SET_USED(dr_ctx);\n+\tRTE_SET_USED(port_val);\n+#endif\n+\treturn -EINVAL;\n+}\n+\n /**\n  * Get GENEVE TLV option FW information according type and class.\n  *\n",
    "prefixes": [
        "2/2"
    ]
}