get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1228,
    "url": "https://patches.dpdk.org/api/patches/1228/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1415587563-11512-3-git-send-email-huawei.xie@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": "<1415587563-11512-3-git-send-email-huawei.xie@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1415587563-11512-3-git-send-email-huawei.xie@intel.com",
    "date": "2014-11-10T02:46:03",
    "name": "[dpdk-dev,v2,2/2] lib/librte_pmd_i40e: add I40E_VFTA_IDX and I40E_VFTA_BIT macros for VFTA related operation",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "a15f5350617beedb9899c1d924df401c06b715e1",
    "submitter": {
        "id": 16,
        "url": "https://patches.dpdk.org/api/people/16/?format=api",
        "name": "Huawei Xie",
        "email": "huawei.xie@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1415587563-11512-3-git-send-email-huawei.xie@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/1228/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/1228/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 356827F2D;\n\tMon, 10 Nov 2014 03:36:46 +0100 (CET)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 778464A6E\n\tfor <dev@dpdk.org>; Mon, 10 Nov 2014 03:36:43 +0100 (CET)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga101.jf.intel.com with ESMTP; 09 Nov 2014 18:46:15 -0800",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga003.jf.intel.com with ESMTP; 09 Nov 2014 18:44:34 -0800",
            "from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com\n\t[10.239.29.90])\n\tby shvmail01.sh.intel.com with ESMTP id sAA2kC3p021014;\n\tMon, 10 Nov 2014 10:46:12 +0800",
            "from shecgisg003.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid sAA2kAkU011564; Mon, 10 Nov 2014 10:46:12 +0800",
            "(from hxie5@localhost)\n\tby shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id sAA2kAXn011560; \n\tMon, 10 Nov 2014 10:46:10 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.04,691,1406617200\"; d=\"scan'208\";a=\"486073671\"",
        "From": "Huawei Xie <huawei.xie@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Mon, 10 Nov 2014 10:46:03 +0800",
        "Message-Id": "<1415587563-11512-3-git-send-email-huawei.xie@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1415587563-11512-1-git-send-email-huawei.xie@intel.com>",
        "References": "<1415587563-11512-1-git-send-email-huawei.xie@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 2/2] lib/librte_pmd_i40e: add I40E_VFTA_IDX\n\tand I40E_VFTA_BIT macros for VFTA related operation",
        "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": "Add two macros I40E_VFTA_IDX and I40E_VFTA_BIT for VFTA manipulation.\nAdd vlan_id check in vlan filter search and set function.\n\nSigned-off-by: Huawei Xie <huawei.xie@intel.com>\n---\n lib/librte_pmd_i40e/i40e_ethdev.c | 17 ++++++++++-------\n lib/librte_pmd_i40e/i40e_ethdev.h |  9 +++++++++\n 2 files changed, 19 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c b/lib/librte_pmd_i40e/i40e_ethdev.c\nindex c0cf3cf..245460f 100644\n--- a/lib/librte_pmd_i40e/i40e_ethdev.c\n+++ b/lib/librte_pmd_i40e/i40e_ethdev.c\n@@ -4033,8 +4033,11 @@ i40e_find_vlan_filter(struct i40e_vsi *vsi,\n {\n \tuint32_t vid_idx, vid_bit;\n \n-\tvid_idx = (uint32_t) ((vlan_id >> 5) & 0x7F);\n-\tvid_bit = (uint32_t) (1 << (vlan_id & 0x1F));\n+\tif (vlan_id > ETH_VLAN_ID_MAX)\n+\t\treturn 0;\n+\n+\tvid_idx = I40E_VFTA_IDX(vlan_id);\n+\tvid_bit = I40E_VFTA_BIT(vlan_id);\n \n \tif (vsi->vfta[vid_idx] & vid_bit)\n \t\treturn 1;\n@@ -4048,11 +4051,11 @@ i40e_set_vlan_filter(struct i40e_vsi *vsi,\n {\n \tuint32_t vid_idx, vid_bit;\n \n-\t/* VFTA is 32-bits size array, each element contains 32 vlan bits, Find the\n-\t *  element first, then find the bits it belongs to\n-\t */\n-\tvid_idx = (uint32_t) ((vlan_id >> 5 ) & 0x7F);\n-\tvid_bit = (uint32_t) (1 << (vlan_id & 0x1F));\n+\tif (vlan_id > ETH_VLAN_ID_MAX)\n+\t\treturn;\n+\n+\tvid_idx = I40E_VFTA_IDX(vlan_id);\n+\tvid_bit = I40E_VFTA_BIT(vlan_id);\n \n \tif (on)\n \t\tvsi->vfta[vid_idx] |= vid_bit;\ndiff --git a/lib/librte_pmd_i40e/i40e_ethdev.h b/lib/librte_pmd_i40e/i40e_ethdev.h\nindex 96361c2..4f2c16a 100644\n--- a/lib/librte_pmd_i40e/i40e_ethdev.h\n+++ b/lib/librte_pmd_i40e/i40e_ethdev.h\n@@ -50,6 +50,15 @@\n #define I40E_DEFAULT_QP_NUM_FDIR  64\n #define I40E_UINT32_BIT_SIZE      (CHAR_BIT * sizeof(uint32_t))\n #define I40E_VFTA_SIZE            (4096 / I40E_UINT32_BIT_SIZE)\n+/*\n+ * vlan_id is a 12 bit number.\n+ * The VFTA array is actually a 4096 bit array, 128 of 32bit elements.\n+ * 2^5 = 32. The val of lower 5 bits specifies the bit in the 32bit element.\n+ * The higher 7 bit val specifies VFTA array index.\n+ */\n+#define I40E_VFTA_BIT(vlan_id)    (1 << ((vlan_id) & 0x1F))\n+#define I40E_VFTA_IDX(vlan_id)    ((vlan_id) >> 5)\n+\n /* Default TC traffic in case DCB is not enabled */\n #define I40E_DEFAULT_TCMAP        0x1\n \n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "2/2"
    ]
}