netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jesse Gross <jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
To: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Cc: dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH net-next 6/7] openvswitch: Check gso_type for correct sk_buff in queue_gso_packets().
Date: Fri, 20 Jul 2012 15:26:49 -0700	[thread overview]
Message-ID: <1342823210-3308-7-git-send-email-jesse@nicira.com> (raw)
In-Reply-To: <1342823210-3308-1-git-send-email-jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>

From: Ben Pfaff <blp-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>

At the point where it was used, skb_shinfo(skb)->gso_type referred to a
post-GSO sk_buff.  Thus, it would always be 0.  We want to know the pre-GSO
gso_type, so we need to obtain it before segmenting.

Before this change, the kernel would pass inconsistent data to userspace:
packets for UDP fragments with nonzero offset would be passed along with
flow keys that indicate a zero offset (that is, the flow key for "later"
fragments claimed to be "first" fragments).  This inconsistency tended
to confuse Open vSwitch userspace, causing it to log messages about
"failed to flow_del" the flows with "later" fragments.

Signed-off-by: Ben Pfaff <blp-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Jesse Gross <jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
---
 net/openvswitch/datapath.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 670e630..29dbfcb 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -263,6 +263,7 @@ err:
 static int queue_gso_packets(int dp_ifindex, struct sk_buff *skb,
 			     const struct dp_upcall_info *upcall_info)
 {
+	unsigned short gso_type = skb_shinfo(skb)->gso_type;
 	struct dp_upcall_info later_info;
 	struct sw_flow_key later_key;
 	struct sk_buff *segs, *nskb;
@@ -279,7 +280,7 @@ static int queue_gso_packets(int dp_ifindex, struct sk_buff *skb,
 		if (err)
 			break;
 
-		if (skb == segs && skb_shinfo(skb)->gso_type & SKB_GSO_UDP) {
+		if (skb == segs && gso_type & SKB_GSO_UDP) {
 			/* The initial flow key extracted by ovs_flow_extract()
 			 * in this case is for a first fragment, so we need to
 			 * properly mark later fragments.
-- 
1.7.9.5

  parent reply	other threads:[~2012-07-20 22:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-20 22:26 [GIT net-next] Open vSwitch Jesse Gross
     [not found] ` <1342823210-3308-1-git-send-email-jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
2012-07-20 22:26   ` [PATCH net-next 1/7] openvswitch: Enable retrieval of TCP flags from IPv6 traffic Jesse Gross
2012-07-20 22:26   ` [PATCH net-next 2/7] openvswitch: Do not send notification if ovs_vport_set_options() failed Jesse Gross
2012-07-20 22:26   ` [PATCH net-next 3/7] openvswitch: Replace Nicira Networks Jesse Gross
2012-07-20 22:26   ` [PATCH net-next 4/7] openvswitch: Reset upper layer protocol info on internal devices Jesse Gross
     [not found]     ` <1342823210-3308-5-git-send-email-jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
2012-09-04  0:57       ` Jesse Gross
     [not found]         ` <CAEP_g=-giF74zveQgLsrAwS0kp2P3cj_O7mHaKKLVfKwQCNBag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-04  1:00           ` David Miller
     [not found]             ` <20120903.210055.1839817610578900310.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-09-04  1:07               ` Jesse Gross
     [not found]                 ` <CAEP_g=_+Q4Axi0vH8nce6zVZgs++62PbiTWum_z+s_PbpwzgOA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-04 18:22                   ` David Miller
2012-09-04 18:23                   ` Chris Wright
2012-07-20 22:26   ` [PATCH net-next 5/7] openvswitch: Check currect return value from skb_gso_segment() Jesse Gross
2012-07-20 22:26   ` Jesse Gross [this message]
2012-07-20 22:26   ` [PATCH net-next 7/7] openvswitch: Fix typo in documentation Jesse Gross
2012-07-20 23:17   ` [GIT net-next] Open vSwitch 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=1342823210-3308-7-git-send-email-jesse@nicira.com \
    --to=jesse-l0m0p4e3n4lqt0dzr+alfa@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.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).