Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/535683/?format=api
{ "id": 535683, "url": "http://patchwork.ozlabs.org/api/patches/535683/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1445830859-4651-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": "<1445830859-4651-3-git-send-email-makita.toshiaki@lab.ntt.co.jp>", "list_archive_url": null, "date": "2015-10-26T03:40:57", "name": "[v2,net-next,2/4] e1000e: Add ndo_enc_hdr_len", "commit_ref": null, "pull_url": null, "state": "deferred", "archived": false, "hash": "6c9ff4956c916ab8893284b2497ed8694a87b3ce", "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/1445830859-4651-3-git-send-email-makita.toshiaki@lab.ntt.co.jp/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/535683/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/535683/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 8538C141357\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 26 Oct 2015 14:41:38 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 8D96B876FF;\n\tMon, 26 Oct 2015 03:41:37 +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 qhj-3mWe2BO6; Mon, 26 Oct 2015 03:41:36 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 3CD5687732;\n\tMon, 26 Oct 2015 03:41:35 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id D27781C11D6\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 26 Oct 2015 03:41:33 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id CE77C872D3\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 26 Oct 2015 03:41:33 +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 h1YnZh7v8900 for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 26 Oct 2015 03:41:32 +0000 (UTC)", "from tama500.ecl.ntt.co.jp (tama500.ecl.ntt.co.jp [129.60.39.148])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id DCCA7873E5\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 26 Oct 2015 03:41:31 +0000 (UTC)", "from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154])\n\tby tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id t9Q3fR74003095;\n\tMon, 26 Oct 2015 12:41:27 +0900", "from vc2.ecl.ntt.co.jp (localhost [127.0.0.1])\n\tby vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 03F3C5F631;\n\tMon, 26 Oct 2015 12:41:27 +0900 (JST)", "from imail3.m.ecl.ntt.co.jp (imail3.m.ecl.ntt.co.jp [129.60.5.248])\n\tby vc2.ecl.ntt.co.jp (Postfix) with ESMTP id E5BE65F592;\n\tMon, 26 Oct 2015 12:41:26 +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\tt9Q3fOfO018936; Mon, 26 Oct 2015 12:41:26 +0900", "by ubuntu-vm-makita (Postfix, from userid 1000)\n\tid 2DEA91E0062; Mon, 26 Oct 2015 12:41:22 +0900 (JST)" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "From": "Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>", "To": "\"David S . Miller\" <davem@davemloft.net>", "Date": "Mon, 26 Oct 2015 12:40:57 +0900", "Message-Id": "<1445830859-4651-3-git-send-email-makita.toshiaki@lab.ntt.co.jp>", "X-Mailer": "git-send-email 1.8.1.2", "In-Reply-To": "<1445830859-4651-1-git-send-email-makita.toshiaki@lab.ntt.co.jp>", "References": "<1445830859-4651-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\ttoshiaki.makita1@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 v2 net-next 2/4] e1000e: Add\n\tndo_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 | 82 ++++++++++++++++++++++--------\n 1 file changed, 60 insertions(+), 22 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c\nindex 0a854a4..61ce986 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,8 @@ 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 +\n+\t\t\t\t\t ETH_FCS_LEN) {\n \t\t\tpba = 14;\n \t\t\tew32(PBA, pba);\n \t\t\tfc->high_water = 0x2800;\n@@ -3997,7 +3998,8 @@ 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 +\n+\t\t\t\t\t ETH_FCS_LEN) {\n \t\t\tfc->high_water = 0x3500;\n \t\t\tfc->low_water = 0x1500;\n \t\t} else {\n@@ -4011,7 +4013,8 @@ 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 +\n+\t\t\t\t\t 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 +4250,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 +4349,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 +5924,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 +5937,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 +5946,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 +5954,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 +5997,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 +6905,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 +6950,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 +6988,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 +7111,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": [ "v2", "net-next", "2/4" ] }