get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 724785,
    "url": "http://patchwork.ozlabs.org/api/patches/724785/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170206223852.31177-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": "<20170206223852.31177-2-jacob.e.keller@intel.com>",
    "list_archive_url": null,
    "date": "2017-02-06T22:38:44",
    "name": "[PART2,1/9] i40e: correctly honor the mask fields for ETHTOOL_SRXCLSRLINS",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "a9438d218ab5b802f05667238231d3f084429847",
    "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/20170206223852.31177-2-jacob.e.keller@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/724785/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/724785/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 3vHMpT5Zfdz9s1y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  7 Feb 2017 09:39:13 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 41E8530A0A;\n\tMon,  6 Feb 2017 22:39:12 +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 ertfsLB8BYKj; Mon,  6 Feb 2017 22:39:08 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 7F2AC30A65;\n\tMon,  6 Feb 2017 22:39:01 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 72A0E1BFF07\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  6 Feb 2017 22:38:57 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 723A7815B4\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  6 Feb 2017 22:38:57 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id CbSiElSKyiJN for <intel-wired-lan@lists.osuosl.org>;\n\tMon,  6 Feb 2017 22:38:54 +0000 (UTC)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id D4F7881B94\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  6 Feb 2017 22:38:54 +0000 (UTC)",
            "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby fmsmga102.fm.intel.com with ESMTP; 06 Feb 2017 14:38:54 -0800",
            "from jekeller-desk.amr.corp.intel.com (HELO\n\tjekeller-desk.jekeller.internal) ([10.166.35.174])\n\tby fmsmga005.fm.intel.com with ESMTP; 06 Feb 2017 14:38:54 -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=\"61907680\"",
        "From": "Jacob Keller <jacob.e.keller@intel.com>",
        "To": "Intel Wired LAN <intel-wired-lan@lists.osuosl.org>",
        "Date": "Mon,  6 Feb 2017 14:38:44 -0800",
        "Message-Id": "<20170206223852.31177-2-jacob.e.keller@intel.com>",
        "X-Mailer": "git-send-email 2.12.0.rc0.151.g8a5726c42288",
        "In-Reply-To": "<20170206223852.31177-1-jacob.e.keller@intel.com>",
        "References": "<20170206223852.31177-1-jacob.e.keller@intel.com>",
        "Subject": "[Intel-wired-lan] [PART2 PATCH 1/9] i40e: correctly honor the mask\n\tfields for ETHTOOL_SRXCLSRLINS",
        "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 current implementation of .set_rxnfc does not properly read the mask\nfield for filter entries. This results in incorrect driver behavior, as\nwe do not reject filters which have masks set to ignore some fields. The\ncurrent implementation simply assumes that every part of the tuple or\n\"input set\" is specified. This results in filters not behaving as\nexpected, and not working correctly.\n\nAs a first step in supporting some partial filters, add code which\nchecks the mask fields and rejects any filters which do not have an\nacceptable mask. For now, we just assume that all fields must be set.\n\nThis will get the driver one step towards allowing some partial filters.\nAt a minimum, the ethtool commands which previously installed filters\nthat would not function will now return a non-zero exit code indicating\nfailure instead.\n\nWe should now be meeting the minimum requirements of the .set_rxnfc API,\nby ensuring that all filters we program have a valid mask value for each\nfield.\n\nFinally, add code to report the mask correctly so that the ethtool\ncommand properly reports the mask to the user.\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\nChange-Id: Ia020149e07c87aa3fcec7b2283621b887ef0546f\n---\n drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 83 ++++++++++++++++++++++++++\n 1 file changed, 83 insertions(+)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\nindex f825181ec7c2..772dd234d581 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n@@ -2371,6 +2371,12 @@ static int i40e_get_ethtool_fdir_entry(struct i40e_pf *pf,\n \tfsp->h_u.tcp_ip4_spec.ip4src = rule->dst_ip;\n \tfsp->h_u.tcp_ip4_spec.ip4dst = rule->src_ip;\n \n+\t/* Set the mask fields */\n+\tfsp->m_u.tcp_ip4_spec.psrc = htons(0xFFFF);\n+\tfsp->m_u.tcp_ip4_spec.pdst = htons(0xFFFF);\n+\tfsp->m_u.tcp_ip4_spec.ip4src = htonl(0xFFFFFFFF);\n+\tfsp->m_u.tcp_ip4_spec.ip4dst = htonl(0xFFFFFFFF);\n+\n \tif (rule->dest_ctl == I40E_FILTER_PROGRAM_DESC_DEST_DROP_PACKET)\n \t\tfsp->ring_cookie = RX_CLS_FLOW_DISC;\n \telse\n@@ -2679,6 +2685,79 @@ static int i40e_del_fdir_entry(struct i40e_vsi *vsi,\n \treturn ret;\n }\n \n+/**\n+ * i40e_check_fdir_input_set - Check that a given rx_flow_spec mask is valid\n+ * @fsp: pointer to Rx flow specification\n+ *\n+ * Ensures that a given ethtool_rx_flow_spec has a valid mask.\n+ **/\n+static int i40e_check_fdir_input_set(struct ethtool_rx_flow_spec *fsp)\n+{\n+\tstruct ethtool_tcpip4_spec *tcp_ip4_spec;\n+\tstruct ethtool_usrip4_spec *usr_ip4_spec;\n+\n+\t/* Verify the provided mask is valid. */\n+\tswitch (fsp->flow_type & ~FLOW_EXT) {\n+\tcase SCTP_V4_FLOW:\n+\tcase TCP_V4_FLOW:\n+\tcase UDP_V4_FLOW:\n+\t\ttcp_ip4_spec = &fsp->m_u.tcp_ip4_spec;\n+\n+\t\t/* IPv4 source address */\n+\t\tif (!tcp_ip4_spec->ip4src || ~tcp_ip4_spec->ip4src)\n+\t\t\treturn -EOPNOTSUPP;\n+\n+\t\t/* IPv4 destination address */\n+\t\tif (!tcp_ip4_spec->ip4dst || ~tcp_ip4_spec->ip4dst)\n+\t\t\treturn -EOPNOTSUPP;\n+\n+\t\t/* L4 source port */\n+\t\tif (!tcp_ip4_spec->psrc || ~tcp_ip4_spec->psrc)\n+\t\t\treturn -EOPNOTSUPP;\n+\n+\t\t/* L4 destination port */\n+\t\tif (!tcp_ip4_spec->pdst || ~tcp_ip4_spec->pdst)\n+\t\t\treturn -EOPNOTSUPP;\n+\n+\t\t/* Filtering on Type of Service is not supported. */\n+\t\tif (tcp_ip4_spec->tos)\n+\t\t\treturn -EOPNOTSUPP;\n+\n+\t\tbreak;\n+\tcase IP_USER_FLOW:\n+\t\tusr_ip4_spec = &fsp->m_u.usr_ip4_spec;\n+\n+\t\t/* IPv4 source address */\n+\t\tif (!usr_ip4_spec->ip4src || ~usr_ip4_spec->ip4src)\n+\t\t\treturn -EOPNOTSUPP;\n+\n+\t\t/* IPv4 destination address */\n+\t\tif (!usr_ip4_spec->ip4dst || ~usr_ip4_spec->ip4dst)\n+\t\t\treturn -EOPNOTSUPP;\n+\n+\t\t/* First 4 bytes of L4 header */\n+\t\tif (!usr_ip4_spec->l4_4_bytes || ~usr_ip4_spec->l4_4_bytes)\n+\t\t\treturn -EOPNOTSUPP;\n+\n+\t\t/* Filtering on Type of Service is not supported. */\n+\t\tif (usr_ip4_spec->tos)\n+\t\t\treturn -EOPNOTSUPP;\n+\n+\t\t/* IP version does not have a mask field. */\n+\t\tif (usr_ip4_spec->ip_ver)\n+\t\t\treturn -EINVAL;\n+\n+\t\t/* L4 protocol doesn't have a mask field. */\n+\t\tif (usr_ip4_spec->proto)\n+\t\t\treturn -EINVAL;\n+\t\tbreak;\n+\tdefault:\n+\t\treturn -EOPNOTSUPP;\n+\t}\n+\n+\treturn 0;\n+}\n+\n /**\n  * i40e_add_fdir_ethtool - Add/Remove Flow Director filters\n  * @vsi: pointer to the targeted VSI\n@@ -2719,6 +2798,10 @@ static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi,\n \tif (fsp->flow_type & FLOW_MAC_EXT)\n \t\treturn -EINVAL;\n \n+\tret = i40e_check_fdir_input_set(fsp);\n+\tif (ret)\n+\t\treturn ret;\n+\n \tif (fsp->location >= (pf->hw.func_caps.fd_filters_best_effort +\n \t\t\t      pf->hw.func_caps.fd_filters_guaranteed)) {\n \t\treturn -EINVAL;\n",
    "prefixes": [
        "PART2",
        "1/9"
    ]
}