get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 19282,
    "url": "http://patches.dpdk.org/api/patches/19282/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1484290401-1404-4-git-send-email-wenzhuo.lu@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": "<1484290401-1404-4-git-send-email-wenzhuo.lu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1484290401-1404-4-git-send-email-wenzhuo.lu@intel.com",
    "date": "2017-01-13T06:52:58",
    "name": "[dpdk-dev,v9,03/26] net/i40e: set VF MAC anti-spoofing from PF",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c571aefe69805c692e2e14b0421b6503bc439163",
    "submitter": {
        "id": 258,
        "url": "http://patches.dpdk.org/api/people/258/?format=api",
        "name": "Wenzhuo Lu",
        "email": "wenzhuo.lu@intel.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1484290401-1404-4-git-send-email-wenzhuo.lu@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/19282/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/19282/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 3B9DFF924;\n\tFri, 13 Jan 2017 07:54:18 +0100 (CET)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby dpdk.org (Postfix) with ESMTP id 083F7558D\n\tfor <dev@dpdk.org>; Fri, 13 Jan 2017 07:53:31 +0100 (CET)",
            "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby fmsmga105.fm.intel.com with ESMTP; 12 Jan 2017 22:53:31 -0800",
            "from dpdk26.sh.intel.com ([10.239.128.228])\n\tby fmsmga005.fm.intel.com with ESMTP; 12 Jan 2017 22:53:30 -0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.33,220,1477983600\"; d=\"scan'208\";a=\"52749728\"",
        "From": "Wenzhuo Lu <wenzhuo.lu@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Wenzhuo Lu <wenzhuo.lu@intel.com>",
        "Date": "Fri, 13 Jan 2017 14:52:58 +0800",
        "Message-Id": "<1484290401-1404-4-git-send-email-wenzhuo.lu@intel.com>",
        "X-Mailer": "git-send-email 1.9.3",
        "In-Reply-To": "<1484290401-1404-1-git-send-email-wenzhuo.lu@intel.com>",
        "References": "<1480637533-37425-1-git-send-email-wenzhuo.lu@intel.com>\n\t<1484290401-1404-1-git-send-email-wenzhuo.lu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v9 03/26] net/i40e: set VF MAC anti-spoofing from\n\tPF",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Support enabling/disabling VF MAC anti-spoofing from\nPF.\nUser can call the API on PF to enable/disable a specific\nVF's MAC anti-spoofing.\n\nSigned-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>\n---\n drivers/net/i40e/i40e_ethdev.c            | 62 +++++++++++++++++++++++++++++++\n drivers/net/i40e/rte_pmd_i40e.h           | 19 ++++++++++\n drivers/net/i40e/rte_pmd_i40e_version.map |  1 +\n 3 files changed, 82 insertions(+)",
    "diff": "diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c\nindex a13d96b..eba5168 100644\n--- a/drivers/net/i40e/i40e_ethdev.c\n+++ b/drivers/net/i40e/i40e_ethdev.c\n@@ -9718,3 +9718,65 @@ static void i40e_set_default_mac_addr(struct rte_eth_dev *dev,\n \n \treturn 0;\n }\n+\n+int\n+rte_pmd_i40e_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf_id, uint8_t on)\n+{\n+\tstruct rte_eth_dev *dev;\n+\tstruct i40e_pf *pf;\n+\tstruct i40e_vsi *vsi;\n+\tstruct i40e_hw *hw;\n+\tstruct i40e_vsi_context ctxt;\n+\tint ret;\n+\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);\n+\n+\tdev = &rte_eth_devices[port];\n+\n+\tpf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n+\n+\tif (vf_id >= pf->vf_num || !pf->vfs) {\n+\t\tPMD_DRV_LOG(ERR, \"Invalid argument.\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tvsi = pf->vfs[vf_id].vsi;\n+\tif (!vsi) {\n+\t\tPMD_DRV_LOG(ERR, \"Invalid VSI.\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/* Check if it has been already on or off */\n+\tif (vsi->info.valid_sections &\n+\t\trte_cpu_to_le_16(I40E_AQ_VSI_PROP_SECURITY_VALID)) {\n+\t\tif (on) {\n+\t\t\tif ((vsi->info.sec_flags &\n+\t\t\t     I40E_AQ_VSI_SEC_FLAG_ENABLE_MAC_CHK) ==\n+\t\t\t    I40E_AQ_VSI_SEC_FLAG_ENABLE_MAC_CHK)\n+\t\t\t\treturn 0; /* already on */\n+\t\t} else {\n+\t\t\tif ((vsi->info.sec_flags &\n+\t\t\t     I40E_AQ_VSI_SEC_FLAG_ENABLE_MAC_CHK) == 0)\n+\t\t\t\treturn 0; /* already off */\n+\t\t}\n+\t}\n+\n+\tvsi->info.valid_sections = cpu_to_le16(I40E_AQ_VSI_PROP_SECURITY_VALID);\n+\tif (on)\n+\t\tvsi->info.sec_flags |= I40E_AQ_VSI_SEC_FLAG_ENABLE_MAC_CHK;\n+\telse\n+\t\tvsi->info.sec_flags &= ~I40E_AQ_VSI_SEC_FLAG_ENABLE_MAC_CHK;\n+\n+\tmemset(&ctxt, 0, sizeof(ctxt));\n+\t(void)rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));\n+\tctxt.seid = vsi->seid;\n+\n+\thw = I40E_VSI_TO_HW(vsi);\n+\tret = i40e_aq_update_vsi_params(hw, &ctxt, NULL);\n+\tif (ret != I40E_SUCCESS) {\n+\t\tret = -ENOTSUP;\n+\t\tPMD_DRV_LOG(ERR, \"Failed to update VSI params\");\n+\t}\n+\n+\treturn ret;\n+}\ndiff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h\nindex 84c9291..d13736f 100644\n--- a/drivers/net/i40e/rte_pmd_i40e.h\n+++ b/drivers/net/i40e/rte_pmd_i40e.h\n@@ -79,4 +79,23 @@ struct rte_pmd_i40e_mb_event_param {\n  */\n int rte_pmd_i40e_ping_vfs(uint8_t port, uint16_t vf);\n \n+/**\n+ * Enable/Disable VF MAC anti spoofing.\n+ *\n+ * @param port\n+ *    The port identifier of the Ethernet device.\n+ * @param vf\n+ *    VF on which to set MAC anti spoofing.\n+ * @param on\n+ *    1 - Enable VFs MAC anti spoofing.\n+ *    0 - Disable VFs MAC anti spoofing.\n+ * @return\n+ *   - (0) if successful.\n+ *   - (-ENODEV) if *port* invalid.\n+ *   - (-EINVAL) if bad parameter.\n+ */\n+int rte_pmd_i40e_set_vf_mac_anti_spoof(uint8_t port,\n+\t\t\t\t       uint16_t vf_id,\n+\t\t\t\t       uint8_t on);\n+\n #endif /* _PMD_I40E_H_ */\ndiff --git a/drivers/net/i40e/rte_pmd_i40e_version.map b/drivers/net/i40e/rte_pmd_i40e_version.map\nindex 3c6a192..0581209 100644\n--- a/drivers/net/i40e/rte_pmd_i40e_version.map\n+++ b/drivers/net/i40e/rte_pmd_i40e_version.map\n@@ -7,5 +7,6 @@ DPDK_17.02 {\n \tglobal:\n \n \trte_pmd_i40e_ping_vfs;\n+\trte_pmd_i40e_set_vf_mac_anti_spoof;\n \n } DPDK_2.0;\n",
    "prefixes": [
        "dpdk-dev",
        "v9",
        "03/26"
    ]
}