[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+mtBx9K61KmguzQBWNbnmesCvWtzh_SjjbjedkgxN6p4Oay4Q@mail.gmail.com>
Date: Wed, 19 Nov 2014 16:51:40 -0800
From: Tom Herbert <therbert@...gle.com>
To: David Miller <davem@...emloft.net>
Cc: _govind@....com, Linux Netdev List <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next] net: use skb_get_hash_raw instead of
skb_get_hash in set_rps_cpu
On Wed, Nov 19, 2014 at 4:16 PM, David Miller <davem@...emloft.net> wrote:
> From: Govindarajulu Varadarajan <_govind@....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@....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
>>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists