netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net PATCH] net: Fix Tx hash bound checking
@ 2020-02-22  2:09 Amritha Nambiar
  2020-02-22  8:07 ` Sergei Shtylyov
  0 siblings, 1 reply; 3+ messages in thread
From: Amritha Nambiar @ 2020-02-22  2:09 UTC (permalink / raw)
  To: netdev, davem; +Cc: alexander.h.duyck, amritha.nambiar, sridhar.samudrala

Fixes: commit 1b837d489e06 ("net: Revoke export for __skb_tx_hash, update it to just be static skb_tx_hash")
Fixes: commit eadec877ce9c ("net: Add support for subordinate traffic classes to netdev_pick_tx")

Fixes the lower and upper bounds when there are multiple TCs and
traffic is on the the same TC on the same device.

The lower bound is represented by 'qoffset' and the upper limit for
hash value is 'qcount + qoffset'. This gives a clean Rx to Tx queue
mapping when there are multiple TCs, as the queue indices for upper TCs
will be offset by 'qoffset'.

Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com>
Reviewed-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Reviewed-by: Sridhar Samudrala <sridhar.samudrala@intel.com>
---
 net/core/dev.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/core/dev.c b/net/core/dev.c
index e10bd680dc03..c6c985fe7b1b 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3076,6 +3076,8 @@ static u16 skb_tx_hash(const struct net_device *dev,
 
 	if (skb_rx_queue_recorded(skb)) {
 		hash = skb_get_rx_queue(skb);
+		if (hash >= qoffset)
+			hash -= qoffset;
 		while (unlikely(hash >= qcount))
 			hash -= qcount;
 		return hash + qoffset;


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

* Re: [net PATCH] net: Fix Tx hash bound checking
  2020-02-22  2:09 [net PATCH] net: Fix Tx hash bound checking Amritha Nambiar
@ 2020-02-22  8:07 ` Sergei Shtylyov
  2020-02-24 18:54   ` Nambiar, Amritha
  0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2020-02-22  8:07 UTC (permalink / raw)
  To: Amritha Nambiar, netdev, davem; +Cc: alexander.h.duyck, sridhar.samudrala

Hello!

On 22.02.2020 5:09, Amritha Nambiar wrote:

> Fixes: commit 1b837d489e06 ("net: Revoke export for __skb_tx_hash, update it to just be static skb_tx_hash")
> Fixes: commit eadec877ce9c ("net: Add support for subordinate traffic classes to netdev_pick_tx")

    No need to say "commit" here. And All tags should be together (below the 
patch description).

> Fixes the lower and upper bounds when there are multiple TCs and
> traffic is on the the same TC on the same device.
> 
> The lower bound is represented by 'qoffset' and the upper limit for
> hash value is 'qcount + qoffset'. This gives a clean Rx to Tx queue
> mapping when there are multiple TCs, as the queue indices for upper TCs
> will be offset by 'qoffset'.
> 
> Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com>
> Reviewed-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
> Reviewed-by: Sridhar Samudrala <sridhar.samudrala@intel.com>
[...]

MBR, Sergei

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

* Re: [net PATCH] net: Fix Tx hash bound checking
  2020-02-22  8:07 ` Sergei Shtylyov
@ 2020-02-24 18:54   ` Nambiar, Amritha
  0 siblings, 0 replies; 3+ messages in thread
From: Nambiar, Amritha @ 2020-02-24 18:54 UTC (permalink / raw)
  To: Sergei Shtylyov, netdev, davem; +Cc: alexander.h.duyck, sridhar.samudrala

On 2/22/2020 12:07 AM, Sergei Shtylyov wrote:
> Hello!
> 
> On 22.02.2020 5:09, Amritha Nambiar wrote:
> 
>> Fixes: commit 1b837d489e06 ("net: Revoke export for __skb_tx_hash, update it to just be static skb_tx_hash")
>> Fixes: commit eadec877ce9c ("net: Add support for subordinate traffic classes to netdev_pick_tx")
> 
>     No need to say "commit" here. And All tags should be together (below the 
> patch description).
> 

Sure. Will send v2 with these changes.

-Amritha

>> Fixes the lower and upper bounds when there are multiple TCs and
>> traffic is on the the same TC on the same device.
>>
>> The lower bound is represented by 'qoffset' and the upper limit for
>> hash value is 'qcount + qoffset'. This gives a clean Rx to Tx queue
>> mapping when there are multiple TCs, as the queue indices for upper TCs
>> will be offset by 'qoffset'.
>>
>> Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com>
>> Reviewed-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
>> Reviewed-by: Sridhar Samudrala <sridhar.samudrala@intel.com>
> [...]
> 
> MBR, Sergei
> 

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

end of thread, other threads:[~2020-02-24 18:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-22  2:09 [net PATCH] net: Fix Tx hash bound checking Amritha Nambiar
2020-02-22  8:07 ` Sergei Shtylyov
2020-02-24 18:54   ` Nambiar, Amritha

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).