get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 724793,
    "url": "http://patchwork.ozlabs.org/api/patches/724793/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170206223913.31525-2-jacob.e.keller@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": "<20170206223913.31525-2-jacob.e.keller@intel.com>",
    "list_archive_url": null,
    "date": "2017-02-06T22:39:13",
    "name": "[PART1,11/11] i40e: always remove old filter when adding new FDir filter",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "9090c5bb698e358c7d53b8f2912dc31339e91e3b",
    "submitter": {
        "id": 9784,
        "url": "http://patchwork.ozlabs.org/api/people/9784/?format=api",
        "name": "Jacob Keller",
        "email": "jacob.e.keller@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/20170206223913.31525-2-jacob.e.keller@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/724793/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/724793/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\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3vHMpr2LdWz9s1y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  7 Feb 2017 09:39:32 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id CAF6C30340;\n\tMon,  6 Feb 2017 22:39:30 +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 3lMA22EzAauk; Mon,  6 Feb 2017 22:39:27 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 486C230A1E;\n\tMon,  6 Feb 2017 22:39:17 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 924E21BFF07\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  6 Feb 2017 22:39:16 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 8FDB488DA8\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  6 Feb 2017 22:39:16 +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 Xhg6MgaZnQOr for <intel-wired-lan@lists.osuosl.org>;\n\tMon,  6 Feb 2017 22:39:15 +0000 (UTC)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 6467788D9C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  6 Feb 2017 22:39:15 +0000 (UTC)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby fmsmga102.fm.intel.com with ESMTP; 06 Feb 2017 14:39:15 -0800",
            "from jekeller-desk.amr.corp.intel.com (HELO\n\tjekeller-desk.jekeller.internal) ([10.166.35.174])\n\tby fmsmga004.fm.intel.com with ESMTP; 06 Feb 2017 14:39:14 -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.33,342,1477983600\"; d=\"scan'208\";a=\"222070241\"",
        "From": "Jacob Keller <jacob.e.keller@intel.com>",
        "To": "Intel Wired LAN <intel-wired-lan@lists.osuosl.org>",
        "Date": "Mon,  6 Feb 2017 14:39:13 -0800",
        "Message-Id": "<20170206223913.31525-2-jacob.e.keller@intel.com>",
        "X-Mailer": "git-send-email 2.12.0.rc0.151.g8a5726c42288",
        "In-Reply-To": "<20170206223913.31525-1-jacob.e.keller@intel.com>",
        "References": "<20170206223913.31525-1-jacob.e.keller@intel.com>",
        "Subject": "[Intel-wired-lan] [PART1 PATCH 11/11] i40e: always remove old\n\tfilter when adding new FDir filter",
        "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": "The previous code relied on i40e_match_fdir_input_set to determine when\ndetermining whether to free the old filter. Change this code so that we\nsimply unconditionally delete the old filter, even if it's identical to\nthe new filter. This ensures that we don't leak any memory, and that we\nalways update the filters as expected.\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 32 ++++++--------------------\n 1 file changed, 7 insertions(+), 25 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\nindex da36621379cc..f825181ec7c2 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n@@ -2582,24 +2582,6 @@ static int i40e_set_rss_hash_opt(struct i40e_pf *pf, struct ethtool_rxnfc *nfc)\n \treturn 0;\n }\n \n-/**\n- * i40e_match_fdir_input_set - Match a new filter against an existing one\n- * @rule: The filter already added\n- * @input: The new filter to comapre against\n- *\n- * Returns true if the two input set match\n- **/\n-static bool i40e_match_fdir_input_set(struct i40e_fdir_filter *rule,\n-\t\t\t\t      struct i40e_fdir_filter *input)\n-{\n-\tif ((rule->dst_ip != input->dst_ip) ||\n-\t    (rule->src_ip != input->src_ip) ||\n-\t    (rule->dst_port != input->dst_port) ||\n-\t    (rule->src_port != input->src_port))\n-\t\treturn false;\n-\treturn true;\n-}\n-\n /**\n  * i40e_update_ethtool_fdir_entry - Updates the fdir filter entry\n  * @vsi: Pointer to the targeted VSI\n@@ -2635,22 +2617,22 @@ static int i40e_update_ethtool_fdir_entry(struct i40e_vsi *vsi,\n \n \t/* if there is an old rule occupying our place remove it */\n \tif (rule && (rule->fd_id == sw_idx)) {\n-\t\tif (input && !i40e_match_fdir_input_set(rule, input))\n-\t\t\terr = i40e_add_del_fdir(vsi, rule, false);\n-\t\telse if (!input)\n-\t\t\terr = i40e_add_del_fdir(vsi, rule, false);\n+\t\t/* Remove this rule, since we're either deleting it, or\n+\t\t * replacing it.\n+\t\t */\n+\t\terr = i40e_add_del_fdir(vsi, rule, false);\n \t\thlist_del(&rule->fdir_node);\n \t\tkfree(rule);\n \t\tpf->fdir_pf_active_filters--;\n \t}\n \n-\t/* If no input this was a delete, err should be 0 if a rule was\n-\t * successfully found and removed from the list else -EINVAL\n+\t/* If we weren't given an input, this is a delete, so just return the\n+\t * error code indicating if there was an entry at the requested slot\n \t */\n \tif (!input)\n \t\treturn err;\n \n-\t/* initialize node and set software index */\n+\t/* Otherwise, install the new rule as requested */\n \tINIT_HLIST_NODE(&input->fdir_node);\n \n \t/* add filter to the list */\n",
    "prefixes": [
        "PART1",
        "11/11"
    ]
}