From: Andrew Evans Date: Thu, 7 Apr 2011 19:43:18 +0000 (+0000) Subject: datapath: Update netdev_frame_hook() for 2.6.39 rx handler API change. X-Git-Tag: v1.2.0~477 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=898ba403b07d89939b6de2abaf899a5d81a9730e;p=sliver-openvswitch.git datapath: Update netdev_frame_hook() for 2.6.39 rx handler API change. netdev_rx_handler_register() changed the type of the skb argument to the callback function as well as the return type. Special-case netdev_frame_hook() to do the right thing on 2.6.39 and later. Signed-off-by: Andrew Evans Acked-by: Jesse Gross --- diff --git a/datapath/vport-netdev.c b/datapath/vport-netdev.c index 2583566b1..18fc5feea 100644 --- a/datapath/vport-netdev.c +++ b/datapath/vport-netdev.c @@ -38,7 +38,23 @@ MODULE_PARM_DESC(vlan_tso, "Enable TSO for VLAN packets"); static void netdev_port_receive(struct vport *vport, struct sk_buff *skb); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39) +/* Called with rcu_read_lock and bottom-halves disabled. */ +static rx_handler_result_t netdev_frame_hook(struct sk_buff **pskb) +{ + struct sk_buff *skb = *pskb; + struct vport *vport; + + if (unlikely(skb->pkt_type == PACKET_LOOPBACK)) + return RX_HANDLER_PASS; + + vport = netdev_get_vport(skb->dev); + + netdev_port_receive(vport, skb); + + return RX_HANDLER_CONSUMED; +} +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) /* Called with rcu_read_lock and bottom-halves disabled. */ static struct sk_buff *netdev_frame_hook(struct sk_buff *skb) {