Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peterson, Scott D <scott.d.peterson@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [net-next PATCH] ixgbe/ixgbevf: Enables TSO for MPLS encapsulated packets
Date: Tue, 15 Nov 2016 19:03:59 +0000	[thread overview]
Message-ID: <1479236637.26945.70.camel@intel.com> (raw)

This patch advertises TSO & GSO features in netdev->mpls_features.?
In ixgbe(vf)_tso() where we set up segmentation offload, the IP?
header will be the inner network header when eth_p_mpls() indicates
the Ethernet protocol is MPLS (UC or MC).

We're submitting this upstream first, because it depends on related
upstream changes not yet present in the OOT drivers.

Suggested-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Scott Peterson <scott.d.peterson@intel.com>
---

?drivers/net/ethernet/intel/ixgbe/ixgbe_main.c?????| 12 ++++++++++--
?drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 12 ++++++++++--
?2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 2436984..04b2ceb 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -55,6 +55,7 @@
?#include <net/tc_act/tc_gact.h>
?#include <net/tc_act/tc_mirred.h>
?#include <net/vxlan.h>
+#include <net/mpls.h>
?
?#include "ixgbe.h"
?#include "ixgbe_common.h"
@@ -7279,7 +7280,10 @@ static int ixgbe_tso(struct ixgbe_ring *tx_ring,
????????if (err < 0)
????????????????return err;
?
-???????ip.hdr = skb_network_header(skb);
+???????if (eth_p_mpls(first->protocol))
+???????????????ip.hdr = skb_inner_network_header(skb);
+???????else
+???????????????ip.hdr = skb_network_header(skb);
????????l4.hdr = skb_checksum_start(skb);
?
????????/* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */
@@ -9653,7 +9657,11 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
?
????????netdev->vlan_features |= netdev->features | NETIF_F_TSO_MANGLEID;
????????netdev->hw_enc_features |= netdev->vlan_features;
-???????netdev->mpls_features |= NETIF_F_HW_CSUM;
+???????netdev->mpls_features |= NETIF_F_SG |
+????????????????????????????????NETIF_F_TSO |
+????????????????????????????????NETIF_F_TSO6 |
+????????????????????????????????NETIF_F_HW_CSUM;
+???????netdev->mpls_features |= IXGBE_GSO_PARTIAL_FEATURES;
?
????????/* set this bit last since it cannot be part of vlan_features */
????????netdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER |
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index d316f50..8498eed 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -49,6 +49,7 @@
?#include <linux/if.h>
?#include <linux/if_vlan.h>
?#include <linux/prefetch.h>
+#include <net/mpls.h>
?
?#include "ixgbevf.h"
?
@@ -3327,7 +3328,10 @@ static int ixgbevf_tso(struct ixgbevf_ring *tx_ring,
????????if (err < 0)
????????????????return err;
?
-???????ip.hdr = skb_network_header(skb);
+???????if (eth_p_mpls(first->protocol))
+???????????????ip.hdr = skb_inner_network_header(skb);
+???????else
+???????????????ip.hdr = skb_network_header(skb);
????????l4.hdr = skb_checksum_start(skb);
?
????????/* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */
@@ -4083,7 +4087,11 @@ static int ixgbevf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
????????????????netdev->features |= NETIF_F_HIGHDMA;
?
????????netdev->vlan_features |= netdev->features | NETIF_F_TSO_MANGLEID;
-???????netdev->mpls_features |= NETIF_F_HW_CSUM;
+???????netdev->mpls_features |= NETIF_F_SG |
+????????????????????????????????NETIF_F_TSO |
+????????????????????????????????NETIF_F_TSO6 |
+????????????????????????????????NETIF_F_HW_CSUM;
+???????netdev->mpls_features |= IXGBEVF_GSO_PARTIAL_FEATURES;
????????netdev->hw_enc_features |= netdev->vlan_features;
?
????????/* set this bit last since it cannot be part of vlan_features */

             reply	other threads:[~2016-11-15 19:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-15 19:03 Peterson, Scott D [this message]
2016-11-15 22:27 ` [Intel-wired-lan] [net-next PATCH] ixgbe/ixgbevf: Enables TSO for MPLS encapsulated packets Peterson, Scott D
2016-11-18  5:53 ` Jeff Kirsher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1479236637.26945.70.camel@intel.com \
    --to=scott.d.peterson@intel.com \
    --cc=intel-wired-lan@osuosl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox