Skip to contentSkip to conversation

veth: backup classid befor switch net_ns

RFC PATCH In review Libo Chen 4 participants 5 messages Jan 3, 2014 – Jan 6, 2014 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore

Libo Chen

author
#0 lore raw

RFC PATCH 3/4 veth: backup classid befor switch net_ns

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.

---
 drivers/net/veth.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/net/veth.c +7 -0
index 2ec2041..ce43a2d 100644
@@ -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);
 
Signature · 1 line
1.8.2.2
#1 lore raw

Hello.

Quoted 13 lines · Libo Chen

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.

---
  drivers/net/veth.c | 7 +++++++
  1 file changed, 7 insertions(+)
drivers/net/veth.c +0 -0
index 2ec2041..ce43a2d 100644

[...]

drivers/net/veth.c static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev) · line 127

Quoted 5 lines
drivers/net/veth.c +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;
 
+	/**

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
*/

drivers/net/veth.c static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev) · line 132

Quoted 5 lines
drivers/net/veth.c +5 -0
+	 * dev_forward_sbk will clear skb->sk, so save
+	 * skb->sk->sk_classid for Qos
+	 */
+	bk_cls_classid(skb);
+

WBR, Sergei

author
#2 lore raw
Quoted 22 lines · Sergei Shtylyov

Hello.

Quoted 13 lines · Libo Chen

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.

---
  drivers/net/veth.c | 7 +++++++
  1 file changed, 7 insertions(+)
drivers/net/veth.c +0 -0
index 2ec2041..ce43a2d 100644

[...]

Quoted 4 lines
drivers/net/veth.c +0 -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;
 
Quoted 7 lines

drivers/net/veth.c static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev) · line 127

Quoted 1 line
drivers/net/veth.c +1 -0
+    /**

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

Quoted 13 lines

drivers/net/veth.c static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev) · line 132

Quoted 6 lines
drivers/net/veth.c +5 -0
+     * dev_forward_sbk will clear skb->sk, so save
+     * skb->sk->sk_classid for Qos
+     */
+    bk_cls_classid(skb);
+

WBR, Sergei

.

A message that is not in the archive (sent off-list or not yet received): 52C694BF.3020903-M4DtvfQ/[email protected]

#4 lore raw
Quoted 22 lines · Sergei Shtylyov

Hello.

Quoted 13 lines · Libo Chen

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.

---
  drivers/net/veth.c | 7 +++++++
  1 file changed, 7 insertions(+)
drivers/net/veth.c +0 -0
index 2ec2041..ce43a2d 100644

[...]

Quoted 4 lines
drivers/net/veth.c +0 -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;
 
Quoted 7 lines

drivers/net/veth.c static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev) · line 127

Quoted 1 line
drivers/net/veth.c +1 -0
+    /**

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

Quoted 13 lines

drivers/net/veth.c static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev) · line 132

Quoted 6 lines
drivers/net/veth.c +5 -0
+     * dev_forward_sbk will clear skb->sk, so save
+     * skb->sk->sk_classid for Qos
+     */
+    bk_cls_classid(skb);
+

WBR, Sergei

.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw

Hello.

Quoted 13 lines · Libo Chen

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.

---
  drivers/net/veth.c | 7 +++++++
  1 file changed, 7 insertions(+)
drivers/net/veth.c +0 -0
index 2ec2041..ce43a2d 100644

[...]

drivers/net/veth.c static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev) · line 127

Quoted 5 lines
drivers/net/veth.c +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;
 
+	/**

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
*/

drivers/net/veth.c static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev) · line 132

Quoted 5 lines
drivers/net/veth.c +5 -0
+	 * dev_forward_sbk will clear skb->sk, so save
+	 * skb->sk->sk_classid for Qos
+	 */
+	bk_cls_classid(skb);
+

WBR, Sergei