datapath: Don't unnecessarily set skb mac header.
authorJesse Gross <jesse@nicira.com>
Sat, 20 Nov 2010 01:20:34 +0000 (17:20 -0800)
committerJesse Gross <jesse@nicira.com>
Fri, 3 Dec 2010 01:10:15 +0000 (17:10 -0800)
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 <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath/vport-internal_dev.c
datapath/vport-netdev.c

index 9079295b1dbabbcfed6085758e115fb0b982ba57..6d610fdab48d8f2f1f8196b0c5c774a1d91d4d24 100644 (file)
@@ -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;
 }
 
index c023c8548bd7af639cb5f19cb204cd4105aa43ad..c643696fcd2598f117bf2d1ef13ebb7322de08a5 100644 (file)
@@ -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);