get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 109676,
    "url": "http://patches.dpdk.org/api/patches/109676/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220413171030.2231163-9-kevinx.liu@intel.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": "<20220413171030.2231163-9-kevinx.liu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220413171030.2231163-9-kevinx.liu@intel.com",
    "date": "2022-04-13T17:10:16",
    "name": "[v3,08/22] net/ice: support dcf VLAN filter and offload configuration",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e5d5aef0b2ff25d65c219aa20e89c019a8c738dc",
    "submitter": {
        "id": 2440,
        "url": "http://patches.dpdk.org/api/people/2440/?format=api",
        "name": "Kevin Liu",
        "email": "kevinx.liu@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "http://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220413171030.2231163-9-kevinx.liu@intel.com/mbox/",
    "series": [
        {
            "id": 22498,
            "url": "http://patches.dpdk.org/api/series/22498/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=22498",
            "date": "2022-04-13T17:10:08",
            "name": "support full function of DCF",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/22498/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/109676/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/109676/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 7B619A0508;\n\tWed, 13 Apr 2022 11:12:41 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id CA6CD42822;\n\tWed, 13 Apr 2022 11:12:19 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by mails.dpdk.org (Postfix) with ESMTP id 41AAB4068B\n for <dev@dpdk.org>; Wed, 13 Apr 2022 11:12:15 +0200 (CEST)",
            "from orsmga007.jf.intel.com ([10.7.209.58])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 13 Apr 2022 02:12:03 -0700",
            "from intel-cd-odc-kevin.cd.intel.com ([10.240.178.195])\n by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 13 Apr 2022 02:12:00 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1649841136; x=1681377136;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=llY6IOz8dlyDhNchvrE++z5xtL8Zh+wU7YCAs0cdukc=;\n b=CWGZhNsD3ho84UQG0hIZlN0aR9HAS/P95hEcewM094uAr4isqlpFNGOf\n K0q7R8zfhRjUeeeRde8D/9EDrpEW0W4yTYEbWeC+sV/k5LaTfOdo233nv\n hMoHrAx8QZGeDbvJdWUkNd6q0VmmZn6WnG5vqKbqJ7KMh4oXJ3PlTT9O1\n 1Y/jhWS9T7o+gdYZ/HyPd7ftoB4yHVC1uUwxGrabg7hA9C00W4XY2PMlc\n KAkdQxNNdkpMbB1TwfWfd4F/r9C0p/82gizNcBKjCidO1TD5dVeyNVofp\n O+gOUXkAlRJA1/S3MEpKWNdzTSMyTau5tTQeGKPcemH2jSamPZI5ZQygr A==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6400,9594,10315\"; a=\"262058373\"",
            "E=Sophos;i=\"5.90,256,1643702400\"; d=\"scan'208\";a=\"262058373\"",
            "E=Sophos;i=\"5.90,256,1643702400\"; d=\"scan'208\";a=\"552122804\""
        ],
        "From": "Kevin Liu <kevinx.liu@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "qiming.yang@intel.com, qi.z.zhang@intel.com, stevex.yang@intel.com,\n Alvin Zhang <alvinx.zhang@intel.com>, Kevin Liu <kevinx.liu@intel.com>",
        "Subject": "[PATCH v3 08/22] net/ice: support dcf VLAN filter and offload\n configuration",
        "Date": "Wed, 13 Apr 2022 17:10:16 +0000",
        "Message-Id": "<20220413171030.2231163-9-kevinx.liu@intel.com>",
        "X-Mailer": "git-send-email 2.33.1",
        "In-Reply-To": "<20220413171030.2231163-1-kevinx.liu@intel.com>",
        "References": "<20220413160932.2074781-1-kevinx.liu@intel.com>\n <20220413171030.2231163-1-kevinx.liu@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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: Alvin Zhang <alvinx.zhang@intel.com>\n\nBelow PMD ops are supported in this patch:\n    .vlan_filter_set  = dcf_dev_vlan_filter_set\n    .vlan_offload_set = dcf_dev_vlan_offload_set\n\nSigned-off-by: Alvin Zhang <alvinx.zhang@intel.com>\nSigned-off-by: Kevin Liu <kevinx.liu@intel.com>\n---\n drivers/net/ice/ice_dcf_ethdev.c | 101 +++++++++++++++++++++++++++++++\n 1 file changed, 101 insertions(+)",
    "diff": "diff --git a/drivers/net/ice/ice_dcf_ethdev.c b/drivers/net/ice/ice_dcf_ethdev.c\nindex 0d944f9fd2..e58cdf47d2 100644\n--- a/drivers/net/ice/ice_dcf_ethdev.c\n+++ b/drivers/net/ice/ice_dcf_ethdev.c\n@@ -1026,6 +1026,105 @@ dcf_dev_set_default_mac_addr(struct rte_eth_dev *dev,\n \treturn 0;\n }\n \n+static int\n+dcf_add_del_vlan(struct ice_dcf_hw *hw, uint16_t vlanid, bool add)\n+{\n+\tstruct virtchnl_vlan_filter_list *vlan_list;\n+\tuint8_t cmd_buffer[sizeof(struct virtchnl_vlan_filter_list) +\n+\t\t\t\t\t\t\tsizeof(uint16_t)];\n+\tstruct dcf_virtchnl_cmd args;\n+\tint err;\n+\n+\tvlan_list = (struct virtchnl_vlan_filter_list *)cmd_buffer;\n+\tvlan_list->vsi_id = hw->vsi_res->vsi_id;\n+\tvlan_list->num_elements = 1;\n+\tvlan_list->vlan_id[0] = vlanid;\n+\n+\tmemset(&args, 0, sizeof(args));\n+\targs.v_op = add ? VIRTCHNL_OP_ADD_VLAN : VIRTCHNL_OP_DEL_VLAN;\n+\targs.req_msg = cmd_buffer;\n+\targs.req_msglen = sizeof(cmd_buffer);\n+\terr = ice_dcf_execute_virtchnl_cmd(hw, &args);\n+\tif (err)\n+\t\tPMD_DRV_LOG(ERR, \"fail to execute command %s\",\n+\t\t\t    add ? \"OP_ADD_VLAN\" :  \"OP_DEL_VLAN\");\n+\n+\treturn err;\n+}\n+\n+static int\n+dcf_enable_vlan_strip(struct ice_dcf_hw *hw)\n+{\n+\tstruct dcf_virtchnl_cmd args;\n+\tint ret;\n+\n+\tmemset(&args, 0, sizeof(args));\n+\targs.v_op = VIRTCHNL_OP_ENABLE_VLAN_STRIPPING;\n+\tret = ice_dcf_execute_virtchnl_cmd(hw, &args);\n+\tif (ret)\n+\t\tPMD_DRV_LOG(ERR,\n+\t\t\t    \"Failed to execute command of OP_ENABLE_VLAN_STRIPPING\");\n+\n+\treturn ret;\n+}\n+\n+static int\n+dcf_disable_vlan_strip(struct ice_dcf_hw *hw)\n+{\n+\tstruct dcf_virtchnl_cmd args;\n+\tint ret;\n+\n+\tmemset(&args, 0, sizeof(args));\n+\targs.v_op = VIRTCHNL_OP_DISABLE_VLAN_STRIPPING;\n+\tret = ice_dcf_execute_virtchnl_cmd(hw, &args);\n+\tif (ret)\n+\t\tPMD_DRV_LOG(ERR,\n+\t\t\t    \"Failed to execute command of OP_DISABLE_VLAN_STRIPPING\");\n+\n+\treturn ret;\n+}\n+\n+static int\n+dcf_dev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)\n+{\n+\tstruct ice_dcf_adapter *adapter = dev->data->dev_private;\n+\tstruct ice_dcf_hw *hw = &adapter->real_hw;\n+\tint err;\n+\n+\tif (!(hw->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN))\n+\t\treturn -ENOTSUP;\n+\n+\terr = dcf_add_del_vlan(hw, vlan_id, on);\n+\tif (err)\n+\t\treturn -EIO;\n+\treturn 0;\n+}\n+\n+static int\n+dcf_dev_vlan_offload_set(struct rte_eth_dev *dev, int mask)\n+{\n+\tstruct ice_dcf_adapter *adapter = dev->data->dev_private;\n+\tstruct ice_dcf_hw *hw = &adapter->real_hw;\n+\tstruct rte_eth_conf *dev_conf = &dev->data->dev_conf;\n+\tint err;\n+\n+\tif (!(hw->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN))\n+\t\treturn -ENOTSUP;\n+\n+\t/* Vlan stripping setting */\n+\tif (mask & RTE_ETH_VLAN_STRIP_MASK) {\n+\t\t/* Enable or disable VLAN stripping */\n+\t\tif (dev_conf->rxmode.offloads & RTE_ETH_RX_OFFLOAD_VLAN_STRIP)\n+\t\t\terr = dcf_enable_vlan_strip(hw);\n+\t\telse\n+\t\t\terr = dcf_disable_vlan_strip(hw);\n+\n+\t\tif (err)\n+\t\t\treturn -EIO;\n+\t}\n+\treturn 0;\n+}\n+\n static int\n ice_dcf_dev_flow_ops_get(struct rte_eth_dev *dev,\n \t\t\t const struct rte_flow_ops **ops)\n@@ -1538,6 +1637,8 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = {\n \t.mac_addr_remove          = dcf_dev_del_mac_addr,\n \t.set_mc_addr_list         = dcf_set_mc_addr_list,\n \t.mac_addr_set             = dcf_dev_set_default_mac_addr,\n+\t.vlan_filter_set          = dcf_dev_vlan_filter_set,\n+\t.vlan_offload_set         = dcf_dev_vlan_offload_set,\n \t.flow_ops_get             = ice_dcf_dev_flow_ops_get,\n \t.udp_tunnel_port_add\t  = ice_dcf_dev_udp_tunnel_port_add,\n \t.udp_tunnel_port_del\t  = ice_dcf_dev_udp_tunnel_port_del,\n",
    "prefixes": [
        "v3",
        "08/22"
    ]
}