get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 736393,
    "url": "http://patchwork.ozlabs.org/api/patches/736393/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170307230523.28702-1-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": "<20170307230523.28702-1-jacob.e.keller@intel.com>",
    "list_archive_url": null,
    "date": "2017-03-07T23:05:22",
    "name": "[v2,1/2] i40e: correctly honor the mask fields for ETHTOOL_SRXCLSRLINS",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "6969d1e398ffb6b2122f6296a100092eb2112a54",
    "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/20170307230523.28702-1-jacob.e.keller@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/736393/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/736393/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 fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\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 3vdC346bYpz9sN6\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  8 Mar 2017 10:06:56 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 6FC3088557;\n\tTue,  7 Mar 2017 23:06: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 jaaJnvVnC8_A; Tue,  7 Mar 2017 23:06:54 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id BF8098855A;\n\tTue,  7 Mar 2017 23:06:54 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 2A8491C05CE\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue,  7 Mar 2017 23:06:54 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 1FA638855B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue,  7 Mar 2017 23:06:54 +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 YcrvjHR5BmhA for <intel-wired-lan@lists.osuosl.org>;\n\tTue,  7 Mar 2017 23:06:53 +0000 (UTC)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 4D6D0884DF\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue,  7 Mar 2017 23:06:53 +0000 (UTC)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t07 Mar 2017 15:06:46 -0800",
            "from jekeller-desk.amr.corp.intel.com (HELO\n\tjekeller-jetplane.jekeller.internal) ([10.166.35.174])\n\tby fmsmga002.fm.intel.com with ESMTP; 07 Mar 2017 15:06:45 -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.36,260,1486454400\"; d=\"scan'208\";\n\ta=\"1139243732\"",
        "From": "Jacob Keller <jacob.e.keller@intel.com>",
        "To": "Intel Wired LAN <intel-wired-lan@lists.osuosl.org>",
        "Date": "Tue,  7 Mar 2017 15:05:22 -0800",
        "Message-Id": "<20170307230523.28702-1-jacob.e.keller@intel.com>",
        "X-Mailer": "git-send-email 2.9.3",
        "Subject": "[Intel-wired-lan] [PATCH v2 1/2] 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\nNote that the typecast to (__be16) when checking source and destination\nport masks is required because the ~ bitwise negation operator does not\ncorrectly handle variables other than integer size.\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\nChange-Id: Ia020149e07c87aa3fcec7b2283621b887ef0546f\n---\nThis is a replacement for \"[PART2,1/9] i40e: correctly honor the mask\nfields for ETHTOOL_SRXCLSRLINS\" \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 ab9328aec392..3c006bbf5ff7 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n@@ -2413,6 +2413,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@@ -2722,6 +2728,79 @@ static int i40e_del_fdir_entry(struct i40e_vsi *vsi,\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 || (__be16)~tcp_ip4_spec->psrc)\n+\t\t\treturn -EOPNOTSUPP;\n+\n+\t\t/* L4 destination port */\n+\t\tif (!tcp_ip4_spec->pdst || (__be16)~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  * @cmd: command to get or set RX flow classification rules\n@@ -2761,6 +2840,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": [
        "v2",
        "1/2"
    ]
}