get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 129114,
    "url": "http://patchwork.dpdk.org/api/patches/129114/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230629132127.7508-3-liudongdong3@huawei.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": "<20230629132127.7508-3-liudongdong3@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230629132127.7508-3-liudongdong3@huawei.com",
    "date": "2023-06-29T13:21:27",
    "name": "[v3,2/2] net/hns3: add FDIR VLAN match mode runtime config",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "c0498072de293340c401b03b4d98a982a4f26774",
    "submitter": {
        "id": 2718,
        "url": "http://patchwork.dpdk.org/api/people/2718/?format=api",
        "name": "Dongdong Liu",
        "email": "liudongdong3@huawei.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patchwork.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230629132127.7508-3-liudongdong3@huawei.com/mbox/",
    "series": [
        {
            "id": 28713,
            "url": "http://patchwork.dpdk.org/api/series/28713/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=28713",
            "date": "2023-06-29T13:21:26",
            "name": "net/hns3: add FDIR VLAN match mode runtime config",
            "version": 3,
            "mbox": "http://patchwork.dpdk.org/series/28713/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/129114/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/129114/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 2E93C42D8C;\n\tThu, 29 Jun 2023 15:24:38 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id AD83A42D30;\n\tThu, 29 Jun 2023 15:24:28 +0200 (CEST)",
            "from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188])\n by mails.dpdk.org (Postfix) with ESMTP id 10C5C40EDB;\n Thu, 29 Jun 2023 15:24:25 +0200 (CEST)",
            "from kwepemi500017.china.huawei.com (unknown [172.30.72.57])\n by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4QsJxL3xwSzMpqK;\n Thu, 29 Jun 2023 21:21:10 +0800 (CST)",
            "from localhost.localdomain (10.28.79.22) by\n kwepemi500017.china.huawei.com (7.221.188.110) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.1.2507.27; Thu, 29 Jun 2023 21:24:21 +0800"
        ],
        "From": "Dongdong Liu <liudongdong3@huawei.com>",
        "To": "<dev@dpdk.org>, <ferruh.yigit@amd.com>, <thomas@monjalon.net>,\n <andrew.rybchenko@oktetlabs.ru>",
        "CC": "<stable@dpdk.org>, <lihuisong@huawei.com>",
        "Subject": "[PATCH v3 2/2] net/hns3: add FDIR VLAN match mode runtime config",
        "Date": "Thu, 29 Jun 2023 21:21:27 +0800",
        "Message-ID": "<20230629132127.7508-3-liudongdong3@huawei.com>",
        "X-Mailer": "git-send-email 2.22.0",
        "In-Reply-To": "<20230629132127.7508-1-liudongdong3@huawei.com>",
        "References": "<20230626124332.28157-1-liudongdong3@huawei.com>\n <20230629132127.7508-1-liudongdong3@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.28.79.22]",
        "X-ClientProxiedBy": "dggems703-chm.china.huawei.com (10.3.19.180) To\n kwepemi500017.china.huawei.com (7.221.188.110)",
        "X-CFilter-Loop": "Reflected",
        "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: Huisong Li <lihuisong@huawei.com>\n\nThe VLAN number in FDIR meta data is used to enable that hardware\nbases on VLAN number to strictly match the input flow. And it is\nenabled by default.\n\nFor the following two rules:\nrule0:\n      pattern: eth type is 0x0806\n      actions: queue index 3\nrule1:\n      pattern: eth type is 0x0806 / vlan vid is 20\n      actions: queue index 4\nIf enable VLAN number, only the ARP packets with VLAN 20 are directed\nto queue 4, and the ARP packets with other VLAN ID cannot be directed\nto the specified queue. If app want to all ARP (VLAN or no VLAN)\npackets to be directed to the specified queue, app has to set many\nrules for VLAN packet. In this case, if driver doesn't enable VLAN\nnumber, app just need to set one rule (rule0).\n\nSo this patch adds a \"fdir_vlan_match_mode\" runtime config which only\ncan be 'strict' or 'nostrict'. And driver still uses 'strict' mode as\nthe default mode. Please select 'nostrict' mode if you request all same\nethertype packets with and without VLAN to a specified queue.\n\nSigned-off-by: Huisong Li <lihuisong@huawei.com>\nSigned-off-by: Dongdong Liu <liudongdong3@huawei.com>\n---\n doc/guides/nics/hns3.rst       | 26 +++++++++++++++++++++++++\n drivers/net/hns3/hns3_common.c | 35 ++++++++++++++++++++++++++++++++++\n drivers/net/hns3/hns3_common.h |  2 ++\n drivers/net/hns3/hns3_fdir.c   | 10 +++++++---\n drivers/net/hns3/hns3_fdir.h   |  8 ++++++++\n 5 files changed, 78 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/doc/guides/nics/hns3.rst b/doc/guides/nics/hns3.rst\nindex 5373ec5a8f..001ccbdb62 100644\n--- a/doc/guides/nics/hns3.rst\n+++ b/doc/guides/nics/hns3.rst\n@@ -140,6 +140,32 @@ Runtime Configuration\n    For example::\n    -a 0000:7d:00.0,mbx_time_limit_ms=600\n \n+- ``fdir_vlan_match_mode`` (default ``strict``)\n+\n+  Used to select VLAN match mode. This runtime config can be ``strict``\n+  or ``nostrict`` and is only valid for PF devices.\n+  If driver works on ``strict`` mode (default mode), hardware does strictly\n+  match the input flow base on VLAN number.\n+\n+  For the following scenarios with two rules:\n+\n+  .. code-block:: console\n+\n+    rule0:\n+      pattern: eth type is 0x0806\n+      actions: queue index 3\n+    rule1:\n+      pattern: eth type is 0x0806 / vlan vid is 20\n+      actions: queue index 4\n+\n+  If application select ``strict`` mode, only the ARP packets with VLAN\n+  20 are directed to queue 4, and the ARP packets with other VLAN ID\n+  cannot be directed to the specified queue. If application want to all\n+  ARP packets with or without VLAN to be directed to the specified queue,\n+  application can select ``nostrict`` mode and just need to set rule0.\n+\n+  For example::\n+  -a 0000:7d:00.0,fdir_vlan_match_mode=nostrict\n \n Driver compilation and testing\n ------------------------------\ndiff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c\nindex f077ef5057..a11ea686fd 100644\n--- a/drivers/net/hns3/hns3_common.c\n+++ b/drivers/net/hns3/hns3_common.c\n@@ -238,6 +238,34 @@ hns3_parse_mbx_time_limit(const char *key, const char *value, void *extra_args)\n \treturn 0;\n }\n \n+static int\n+hns3_parse_vlan_match_mode(const char *key, const char *value, void *args)\n+{\n+\tuint8_t mode;\n+\n+\tRTE_SET_USED(key);\n+\n+\tif (value == NULL) {\n+\t\tPMD_INIT_LOG(WARNING, \"no value for key:\\\"%s\\\"\", key);\n+\t\treturn -1;\n+\t}\n+\n+\tif (strcmp(value, \"strict\") == 0) {\n+\t\tmode = HNS3_FDIR_VLAN_STRICT_MATCH;\n+\t} else if (strcmp(value, \"nostrict\") == 0) {\n+\t\tmode = HNS3_FDIR_VLAN_NOSTRICT_MATCH;\n+\t} else {\n+\t\tPMD_INIT_LOG(WARNING, \"invalid value:\\\"%s\\\" for key:\\\"%s\\\", \"\n+\t\t\t\"value must be 'strict' or 'nostrict'\",\n+\t\t\tvalue, key);\n+\t\treturn -1;\n+\t}\n+\n+\t*(uint8_t *)args = mode;\n+\n+\treturn 0;\n+}\n+\n void\n hns3_parse_devargs(struct rte_eth_dev *dev)\n {\n@@ -254,6 +282,8 @@ hns3_parse_devargs(struct rte_eth_dev *dev)\n \thns->tx_func_hint = HNS3_IO_FUNC_HINT_NONE;\n \thns->dev_caps_mask = 0;\n \thns->mbx_time_limit_ms = HNS3_MBX_DEF_TIME_LIMIT_MS;\n+\tif (!hns->is_vf)\n+\t\thns->pf.fdir.vlan_match_mode = HNS3_FDIR_VLAN_STRICT_MATCH;\n \n \tif (dev->device->devargs == NULL)\n \t\treturn;\n@@ -270,6 +300,11 @@ hns3_parse_devargs(struct rte_eth_dev *dev)\n \t\t\t   &hns3_parse_dev_caps_mask, &dev_caps_mask);\n \t(void)rte_kvargs_process(kvlist, HNS3_DEVARG_MBX_TIME_LIMIT_MS,\n \t\t\t   &hns3_parse_mbx_time_limit, &mbx_time_limit_ms);\n+\tif (!hns->is_vf)\n+\t\t(void)rte_kvargs_process(kvlist,\n+\t\t\t\t\t HNS3_DEVARG_FDIR_VALN_MATCH_MODE,\n+\t\t\t\t\t &hns3_parse_vlan_match_mode,\n+\t\t\t\t\t &hns->pf.fdir.vlan_match_mode);\n \n \trte_kvargs_free(kvlist);\n \ndiff --git a/drivers/net/hns3/hns3_common.h b/drivers/net/hns3/hns3_common.h\nindex 8eaeda26e7..cf9593bd0c 100644\n--- a/drivers/net/hns3/hns3_common.h\n+++ b/drivers/net/hns3/hns3_common.h\n@@ -27,6 +27,8 @@ enum {\n \n #define HNS3_DEVARG_MBX_TIME_LIMIT_MS\t\"mbx_time_limit_ms\"\n \n+#define HNS3_DEVARG_FDIR_VALN_MATCH_MODE\t\"fdir_vlan_match_mode\"\n+\n #define MSEC_PER_SEC              1000L\n #define USEC_PER_MSEC             1000L\n \ndiff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c\nindex 48a91fb517..c80fa59e63 100644\n--- a/drivers/net/hns3/hns3_fdir.c\n+++ b/drivers/net/hns3/hns3_fdir.c\n@@ -355,9 +355,13 @@ int hns3_init_fd_config(struct hns3_adapter *hns)\n \t/* roce_type is used to filter roce frames\n \t * dst_vport is used to specify the rule\n \t */\n-\tkey_cfg->meta_data_active = BIT(DST_VPORT) | BIT(TUNNEL_PACKET) |\n-\t    BIT(VLAN_NUMBER);\n-\thns3_dbg(hw, \"fdir meta data: dst_vport tunnel_packet vlan_number\");\n+\tkey_cfg->meta_data_active = BIT(DST_VPORT) | BIT(TUNNEL_PACKET);\n+\tif (pf->fdir.vlan_match_mode)\n+\t\tkey_cfg->meta_data_active |= BIT(VLAN_NUMBER);\n+\n+\thns3_dbg(hw, \"fdir meta data: dst_vport tunnel_packet %s\",\n+\t\t (pf->fdir.vlan_match_mode == HNS3_FDIR_VLAN_STRICT_MATCH) ?\n+\t\t \"vlan_number\" : \"\");\n \n \tret = hns3_get_fd_allocation(hw,\n \t\t\t\t     &pf->fdir.fd_cfg.rule_num[HNS3_FD_STAGE_1],\ndiff --git a/drivers/net/hns3/hns3_fdir.h b/drivers/net/hns3/hns3_fdir.h\nindex ce70a534dc..308cfbe56f 100644\n--- a/drivers/net/hns3/hns3_fdir.h\n+++ b/drivers/net/hns3/hns3_fdir.h\n@@ -170,6 +170,13 @@ struct hns3_fdir_rule_ele {\n \n TAILQ_HEAD(hns3_fdir_rule_list, hns3_fdir_rule_ele);\n \n+/*\n+ * On 'strict' mode, hardware bases on VLAN number to exactly match the\n+ * input flow.\n+ */\n+#define HNS3_FDIR_VLAN_STRICT_MATCH\t1\n+#define HNS3_FDIR_VLAN_NOSTRICT_MATCH\t0\n+\n /*\n  *  A structure used to define fields of a FDIR related info.\n  */\n@@ -178,6 +185,7 @@ struct hns3_fdir_info {\n \tstruct hns3_fdir_rule_ele **hash_map;\n \tstruct rte_hash *hash_handle;\n \tstruct hns3_fd_cfg fd_cfg;\n+\tuint8_t vlan_match_mode;\n };\n \n struct hns3_adapter;\n",
    "prefixes": [
        "v3",
        "2/2"
    ]
}