netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vlad Yasevich <vyasevic@redhat.com>
To: netdev@vger.kernel.org
Cc: mst@redhat.com, Vlad Yasevich <vyasevic@redhat.com>
Subject: [PATCH v4 3/3] macvtap: Ignore tap features when VNET_HDR is off
Date: Fri, 16 Aug 2013 15:25:02 -0400	[thread overview]
Message-ID: <1376681102-19753-4-git-send-email-vyasevic@redhat.com> (raw)
In-Reply-To: <1376681102-19753-1-git-send-email-vyasevic@redhat.com>

When the user turns off VNET_HDR support on the
macvtap device, there is no way to provide any
offload information to the user.  So, it's safer
to ignore offload setting then depend on the user
setting them correctly.

Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
---
 drivers/net/macvtap.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 4acfbce..ea53abb 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -290,9 +290,11 @@ static int macvtap_forward(struct net_device *dev, struct sk_buff *skb)
 
 	skb->dev = dev;
 	/* Apply the forward feature mask so that we perform segmentation
-	 * according to users wishes.
+	 * according to users wishes.  This only works if VNET_HDR is
+	 * enabled.
 	 */
-	features |= vlan->tap_features;
+	if (q->flags & IFF_VNET_HDR)
+		features |= vlan->tap_features;
 	if (netif_needs_gso(skb, features)) {
 		struct sk_buff *segs = __skb_gso_segment(skb, features, false);
 
-- 
1.8.1.4

  parent reply	other threads:[~2013-08-16 22:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-16 19:24 [PATCH v4 0/3] Correctly perform offloads when VNET_HDR is disabled Vlad Yasevich
2013-08-16 19:25 ` [PATCH v4 1/3] macvtap: simplify usage of tap_features Vlad Yasevich
2013-08-20 20:09   ` David Miller
2013-08-16 19:25 ` [PATCH v4 2/3] macvtap: Correctly set tap features when IFF_VNET_HDR is disabled Vlad Yasevich
2013-08-20 20:09   ` David Miller
2013-08-16 19:25 ` Vlad Yasevich [this message]
2013-08-20 20:09   ` [PATCH v4 3/3] macvtap: Ignore tap features when VNET_HDR is off David Miller

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=1376681102-19753-4-git-send-email-vyasevic@redhat.com \
    --to=vyasevic@redhat.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).