get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 459496,
    "url": "http://patchwork.ozlabs.org/api/patches/459496/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20150408204630.4643.37880.stgit@ahduyck-vm-fedora22/",
    "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": "<20150408204630.4643.37880.stgit@ahduyck-vm-fedora22>",
    "list_archive_url": null,
    "date": "2015-04-08T21:02:34",
    "name": "e1000e: Cleanup handling of VLAN_HLEN as a part of max frame size",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "84ab6f365aff62e127d4ab0453e511e3fa154dbe",
    "submitter": {
        "id": 64958,
        "url": "http://patchwork.ozlabs.org/api/people/64958/?format=api",
        "name": "Alexander Duyck",
        "email": "alexander.h.duyck@redhat.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/20150408204630.4643.37880.stgit@ahduyck-vm-fedora22/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/459496/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/459496/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 hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133])\n\tby ozlabs.org (Postfix) with ESMTP id EC97A14021A\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  9 Apr 2015 07:02:44 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 1D0D49521D;\n\tWed,  8 Apr 2015 21:02:44 +0000 (UTC)",
            "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 8VMpYpmuzFKk; Wed,  8 Apr 2015 21:02:43 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 55B979521E;\n\tWed,  8 Apr 2015 21:02:43 +0000 (UTC)",
            "from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 970F41C2333\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed,  8 Apr 2015 21:02:41 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 90B16A2E3B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed,  8 Apr 2015 21:02:41 +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 CGbcDmJVZppS for <intel-wired-lan@lists.osuosl.org>;\n\tWed,  8 Apr 2015 21:02:40 +0000 (UTC)",
            "from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 223CAA2DE6\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed,  8 Apr 2015 21:02:40 +0000 (UTC)",
            "from int-mx14.intmail.prod.int.phx2.redhat.com\n\t(int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27])\n\tby mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t38L2arm024420\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=FAIL); Wed, 8 Apr 2015 17:02:36 -0400",
            "from [192.168.122.149] ([10.3.112.3])\n\tby int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with\n\tESMTP id t38L2ZV1025543; Wed, 8 Apr 2015 17:02:35 -0400"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "From": "Alexander Duyck <alexander.h.duyck@redhat.com>",
        "To": "intel-wired-lan@lists.osuosl.org, jeffrey.t.kirsher@intel.com",
        "Date": "Wed, 08 Apr 2015 14:02:34 -0700",
        "Message-ID": "<20150408204630.4643.37880.stgit@ahduyck-vm-fedora22>",
        "In-Reply-To": "<alpine.NEB.2.11.1504081019220.3388@chris.i8u.org>",
        "References": "<alpine.NEB.2.11.1504081019220.3388@chris.i8u.org>",
        "User-Agent": "StGit/0.17.1-dirty",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.68 on 10.5.11.27",
        "Cc": "netdev@vger.kernel.org, mike@cchtml.com, htodd@twofifty.com",
        "Subject": "[Intel-wired-lan] [PATCH] e1000e: Cleanup handling of VLAN_HLEN as\n\ta part of max 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": "When the VLAN_HLEN was added to the calculation for the maximum frame size\nthere seems to have been a number of issues added to the driver.\n\nThe first issue is that in some cases the maximum frame size for a device\nnever really reached the actual maximum frame size as the VLAN header\nlength was not included the calculation for that value.  As a result some\nparts only supported a maximum frame size of either 1496 in the case of\nparts that didn't support jumbo frames, and 8996 in the case of the parts\nthat do.\n\nThe second issue is the fact that there were several checks that weren't\nupdated so as a result setting an MTU of 1500 was treated as enabling jumbo\nframes as the calculated value was 1522 instead of 1518.  I have addressed\nthose by replacing ETH_FRAME_LEN with VLAN_ETH_FRAME_LEN where appropriate.\n\nThe final issue was the fact that lowering the MTU below 1500 would cause\nthe driver to allocate 2K buffers for the rings.  This is an old issue that\nwas fixed several years ago in igb/ixgbe and I am addressing now by just\nreplacing == with a <= so that we always just round up to 1522 for anything\nthat isn't a jumbo frame.\n\nFixes: c751a3d58cf2d (\"e1000e: Correctly include VLAN_HLEN when changing interface MTU\")\nSigned-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>\n---\n\nI have only build tested this though I am 99% sure the fixes here are\ncorrect.  This patch should fix issues on 82573 and ich8 w/ setting an MTU\nof 1500, and for the PCH series w/ setting an MTU of 9000.\n\nI assume I can get away with bumping the max_hw_frame_size for the PCH\nparts from 9018 to 9022 based on the fact that the Windows INF for the parts\nlists supporting either 1514, 4088, and 9014 all of which exclude the 8\nbytes for CRC and VLAN header.\n\n drivers/net/ethernet/intel/e1000e/82571.c   |    2 +-\n drivers/net/ethernet/intel/e1000e/ich8lan.c |   10 +++++-----\n drivers/net/ethernet/intel/e1000e/netdev.c  |   18 ++++++++----------\n 3 files changed, 14 insertions(+), 16 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c\nindex dc79ed85030b..32e77755a9c6 100644\n--- a/drivers/net/ethernet/intel/e1000e/82571.c\n+++ b/drivers/net/ethernet/intel/e1000e/82571.c\n@@ -2010,7 +2010,7 @@ const struct e1000_info e1000_82573_info = {\n \t.flags2\t\t\t= FLAG2_DISABLE_ASPM_L1\n \t\t\t\t  | FLAG2_DISABLE_ASPM_L0S,\n \t.pba\t\t\t= 20,\n-\t.max_hw_frame_size\t= ETH_FRAME_LEN + ETH_FCS_LEN,\n+\t.max_hw_frame_size\t= VLAN_ETH_FRAME_LEN + ETH_FCS_LEN,\n \t.get_variants\t\t= e1000_get_variants_82571,\n \t.mac_ops\t\t= &e82571_mac_ops,\n \t.phy_ops\t\t= &e82_phy_ops_m88,\ndiff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c\nindex 9d81c0317433..e2498dbf3c3b 100644\n--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c\n+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c\n@@ -1563,7 +1563,7 @@ static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter)\n \t    ((adapter->hw.mac.type >= e1000_pch2lan) &&\n \t     (!(er32(CTRL_EXT) & E1000_CTRL_EXT_LSECCK)))) {\n \t\tadapter->flags &= ~FLAG_HAS_JUMBO_FRAMES;\n-\t\tadapter->max_hw_frame_size = ETH_FRAME_LEN + ETH_FCS_LEN;\n+\t\tadapter->max_hw_frame_size = VLAN_ETH_FRAME_LEN + ETH_FCS_LEN;\n \n \t\thw->mac.ops.blink_led = NULL;\n \t}\n@@ -5681,7 +5681,7 @@ const struct e1000_info e1000_ich8_info = {\n \t\t\t\t  | FLAG_HAS_FLASH\n \t\t\t\t  | FLAG_APME_IN_WUC,\n \t.pba\t\t\t= 8,\n-\t.max_hw_frame_size\t= ETH_FRAME_LEN + ETH_FCS_LEN,\n+\t.max_hw_frame_size\t= VLAN_ETH_FRAME_LEN + ETH_FCS_LEN,\n \t.get_variants\t\t= e1000_get_variants_ich8lan,\n \t.mac_ops\t\t= &ich8_mac_ops,\n \t.phy_ops\t\t= &ich8_phy_ops,\n@@ -5754,7 +5754,7 @@ const struct e1000_info e1000_pch2_info = {\n \t.flags2\t\t\t= FLAG2_HAS_PHY_STATS\n \t\t\t\t  | FLAG2_HAS_EEE,\n \t.pba\t\t\t= 26,\n-\t.max_hw_frame_size\t= 9018,\n+\t.max_hw_frame_size\t= 9022,\n \t.get_variants\t\t= e1000_get_variants_ich8lan,\n \t.mac_ops\t\t= &ich8_mac_ops,\n \t.phy_ops\t\t= &ich8_phy_ops,\n@@ -5774,7 +5774,7 @@ const struct e1000_info e1000_pch_lpt_info = {\n \t.flags2\t\t\t= FLAG2_HAS_PHY_STATS\n \t\t\t\t  | FLAG2_HAS_EEE,\n \t.pba\t\t\t= 26,\n-\t.max_hw_frame_size\t= 9018,\n+\t.max_hw_frame_size\t= 9022,\n \t.get_variants\t\t= e1000_get_variants_ich8lan,\n \t.mac_ops\t\t= &ich8_mac_ops,\n \t.phy_ops\t\t= &ich8_phy_ops,\n@@ -5794,7 +5794,7 @@ const struct e1000_info e1000_pch_spt_info = {\n \t.flags2\t\t\t= FLAG2_HAS_PHY_STATS\n \t\t\t\t  | FLAG2_HAS_EEE,\n \t.pba\t\t\t= 26,\n-\t.max_hw_frame_size\t= 9018,\n+\t.max_hw_frame_size\t= 9022,\n \t.get_variants\t\t= e1000_get_variants_ich8lan,\n \t.mac_ops\t\t= &ich8_mac_ops,\n \t.phy_ops\t\t= &ich8_phy_ops,\ndiff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c\nindex 74ec185a697f..f77db9304060 100644\n--- a/drivers/net/ethernet/intel/e1000e/netdev.c\n+++ b/drivers/net/ethernet/intel/e1000e/netdev.c\n@@ -3807,7 +3807,7 @@ void e1000e_reset(struct e1000_adapter *adapter)\n \t/* reset Packet Buffer Allocation to default */\n \tew32(PBA, pba);\n \n-\tif (adapter->max_frame_size > ETH_FRAME_LEN + ETH_FCS_LEN) {\n+\tif (adapter->max_frame_size > (VLAN_ETH_FRAME_LEN + ETH_FCS_LEN)) {\n \t\t/* To maintain wire speed transmits, the Tx FIFO should be\n \t\t * large enough to accommodate two full transmit packets,\n \t\t * rounded up to the next 1KB and expressed in KB.  Likewise,\n@@ -4196,9 +4196,9 @@ static int e1000_sw_init(struct e1000_adapter *adapter)\n {\n \tstruct net_device *netdev = adapter->netdev;\n \n-\tadapter->rx_buffer_len = ETH_FRAME_LEN + VLAN_HLEN + ETH_FCS_LEN;\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 + ETH_HLEN + ETH_FCS_LEN;\n+\tadapter->max_frame_size = netdev->mtu + VLAN_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@@ -5781,17 +5781,17 @@ struct rtnl_link_stats64 *e1000e_get_stats64(struct net_device *netdev,\n static int e1000_change_mtu(struct net_device *netdev, int new_mtu)\n {\n \tstruct e1000_adapter *adapter = netdev_priv(netdev);\n-\tint max_frame = new_mtu + VLAN_HLEN + ETH_HLEN + ETH_FCS_LEN;\n+\tint max_frame = new_mtu + VLAN_ETH_HLEN + ETH_FCS_LEN;\n \n \t/* Jumbo frame support */\n-\tif ((max_frame > ETH_FRAME_LEN + ETH_FCS_LEN) &&\n+\tif ((max_frame > (VLAN_ETH_FRAME_LEN + ETH_FCS_LEN)) &&\n \t    !(adapter->flags & FLAG_HAS_JUMBO_FRAMES)) {\n \t\te_err(\"Jumbo Frames not supported.\\n\");\n \t\treturn -EINVAL;\n \t}\n \n \t/* Supported frame sizes */\n-\tif ((new_mtu < ETH_ZLEN + ETH_FCS_LEN + VLAN_HLEN) ||\n+\tif ((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@@ -5831,10 +5831,8 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)\n \t\tadapter->rx_buffer_len = 4096;\n \n \t/* adjust allocation if LPE protects us, and we aren't using SBP */\n-\tif ((max_frame == ETH_FRAME_LEN + ETH_FCS_LEN) ||\n-\t    (max_frame == ETH_FRAME_LEN + VLAN_HLEN + ETH_FCS_LEN))\n-\t\tadapter->rx_buffer_len = ETH_FRAME_LEN + VLAN_HLEN\n-\t\t    + ETH_FCS_LEN;\n+\tif (max_frame <= (VLAN_ETH_FRAME_LEN + ETH_FCS_LEN))\n+\t\tadapter->rx_buffer_len = VLAN_ETH_FRAME_LEN + ETH_FCS_LEN;\n \n \tif (netif_running(netdev))\n \t\te1000e_up(adapter);\n",
    "prefixes": []
}