Subject: Re: [PATCH 1/2] rps: core implementation

From: Jarek Poplawski <[email-masked]>
Date: Thu, 19 Nov 2009 09:57:31 +0000

On 11-11-2009 07:53, Tom Herbert wrote:
> Third version of RPS.
> 
> Signed-off-by: Tom Herbert <[email-masked]>
...
> @@ -2266,10 +2401,10 @@ void netif_nit_deliver(struct sk_buff *skb)
>  }
> 
>  /**
> - *	netif_receive_skb - process receive buffer from network
> + *	__netif_receive_skb - process receive buffer from network
>   *	@skb: buffer to process
>   *
> - *	netif_receive_skb() is the main receive data processing function.
> + *	__netif__napireceive_skb() is the main receive data processing function.

--------------->^^^^^^^^^^^^ ?

>   *	It always succeeds. The buffer may be dropped during processing
>   *	for congestion control or by the protocol layers.
>   *
> @@ -2280,7 +2415,8 @@ void netif_nit_deliver(struct sk_buff *skb)
>   *	NET_RX_SUCCESS: no congestion
>   *	NET_RX_DROP: packet was dropped
>   */
> -int netif_receive_skb(struct sk_buff *skb)
> +
> +int __netif_receive_skb(struct sk_buff *skb)
>  {
>  	struct packet_type *ptype, *pt_prev;
>  	struct net_device *orig_dev;
> @@ -2378,6 +2514,16 @@ out:
>  }
>  EXPORT_SYMBOL(netif_receive_skb);
> 
> +int netif_receive_skb(struct sk_buff *skb)
> +{
> +	int cpu = get_rps_cpu(skb->dev, skb);
> +
> +	if (cpu < 0)

The description reads: "This solution queues packets early on in the
receive path on the backlog queues of other CPUs.", so I'm not sure
it's intended. Did you test it like this (and it was visibly worse)?:

	if (cpu < 0 || cpu == smp_processor_id())

> +		return __netif_receive_skb(skb);
> +	else
> +		return enqueue_to_backlog(skb, cpu);
> +}
> +

Jarek P.