From: Jesse Gross Date: Sat, 20 Nov 2010 01:20:34 +0000 (-0800) Subject: datapath: Don't unnecessarily set skb mac header. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e216c6b593c8e06cd80cccd70d7e4a1029d4d10;p=openvswitch datapath: Don't unnecessarily set skb mac header. We currently call skb_reset_mac_header() in a few places when a packet is received. However, this is not needed because flow_extract() will set all of the protocol headers during parsing and nothing needs the packet headers before that time. Signed-off-by: Jesse Gross Acked-by: Ben Pfaff --- diff --git a/datapath/vport-internal_dev.c b/datapath/vport-internal_dev.c index 9079295b..6d610fda 100644 --- a/datapath/vport-internal_dev.c +++ b/datapath/vport-internal_dev.c @@ -73,12 +73,10 @@ static int internal_dev_xmit(struct sk_buff *skb, struct net_device *netdev) struct internal_dev *internal_dev = internal_dev_priv(netdev); struct vport *vport = rcu_dereference(internal_dev->vport); - skb_reset_mac_header(skb); compute_ip_summed(skb, true); OVS_CB(skb)->flow = NULL; vport_receive(vport, skb); - return 0; } diff --git a/datapath/vport-netdev.c b/datapath/vport-netdev.c index c023c854..c643696f 100644 --- a/datapath/vport-netdev.c +++ b/datapath/vport-netdev.c @@ -264,9 +264,7 @@ static void netdev_port_receive(struct vport *vport, struct sk_buff *skb) skb_warn_if_lro(skb); - /* Push the Ethernet header back on. */ skb_push(skb, ETH_HLEN); - skb_reset_mac_header(skb); compute_ip_summed(skb, false); vport_receive(vport, skb);