Netdev List
 help / color / mirror / Atom feed
From: roy.qing.li-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
To: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org,
	pshelar-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org
Subject: [PATCH] openvswitch: distinguish between the dropped and consumed skb
Date: Tue,  2 Sep 2014 20:52:49 +0800	[thread overview]
Message-ID: <1409662369-2528-1-git-send-email-roy.qing.li@gmail.com> (raw)

From: Li RongQing <roy.qing.li-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

distinguish between the dropped and consumed skb, not assume the skb
is consumed always

Cc: Pravin Shelar <pshelar-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Li RongQing <roy.qing.li-Re5JQEeQqe8AvxtiuMwx3w@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 35d866f..dacf56f 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -266,7 +266,6 @@ void ovs_dp_process_received_packet(struct vport *p, struct sk_buff *skb)
 		upcall.userdata = NULL;
 		upcall.portid = ovs_vport_find_upcall_portid(p, skb);
 		ovs_dp_upcall(dp, skb, &upcall);
-		consume_skb(skb);
 		stats_counter = &stats->n_missed;
 		goto out;
 	}
@@ -304,9 +303,11 @@ int ovs_dp_upcall(struct datapath *dp, struct sk_buff *skb,
 	if (err)
 		goto err;
 
+	consume_skb(skb);
 	return 0;
 
 err:
+	kfree_skb(skb);
 	stats = this_cpu_ptr(dp->stats_percpu);
 
 	u64_stats_update_begin(&stats->syncp);
-- 
1.7.10.4

             reply	other threads:[~2014-09-02 12:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-02 12:52 roy.qing.li-Re5JQEeQqe8AvxtiuMwx3w [this message]
2014-09-02 13:14 ` [ovs-dev] [PATCH] openvswitch: distinguish between the dropped and consumed skb Thomas Graf
2014-09-02 20:20   ` Pravin Shelar

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=1409662369-2528-1-git-send-email-roy.qing.li@gmail.com \
    --to=roy.qing.li-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=pshelar-l0M0P4e3n4LQT0dZR+AlfA@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