diff --git a/[refs] b/[refs] index 5e37facba7ef..02ec586aa5ea 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fd793d8905720595caede6bd26c5df6c0ecd37f8 +refs/heads/master: 66496d4973dcb848d163805fa6b485850b7555e3 diff --git a/trunk/include/linux/netdevice.h b/trunk/include/linux/netdevice.h index 55c2086e1f06..470f7c951afb 100644 --- a/trunk/include/linux/netdevice.h +++ b/trunk/include/linux/netdevice.h @@ -1331,7 +1331,7 @@ struct softnet_data { struct sk_buff *completion_queue; /* Elements below can be accessed between CPUs for RPS */ -#ifdef CONFIG_RPS +#ifdef CONFIG_SMP struct call_single_data csd ____cacheline_aligned_in_smp; #endif struct sk_buff_head input_pkt_queue; diff --git a/trunk/net/core/dev.c b/trunk/net/core/dev.c index e8041eb76ac1..876b1112d5ba 100644 --- a/trunk/net/core/dev.c +++ b/trunk/net/core/dev.c @@ -2206,7 +2206,6 @@ DEFINE_PER_CPU(struct netif_rx_stats, netdev_rx_stat) = { 0, }; /* * get_rps_cpu is called from netif_receive_skb and returns the target * CPU from the RPS map of the receiving queue for a given skb. - * rcu_read_lock must be held on entry. */ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb) { @@ -2218,6 +2217,8 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb) u8 ip_proto; u32 addr1, addr2, ports, ihl; + rcu_read_lock(); + if (skb_rx_queue_recorded(skb)) { u16 index = skb_get_rx_queue(skb); if (unlikely(index >= dev->num_rx_queues)) { @@ -2295,6 +2296,7 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb) } done: + rcu_read_unlock(); return cpu; } @@ -2390,7 +2392,7 @@ static int enqueue_to_backlog(struct sk_buff *skb, int cpu) int netif_rx(struct sk_buff *skb) { - int ret; + int cpu; /* if netpoll wants it, pretend we never saw it */ if (netpoll_rx(skb)) @@ -2400,21 +2402,14 @@ int netif_rx(struct sk_buff *skb) net_timestamp(skb); #ifdef CONFIG_RPS - { - int cpu; - - rcu_read_lock(); - cpu = get_rps_cpu(skb->dev, skb); - if (cpu < 0) - cpu = smp_processor_id(); - ret = enqueue_to_backlog(skb, cpu); - rcu_read_unlock(); - } + cpu = get_rps_cpu(skb->dev, skb); + if (cpu < 0) + cpu = smp_processor_id(); #else - ret = enqueue_to_backlog(skb, get_cpu()); - put_cpu(); + cpu = smp_processor_id(); #endif - return ret; + + return enqueue_to_backlog(skb, cpu); } EXPORT_SYMBOL(netif_rx); diff --git a/trunk/net/ipv4/Kconfig b/trunk/net/ipv4/Kconfig index be597749c385..8e3a1fd938ab 100644 --- a/trunk/net/ipv4/Kconfig +++ b/trunk/net/ipv4/Kconfig @@ -252,7 +252,7 @@ config IP_MROUTE config IP_MROUTE_MULTIPLE_TABLES bool "IP: multicast policy routing" - depends on IP_ADVANCED_ROUTER + depends on IP_MROUTE && IP_ADVANCED_ROUTER select FIB_RULES help Normally, a multicast router runs a userspace daemon and decides