diff options
| author | Andrew Evans <aevans@nicira.com> | 2011-04-07 19:43:18 +0000 |
|---|---|---|
| committer | Andrew Evans <aevans@nicira.com> | 2011-04-07 20:27:32 +0000 |
| commit | 898ba403b07d89939b6de2abaf899a5d81a9730e (patch) | |
| tree | f3d201fa74e4c637966157c2601d56c1b03a30f1 /datapath | |
| parent | 76c9c4231400245864addfc7a8aabaa79843b4bd (diff) | |
| download | openvswitch-898ba403b07d89939b6de2abaf899a5d81a9730e.tar.gz | |
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 <aevans@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'datapath')
| -rw-r--r-- | datapath/vport-netdev.c | 18 |
1 files changed, 17 insertions, 1 deletions
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) { |
