From: Joseph Gasparakis <joseph.gasparakis@intel.com>
To: davem@davemloft.net, shemminger@vyatta.com, chrisw@sous-sol.org,
gospo@redhat.com
Cc: Joseph Gasparakis <joseph.gasparakis@intel.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
dmitry@broadcom.com, saeed.bishara@gmail.com,
Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>,
Alexander Duyck <alexander.h.duyck@intel.com>
Subject: [PATCH v3 3/4] vxlan: capture inner headers during encapsulation
Date: Thu, 6 Dec 2012 17:56:58 -0800 [thread overview]
Message-ID: <1354845419-22483-4-git-send-email-joseph.gasparakis@intel.com> (raw)
In-Reply-To: <1354845419-22483-1-git-send-email-joseph.gasparakis@intel.com>
Allow VXLAN to make use of Tx checksum offloading and Tx scatter-gather.
The advantage to these two changes is that it also allows the VXLAN to
make use of GSO.
Signed-off-by: Joseph Gasparakis <joseph.gasparakis@intel.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
---
drivers/net/vxlan.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index ce77b8b..88b31f2 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -876,6 +876,11 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev)
goto drop;
}
+ if (!skb->encapsulation) {
+ skb_reset_inner_headers(skb);
+ skb->encapsulation = 1;
+ }
+
/* Need space for new headers (invalidates iph ptr) */
if (skb_cow_head(skb, VXLAN_HEADROOM))
goto drop;
@@ -947,7 +952,8 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev)
vxlan_set_owner(dev, skb);
/* See iptunnel_xmit() */
- skb->ip_summed = CHECKSUM_NONE;
+ if (skb->ip_summed != CHECKSUM_PARTIAL)
+ skb->ip_summed = CHECKSUM_NONE;
ip_select_ident(iph, &rt->dst, NULL);
err = ip_local_out(skb);
@@ -1168,6 +1174,8 @@ static void vxlan_setup(struct net_device *dev)
dev->tx_queue_len = 0;
dev->features |= NETIF_F_LLTX;
dev->features |= NETIF_F_NETNS_LOCAL;
+ dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM;
+ dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM;
dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
spin_lock_init(&vxlan->hash_lock);
--
1.7.6.4
next prev parent reply other threads:[~2012-12-07 1:56 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-07 1:56 [PATCH v3 net-next 0/4] tunneling: Add support for hardware-offloaded encapsulation Joseph Gasparakis
2012-12-07 1:56 ` [PATCH v3 1/4] net: " Joseph Gasparakis
2012-12-07 10:07 ` Ben Hutchings
2012-12-07 16:45 ` Alexander Duyck
2012-12-07 17:13 ` Ben Hutchings
2012-12-07 18:24 ` Joseph Gasparakis
2012-12-07 19:28 ` David Miller
2012-12-07 19:41 ` Joseph Gasparakis
2012-12-07 19:37 ` David Miller
2012-12-07 19:52 ` Joseph Gasparakis
2012-12-07 19:52 ` David Miller
2012-12-07 20:18 ` Joseph Gasparakis
2012-12-07 23:15 ` Jeff Kirsher
2012-12-07 1:56 ` [PATCH v3 2/4] net: Handle encapsulated offloads before fragmentation or handing to lower dev Joseph Gasparakis
2012-12-07 23:15 ` Jeff Kirsher
2012-12-07 1:56 ` Joseph Gasparakis [this message]
2012-12-07 23:16 ` [PATCH v3 3/4] vxlan: capture inner headers during encapsulation Jeff Kirsher
2012-12-07 1:56 ` [RFC PATCH v3 4/4] ixgbe: Adding tx encapsulation capability Joseph Gasparakis
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=1354845419-22483-4-git-send-email-joseph.gasparakis@intel.com \
--to=joseph.gasparakis@intel.com \
--cc=alexander.h.duyck@intel.com \
--cc=chrisw@sous-sol.org \
--cc=davem@davemloft.net \
--cc=dmitry@broadcom.com \
--cc=gospo@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=peter.p.waskiewicz.jr@intel.com \
--cc=saeed.bishara@gmail.com \
--cc=shemminger@vyatta.com \
/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;
as well as URLs for NNTP newsgroup(s).