public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Libo Chen <clbchenlibo.chen@huawei.com>
To: David Miller <davem@davemloft.net>
Cc: <edumazet@google.com>, <kaber@trash.net>, <peterz@infradead.org>,
	<honkiko@gmail.com>, <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>, <cgroups@vger.kernel.org>,
	<containers@lists.linux-foundation.org>, <jhs@mojatatu.com>,
	Li Zefan <lizefan@huawei.com>,
	Serge Hallyn <serge.hallyn@ubuntu.com>
Subject: [RFC PATCH net-next 3/4] veth: backup classid befor switch net_ns
Date: Fri, 3 Jan 2014 11:11:14 +0800	[thread overview]
Message-ID: <52C62A52.8050003@huawei.com> (raw)


dev_forward_skb will clear skb->sk, so we need save classid
before that, otherwise the skb can not be under control by
net_cls.

Signed-off-by: Libo Chen <clbchenlibo.chen@huawei.com>
---
 drivers/net/veth.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 2ec2041..ce43a2d 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -18,6 +18,7 @@
 #include <net/xfrm.h>
 #include <linux/veth.h>
 #include <linux/module.h>
+#include <net/cls_cgroup.h>

 #define DRV_NAME	"veth"
 #define DRV_VERSION	"1.0"
@@ -123,6 +124,12 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)
 	    rcv->features & NETIF_F_RXCSUM)
 		skb->ip_summed = CHECKSUM_UNNECESSARY;

+	/**
+	 * dev_forward_sbk will clear skb->sk, so save
+	 * skb->sk->sk_classid for Qos
+	 */
+	bk_cls_classid(skb);
+
 	if (likely(dev_forward_skb(rcv, skb) == NET_RX_SUCCESS)) {
 		struct pcpu_vstats *stats = this_cpu_ptr(dev->vstats);

-- 
1.8.2.2



             reply	other threads:[~2014-01-03  3:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-03  3:11 Libo Chen [this message]
2014-01-03 10:45 ` [RFC PATCH net-next 3/4] veth: backup classid befor switch net_ns Sergei Shtylyov
2014-01-06  2:16   ` Libo Chen

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=52C62A52.8050003@huawei.com \
    --to=clbchenlibo.chen@huawei.com \
    --cc=cgroups@vger.kernel.org \
    --cc=containers@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=honkiko@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=kaber@trash.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=serge.hallyn@ubuntu.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