get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 94155,
    "url": "https://patches.dpdk.org/api/patches/94155/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1623553508-5478-3-git-send-email-humin29@huawei.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<1623553508-5478-3-git-send-email-humin29@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1623553508-5478-3-git-send-email-humin29@huawei.com",
    "date": "2021-06-13T03:05:06",
    "name": "[2/4] net/hns3: support for VF modify VLAN filter state",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "e9841dd4f5b5ed2d61e6e0565dcd1b6702fe023d",
    "submitter": {
        "id": 1944,
        "url": "https://patches.dpdk.org/api/people/1944/?format=api",
        "name": "humin (Q)",
        "email": "humin29@huawei.com"
    },
    "delegate": {
        "id": 3961,
        "url": "https://patches.dpdk.org/api/users/3961/?format=api",
        "username": "arybchenko",
        "first_name": "Andrew",
        "last_name": "Rybchenko",
        "email": "andrew.rybchenko@oktetlabs.ru"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1623553508-5478-3-git-send-email-humin29@huawei.com/mbox/",
    "series": [
        {
            "id": 17309,
            "url": "https://patches.dpdk.org/api/series/17309/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=17309",
            "date": "2021-06-13T03:05:07",
            "name": "features for hns3 PMD",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/17309/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/94155/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/94155/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 BE598A0C40;\n\tSun, 13 Jun 2021 05:05:47 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 3C2A3410FC;\n\tSun, 13 Jun 2021 05:05:37 +0200 (CEST)",
            "from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187])\n by mails.dpdk.org (Postfix) with ESMTP id 409B34003E\n for <dev@dpdk.org>; Sun, 13 Jun 2021 05:05:33 +0200 (CEST)",
            "from dggeme756-chm.china.huawei.com (unknown [172.30.72.57])\n by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4G2fWy3cwLzZcDQ\n for <dev@dpdk.org>; Sun, 13 Jun 2021 11:02:38 +0800 (CST)",
            "from localhost.localdomain (10.69.192.56) by\n dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id\n 15.1.2176.2; Sun, 13 Jun 2021 11:05:31 +0800"
        ],
        "From": "\"Min Hu (Connor)\" <humin29@huawei.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<ferruh.yigit@intel.com>",
        "Date": "Sun, 13 Jun 2021 11:05:06 +0800",
        "Message-ID": "<1623553508-5478-3-git-send-email-humin29@huawei.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1623553508-5478-1-git-send-email-humin29@huawei.com>",
        "References": "<1623553508-5478-1-git-send-email-humin29@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.69.192.56]",
        "X-ClientProxiedBy": "dggems703-chm.china.huawei.com (10.3.19.180) To\n dggeme756-chm.china.huawei.com (10.3.19.102)",
        "X-CFilter-Loop": "Reflected",
        "Subject": "[dpdk-dev] [PATCH 2/4] net/hns3: support for VF modify VLAN filter\n state",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Chengchang Tang <tangchengchang@huawei.com>\n\nSince the HW limitation for VF, the VLAN filter is default enabled, and\nis not allowed to be closed. Now, the limitation has been removed in\nKunpeng930 network engine, so this patch add support for VF to modify the\nVLAN filter state.\n\nA capabilities bit is added to differentiate between different platforms\nand achieve compatibility. When the VF runs on an incomatible platform or\nan incompatible kernel-mode driver version is used, the VF behavior is\nthe same as that before.\n\nSigned-off-by: Chengchang Tang <tangchengchang@huawei.com>\nSigned-off-by: Min Hu (Connor) <humin29@huawei.com>\n---\n drivers/net/hns3/hns3_cmd.h       |  9 ++++++++\n drivers/net/hns3/hns3_ethdev.h    |  4 ++++\n drivers/net/hns3/hns3_ethdev_vf.c | 48 ++++++++++++++++++++++++++++++++++++---\n drivers/net/hns3/hns3_mbx.h       |  1 +\n 4 files changed, 59 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h\nindex eafa365..a762158 100644\n--- a/drivers/net/hns3/hns3_cmd.h\n+++ b/drivers/net/hns3/hns3_cmd.h\n@@ -321,6 +321,15 @@ enum HNS3_CAPS_BITS {\n \tHNS3_CAPS_RXD_ADV_LAYOUT_B = 15,\n };\n \n+/* Capabilities of VF dependent on the PF */\n+enum HNS3VF_CAPS_BITS {\n+\t/*\n+\t * The following capability index definitions must be the same as those\n+\t * in kernel side PF.\n+\t */\n+\tHNS3VF_CAPS_VLAN_FLT_MOD_B = 0,\n+};\n+\n enum HNS3_API_CAP_BITS {\n \tHNS3_API_CAP_FLEX_RSS_TBL_B,\n };\ndiff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h\nindex ee84519..b8347c2 100644\n--- a/drivers/net/hns3/hns3_ethdev.h\n+++ b/drivers/net/hns3/hns3_ethdev.h\n@@ -869,8 +869,12 @@ enum {\n \tHNS3_DEV_SUPPORT_RXD_ADV_LAYOUT_B,\n \tHNS3_DEV_SUPPORT_OUTER_UDP_CKSUM_B,\n \tHNS3_DEV_SUPPORT_RAS_IMP_B,\n+\tHNS3_DEV_SUPPORT_VF_VLAN_FLT_MOD_B,\n };\n \n+#define hns3_dev_vf_vlan_flt_supported(hw) \\\n+\t\thns3_get_bit((hw)->capability, HNS3_DEV_SUPPORT_VF_VLAN_FLT_MOD_B)\n+\n #define hns3_dev_dcb_supported(hw) \\\n \thns3_get_bit((hw)->capability, HNS3_DEV_SUPPORT_DCB_B)\n \ndiff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c\nindex dc95e71..8f3be64 100644\n--- a/drivers/net/hns3/hns3_ethdev_vf.c\n+++ b/drivers/net/hns3/hns3_ethdev_vf.c\n@@ -1408,6 +1408,14 @@ hns3vf_get_queue_depth(struct hns3_hw *hw)\n \treturn 0;\n }\n \n+static void\n+hns3vf_update_caps(struct hns3_hw *hw, uint32_t caps)\n+{\n+\tif (hns3_get_bit(caps, HNS3VF_CAPS_VLAN_FLT_MOD_B))\n+\t\thns3_set_bit(hw->capability,\n+\t\t\t\tHNS3_DEV_SUPPORT_VF_VLAN_FLT_MOD_B, 1);\n+}\n+\n static int\n hns3vf_get_num_tc(struct hns3_hw *hw)\n {\n@@ -1440,7 +1448,7 @@ hns3vf_get_basic_info(struct hns3_hw *hw)\n \thw->hw_tc_map = basic_info->hw_tc_map;\n \thw->num_tc = hns3vf_get_num_tc(hw);\n \thw->pf_vf_if_version = basic_info->pf_vf_if_version;\n-\n+\thns3vf_update_caps(hw, basic_info->caps);\n \n \treturn 0;\n }\n@@ -1611,6 +1619,26 @@ hns3vf_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)\n }\n \n static int\n+hns3vf_en_vlan_filter(struct hns3_hw *hw, bool enable)\n+{\n+\tuint8_t msg_data;\n+\tint ret;\n+\n+\tif (!hns3_dev_vf_vlan_flt_supported(hw))\n+\t\treturn 0;\n+\n+\tmsg_data = enable ? 1 : 0;\n+\tret = hns3_send_mbx_msg(hw, HNS3_MBX_SET_VLAN,\n+\t\t\tHNS3_MBX_ENABLE_VLAN_FILTER, &msg_data,\n+\t\t\tsizeof(msg_data), true, NULL, 0);\n+\tif (ret)\n+\t\thns3_err(hw, \"%s vlan filter failed, ret = %d.\",\n+\t\t\t\tenable ? \"enable\" : \"disable\", ret);\n+\n+\treturn ret;\n+}\n+\n+static int\n hns3vf_en_hw_strip_rxvtag(struct hns3_hw *hw, bool enable)\n {\n \tuint8_t msg_data;\n@@ -1641,6 +1669,19 @@ hns3vf_vlan_offload_set(struct rte_eth_dev *dev, int mask)\n \t}\n \n \ttmp_mask = (unsigned int)mask;\n+\n+\tif (tmp_mask & ETH_VLAN_FILTER_MASK) {\n+\t\trte_spinlock_lock(&hw->lock);\n+\t\t/* Enable or disable VLAN filter */\n+\t\tif (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_FILTER)\n+\t\t\tret = hns3vf_en_vlan_filter(hw, true);\n+\t\telse\n+\t\t\tret = hns3vf_en_vlan_filter(hw, false);\n+\t\trte_spinlock_unlock(&hw->lock);\n+\t\tif (ret)\n+\t\t\treturn ret;\n+\t}\n+\n \t/* Vlan stripping setting */\n \tif (tmp_mask & ETH_VLAN_STRIP_MASK) {\n \t\trte_spinlock_lock(&hw->lock);\n@@ -1738,9 +1779,10 @@ hns3vf_dev_configure_vlan(struct rte_eth_dev *dev)\n \t}\n \n \t/* Apply vlan offload setting */\n-\tret = hns3vf_vlan_offload_set(dev, ETH_VLAN_STRIP_MASK);\n+\tret = hns3vf_vlan_offload_set(dev, ETH_VLAN_STRIP_MASK |\n+\t\t\t\t\tETH_VLAN_FILTER_MASK);\n \tif (ret)\n-\t\thns3_err(hw, \"dev config vlan offload failed, ret =%d\", ret);\n+\t\thns3_err(hw, \"dev config vlan offload failed, ret = %d.\", ret);\n \n \treturn ret;\n }\ndiff --git a/drivers/net/hns3/hns3_mbx.h b/drivers/net/hns3/hns3_mbx.h\nindex f07dbe3..f868e33 100644\n--- a/drivers/net/hns3/hns3_mbx.h\n+++ b/drivers/net/hns3/hns3_mbx.h\n@@ -71,6 +71,7 @@ enum hns3_mbx_vlan_cfg_subcode {\n \tHNS3_MBX_VLAN_TX_OFF_CFG,               /* set tx side vlan offload */\n \tHNS3_MBX_VLAN_RX_OFF_CFG,               /* set rx side vlan offload */\n \tHNS3_MBX_GET_PORT_BASE_VLAN_STATE = 4,  /* get port based vlan state */\n+\tHNS3_MBX_ENABLE_VLAN_FILTER,            /* set vlan filter state */\n };\n \n enum hns3_mbx_tbl_cfg_subcode {\n",
    "prefixes": [
        "2/4"
    ]
}