netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: use skb_get_hash_raw instead of skb_get_hash in set_rps_cpu
@ 2014-11-19 10:00 Govindarajulu Varadarajan
  2014-11-20  0:16 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Govindarajulu Varadarajan @ 2014-11-19 10:00 UTC (permalink / raw)
  To: davem, netdev; +Cc: Govindarajulu Varadarajan

In set_rps_cpu, we call skb_get_hash to get the hash of skb. The caller
get_rps_cpu has already determined the hash of skb by calling skb_get_hash.

Since get_rps_cpu is the only caller of set_rps_cpu, we can use skb_get_hash_raw

Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
---
 net/core/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 1ab168e..b4ad4d1 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3055,7 +3055,7 @@ set_rps_cpu(struct net_device *dev, struct sk_buff *skb,
 		flow_table = rcu_dereference(rxqueue->rps_flow_table);
 		if (!flow_table)
 			goto out;
-		flow_id = skb_get_hash(skb) & flow_table->mask;
+		flow_id = skb_get_hash_raw(skb) & flow_table->mask;
 		rc = dev->netdev_ops->ndo_rx_flow_steer(dev, skb,
 							rxq_index, flow_id);
 		if (rc < 0)
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: use skb_get_hash_raw instead of skb_get_hash in set_rps_cpu
  2014-11-19 10:00 [PATCH net-next] net: use skb_get_hash_raw instead of skb_get_hash in set_rps_cpu Govindarajulu Varadarajan
@ 2014-11-20  0:16 ` David Miller
  2014-11-20  0:51   ` Tom Herbert
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2014-11-20  0:16 UTC (permalink / raw)
  To: _govind; +Cc: netdev, therbert

From: Govindarajulu Varadarajan <_govind@gmx.com>
Date: Wed, 19 Nov 2014 15:30:44 +0530

> In set_rps_cpu, we call skb_get_hash to get the hash of skb. The caller
> get_rps_cpu has already determined the hash of skb by calling skb_get_hash.
> 
> Since get_rps_cpu is the only caller of set_rps_cpu, we can use skb_get_hash_raw
> 
> Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>

Tom, please review.  And if you agree with this change, you'll need to
be spinning your flow_id change relative to this I guess since it overlaps.

> ---
>  net/core/dev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 1ab168e..b4ad4d1 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -3055,7 +3055,7 @@ set_rps_cpu(struct net_device *dev, struct sk_buff *skb,
>  		flow_table = rcu_dereference(rxqueue->rps_flow_table);
>  		if (!flow_table)
>  			goto out;
> -		flow_id = skb_get_hash(skb) & flow_table->mask;
> +		flow_id = skb_get_hash_raw(skb) & flow_table->mask;
>  		rc = dev->netdev_ops->ndo_rx_flow_steer(dev, skb,
>  							rxq_index, flow_id);
>  		if (rc < 0)
> -- 
> 2.1.0
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: use skb_get_hash_raw instead of skb_get_hash in set_rps_cpu
  2014-11-20  0:16 ` David Miller
@ 2014-11-20  0:51   ` Tom Herbert
  2014-11-20  1:57     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Herbert @ 2014-11-20  0:51 UTC (permalink / raw)
  To: David Miller; +Cc: _govind, Linux Netdev List

On Wed, Nov 19, 2014 at 4:16 PM, David Miller <davem@davemloft.net> wrote:
> From: Govindarajulu Varadarajan <_govind@gmx.com>
> Date: Wed, 19 Nov 2014 15:30:44 +0530
>
>> In set_rps_cpu, we call skb_get_hash to get the hash of skb. The caller
>> get_rps_cpu has already determined the hash of skb by calling skb_get_hash.
>>
>> Since get_rps_cpu is the only caller of set_rps_cpu, we can use skb_get_hash_raw
>>
>> Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
>
> Tom, please review.  And if you agree with this change, you'll need to
> be spinning your flow_id change relative to this I guess since it overlaps.
>
We should probably pass hash as an argument in set_rps_cpu. It's only
called from once place and the rflow is specifically chosen based on
hash computed by caller-- don't want any ambiguity there.

>> ---
>>  net/core/dev.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/core/dev.c b/net/core/dev.c
>> index 1ab168e..b4ad4d1 100644
>> --- a/net/core/dev.c
>> +++ b/net/core/dev.c
>> @@ -3055,7 +3055,7 @@ set_rps_cpu(struct net_device *dev, struct sk_buff *skb,
>>               flow_table = rcu_dereference(rxqueue->rps_flow_table);
>>               if (!flow_table)
>>                       goto out;
>> -             flow_id = skb_get_hash(skb) & flow_table->mask;
>> +             flow_id = skb_get_hash_raw(skb) & flow_table->mask;
>>               rc = dev->netdev_ops->ndo_rx_flow_steer(dev, skb,
>>                                                       rxq_index, flow_id);
>>               if (rc < 0)
>> --
>> 2.1.0
>>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: use skb_get_hash_raw instead of skb_get_hash in set_rps_cpu
  2014-11-20  0:51   ` Tom Herbert
@ 2014-11-20  1:57     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2014-11-20  1:57 UTC (permalink / raw)
  To: therbert; +Cc: _govind, netdev

From: Tom Herbert <therbert@google.com>
Date: Wed, 19 Nov 2014 16:51:40 -0800

> On Wed, Nov 19, 2014 at 4:16 PM, David Miller <davem@davemloft.net> wrote:
>> From: Govindarajulu Varadarajan <_govind@gmx.com>
>> Date: Wed, 19 Nov 2014 15:30:44 +0530
>>
>>> In set_rps_cpu, we call skb_get_hash to get the hash of skb. The caller
>>> get_rps_cpu has already determined the hash of skb by calling skb_get_hash.
>>>
>>> Since get_rps_cpu is the only caller of set_rps_cpu, we can use skb_get_hash_raw
>>>
>>> Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
>>
>> Tom, please review.  And if you agree with this change, you'll need to
>> be spinning your flow_id change relative to this I guess since it overlaps.
>>
> We should probably pass hash as an argument in set_rps_cpu. It's only
> called from once place and the rflow is specifically chosen based on
> hash computed by caller-- don't want any ambiguity there.

Yep, that sounds a lot less error prone.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-11-20  1:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-19 10:00 [PATCH net-next] net: use skb_get_hash_raw instead of skb_get_hash in set_rps_cpu Govindarajulu Varadarajan
2014-11-20  0:16 ` David Miller
2014-11-20  0:51   ` Tom Herbert
2014-11-20  1:57     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).