get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 76293,
    "url": "http://patches.dpdk.org/api/patches/76293/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200902063802.102428-3-qiming.yang@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": "<20200902063802.102428-3-qiming.yang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200902063802.102428-3-qiming.yang@intel.com",
    "date": "2020-09-02T06:38:02",
    "name": "[2/2] net/ice: add VLAN config for DCF",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "acdeac9f5a59728f8dfbb648a1ba498d5bdb3fb0",
    "submitter": {
        "id": 522,
        "url": "http://patches.dpdk.org/api/people/522/?format=api",
        "name": "Qiming Yang",
        "email": "qiming.yang@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/20200902063802.102428-3-qiming.yang@intel.com/mbox/",
    "series": [
        {
            "id": 11891,
            "url": "http://patches.dpdk.org/api/series/11891/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11891",
            "date": "2020-09-02T06:38:01",
            "name": "enable VLAN offload in DCF",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/11891/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/76293/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/76293/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 692D2A04B5;\n\tWed,  2 Sep 2020 08:59:47 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C50C51C0B6;\n\tWed,  2 Sep 2020 08:59:32 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by dpdk.org (Postfix) with ESMTP id 31E9A1C07D\n for <dev@dpdk.org>; Wed,  2 Sep 2020 08:59:30 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 01 Sep 2020 23:59:28 -0700",
            "from dpdk-qiming1.sh.intel.com ([10.67.119.9])\n by fmsmga004.fm.intel.com with ESMTP; 01 Sep 2020 23:59:27 -0700"
        ],
        "IronPort-SDR": [
            "\n 3sFe6EhnF3RuZonyl4krWkx7JmkPpSXZmvhByKOBsd5a3w0DPj0UczNYBMDhuk3B1fmqBUleeQ\n bx6/tjihD+nQ==",
            "\n hmcYWKwEUodhiBU0CA7RGj33ZYnEdpZTnWW7BrLXRMKc5N1baqHezvDalGv7eC7KE8/G4KGTYS\n B1iseVWkF7kg=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9731\"; a=\"156593272\"",
            "E=Sophos;i=\"5.76,381,1592895600\"; d=\"scan'208\";a=\"156593272\"",
            "E=Sophos;i=\"5.76,381,1592895600\"; d=\"scan'208\";a=\"325664236\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Qiming Yang <qiming.yang@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "qi.z.zhang@intel.com,\n\tQiming Yang <qiming.yang@intel.com>",
        "Date": "Wed,  2 Sep 2020 14:38:02 +0800",
        "Message-Id": "<20200902063802.102428-3-qiming.yang@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20200902063802.102428-1-qiming.yang@intel.com>",
        "References": "<20200902063802.102428-1-qiming.yang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 2/2] net/ice: add VLAN config for DCF",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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": "This patch add support for VF VLAN offload, port VLAN id set and\nVLAN ethertype set in DCF.\n\nThis patch depend on base code update.\n\nSigned-off-by: Qiming Yang <qiming.yang@intel.com>\n---\n drivers/net/ice/ice_dcf.h                |   1 +\n drivers/net/ice/ice_dcf_vf_representor.c | 120 +++++++++++++++++++++++\n 2 files changed, 121 insertions(+)",
    "diff": "diff --git a/drivers/net/ice/ice_dcf.h b/drivers/net/ice/ice_dcf.h\nindex a44a01e90..b960cf7cf 100644\n--- a/drivers/net/ice/ice_dcf.h\n+++ b/drivers/net/ice/ice_dcf.h\n@@ -59,6 +59,7 @@ struct ice_dcf_hw {\n \tuint16_t nb_msix;\n \tuint16_t rxq_map[16];\n \tstruct virtchnl_eth_stats eth_stats_offset;\n+\tstruct virtchnl_dcf_vlan_offload vlan_config;\n };\n \n int ice_dcf_execute_virtchnl_cmd(struct ice_dcf_hw *hw,\ndiff --git a/drivers/net/ice/ice_dcf_vf_representor.c b/drivers/net/ice/ice_dcf_vf_representor.c\nindex ceb54ab15..53d0db85f 100644\n--- a/drivers/net/ice/ice_dcf_vf_representor.c\n+++ b/drivers/net/ice/ice_dcf_vf_representor.c\n@@ -185,6 +185,123 @@ ice_dcf_representor_dev_info_get(struct rte_eth_dev *dev,\n \treturn 0;\n }\n \n+static int\n+ice_dcf_config_vlan_offload(struct ice_dcf_hw *hw,\n+\t\tstruct virtchnl_dcf_vlan_offload *vlan_config)\n+{\n+\tstruct dcf_virtchnl_cmd args;\n+\tint err;\n+\n+\tmemset(&args, 0, sizeof(args));\n+\targs.v_op = VIRTCHNL_OP_DCF_VLAN_OFFLOAD;\n+\targs.req_msg = (uint8_t *)vlan_config;\n+\targs.req_msglen = sizeof(vlan_config);\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\t \"VIRTCHNL_OP_DCF_VLAN_OFFLOAD\");\n+\treturn err;\n+}\n+\n+static int\n+ice_dcf_representor_vlan_offload_set(struct rte_eth_dev *dev, int mask)\n+{\n+\tstruct ice_dcf_vf_representor *representor = dev->data->dev_private;\n+\tstruct ice_dcf_hw *hw = &representor->adapter->real_hw;\n+\tstruct virtchnl_dcf_vlan_offload vlan_config;\n+\tint ret = 0;\n+\n+\tvlan_config.vf_id = representor->vf_id;\n+\n+\tif (hw->vlan_config.tx_flags == VIRTCHNL_VLAN_TX_INSERT) {\n+\t\tPMD_DRV_LOG(ERR, \"Please clear pvid before set vlan offload.\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (mask & ETH_VLAN_STRIP_MASK) {\n+\t\tif (hw->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) {\n+\t\t\tvlan_config.type = VIRTCHNL_VLAN_OUTER_TYPE;\n+\t\t\tvlan_config.rx_flags = VIRTCHNL_VLAN_RX_STRIP_IN_DESC;\n+\t\t\tvlan_config.tx_flags = VIRTCHNL_VLAN_TX_INSERT_BY_DESC;\n+\t\t} else {\n+\t\t\tvlan_config.type = VIRTCHNL_VLAN_OUTER_TYPE;\n+\t\t\tvlan_config.rx_flags = VIRTCHNL_VLAN_RX_NO_STRIP;\n+\t\t\tvlan_config.tx_flags = VIRTCHNL_VLAN_TX_INSERT_BY_DESC;\n+\t\t}\n+\t\tret = ice_dcf_config_vlan_offload(hw, &vlan_config);\n+\t\tif (ret < 0) {\n+\t\t\tPMD_DRV_LOG(ERR, \"Failed to set vlan offload.\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\n+\trte_memcpy(&hw->vlan_config, &vlan_config, sizeof(vlan_config));\n+\n+\treturn ret;\n+}\n+\n+static int\n+ice_dcf_representor_vlan_pvid_set(struct rte_eth_dev *dev,\n+\t\t\t\t  uint16_t pvid, int on)\n+{\n+\tstruct ice_dcf_vf_representor *representor = dev->data->dev_private;\n+\tstruct ice_dcf_hw *hw = &representor->adapter->real_hw;\n+\tstruct virtchnl_dcf_vlan_offload vlan_config;\n+\tint ret;\n+\n+\tvlan_config.vf_id = representor->vf_id;\n+\tvlan_config.type = VIRTCHNL_VLAN_OUTER_TYPE;\n+\tvlan_config.vlan_id = pvid;\n+\tif (on) {\n+\t\tvlan_config.rx_flags = VIRTCHNL_VLAN_RX_STRIP_ONLY;\n+\t\tvlan_config.tx_flags = VIRTCHNL_VLAN_TX_INSERT;\n+\t} else {\n+\t\tvlan_config.rx_flags = VIRTCHNL_VLAN_RX_NO_STRIP;\n+\t\tvlan_config.tx_flags = VIRTCHNL_VLAN_TX_INSERT_BY_DESC;\n+\t}\n+\n+\tret = ice_dcf_config_vlan_offload(hw, &vlan_config);\n+\tif (ret < 0) {\n+\t\tPMD_DRV_LOG(ERR, \"Failed to set pvid.\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\trte_memcpy(&hw->vlan_config, &vlan_config, sizeof(vlan_config));\n+\n+\treturn 0;\n+}\n+\n+static int\n+ice_dcf_representor_vlan_tpid_set(struct rte_eth_dev *dev,\n+\t\t\t\t  enum rte_vlan_type vlan_type,\n+\t\t\t\t  uint16_t tpid)\n+{\n+\tstruct ice_dcf_vf_representor *representor = dev->data->dev_private;\n+\tstruct ice_dcf_hw *hw = &representor->adapter->real_hw;\n+\tstruct virtchnl_dcf_vlan_offload vlan_config;\n+\tint ret;\n+\n+\tif (vlan_type != ETH_VLAN_TYPE_INNER &&\n+\t    vlan_type != ETH_VLAN_TYPE_OUTER) {\n+\t\tPMD_DRV_LOG(ERR,\n+\t\t\t    \"Unsupported vlan type.\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tvlan_config.vf_id = representor->vf_id;\n+\tvlan_config.ether_type = tpid;\n+\tret = ice_dcf_config_vlan_offload(hw, &vlan_config);\n+\tif (ret < 0) {\n+\t\tPMD_DRV_LOG(ERR,\n+\t\t\t    \"Set tpid fail\\n\");\n+\t\treturn ret;\n+\t}\n+\n+\trte_memcpy(&hw->vlan_config, &vlan_config, sizeof(vlan_config));\n+\n+\treturn ret;\n+}\n+\n static const struct eth_dev_ops ice_dcf_representor_dev_ops = {\n \t.dev_configure        = ice_dcf_representor_dev_configure,\n \t.dev_start            = ice_dcf_representor_dev_start,\n@@ -195,6 +312,9 @@ static const struct eth_dev_ops ice_dcf_representor_dev_ops = {\n \t.promiscuous_enable   = ice_dcf_representor_promiscuous_enable,\n \t.promiscuous_disable  = ice_dcf_representor_promiscuous_disable,\n \t.link_update          = ice_dcf_representor_link_update,\n+\t.vlan_offload_set     = ice_dcf_representor_vlan_offload_set,\n+\t.vlan_pvid_set        = ice_dcf_representor_vlan_pvid_set,\n+\t.vlan_tpid_set        = ice_dcf_representor_vlan_tpid_set,\n };\n \n int\n",
    "prefixes": [
        "2/2"
    ]
}