From: Joseph Gasparakis <joseph.gasparakis@intel.com>
To: davem@davemloft.net, shemminger@vyatta.com, chrisw@sous-sol.org,
gospo@redhat.com
Cc: Alexander Duyck <alexander.h.duyck@intel.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
dmitry@broadcom.com, saeed.bishara@gmail.com
Subject: [PATCH v3 2/4] net: Handle encapsulated offloads before fragmentation or handing to lower dev
Date: Thu, 6 Dec 2012 17:56:57 -0800 [thread overview]
Message-ID: <1354845419-22483-3-git-send-email-joseph.gasparakis@intel.com> (raw)
In-Reply-To: <1354845419-22483-1-git-send-email-joseph.gasparakis@intel.com>
From: Alexander Duyck <alexander.h.duyck@intel.com>
This change allows the VXLAN to enable Tx checksum offloading even on
devices that do not support encapsulated checksum offloads. The
advantage to this is that it allows for the lower device to change due
to routing table changes without impacting features on the VXLAN itself.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
---
net/core/dev.c | 15 +++++++++++++--
net/ipv4/ip_output.c | 4 ++++
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 2a5f5586..7a2646a 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2324,6 +2324,13 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
skb->vlan_tci = 0;
}
+ /* If encapsulation offload request, verify we are testing
+ * hardware encapsulation features instead of standard
+ * features for the netdev
+ */
+ if (skb->encapsulation)
+ features &= dev->hw_enc_features;
+
if (netif_needs_gso(skb, features)) {
if (unlikely(dev_gso_segment(skb, features)))
goto out_kfree_skb;
@@ -2339,8 +2346,12 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
* checksumming here.
*/
if (skb->ip_summed == CHECKSUM_PARTIAL) {
- skb_set_transport_header(skb,
- skb_checksum_start_offset(skb));
+ if (skb->encapsulation)
+ skb_set_inner_transport_header(skb,
+ skb_checksum_start_offset(skb));
+ else
+ skb_set_transport_header(skb,
+ skb_checksum_start_offset(skb));
if (!(features & NETIF_F_ALL_CSUM) &&
skb_checksum_help(skb))
goto out_kfree_skb;
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 6537a40..3e98ed2 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -595,6 +595,10 @@ slow_path_clean:
}
slow_path:
+ /* for offloaded checksums cleanup checksum before fragmentation */
+ if ((skb->ip_summed == CHECKSUM_PARTIAL) && skb_checksum_help(skb))
+ goto fail;
+
left = skb->len - hlen; /* Space per frame */
ptr = hlen; /* Where to start from */
--
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 ` Joseph Gasparakis [this message]
2012-12-07 23:15 ` [PATCH v3 2/4] net: Handle encapsulated offloads before fragmentation or handing to lower dev Jeff Kirsher
2012-12-07 1:56 ` [PATCH v3 3/4] vxlan: capture inner headers during encapsulation Joseph Gasparakis
2012-12-07 23:16 ` 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-3-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=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).