Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/564176/?format=api
{ "id": 564176, "url": "http://patchwork.ozlabs.org/api/patches/564176/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160107071039.13648.55302.stgit@localhost.localdomain/", "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": "<20160107071039.13648.55302.stgit@localhost.localdomain>", "list_archive_url": null, "date": "2016-01-07T07:10:39", "name": "[next,03/11] igb: Allow asymmetric configuration of MTU versus Rx frame size", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "d47dc9452345dfe32a18daa71c5ce92a93cf918a", "submitter": { "id": 67293, "url": "http://patchwork.ozlabs.org/api/people/67293/?format=api", "name": "Alexander Duyck", "email": "aduyck@mirantis.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/20160107071039.13648.55302.stgit@localhost.localdomain/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/564176/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/564176/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\tby ozlabs.org (Postfix) with ESMTP id BCC261402C0\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 7 Jan 2016 18:10:47 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 0258832D9E;\n\tThu, 7 Jan 2016 07:10:47 +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 UBe0HmT1gyHG; Thu, 7 Jan 2016 07:10:45 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 2231A32D95;\n\tThu, 7 Jan 2016 07:10:45 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id C88611C09CE\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 7 Jan 2016 07:10:43 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id C15AE303A9\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 7 Jan 2016 07:10:43 +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 pp5TwZ1swXUB for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 7 Jan 2016 07:10:42 +0000 (UTC)", "from mail-pa0-f42.google.com (mail-pa0-f42.google.com\n\t[209.85.220.42])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 3D10E32D9D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 7 Jan 2016 07:10:42 +0000 (UTC)", "by mail-pa0-f42.google.com with SMTP id cy9so251584585pac.0\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 06 Jan 2016 23:10:42 -0800 (PST)", "from localhost.localdomain\n\t(static-50-53-29-36.bvtn.or.frontiernet.net. [50.53.29.36])\n\tby smtp.gmail.com with ESMTPSA id\n\tdz12sm86407656pac.2.2016.01.06.23.10.40\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 06 Jan 2016 23:10:40 -0800 (PST)" ], "Authentication-Results": "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=mirantis.com header.i=@mirantis.com\n\theader.b=K8pWX4y/; dkim-atps=neutral", "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "from auto-whitelisted by SQLgrey-1.7.6", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=mirantis.com;\n\ts=google; \n\th=subject:from:to:cc:date:message-id:in-reply-to:references\n\t:user-agent:mime-version:content-type:content-transfer-encoding;\n\tbh=RkYFSVdiOZjDBeNhARyXVqRpliLIUoROBeK5vFfkzhk=;\n\tb=K8pWX4y/dad0SmHW+Ms0zxJ0XTbWe1Dz9oElYRdes5F8erAoQxP4Yh0nSTYPq1uhO/\n\tN2ToWCalvY8f2209I2VBwIQgB/htb/xRcrG/AWfCYiGexq7b3bMI8IZCgU2NiAD1Tnci\n\tQIPMhdkMzfBliB/n3gfkBZjr6vOOajos2JVLU=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:subject:from:to:cc:date:message-id:in-reply-to\n\t:references:user-agent:mime-version:content-type\n\t:content-transfer-encoding;\n\tbh=RkYFSVdiOZjDBeNhARyXVqRpliLIUoROBeK5vFfkzhk=;\n\tb=j6tbRrUasneH04eeiuJmmk/XbbFAZJoNSvxVdU/oKYgf+bdD4OwJ3hgBKeLCICtr8S\n\t2vGzUHrZ1EL/jpx+cdXgyfHeWUhwivtdpsc34eyHaHGY8WnwcNpbClz79I5MNMMGdhGg\n\tgOB3EZcKMyGrDEyH0CNGZv4JZ7LsIK9oW0oaJuGEuyq9epD19CTJ/J2HWgY9CMVBLGIl\n\t8/ZURSFH9jz/gSfws1+5QAnzzkKMMBIQNz/8k4+iTRihYIAYqWYY2ZwbnTXYzyXGmcps\n\tx2wjk3q3eV3RZ/WEAIzRlZT7OdOIMYt25lxxYl8gFRlEcmq+5wA8u0nq9aVzPpH7PbBC\n\tRH1w==", "X-Gm-Message-State": "ALoCoQnaqyoF78DzCmbVllfU67o3OM8wiVK970VqzEUBJtaf97f3SUXttjo4t30q0p9QjQuT8L2A3D2ADg7LhIq7pCCNv8GpDQ==", "X-Received": "by 10.66.159.226 with SMTP id xf2mr148428541pab.23.1452150641458;\n\tWed, 06 Jan 2016 23:10:41 -0800 (PST)", "From": "Alexander Duyck <aduyck@mirantis.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Wed, 06 Jan 2016 23:10:39 -0800", "Message-ID": "<20160107071039.13648.55302.stgit@localhost.localdomain>", "In-Reply-To": "<20160107070850.13648.21033.stgit@localhost.localdomain>", "References": "<20160107070850.13648.21033.stgit@localhost.localdomain>", "User-Agent": "StGit/0.17.1-dirty", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [next PATCH 03/11] igb: Allow asymmetric\n\tconfiguration of MTU versus Rx frame size", "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>", "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": "Since the igb driver is using page based receive there is no point in\nlimiting the Rx capabilities of the device. The driver can receive 9K\njumbo frames at all times. The only changes needed due to MTU changes are\nupdates for the FIFO sizes and flow-control watermarks.\n\nUpdate the maximum frame size to reflect the 9.5K limitation of the\nhardware, and replace all instances of max_frame_size with\nMAX_JUMBO_FRAME_SIZE when referring to an Rx FIFO or frame.\n\nSigned-off-by: Alexander Duyck <aduyck@mirantis.com>\n---\n drivers/net/ethernet/intel/igb/e1000_defines.h | 3 -\n drivers/net/ethernet/intel/igb/igb_main.c | 107 +++++++++---------------\n 2 files changed, 42 insertions(+), 68 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/igb/e1000_defines.h b/drivers/net/ethernet/intel/igb/e1000_defines.h\nindex e28f06e56f37..3e4181a4b177 100644\n--- a/drivers/net/ethernet/intel/igb/e1000_defines.h\n+++ b/drivers/net/ethernet/intel/igb/e1000_defines.h\n@@ -357,7 +357,8 @@\n /* Ethertype field values */\n #define ETHERNET_IEEE_VLAN_TYPE 0x8100 /* 802.3ac packet */\n \n-#define MAX_JUMBO_FRAME_SIZE 0x3F00\n+/* As per the EAS the maximum supported size is 9.5KB (9728 bytes) */\n+#define MAX_JUMBO_FRAME_SIZE 0x2600\n \n /* PBA constants */\n #define E1000_PBA_32K 0x0020\ndiff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c\nindex 3b6d4e10d095..5b200c9f7658 100644\n--- a/drivers/net/ethernet/intel/igb/igb_main.c\n+++ b/drivers/net/ethernet/intel/igb/igb_main.c\n@@ -1891,7 +1891,7 @@ void igb_reset(struct igb_adapter *adapter)\n \tstruct e1000_hw *hw = &adapter->hw;\n \tstruct e1000_mac_info *mac = &hw->mac;\n \tstruct e1000_fc_info *fc = &hw->fc;\n-\tu32 pba = 0, tx_space, min_tx_space, min_rx_space, hwm;\n+\tu32 pba, hwm;\n \n \t/* Repartition Pba for greater than 9k mtu\n \t * To take effect CTRL.RST is required.\n@@ -1917,9 +1917,10 @@ void igb_reset(struct igb_adapter *adapter)\n \t\tbreak;\n \t}\n \n-\tif ((adapter->max_frame_size > ETH_FRAME_LEN + ETH_FCS_LEN) &&\n-\t (mac->type < e1000_82576)) {\n-\t\t/* adjust PBA for jumbo frames */\n+\tif (mac->type == e1000_82575) {\n+\t\tu32 min_rx_space, min_tx_space, needed_tx_space;\n+\n+\t\t/* write Rx PBA so that hardware can report correct Tx PBA */\n \t\twr32(E1000_PBA, pba);\n \n \t\t/* To maintain wire speed transmits, the Tx FIFO should be\n@@ -1929,31 +1930,26 @@ void igb_reset(struct igb_adapter *adapter)\n \t\t * one full receive packet and is similarly rounded up and\n \t\t * expressed in KB.\n \t\t */\n-\t\tpba = rd32(E1000_PBA);\n-\t\t/* upper 16 bits has Tx packet buffer allocation size in KB */\n-\t\ttx_space = pba >> 16;\n-\t\t/* lower 16 bits has Rx packet buffer allocation size in KB */\n-\t\tpba &= 0xffff;\n-\t\t/* the Tx fifo also stores 16 bytes of information about the Tx\n-\t\t * but don't include ethernet FCS because hardware appends it\n+\t\tmin_rx_space = DIV_ROUND_UP(MAX_JUMBO_FRAME_SIZE, 1024);\n+\n+\t\t/* The Tx FIFO also stores 16 bytes of information about the Tx\n+\t\t * but don't include Ethernet FCS because hardware appends it.\n+\t\t * We only need to round down to the nearest 512 byte block count\n+\t\t * since the value we care about is 2 frames, not 1.\n \t\t */\n-\t\tmin_tx_space = (adapter->max_frame_size +\n-\t\t\t\tsizeof(union e1000_adv_tx_desc) -\n-\t\t\t\tETH_FCS_LEN) * 2;\n-\t\tmin_tx_space = ALIGN(min_tx_space, 1024);\n-\t\tmin_tx_space >>= 10;\n-\t\t/* software strips receive CRC, so leave room for it */\n-\t\tmin_rx_space = adapter->max_frame_size;\n-\t\tmin_rx_space = ALIGN(min_rx_space, 1024);\n-\t\tmin_rx_space >>= 10;\n+\t\tmin_tx_space = adapter->max_frame_size;\n+\t\tmin_tx_space += sizeof(union e1000_adv_tx_desc) - ETH_FCS_LEN;\n+\t\tmin_tx_space = DIV_ROUND_UP(min_tx_space, 512);\n+\n+\t\t/* upper 16 bits has Tx packet buffer allocation size in KB */\n+\t\tneeded_tx_space = min_tx_space - (rd32(E1000_PBA) >> 16);\n \n \t\t/* If current Tx allocation is less than the min Tx FIFO size,\n \t\t * and the min Tx FIFO size is less than the current Rx FIFO\n-\t\t * allocation, take space away from current Rx allocation\n+\t\t * allocation, take space away from current Rx allocation.\n \t\t */\n-\t\tif (tx_space < min_tx_space &&\n-\t\t ((min_tx_space - tx_space) < pba)) {\n-\t\t\tpba = pba - (min_tx_space - tx_space);\n+\t\tif (needed_tx_space < pba) {\n+\t\t\tpba -= needed_tx_space;\n \n \t\t\t/* if short on Rx space, Rx wins and must trump Tx\n \t\t\t * adjustment\n@@ -1961,18 +1957,20 @@ void igb_reset(struct igb_adapter *adapter)\n \t\t\tif (pba < min_rx_space)\n \t\t\t\tpba = min_rx_space;\n \t\t}\n+\n+\t\t/* adjust PBA for jumbo frames */\n \t\twr32(E1000_PBA, pba);\n \t}\n \n-\t/* flow control settings */\n-\t/* The high water mark must be low enough to fit one full frame\n-\t * (or the size used for early receive) above it in the Rx FIFO.\n-\t * Set it to the lower of:\n-\t * - 90% of the Rx FIFO size, or\n-\t * - the full Rx FIFO size minus one full frame\n+\t/* flow control settings\n+\t * The high water mark must be low enough to fit one full frame\n+\t * after transmitting the pause frame. As such we must have enough\n+\t * space to allow for us to complete our current transmit and then\n+\t * receive the frame that is in progress from the link partner.\n+\t * Set it to:\n+\t * - the full Rx FIFO size minus one full Tx plus one full Rx frame\n \t */\n-\thwm = min(((pba << 10) * 9 / 10),\n-\t\t\t((pba << 10) - 2 * adapter->max_frame_size));\n+\thwm = (pba << 10) - (adapter->max_frame_size + MAX_JUMBO_FRAME_SIZE);\n \n \tfc->high_water = hwm & 0xFFFFFFF0;\t/* 16-byte granularity */\n \tfc->low_water = fc->high_water - 16;\n@@ -3612,7 +3610,7 @@ void igb_setup_rctl(struct igb_adapter *adapter)\n \t/* disable store bad packets and clear size bits. */\n \trctl &= ~(E1000_RCTL_SBP | E1000_RCTL_SZ_256);\n \n-\t/* enable LPE to prevent packets larger than max_frame_size */\n+\t/* enable LPE to allow for reception of jumbo frames */\n \trctl |= E1000_RCTL_LPE;\n \n \t/* disable queue 0 to prevent tail write w/o re-config */\n@@ -3668,32 +3666,6 @@ static inline int igb_set_vf_rlpml(struct igb_adapter *adapter, int size,\n \treturn 0;\n }\n \n-/**\n- * igb_rlpml_set - set maximum receive packet size\n- * @adapter: board private structure\n- *\n- * Configure maximum receivable packet size.\n- **/\n-static void igb_rlpml_set(struct igb_adapter *adapter)\n-{\n-\tu32 max_frame_size = adapter->max_frame_size;\n-\tstruct e1000_hw *hw = &adapter->hw;\n-\tu16 pf_id = adapter->vfs_allocated_count;\n-\n-\tif (pf_id) {\n-\t\tigb_set_vf_rlpml(adapter, max_frame_size, pf_id);\n-\t\t/* If we're in VMDQ or SR-IOV mode, then set global RLPML\n-\t\t * to our max jumbo frame size, in case we need to enable\n-\t\t * jumbo frames on one of the rings later.\n-\t\t * This will not pass over-length frames into the default\n-\t\t * queue because it's gated by the VMOLR.RLPML.\n-\t\t */\n-\t\tmax_frame_size = MAX_JUMBO_FRAME_SIZE;\n-\t}\n-\n-\twr32(E1000_RLPML, max_frame_size);\n-}\n-\n static inline void igb_set_vmolr(struct igb_adapter *adapter,\n \t\t\t\t int vfn, bool aupe)\n {\n@@ -4191,7 +4163,14 @@ static void igb_set_rx_mode(struct net_device *netdev)\n \n \tvmolr |= rd32(E1000_VMOLR(vfn)) &\n \t\t ~(E1000_VMOLR_ROPE | E1000_VMOLR_MPME | E1000_VMOLR_ROMPE);\n+\n+\t/* enable Rx jumbo frames, no need for restriction */\n+\tvmolr &= ~E1000_VMOLR_RLPML_MASK;\n+\tvmolr |= MAX_JUMBO_FRAME_SIZE | E1000_VMOLR_LPE;\n+\n \twr32(E1000_VMOLR(vfn), vmolr);\n+\twr32(E1000_RLPML, MAX_JUMBO_FRAME_SIZE);\n+\n \tigb_restore_vf_multicasts(adapter);\n }\n \n@@ -7331,8 +7310,6 @@ static void igb_vlan_mode(struct net_device *netdev, netdev_features_t features)\n \t\tctrl &= ~E1000_CTRL_VME;\n \t\twr32(E1000_CTRL, ctrl);\n \t}\n-\n-\tigb_rlpml_set(adapter);\n }\n \n static int igb_vlan_rx_add_vid(struct net_device *netdev,\n@@ -8088,9 +8065,7 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba)\n \t\t\t * than the Rx threshold. Set hwm to PBA - max frame\n \t\t\t * size in 16B units, capping it at PBA - 6KB.\n \t\t\t */\n-\t\t\thwm = 64 * pba - adapter->max_frame_size / 16;\n-\t\t\tif (hwm < 64 * (pba - 6))\n-\t\t\t\thwm = 64 * (pba - 6);\n+\t\t\thwm = 64 * (pba - 6);\n \t\t\treg = rd32(E1000_FCRTC);\n \t\t\treg &= ~E1000_FCRTC_RTH_COAL_MASK;\n \t\t\treg |= ((hwm << E1000_FCRTC_RTH_COAL_SHIFT)\n@@ -8100,9 +8075,7 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba)\n \t\t\t/* Set the DMA Coalescing Rx threshold to PBA - 2 * max\n \t\t\t * frame size, capping it at PBA - 10KB.\n \t\t\t */\n-\t\t\tdmac_thr = pba - adapter->max_frame_size / 512;\n-\t\t\tif (dmac_thr < pba - 10)\n-\t\t\t\tdmac_thr = pba - 10;\n+\t\t\tdmac_thr = pba - 10;\n \t\t\treg = rd32(E1000_DMACR);\n \t\t\treg &= ~E1000_DMACR_DMACTHR_MASK;\n \t\t\treg |= ((dmac_thr << E1000_DMACR_DMACTHR_SHIFT)\n", "prefixes": [ "next", "03/11" ] }