* [RFC PATCH net-next 3/4] veth: backup classid befor switch net_ns
@ 2014-01-03 3:11 Libo Chen
[not found] ` <52C62A52.8050003-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Libo Chen @ 2014-01-03 3:11 UTC (permalink / raw)
To: David Miller
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
Serge Hallyn, LKML, honkiko-Re5JQEeQqe8AvxtiuMwx3w,
edumazet-hpIqsD4AKlfQT0dZR+AlfA, cgroups-u79uwXL29TY76Z2rM5mHXA,
kaber-dcUjhNyLwpNeoWH0uzbU5w
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-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [RFC PATCH net-next 3/4] veth: backup classid befor switch net_ns
[not found] ` <52C62A52.8050003-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
@ 2014-01-03 10:45 ` Sergei Shtylyov
[not found] ` <52C694BF.3020903-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2014-01-03 10:45 UTC (permalink / raw)
To: Libo Chen, David Miller
Cc: edumazet-hpIqsD4AKlfQT0dZR+AlfA, kaber-dcUjhNyLwpNeoWH0uzbU5w,
peterz-wEGCiKHe2LqWVfeAwA7xHQ, honkiko-Re5JQEeQqe8AvxtiuMwx3w,
netdev-u79uwXL29TY76Z2rM5mHXA, LKML,
cgroups-u79uwXL29TY76Z2rM5mHXA,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
jhs-jkUAjuhPggJWk0Htik3J/w, Li Zefan, Serge Hallyn
Hello.
On 03-01-2014 7:11, Libo Chen wrote:
> 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-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> ---
> 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
[...]
> @@ -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;
>
> + /**
Why you're using kernel-doc style comments out of place? The format of
multi-line comments in the networking code is this:
/* bla
* bla
*/
> + * dev_forward_sbk will clear skb->sk, so save
> + * skb->sk->sk_classid for Qos
> + */
> + bk_cls_classid(skb);
> +
WBR, Sergei
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC PATCH net-next 3/4] veth: backup classid befor switch net_ns
[not found] ` <52C694BF.3020903-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
@ 2014-01-06 2:16 ` Libo Chen
0 siblings, 0 replies; 3+ messages in thread
From: Libo Chen @ 2014-01-06 2:16 UTC (permalink / raw)
To: Sergei Shtylyov, David Miller
Cc: edumazet-hpIqsD4AKlfQT0dZR+AlfA, kaber-dcUjhNyLwpNeoWH0uzbU5w,
peterz-wEGCiKHe2LqWVfeAwA7xHQ, honkiko-Re5JQEeQqe8AvxtiuMwx3w,
netdev-u79uwXL29TY76Z2rM5mHXA, LKML,
cgroups-u79uwXL29TY76Z2rM5mHXA,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
jhs-jkUAjuhPggJWk0Htik3J/w, Li Zefan, Serge Hallyn
On 2014/1/3 18:45, Sergei Shtylyov wrote:
> Hello.
>
> On 03-01-2014 7:11, Libo Chen wrote:
>
>> 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-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
>> ---
>> 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
> [...]
>> @@ -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;
>>
>> + /**
>
> Why you're using kernel-doc style comments out of place? The format of multi-line comments in the networking code is this:
>
> /* bla
> * bla
> */
thank you
Libo
>
>> + * dev_forward_sbk will clear skb->sk, so save
>> + * skb->sk->sk_classid for Qos
>> + */
>> + bk_cls_classid(skb);
>> +
>
> WBR, Sergei
>
>
>
> .
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-01-06 2:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-03 3:11 [RFC PATCH net-next 3/4] veth: backup classid befor switch net_ns Libo Chen
[not found] ` <52C62A52.8050003-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2014-01-03 10:45 ` Sergei Shtylyov
[not found] ` <52C694BF.3020903-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2014-01-06 2:16 ` Libo Chen
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).