Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/696731/?format=api
{ "id": 696731, "url": "http://patchwork.ozlabs.org/api/patches/696731/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/147949699683.18376.16266711523851563132.stgit@sdpeters-desk.jf.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": "<147949699683.18376.16266711523851563132.stgit@sdpeters-desk.jf.intel.com>", "list_archive_url": null, "date": "2016-11-18T19:25:42", "name": "[net-next,2] ixgbe/ixgbevf: Enables TSO for MPLS encapsulated packets", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "22fa98b90004a724fdf6cdf02d699054cdcaeaba", "submitter": { "id": 70047, "url": "http://patchwork.ozlabs.org/api/people/70047/?format=api", "name": "Scott Peterson", "email": "scott.d.peterson@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/147949699683.18376.16266711523851563132.stgit@sdpeters-desk.jf.intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/696731/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/696731/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\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3tL7JF0vvDz9t0w\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 19 Nov 2016 06:25:48 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 5F260883B2;\n\tFri, 18 Nov 2016 19:25:47 +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 LuWpAqduVncE; Fri, 18 Nov 2016 19:25:46 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 1495F8839B;\n\tFri, 18 Nov 2016 19:25:46 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 9DB2D1C02F6\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 18 Nov 2016 19:25:44 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 9689C2A219\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 18 Nov 2016 19:25:44 +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 SWnpwgKPXkyf for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 18 Nov 2016 19:25:43 +0000 (UTC)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 81C192A189\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 18 Nov 2016 19:25:43 +0000 (UTC)", "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby fmsmga104.fm.intel.com with ESMTP; 18 Nov 2016 11:25:42 -0800", "from sdpeters-desk.jf.intel.com ([134.134.2.60])\n\tby orsmga003.jf.intel.com with ESMTP; 18 Nov 2016 11:25:42 -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.31,659,1473145200\"; d=\"scan'208\";a=\"903029617\"", "From": "Scott Peterson <scott.d.peterson@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Fri, 18 Nov 2016 11:25:42 -0800", "Message-ID": "<147949699683.18376.16266711523851563132.stgit@sdpeters-desk.jf.intel.com>", "User-Agent": "StGit/0.17.1-dirty", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [net-next PATCH 2] ixgbe/ixgbevf: Enables TSO for\n\tMPLS encapsulated packets", "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": "This patch advertises TSO & GSO features in netdev->mpls_features.\nIn ixgbe(vf)_tso() where we set up segmentation offload, the IP\nheader will be the inner network header when eth_p_mpls() indicates\nthe Ethernet protocol is MPLS (UC or MC).\n\nWe're submitting this upstream first, because it depends on related\nupstream changes not yet present in the OOT drivers.\n\nSuggested-by: Alexander Duyck <alexander.h.duyck@intel.com>\nSigned-off-by: Scott Peterson <scott.d.peterson@intel.com>\n---\nV2: Patch formatting de-fubared. It applies for me now. Sorry, Jeff.\n\nTesting Hints:\n\nI did basic testing of this by setting up a simple MPLS tunnel (one label)\nbetween two nodes. I sent a megabyte of random data with ncat from the node\nwith this patch, and verified the rx pattern matched the tx pattern. There is\nno TSO stat in ixgbe AFAIK. To confirm TSO occurred in the test, I ran it once\nwith a pr_err() added to the clause below that detects MPLS. I repeated the\nverification test after removing the debug logging. This was done for each\ndriver. I would not be surprised to discover there is a better way to verify\nTSO occurs on ixgbe.\n\nA more complete test would verify that all the GSO features supported by\nixgbe/ixgbevf (see IXGBE_GSO_PARTIAL_FEATURES) work correctly when nested\ninside MPLS. This needs to be done at least once on both drivers.\n\nClues for setting up an MPLS tunnel follow. This may be obvious, but note the\nrp_filter step was required.\n\nOn both nodes:\n\nmodprobe mpls-router\nmodprobe mpls-iptunnel\nmodprobe mpls-gso\necho 1 > /proc/sys/net/mpls/conf/<your ixgbe>/input\necho 1 > /proc/sys/net/mpls/conf/lo/input\necho 1048575 > /proc/sys/net/mpls/platform_labels\n#Relax reverse path filtering\necho 2 > /proc/sys/net/ipv4/conf/all/rp_filter\n\nOn both nodes add a /32 address outside the range of all local subnets to lo\nfor use as the MPLS endpoint addresses.\n\nAdd a route over MPLS with tag 101 from each node, like:\n\nip route add <other mpls ip>/32 encap mpls 101 via inet <other ixgbe ip>\n\nAdd an MPLS decapsulation (deliver tag 101 to lo) route on both nodes:\n\nip -f mpls route add 101 dev lo\n\nNow from either end ping <other mpls ip> will work, and wireshark on ixgbe will\nshow MPLS encapsulated ICMP messages exchanged.\n\nWhen you unload/load ixgbe/ixgbevf, these need to be repeated:\n\necho 1 > /proc/sys/net/mpls/conf/<your ixgbe>/input\nip route add <other mpls ip>/32 encap mpls 101 via inet <other ixgbe ip>\n\nWhen you transfer the file with ncat, use the <other mpls ip>, of course.\nIt will work if you use <other ixgbe>, but that won't be MPLS encapsulated.\n\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 12 ++++++++++--\n drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 12 ++++++++++--\n 2 files changed, 20 insertions(+), 4 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex 2436984..04b2ceb 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -55,6 +55,7 @@\n #include <net/tc_act/tc_gact.h>\n #include <net/tc_act/tc_mirred.h>\n #include <net/vxlan.h>\n+#include <net/mpls.h>\n \n #include \"ixgbe.h\"\n #include \"ixgbe_common.h\"\n@@ -7279,7 +7280,10 @@ static int ixgbe_tso(struct ixgbe_ring *tx_ring,\n \tif (err < 0)\n \t\treturn err;\n \n-\tip.hdr = skb_network_header(skb);\n+\tif (eth_p_mpls(first->protocol))\n+\t\tip.hdr = skb_inner_network_header(skb);\n+\telse\n+\t\tip.hdr = skb_network_header(skb);\n \tl4.hdr = skb_checksum_start(skb);\n \n \t/* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */\n@@ -9653,7 +9657,11 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n \n \tnetdev->vlan_features |= netdev->features | NETIF_F_TSO_MANGLEID;\n \tnetdev->hw_enc_features |= netdev->vlan_features;\n-\tnetdev->mpls_features |= NETIF_F_HW_CSUM;\n+\tnetdev->mpls_features |= NETIF_F_SG |\n+\t\t\t\t NETIF_F_TSO |\n+\t\t\t\t NETIF_F_TSO6 |\n+\t\t\t\t NETIF_F_HW_CSUM;\n+\tnetdev->mpls_features |= IXGBE_GSO_PARTIAL_FEATURES;\n \n \t/* set this bit last since it cannot be part of vlan_features */\n \tnetdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER |\ndiff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\nindex d316f50..8498eed 100644\n--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\n+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\n@@ -49,6 +49,7 @@\n #include <linux/if.h>\n #include <linux/if_vlan.h>\n #include <linux/prefetch.h>\n+#include <net/mpls.h>\n \n #include \"ixgbevf.h\"\n \n@@ -3327,7 +3328,10 @@ static int ixgbevf_tso(struct ixgbevf_ring *tx_ring,\n \tif (err < 0)\n \t\treturn err;\n \n-\tip.hdr = skb_network_header(skb);\n+\tif (eth_p_mpls(first->protocol))\n+\t\tip.hdr = skb_inner_network_header(skb);\n+\telse\n+\t\tip.hdr = skb_network_header(skb);\n \tl4.hdr = skb_checksum_start(skb);\n \n \t/* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */\n@@ -4083,7 +4087,11 @@ static int ixgbevf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n \t\tnetdev->features |= NETIF_F_HIGHDMA;\n \n \tnetdev->vlan_features |= netdev->features | NETIF_F_TSO_MANGLEID;\n-\tnetdev->mpls_features |= NETIF_F_HW_CSUM;\n+\tnetdev->mpls_features |= NETIF_F_SG |\n+\t\t\t\t NETIF_F_TSO |\n+\t\t\t\t NETIF_F_TSO6 |\n+\t\t\t\t NETIF_F_HW_CSUM;\n+\tnetdev->mpls_features |= IXGBEVF_GSO_PARTIAL_FEATURES;\n \tnetdev->hw_enc_features |= netdev->vlan_features;\n \n \t/* set this bit last since it cannot be part of vlan_features */\n", "prefixes": [ "net-next", "2" ] }