get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 568515,
    "url": "http://patchwork.ozlabs.org/api/patches/568515/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1452897202-15204-4-git-send-email-joshua.a.hay@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": "<1452897202-15204-4-git-send-email-joshua.a.hay@intel.com>",
    "list_archive_url": null,
    "date": "2016-01-15T22:33:10",
    "name": "[next,S28,03/15] i40evf: support packet split receive",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "5ea3901883ac32bcf744d6de5c41e1375760a13b",
    "submitter": {
        "id": 19461,
        "url": "http://patchwork.ozlabs.org/api/people/19461/?format=api",
        "name": "Joshua Hay",
        "email": "joshua.a.hay@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/1452897202-15204-4-git-send-email-joshua.a.hay@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/568515/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/568515/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 whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ozlabs.org (Postfix) with ESMTP id BDAE0140BAD\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 16 Jan 2016 09:33:40 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 2FF6E91A4D;\n\tFri, 15 Jan 2016 22:33:39 +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 mUz30cIjD+F4; Fri, 15 Jan 2016 22:33:35 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 84A5591A7A;\n\tFri, 15 Jan 2016 22:33:30 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 029B01C2189\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 15 Jan 2016 22:33:26 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id F36FB8B14E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 15 Jan 2016 22:33:25 +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 r4SOj-osS0VU for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 15 Jan 2016 22:33:23 +0000 (UTC)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 931DA8B15F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 15 Jan 2016 22:33:23 +0000 (UTC)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga103.fm.intel.com with ESMTP; 15 Jan 2016 14:33:23 -0800",
            "from jahay1-mobl2.amr.corp.intel.com (HELO\n\tlocalhost.localdomain.localdomain) ([134.134.176.81])\n\tby fmsmga002.fm.intel.com with ESMTP; 15 Jan 2016 14:33:22 -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,302,1449561600\"; d=\"scan'208\";a=\"894132177\"",
        "From": "Joshua Hay <joshua.a.hay@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Fri, 15 Jan 2016 14:33:10 -0800",
        "Message-Id": "<1452897202-15204-4-git-send-email-joshua.a.hay@intel.com>",
        "X-Mailer": "git-send-email 2.1.0",
        "In-Reply-To": "<1452897202-15204-1-git-send-email-joshua.a.hay@intel.com>",
        "References": "<1452897202-15204-1-git-send-email-joshua.a.hay@intel.com>",
        "Subject": "[Intel-wired-lan] [next PATCH S28 03/15] i40evf: support packet\n\tsplit receive",
        "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": "From: Mitch Williams <mitch.a.williams@intel.com>\n\nSupport packet split receive on VFs. This is off by default but can be\nenabled using ethtool private flags. Because we need to trigger a reset\nfrom outside of i40evf_main.c, create a new function to do so, and\nexport it.\n\nAlso update copyright year in file headers.\n\nSigned-off-by: Mitch Williams <mitch.a.williams@intel.com>\nChange-ID: I721aa5d70113d3d6d94102e5f31526f6fc57cbbb\n---\nTesting Hints: Use ethtool --set-priv-flags to enable and disable\npacket split. Traffic should proceed as normal in either mode.\n\n drivers/net/ethernet/intel/i40evf/i40evf.h         |  6 +-\n drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c | 67 +++++++++++++++++++++-\n drivers/net/ethernet/intel/i40evf/i40evf_main.c    | 64 +++++++++++----------\n .../net/ethernet/intel/i40evf/i40evf_virtchnl.c    |  4 ++\n 4 files changed, 110 insertions(+), 31 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40evf/i40evf.h b/drivers/net/ethernet/intel/i40evf/i40evf.h\nindex 9e15f68..e657ecc 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf.h\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf.h\n@@ -1,7 +1,7 @@\n /*******************************************************************************\n  *\n  * Intel Ethernet Controller XL710 Family Linux Virtual Function Driver\n- * Copyright(c) 2013 - 2014 Intel Corporation.\n+ * Copyright(c) 2013 - 2016 Intel Corporation.\n  *\n  * This program is free software; you can redistribute it and/or modify it\n  * under the terms and conditions of the GNU General Public License,\n@@ -274,6 +274,9 @@ struct i40evf_adapter {\n };\n \n \n+/* Ethtool Private Flags */\n+#define I40EVF_PRIV_FLAGS_PS\t\tBIT(0)\n+\n /* needed by i40evf_ethtool.c */\n extern char i40evf_driver_name[];\n extern const char i40evf_driver_version[];\n@@ -281,6 +284,7 @@ extern const char i40evf_driver_version[];\n int i40evf_up(struct i40evf_adapter *adapter);\n void i40evf_down(struct i40evf_adapter *adapter);\n int i40evf_process_config(struct i40evf_adapter *adapter);\n+void i40evf_schedule_reset(struct i40evf_adapter *adapter);\n void i40evf_reset(struct i40evf_adapter *adapter);\n void i40evf_set_ethtool_ops(struct net_device *netdev);\n void i40evf_update_stats(struct i40evf_adapter *adapter);\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c\nindex bd1c272..dd4430a 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c\n@@ -1,7 +1,7 @@\n /*******************************************************************************\n  *\n  * Intel Ethernet Controller XL710 Family Linux Virtual Function Driver\n- * Copyright(c) 2013 - 2015 Intel Corporation.\n+ * Copyright(c) 2013 - 2016 Intel Corporation.\n  *\n  * This program is free software; you can redistribute it and/or modify it\n  * under the terms and conditions of the GNU General Public License,\n@@ -63,6 +63,12 @@ static const struct i40evf_stats i40evf_gstrings_stats[] = {\n #define I40EVF_STATS_LEN(_dev) \\\n \t(I40EVF_GLOBAL_STATS_LEN + I40EVF_QUEUE_STATS_LEN(_dev))\n \n+static const char i40evf_priv_flags_strings[][ETH_GSTRING_LEN] = {\n+\t\"packet-split\",\n+};\n+\n+#define I40EVF_PRIV_FLAGS_STR_LEN ARRAY_SIZE(i40evf_priv_flags_strings)\n+\n /**\n  * i40evf_get_settings - Get Link Speed and Duplex settings\n  * @netdev: network interface device structure\n@@ -97,6 +103,8 @@ static int i40evf_get_sset_count(struct net_device *netdev, int sset)\n {\n \tif (sset == ETH_SS_STATS)\n \t\treturn I40EVF_STATS_LEN(netdev);\n+\telse if (sset == ETH_SS_PRIV_FLAGS)\n+\t\treturn I40EVF_PRIV_FLAGS_STR_LEN;\n \telse\n \t\treturn -EINVAL;\n }\n@@ -162,6 +170,12 @@ static void i40evf_get_strings(struct net_device *netdev, u32 sset, u8 *data)\n \t\t\tsnprintf(p, ETH_GSTRING_LEN, \"rx-%u.bytes\", i);\n \t\t\tp += ETH_GSTRING_LEN;\n \t\t}\n+\t} else if (sset == ETH_SS_PRIV_FLAGS) {\n+\t\tfor (i = 0; i < I40EVF_PRIV_FLAGS_STR_LEN; i++) {\n+\t\t\tmemcpy(data, i40evf_priv_flags_strings[i],\n+\t\t\t       ETH_GSTRING_LEN);\n+\t\t\tdata += ETH_GSTRING_LEN;\n+\t\t}\n \t}\n }\n \n@@ -211,6 +225,7 @@ static void i40evf_get_drvinfo(struct net_device *netdev,\n \tstrlcpy(drvinfo->version, i40evf_driver_version, 32);\n \tstrlcpy(drvinfo->fw_version, \"N/A\", 4);\n \tstrlcpy(drvinfo->bus_info, pci_name(adapter->pdev), 32);\n+\tdrvinfo->n_priv_flags = I40EVF_PRIV_FLAGS_STR_LEN;\n }\n \n /**\n@@ -710,6 +725,54 @@ static int i40evf_set_rxfh(struct net_device *netdev, const u32 *indir,\n \t\t\t\t I40EVF_HLUT_ARRAY_SIZE);\n }\n \n+/**\n+ * i40evf_get_priv_flags - report device private flags\n+ * @dev: network interface device structure\n+ *\n+ * The get string set count and the string set should be matched for each\n+ * flag returned.  Add new strings for each flag to the i40e_priv_flags_strings\n+ * array.\n+ *\n+ * Returns a u32 bitmap of flags.\n+ **/\n+static u32 i40evf_get_priv_flags(struct net_device *dev)\n+{\n+\tstruct i40evf_adapter *adapter = netdev_priv(dev);\n+\tu32 ret_flags = 0;\n+\n+\tret_flags |= adapter->flags & I40EVF_FLAG_RX_PS_ENABLED ?\n+\t\tI40EVF_PRIV_FLAGS_PS : 0;\n+\n+\treturn ret_flags;\n+}\n+\n+/**\n+ * i40evf_set_priv_flags - set private flags\n+ * @dev: network interface device structure\n+ * @flags: bit flags to be set\n+ **/\n+static int i40evf_set_priv_flags(struct net_device *dev, u32 flags)\n+{\n+\tstruct i40evf_adapter *adapter = netdev_priv(dev);\n+\tbool reset_required = false;\n+\n+\tif ((flags & I40EVF_PRIV_FLAGS_PS) &&\n+\t    !(adapter->flags & I40EVF_FLAG_RX_PS_ENABLED)) {\n+\t\tadapter->flags |= I40EVF_FLAG_RX_PS_ENABLED;\n+\t\treset_required = true;\n+\t} else if (!(flags & I40EVF_PRIV_FLAGS_PS) &&\n+\t\t   (adapter->flags & I40EVF_FLAG_RX_PS_ENABLED)) {\n+\t\tadapter->flags &= ~I40EVF_FLAG_RX_PS_ENABLED;\n+\t\treset_required = true;\n+\t}\n+\n+\t/* if needed, issue reset to cause things to take effect */\n+\tif (reset_required)\n+\t\ti40evf_schedule_reset(adapter);\n+\n+\treturn 0;\n+}\n+\n static const struct ethtool_ops i40evf_ethtool_ops = {\n \t.get_settings\t\t= i40evf_get_settings,\n \t.get_drvinfo\t\t= i40evf_get_drvinfo,\n@@ -719,6 +782,8 @@ static const struct ethtool_ops i40evf_ethtool_ops = {\n \t.get_strings\t\t= i40evf_get_strings,\n \t.get_ethtool_stats\t= i40evf_get_ethtool_stats,\n \t.get_sset_count\t\t= i40evf_get_sset_count,\n+\t.get_priv_flags\t\t= i40evf_get_priv_flags,\n+\t.set_priv_flags\t\t= i40evf_set_priv_flags,\n \t.get_msglevel\t\t= i40evf_get_msglevel,\n \t.set_msglevel\t\t= i40evf_set_msglevel,\n \t.get_coalesce\t\t= i40evf_get_coalesce,\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c\nindex b105790..2b3c81b 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c\n@@ -173,6 +173,19 @@ void i40evf_debug_d(void *hw, u32 mask, char *fmt_str, ...)\n }\n \n /**\n+ * i40evf_schedule_reset - Set the flags and schedule a reset event\n+ * @adapter: board private structure\n+ **/\n+void i40evf_schedule_reset(struct i40evf_adapter *adapter)\n+{\n+\tif (!(adapter->flags &\n+\t      (I40EVF_FLAG_RESET_PENDING | I40EVF_FLAG_RESET_NEEDED))) {\n+\t\tadapter->flags |= I40EVF_FLAG_RESET_NEEDED;\n+\t\tschedule_work(&adapter->reset_task);\n+\t}\n+}\n+\n+/**\n  * i40evf_tx_timeout - Respond to a Tx Hang\n  * @netdev: network interface device structure\n  **/\n@@ -181,11 +194,7 @@ static void i40evf_tx_timeout(struct net_device *netdev)\n \tstruct i40evf_adapter *adapter = netdev_priv(netdev);\n \n \tadapter->tx_timeout_count++;\n-\tif (!(adapter->flags & (I40EVF_FLAG_RESET_PENDING |\n-\t\t\t\tI40EVF_FLAG_RESET_NEEDED))) {\n-\t\tadapter->flags |= I40EVF_FLAG_RESET_NEEDED;\n-\t\tqueue_work(i40evf_wq, &adapter->reset_task);\n-\t}\n+\ti40evf_schedule_reset(adapter);\n }\n \n /**\n@@ -638,35 +647,22 @@ static void i40evf_configure_rx(struct i40evf_adapter *adapter)\n \tint rx_buf_len;\n \n \n-\tadapter->flags &= ~I40EVF_FLAG_RX_PS_CAPABLE;\n-\tadapter->flags |= I40EVF_FLAG_RX_1BUF_CAPABLE;\n-\n-\t/* Decide whether to use packet split mode or not */\n-\tif (netdev->mtu > ETH_DATA_LEN) {\n-\t\tif (adapter->flags & I40EVF_FLAG_RX_PS_CAPABLE)\n-\t\t\tadapter->flags |= I40EVF_FLAG_RX_PS_ENABLED;\n-\t\telse\n-\t\t\tadapter->flags &= ~I40EVF_FLAG_RX_PS_ENABLED;\n-\t} else {\n-\t\tif (adapter->flags & I40EVF_FLAG_RX_1BUF_CAPABLE)\n-\t\t\tadapter->flags &= ~I40EVF_FLAG_RX_PS_ENABLED;\n-\t\telse\n-\t\t\tadapter->flags |= I40EVF_FLAG_RX_PS_ENABLED;\n-\t}\n-\n \t/* Set the RX buffer length according to the mode */\n-\tif (adapter->flags & I40EVF_FLAG_RX_PS_ENABLED) {\n-\t\trx_buf_len = I40E_RX_HDR_SIZE;\n-\t} else {\n-\t\tif (netdev->mtu <= ETH_DATA_LEN)\n-\t\t\trx_buf_len = I40EVF_RXBUFFER_2048;\n-\t\telse\n-\t\t\trx_buf_len = ALIGN(max_frame, 1024);\n-\t}\n+\tif (adapter->flags & I40EVF_FLAG_RX_PS_ENABLED ||\n+\t    netdev->mtu <= ETH_DATA_LEN)\n+\t\trx_buf_len = I40EVF_RXBUFFER_2048;\n+\telse\n+\t\trx_buf_len = ALIGN(max_frame, 1024);\n \n \tfor (i = 0; i < adapter->num_active_queues; i++) {\n \t\tadapter->rx_rings[i].tail = hw->hw_addr + I40E_QRX_TAIL1(i);\n \t\tadapter->rx_rings[i].rx_buf_len = rx_buf_len;\n+\t\tif (adapter->flags & I40EVF_FLAG_RX_PS_ENABLED) {\n+\t\t\tset_ring_ps_enabled(&adapter->rx_rings[i]);\n+\t\t\tadapter->rx_rings[i].rx_hdr_len = I40E_RX_HDR_SIZE;\n+\t\t} else {\n+\t\t\tclear_ring_ps_enabled(&adapter->rx_rings[i]);\n+\t\t}\n \t}\n }\n \n@@ -1003,7 +999,12 @@ static void i40evf_configure(struct i40evf_adapter *adapter)\n \tfor (i = 0; i < adapter->num_active_queues; i++) {\n \t\tstruct i40e_ring *ring = &adapter->rx_rings[i];\n \n+\tif (adapter->flags & I40EVF_FLAG_RX_PS_ENABLED) {\n+\t\ti40evf_alloc_rx_headers(ring);\n+\t\ti40evf_alloc_rx_buffers_ps(ring, ring->count);\n+\t} else {\n \t\ti40evf_alloc_rx_buffers_1buf(ring, ring->count);\n+\t}\n \t\tring->next_to_use = ring->count - 1;\n \t\twritel(ring->next_to_use, ring->tail);\n \t}\n@@ -2481,6 +2482,11 @@ static void i40evf_init_task(struct work_struct *work)\n \tadapter->current_op = I40E_VIRTCHNL_OP_UNKNOWN;\n \n \tadapter->flags |= I40EVF_FLAG_RX_CSUM_ENABLED;\n+\tadapter->flags |= I40EVF_FLAG_RX_1BUF_CAPABLE;\n+\tadapter->flags |= I40EVF_FLAG_RX_PS_CAPABLE;\n+\n+\t/* Default to single buffer rx, can be changed through ethtool. */\n+\tadapter->flags &= ~I40EVF_FLAG_RX_PS_ENABLED;\n \n \tnetdev->netdev_ops = &i40evf_netdev_ops;\n \ti40evf_set_ethtool_ops(netdev);\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c\nindex d3739cc..488e738 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c\n@@ -270,6 +270,10 @@ void i40evf_configure_queues(struct i40evf_adapter *adapter)\n \t\tvqpi->rxq.max_pkt_size = adapter->netdev->mtu\n \t\t\t\t\t+ ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN;\n \t\tvqpi->rxq.databuffer_size = adapter->rx_rings[i].rx_buf_len;\n+\t\tif (adapter->flags & I40EVF_FLAG_RX_PS_ENABLED) {\n+\t\t\tvqpi->rxq.splithdr_enabled = true;\n+\t\t\tvqpi->rxq.hdr_size = I40E_RX_HDR_SIZE;\n+\t\t}\n \t\tvqpi++;\n \t}\n \n",
    "prefixes": [
        "next",
        "S28",
        "03/15"
    ]
}