get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 7925,
    "url": "https://patches.dpdk.org/api/patches/7925/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1445576732-23589-1-git-send-email-wenzhuo.lu@intel.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": "<1445576732-23589-1-git-send-email-wenzhuo.lu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1445576732-23589-1-git-send-email-wenzhuo.lu@intel.com",
    "date": "2015-10-23T05:05:32",
    "name": "[dpdk-dev,v3] ixgbe: Drop flow control frames from VFs",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "69360388d79d810b133de845a5a0c07ad599a182",
    "submitter": {
        "id": 258,
        "url": "https://patches.dpdk.org/api/people/258/?format=api",
        "name": "Wenzhuo Lu",
        "email": "wenzhuo.lu@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1445576732-23589-1-git-send-email-wenzhuo.lu@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/7925/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/7925/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 56A70C350;\n\tFri, 23 Oct 2015 07:05:42 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 817C6C34C\n\tfor <dev@dpdk.org>; Fri, 23 Oct 2015 07:05:41 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby orsmga101.jf.intel.com with ESMTP; 22 Oct 2015 22:05:40 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby fmsmga002.fm.intel.com with ESMTP; 22 Oct 2015 22:05:39 -0700",
            "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id t9N55cmu012334;\n\tFri, 23 Oct 2015 13:05:38 +0800",
            "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid t9N55Y8B023623; Fri, 23 Oct 2015 13:05:36 +0800",
            "(from wenzhuol@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t9N55YTV023619; \n\tFri, 23 Oct 2015 13:05:34 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.20,185,1444719600\"; d=\"scan'208\";a=\"833590588\"",
        "From": "Wenzhuo Lu <wenzhuo.lu@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri, 23 Oct 2015 13:05:32 +0800",
        "Message-Id": "<1445576732-23589-1-git-send-email-wenzhuo.lu@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1444445798-23929-1-git-send-email-wenzhuo.lu@intel.com>",
        "References": "<1444445798-23929-1-git-send-email-wenzhuo.lu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v3] ixgbe: Drop flow control frames from VFs",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <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": "This patch will drop flow control frames from being transmitted\nfrom VSIs.\nWith this patch in place a malicious VF cannot send flow control\nor PFC packets out on the wire.\n\nV2:\nReword the comments.\n\nV3:\nMove the check of set_ethertype_anti_spoofing to the top of the function,\nto avoid occupying an ethertype_filter entity without using it.\n\nSigned-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>\n---\n drivers/net/ixgbe/ixgbe_pf.c | 47 ++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 47 insertions(+)",
    "diff": "diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c\nindex fd1c4ca..1627030 100644\n--- a/drivers/net/ixgbe/ixgbe_pf.c\n+++ b/drivers/net/ixgbe/ixgbe_pf.c\n@@ -55,6 +55,7 @@\n #define IXGBE_MAX_VFTA     (128)\n #define IXGBE_VF_MSG_SIZE_DEFAULT 1\n #define IXGBE_VF_GET_QUEUE_MSG_SIZE 5\n+#define IXGBE_ETHERTYPE_FLOW_CTRL 0x8808\n \n static inline uint16_t\n dev_num_vf(struct rte_eth_dev *eth_dev)\n@@ -166,6 +167,50 @@ void ixgbe_pf_host_uninit(struct rte_eth_dev *eth_dev)\n \t*vfinfo = NULL;\n }\n \n+static void\n+ixgbe_add_tx_flow_control_drop_filter(struct rte_eth_dev *eth_dev)\n+{\n+\tstruct ixgbe_hw *hw =\n+\t\tIXGBE_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);\n+\tstruct ixgbe_filter_info *filter_info =\n+\t\tIXGBE_DEV_PRIVATE_TO_FILTER_INFO(eth_dev->data->dev_private);\n+\tuint16_t vf_num;\n+\tint i;\n+\n+\tif (!hw->mac.ops.set_ethertype_anti_spoofing) {\n+\t\tRTE_LOG(INFO, PMD, \"ether type anti-spoofing is not\"\n+\t\t\t\" supported.\\n\");\n+\t\treturn;\n+\t}\n+\n+\t/* occupy an entity of ether type filter */\n+\tfor (i = 0; i < IXGBE_MAX_ETQF_FILTERS; i++) {\n+\t\tif (!(filter_info->ethertype_mask & (1 << i))) {\n+\t\t\tfilter_info->ethertype_mask |= 1 << i;\n+\t\t\tfilter_info->ethertype_filters[i] =\n+\t\t\t\tIXGBE_ETHERTYPE_FLOW_CTRL;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\tif (i == IXGBE_MAX_ETQF_FILTERS) {\n+\t\tRTE_LOG(ERR, PMD, \"Cannot find an unused ether type filter\"\n+\t\t\t\" entity for flow control.\\n\");\n+\t\treturn;\n+\t}\n+\n+\tIXGBE_WRITE_REG(hw, IXGBE_ETQF(i),\n+\t\t\t(IXGBE_ETQF_FILTER_EN |\n+\t\t\tIXGBE_ETQF_TX_ANTISPOOF |\n+\t\t\tIXGBE_ETHERTYPE_FLOW_CTRL));\n+\n+\tvf_num = dev_num_vf(eth_dev);\n+\tfor (i = 0; i < vf_num; i++) {\n+\t\thw->mac.ops.set_ethertype_anti_spoofing(hw, true, i);\n+\t}\n+\n+\treturn;\n+}\n+\n int ixgbe_pf_host_configure(struct rte_eth_dev *eth_dev)\n {\n \tuint32_t vtctl, fcrth;\n@@ -262,6 +307,8 @@ int ixgbe_pf_host_configure(struct rte_eth_dev *eth_dev)\n \t\tIXGBE_WRITE_REG(hw, IXGBE_FCRTH_82599(i), fcrth);\n \t}\n \n+\tixgbe_add_tx_flow_control_drop_filter(eth_dev);\n+\n \treturn 0;\n }\n \n",
    "prefixes": [
        "dpdk-dev",
        "v3"
    ]
}