From 898ba403b07d89939b6de2abaf899a5d81a9730e Mon Sep 17 00:00:00 2001 From: Andrew Evans Date: Thu, 7 Apr 2011 19:43:18 +0000 Subject: [PATCH] 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 --- datapath/vport-netdev.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/datapath/vport-netdev.c b/datapath/vport-netdev.c index 2583566b..18fc5fee 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) { -- 2.30.2