projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
datapath: Backport consume_skb().
[openvswitch]
/
datapath
/
vport-internal_dev.c
diff --git
a/datapath/vport-internal_dev.c
b/datapath/vport-internal_dev.c
index 63f3f69ce81b55eccede464225a53d416f5240cd..b7bcbce6abf2245c429b16b95908d36b3c33950d 100644
(file)
--- a/
datapath/vport-internal_dev.c
+++ b/
datapath/vport-internal_dev.c
@@
-73,7
+73,11
@@
static int internal_dev_mac_addr(struct net_device *dev, void *p)
/* Called with rcu_read_lock and bottom-halves disabled. */
static int internal_dev_xmit(struct sk_buff *skb, struct net_device *netdev)
{
/* Called with rcu_read_lock and bottom-halves disabled. */
static int internal_dev_xmit(struct sk_buff *skb, struct net_device *netdev)
{
- compute_ip_summed(skb, true);
+ if (unlikely(compute_ip_summed(skb, true))) {
+ kfree_skb(skb);
+ return 0;
+ }
+
vlan_copy_skb_tci(skb);
OVS_CB(skb)->flow = NULL;
vlan_copy_skb_tci(skb);
OVS_CB(skb)->flow = NULL;
@@
-176,6
+180,11
@@
static void do_setup(struct net_device *netdev)
netdev->features = NETIF_F_LLTX | NETIF_F_SG | NETIF_F_FRAGLIST |
NETIF_F_HIGHDMA | NETIF_F_HW_CSUM | NETIF_F_TSO;
netdev->features = NETIF_F_LLTX | NETIF_F_SG | NETIF_F_FRAGLIST |
NETIF_F_HIGHDMA | NETIF_F_HW_CSUM | NETIF_F_TSO;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
+ netdev->vlan_features = netdev->features;
+ netdev->features |= NETIF_F_HW_VLAN_TX;
+#endif
+
vport_gen_rand_ether_addr(netdev->dev_addr);
}
vport_gen_rand_ether_addr(netdev->dev_addr);
}
@@
-247,6
+256,7
@@
static int internal_dev_recv(struct vport *vport, struct sk_buff *skb)
skb->dev = netdev;
skb->pkt_type = PACKET_HOST;
skb->protocol = eth_type_trans(skb, netdev);
skb->dev = netdev;
skb->pkt_type = PACKET_HOST;
skb->protocol = eth_type_trans(skb, netdev);
+ forward_ip_summed(skb, false);
if (in_interrupt())
netif_rx(skb);
if (in_interrupt())
netif_rx(skb);