get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 593099,
    "url": "http://patchwork.ozlabs.org/api/patches/593099/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1457372509-3135-1-git-send-email-sridhar.samudrala@intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1457372509-3135-1-git-send-email-sridhar.samudrala@intel.com>",
    "list_archive_url": null,
    "date": "2016-03-07T17:41:47",
    "name": "[v2,net-next,1/3] net: ixgbe: fix error handling in tc cls_u32 offload routines.",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "a1d8f2c3226186178da894cbec1084a190a93b39",
    "submitter": {
        "id": 65219,
        "url": "http://patchwork.ozlabs.org/api/people/65219/?format=api",
        "name": "Samudrala, Sridhar",
        "email": "sridhar.samudrala@intel.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1457372509-3135-1-git-send-email-sridhar.samudrala@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/593099/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/593099/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@lists.osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Received": [
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ozlabs.org (Postfix) with ESMTP id 4EA7A1402D8\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  8 Mar 2016 04:45:58 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 89F3633A3D;\n\tMon,  7 Mar 2016 17:45:57 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id cN5RWNb0NyWb; Mon,  7 Mar 2016 17:45:56 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 1597E31257;\n\tMon,  7 Mar 2016 17:45:56 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 41ECD1C1677\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  7 Mar 2016 17:45:55 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 3D3C6A6349\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  7 Mar 2016 17:45:55 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id c9FeYnmo-yLy for <intel-wired-lan@lists.osuosl.org>;\n\tMon,  7 Mar 2016 17:45:50 +0000 (UTC)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 27293A633F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  7 Mar 2016 17:45:50 +0000 (UTC)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby fmsmga102.fm.intel.com with ESMTP; 07 Mar 2016 09:45:49 -0800",
            "from unknown (HELO sri02.jf.intel.com) ([10.166.39.21])\n\tby fmsmga004.fm.intel.com with ESMTP; 07 Mar 2016 09:45:50 -0800"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.22,552,1449561600\"; d=\"scan'208\";a=\"61475938\"",
        "From": "Sridhar Samudrala <sridhar.samudrala@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org, john.r.fastabend@intel.com,\n\tjeffrey.t.kirsher@intel.com",
        "Date": "Mon,  7 Mar 2016 09:41:47 -0800",
        "Message-Id": "<1457372509-3135-1-git-send-email-sridhar.samudrala@intel.com>",
        "X-Mailer": "git-send-email 2.1.0",
        "Subject": "[Intel-wired-lan] [PATCH v2 net-next 1/3] net: ixgbe: fix error\n\thandling in tc cls_u32 offload routines.",
        "X-BeenThere": "intel-wired-lan@lists.osuosl.org",
        "X-Mailman-Version": "2.1.18-1",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>",
        "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>",
        "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>"
    },
    "content": "Check for handle ids when adding/deleting hash nodes OR adding/deleting\nfilter entries and limit them to max number of links or header nodes\nsupported(IXGBE_MAX_LINK_HANDLE).\n\nStart from bit 0 when setting hash table bit-map.(adapter->tables)\n\nSigned-off-by: Sridhar Samudrala <sridhar.samudrala@intel.com>\n\n---\n\nJeff,\nThis patchset replaces the following 2 patches that are in your queue.\nhttps://patchwork.ozlabs.org/patch/591644/\nhttps://patchwork.ozlabs.org/patch/592194/\n\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 52 +++++++++++++++++----------\n 1 file changed, 34 insertions(+), 18 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex b893ff8..10ccd96 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -8209,10 +8209,17 @@ int ixgbe_setup_tc(struct net_device *dev, u8 tc)\n static int ixgbe_delete_clsu32(struct ixgbe_adapter *adapter,\n \t\t\t       struct tc_cls_u32_offload *cls)\n {\n+\tu32 uhtid = TC_U32_USERHTID(cls->knode.handle);\n+\tu32 loc;\n \tint err;\n \n+\tif ((uhtid != 0x800) && (uhtid >= IXGBE_MAX_LINK_HANDLE))\n+\t\treturn -EINVAL;\n+\n+\tloc = cls->knode.handle & 0xfffff;\n+\n \tspin_lock(&adapter->fdir_perfect_lock);\n-\terr = ixgbe_update_ethtool_fdir_entry(adapter, NULL, cls->knode.handle);\n+\terr = ixgbe_update_ethtool_fdir_entry(adapter, NULL, loc);\n \tspin_unlock(&adapter->fdir_perfect_lock);\n \treturn err;\n }\n@@ -8221,20 +8228,30 @@ static int ixgbe_configure_clsu32_add_hnode(struct ixgbe_adapter *adapter,\n \t\t\t\t\t    __be16 protocol,\n \t\t\t\t\t    struct tc_cls_u32_offload *cls)\n {\n+\tu32 uhtid = TC_U32_USERHTID(cls->hnode.handle);\n+\n+\tif (uhtid >= IXGBE_MAX_LINK_HANDLE)\n+\t\treturn -EINVAL;\n+\n \t/* This ixgbe devices do not support hash tables at the moment\n \t * so abort when given hash tables.\n \t */\n \tif (cls->hnode.divisor > 0)\n \t\treturn -EINVAL;\n \n-\tset_bit(TC_U32_USERHTID(cls->hnode.handle), &adapter->tables);\n+\tset_bit(uhtid-1, &adapter->tables);\n \treturn 0;\n }\n \n static int ixgbe_configure_clsu32_del_hnode(struct ixgbe_adapter *adapter,\n \t\t\t\t\t    struct tc_cls_u32_offload *cls)\n {\n-\tclear_bit(TC_U32_USERHTID(cls->hnode.handle), &adapter->tables);\n+\tu32 uhtid = TC_U32_USERHTID(cls->hnode.handle);\n+\n+\tif (uhtid >= IXGBE_MAX_LINK_HANDLE)\n+\t\treturn -EINVAL;\n+\n+\tclear_bit(uhtid-1, &adapter->tables);\n \treturn 0;\n }\n \n@@ -8252,27 +8269,29 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter,\n #endif\n \tint i, err = 0;\n \tu8 queue;\n-\tu32 handle;\n+\tu32 uhtid, link_uhtid;\n \n \tmemset(&mask, 0, sizeof(union ixgbe_atr_input));\n-\thandle = cls->knode.handle;\n+\tuhtid = TC_U32_USERHTID(cls->knode.handle);\n+\tlink_uhtid = TC_U32_USERHTID(cls->knode.link_handle);\n \n-\t/* At the moment cls_u32 jumps to transport layer and skips past\n+\t/* At the moment cls_u32 jumps to network layer and skips past\n \t * L2 headers. The canonical method to match L2 frames is to use\n \t * negative values. However this is error prone at best but really\n \t * just broken because there is no way to \"know\" what sort of hdr\n-\t * is in front of the transport layer. Fix cls_u32 to support L2\n+\t * is in front of the network layer. Fix cls_u32 to support L2\n \t * headers when needed.\n \t */\n \tif (protocol != htons(ETH_P_IP))\n \t\treturn -EINVAL;\n \n-\tif (cls->knode.link_handle ||\n-\t    cls->knode.link_handle >= IXGBE_MAX_LINK_HANDLE) {\n+\tif (link_uhtid) {\n \t\tstruct ixgbe_nexthdr *nexthdr = ixgbe_ipv4_jumps;\n-\t\tu32 uhtid = TC_U32_USERHTID(cls->knode.link_handle);\n \n-\t\tif (!test_bit(uhtid, &adapter->tables))\n+\t\tif (link_uhtid >= IXGBE_MAX_LINK_HANDLE)\n+\t\t\treturn -EINVAL;\n+\n+\t\tif (!test_bit(link_uhtid-1, &adapter->tables))\n \t\t\treturn -EINVAL;\n \n \t\tfor (i = 0; nexthdr[i].jump; i++) {\n@@ -8288,10 +8307,7 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter,\n \t\t\t    nexthdr->mask != cls->knode.sel->keys[0].mask)\n \t\t\t\treturn -EINVAL;\n \n-\t\t\tif (uhtid >= IXGBE_MAX_LINK_HANDLE)\n-\t\t\t\treturn -EINVAL;\n-\n-\t\t\tadapter->jump_tables[uhtid] = nexthdr->jump;\n+\t\t\tadapter->jump_tables[link_uhtid] = nexthdr->jump;\n \t\t}\n \t\treturn 0;\n \t}\n@@ -8308,13 +8324,13 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter,\n \t * To add support for new nodes update ixgbe_model.h parse structures\n \t * this function _should_ be generic try not to hardcode values here.\n \t */\n-\tif (TC_U32_USERHTID(handle) == 0x800) {\n+\tif (uhtid == 0x800) {\n \t\tfield_ptr = adapter->jump_tables[0];\n \t} else {\n-\t\tif (TC_U32_USERHTID(handle) >= ARRAY_SIZE(adapter->jump_tables))\n+\t\tif (uhtid >= IXGBE_MAX_LINK_HANDLE)\n \t\t\treturn -EINVAL;\n \n-\t\tfield_ptr = adapter->jump_tables[TC_U32_USERHTID(handle)];\n+\t\tfield_ptr = adapter->jump_tables[uhtid];\n \t}\n \n \tif (!field_ptr)\n",
    "prefixes": [
        "v2",
        "net-next",
        "1/3"
    ]
}