get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 534737,
    "url": "http://patchwork.ozlabs.org/api/patches/534737/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1445572173-15402-3-git-send-email-makita.toshiaki@lab.ntt.co.jp/",
    "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": "<1445572173-15402-3-git-send-email-makita.toshiaki@lab.ntt.co.jp>",
    "list_archive_url": null,
    "date": "2015-10-23T03:49:31",
    "name": "[net-next,2/4] e1000e: Add ndo_enc_hdr_len",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "be836b94242b092579c439d9d084c48b5d7f3a40",
    "submitter": {
        "id": 22461,
        "url": "http://patchwork.ozlabs.org/api/people/22461/?format=api",
        "name": "Toshiaki Makita",
        "email": "makita.toshiaki@lab.ntt.co.jp"
    },
    "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/1445572173-15402-3-git-send-email-makita.toshiaki@lab.ntt.co.jp/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/534737/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/534737/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\tby ozlabs.org (Postfix) with ESMTP id 41117141321\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 23 Oct 2015 15:37:41 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 91FC58BDF7;\n\tFri, 23 Oct 2015 04:37:40 +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 VEnUKJguKowN; Fri, 23 Oct 2015 04:37:39 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id D8FE78B063;\n\tFri, 23 Oct 2015 04:37:39 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 5B7581C105D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 23 Oct 2015 04:37:38 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 56B2430089\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 23 Oct 2015 04:37:38 +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 QS1HRNqnxTf2 for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 23 Oct 2015 04:37:36 +0000 (UTC)",
            "from tama50.ecl.ntt.co.jp (tama50.ecl.ntt.co.jp [129.60.39.147])\n\tby silver.osuosl.org (Postfix) with ESMTP id 2C1042EC2E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 23 Oct 2015 04:37:36 +0000 (UTC)",
            "from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153])\n\tby tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id t9N3nimw015056; \n\tFri, 23 Oct 2015 12:49:44 +0900",
            "from vc1.ecl.ntt.co.jp (localhost [127.0.0.1])\n\tby vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 141B65F63F;\n\tFri, 23 Oct 2015 12:49:44 +0900 (JST)",
            "from imail3.m.ecl.ntt.co.jp (imail3.m.ecl.ntt.co.jp [129.60.5.248])\n\tby vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 033DB5F623;\n\tFri, 23 Oct 2015 12:49:44 +0900 (JST)",
            "from ubuntu-vm-makita ([129.60.241.200])\n\tby imail3.m.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id\n\tt9N3nhgM026654; Fri, 23 Oct 2015 12:49:43 +0900",
            "by ubuntu-vm-makita (Postfix, from userid 1000)\n\tid AFE271E6EF9; Fri, 23 Oct 2015 12:49:37 +0900 (JST)"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "from auto-whitelisted by SQLgrey-1.7.6",
        "From": "Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>",
        "To": "\"David S . Miller\" <davem@davemloft.net>",
        "Date": "Fri, 23 Oct 2015 12:49:31 +0900",
        "Message-Id": "<1445572173-15402-3-git-send-email-makita.toshiaki@lab.ntt.co.jp>",
        "X-Mailer": "git-send-email 1.8.1.2",
        "In-Reply-To": "<1445572173-15402-1-git-send-email-makita.toshiaki@lab.ntt.co.jp>",
        "References": "<1445572173-15402-1-git-send-email-makita.toshiaki@lab.ntt.co.jp>",
        "X-TM-AS-MML": "disable",
        "Cc": "netdev@vger.kernel.org, Vlad Yasevich <vyasevich@gmail.com>,\n\tStephen Hemminger <stephen@networkplumber.org>,\n\tintel-wired-lan@lists.osuosl.org,\n\tToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>,\n\tPatrick McHardy <kaber@trash.net>",
        "Subject": "[Intel-wired-lan] [PATCH net-next 2/4] e1000e: Add ndo_enc_hdr_len",
        "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": "e1000e has 4 bytes additional room for vlan header, so set default\nenc_hdr_len to 4.\nNote that e1000e uses mtu to validate frame size in some places, which\nare needed to be modified to use max_frame_size as extra header room\nbecame variable.\n\nSigned-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>\n---\n drivers/net/ethernet/intel/e1000e/netdev.c | 79 +++++++++++++++++++++---------\n 1 file changed, 57 insertions(+), 22 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c\nindex 0a854a4..6a54f07 100644\n--- a/drivers/net/ethernet/intel/e1000e/netdev.c\n+++ b/drivers/net/ethernet/intel/e1000e/netdev.c\n@@ -3046,7 +3046,7 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)\n \tif (hw->mac.type >= e1000_pch2lan) {\n \t\ts32 ret_val;\n \n-\t\tif (adapter->netdev->mtu > ETH_DATA_LEN)\n+\t\tif (adapter->max_frame_size > VLAN_ETH_FRAME_LEN + ETH_FCS_LEN)\n \t\t\tret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true);\n \t\telse\n \t\t\tret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false);\n@@ -3066,7 +3066,7 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)\n \trctl &= ~E1000_RCTL_SBP;\n \n \t/* Enable Long Packet receive */\n-\tif (adapter->netdev->mtu <= ETH_DATA_LEN)\n+\tif (adapter->max_frame_size <= VLAN_ETH_FRAME_LEN + ETH_FCS_LEN)\n \t\trctl &= ~E1000_RCTL_LPE;\n \telse\n \t\trctl |= E1000_RCTL_LPE;\n@@ -3286,7 +3286,7 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)\n \t/* With jumbo frames, excessive C-state transition latencies result\n \t * in dropped transactions.\n \t */\n-\tif (adapter->netdev->mtu > ETH_DATA_LEN) {\n+\tif (adapter->max_frame_size > VLAN_ETH_FRAME_LEN + ETH_FCS_LEN) {\n \t\tu32 lat =\n \t\t    ((er32(PBA) & E1000_PBA_RXA_MASK) * 1024 -\n \t\t     adapter->max_frame_size) * 8 / 1000;\n@@ -3978,7 +3978,7 @@ void e1000e_reset(struct e1000_adapter *adapter)\n \tswitch (hw->mac.type) {\n \tcase e1000_ich9lan:\n \tcase e1000_ich10lan:\n-\t\tif (adapter->netdev->mtu > ETH_DATA_LEN) {\n+\t\tif (adapter->max_frame_size > VLAN_ETH_FRAME_LEN + ETH_FCS_LEN) {\n \t\t\tpba = 14;\n \t\t\tew32(PBA, pba);\n \t\t\tfc->high_water = 0x2800;\n@@ -3997,7 +3997,7 @@ void e1000e_reset(struct e1000_adapter *adapter)\n \t\t/* Workaround PCH LOM adapter hangs with certain network\n \t\t * loads.  If hangs persist, try disabling Tx flow control.\n \t\t */\n-\t\tif (adapter->netdev->mtu > ETH_DATA_LEN) {\n+\t\tif (adapter->max_frame_size > VLAN_ETH_FRAME_LEN + ETH_FCS_LEN) {\n \t\t\tfc->high_water = 0x3500;\n \t\t\tfc->low_water = 0x1500;\n \t\t} else {\n@@ -4011,7 +4011,7 @@ void e1000e_reset(struct e1000_adapter *adapter)\n \tcase e1000_pch_spt:\n \t\tfc->refresh_time = 0x0400;\n \n-\t\tif (adapter->netdev->mtu <= ETH_DATA_LEN) {\n+\t\tif (adapter->max_frame_size <= VLAN_ETH_FRAME_LEN + ETH_FCS_LEN) {\n \t\t\tfc->high_water = 0x05C20;\n \t\t\tfc->low_water = 0x05048;\n \t\t\tfc->pause_time = 0x0650;\n@@ -4247,7 +4247,7 @@ void e1000e_down(struct e1000_adapter *adapter, bool reset)\n \n \t/* Disable Si errata workaround on PCHx for jumbo frame flow */\n \tif ((hw->mac.type >= e1000_pch2lan) &&\n-\t    (adapter->netdev->mtu > ETH_DATA_LEN) &&\n+\t    (adapter->max_frame_size > VLAN_ETH_FRAME_LEN + ETH_FCS_LEN) &&\n \t    e1000_lv_jumbo_workaround_ich8lan(hw, false))\n \t\te_dbg(\"failed to disable jumbo frame workaround mode\\n\");\n \n@@ -4346,7 +4346,8 @@ static int e1000_sw_init(struct e1000_adapter *adapter)\n \n \tadapter->rx_buffer_len = VLAN_ETH_FRAME_LEN + ETH_FCS_LEN;\n \tadapter->rx_ps_bsize0 = 128;\n-\tadapter->max_frame_size = netdev->mtu + VLAN_ETH_HLEN + ETH_FCS_LEN;\n+\tadapter->max_frame_size = netdev->mtu + netdev->enc_hdr_len +\n+\t\t\t\t  ETH_HLEN + ETH_FCS_LEN;\n \tadapter->min_frame_size = ETH_ZLEN + ETH_FCS_LEN;\n \tadapter->tx_ring_count = E1000_DEFAULT_TXD;\n \tadapter->rx_ring_count = E1000_DEFAULT_RXD;\n@@ -5920,17 +5921,10 @@ struct rtnl_link_stats64 *e1000e_get_stats64(struct net_device *netdev,\n \treturn stats;\n }\n \n-/**\n- * e1000_change_mtu - Change the Maximum Transfer Unit\n- * @netdev: network interface device structure\n- * @new_mtu: new value for maximum frame size\n- *\n- * Returns 0 on success, negative on failure\n- **/\n-static int e1000_change_mtu(struct net_device *netdev, int new_mtu)\n+static int e1000_change_max_frame(struct net_device *netdev, int max_frame,\n+\t\t\t\t  int new_mtu)\n {\n \tstruct e1000_adapter *adapter = netdev_priv(netdev);\n-\tint max_frame = new_mtu + VLAN_ETH_HLEN + ETH_FCS_LEN;\n \n \t/* Jumbo frame support */\n \tif ((max_frame > (VLAN_ETH_FRAME_LEN + ETH_FCS_LEN)) &&\n@@ -5940,7 +5934,7 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)\n \t}\n \n \t/* Supported frame sizes */\n-\tif ((new_mtu < (VLAN_ETH_ZLEN + ETH_FCS_LEN)) ||\n+\tif ((new_mtu && new_mtu < (VLAN_ETH_ZLEN + ETH_FCS_LEN)) ||\n \t    (max_frame > adapter->max_hw_frame_size)) {\n \t\te_err(\"Unsupported MTU setting\\n\");\n \t\treturn -EINVAL;\n@@ -5949,7 +5943,7 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)\n \t/* Jumbo frame workaround on 82579 and newer requires CRC be stripped */\n \tif ((adapter->hw.mac.type >= e1000_pch2lan) &&\n \t    !(adapter->flags2 & FLAG2_CRC_STRIPPING) &&\n-\t    (new_mtu > ETH_DATA_LEN)) {\n+\t    (max_frame > VLAN_ETH_FRAME_LEN + ETH_FCS_LEN)) {\n \t\te_err(\"Jumbo Frames not supported on this device when CRC stripping is disabled.\\n\");\n \t\treturn -EINVAL;\n \t}\n@@ -5957,9 +5951,14 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)\n \twhile (test_and_set_bit(__E1000_RESETTING, &adapter->state))\n \t\tusleep_range(1000, 2000);\n \t/* e1000e_down -> e1000e_reset dependent on max_frame_size & mtu */\n+\tif (new_mtu) {\n+\t\te_info(\"changing MTU from %d to %d\\n\", netdev->mtu, new_mtu);\n+\t\tnetdev->mtu = new_mtu;\n+\t} else {\n+\t\te_info(\"changing max frame size from %d to %d\\n\",\n+\t\t       adapter->max_frame_size, max_frame);\n+\t}\n \tadapter->max_frame_size = max_frame;\n-\te_info(\"changing MTU from %d to %d\\n\", netdev->mtu, new_mtu);\n-\tnetdev->mtu = new_mtu;\n \n \tpm_runtime_get_sync(netdev->dev.parent);\n \n@@ -5995,6 +5994,20 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)\n \treturn 0;\n }\n \n+/**\n+ * e1000_change_mtu - Change the Maximum Transfer Unit\n+ * @netdev: network interface device structure\n+ * @new_mtu: new value for maximum frame size\n+ *\n+ * Returns 0 on success, negative on failure\n+ **/\n+static int e1000_change_mtu(struct net_device *netdev, int new_mtu)\n+{\n+\tint max_frame = new_mtu + netdev->enc_hdr_len + ETH_HLEN + ETH_FCS_LEN;\n+\n+\treturn e1000_change_max_frame(netdev, max_frame, new_mtu);\n+}\n+\n static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr,\n \t\t\t   int cmd)\n {\n@@ -6889,7 +6902,8 @@ static netdev_features_t e1000_fix_features(struct net_device *netdev,\n \tstruct e1000_hw *hw = &adapter->hw;\n \n \t/* Jumbo frame workaround on 82579 and newer requires CRC be stripped */\n-\tif ((hw->mac.type >= e1000_pch2lan) && (netdev->mtu > ETH_DATA_LEN))\n+\tif (hw->mac.type >= e1000_pch2lan &&\n+\t    adapter->max_frame_size > VLAN_ETH_FRAME_LEN + ETH_FCS_LEN)\n \t\tfeatures &= ~NETIF_F_RXFCS;\n \n \treturn features;\n@@ -6933,6 +6947,24 @@ static int e1000_set_features(struct net_device *netdev,\n \treturn 0;\n }\n \n+/**\n+ * e1000_enc_hdr_len - Expand encapsulation header room\n+ * @netdev: network interface device structure\n+ * @new_mtu: new value for maximum encapsulation header length\n+ *\n+ * Returns 0 on success, negative on failure\n+ **/\n+static int e1000_enc_hdr_len(struct net_device *netdev, int new_len)\n+{\n+\tstruct e1000_adapter *adapter = netdev_priv(netdev);\n+\tint max_frame = netdev->mtu + new_len + ETH_HLEN + ETH_FCS_LEN;\n+\n+\tif (max_frame <= adapter->max_frame_size)\n+\t\treturn 0;\n+\n+\treturn e1000_change_max_frame(netdev, max_frame, 0);\n+}\n+\n static const struct net_device_ops e1000e_netdev_ops = {\n \t.ndo_open\t\t= e1000_open,\n \t.ndo_stop\t\t= e1000_close,\n@@ -6953,6 +6985,7 @@ static const struct net_device_ops e1000e_netdev_ops = {\n \t.ndo_set_features = e1000_set_features,\n \t.ndo_fix_features = e1000_fix_features,\n \t.ndo_features_check\t= passthru_features_check,\n+\t.ndo_enc_hdr_len\t= e1000_enc_hdr_len,\n };\n \n /**\n@@ -7075,6 +7108,8 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n \tnetdev->mem_start = mmio_start;\n \tnetdev->mem_end = mmio_start + mmio_len;\n \n+\tnetdev->enc_hdr_len = VLAN_HLEN;\n+\n \tadapter->bd_number = cards_found++;\n \n \te1000e_check_options(adapter);\n",
    "prefixes": [
        "net-next",
        "2/4"
    ]
}