netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: netdev_pick_tx: use get_xps_q if xps map is set
@ 2013-05-17  8:48 govindarajulu.v
  2013-05-17 13:35 ` Eric Dumazet
  0 siblings, 1 reply; 5+ messages in thread
From: govindarajulu.v @ 2013-05-17  8:48 UTC (permalink / raw)
  To: davem; +Cc: xiyou.wangcong, netdev, linux-kernel, govindarajulu.v

From: "govindarajulu.v" <govindarajulu90@gmail.com>

netdev_pick_tx ignores the xps map configuration if netdev->ndo_select_queue
is defined. Most of the drivers define ndo_select_queue. The problem with this
is, if admin wants kernel to pick tx queue based on xps map (instead of driver
defined ndo_select_queue), he has to netdev->ndo_select_queue = NULL, compile
and reload.

This patch fixes it by checking if dev->xps_maps is defined. If yes it
proceeds with get_xps_queue. If not it proceeds with netdev->ndo_select_queue
(if defined).

Compile test only.

Signed-off-by: govindarajulu.v <govindarajulu90@gmail.com>
---
 net/core/flow_dissector.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 00ee068..b2e3c81 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -368,10 +368,11 @@ struct netdev_queue *netdev_pick_tx(struct net_device *dev,
 
 	if (dev->real_num_tx_queues != 1) {
 		const struct net_device_ops *ops = dev->netdev_ops;
-		if (ops->ndo_select_queue)
-			queue_index = ops->ndo_select_queue(dev, skb);
-		else
+		if (rcu_access_pointer(dev->xps_maps) ||
+		    !ops->ndo_select_queue)
 			queue_index = __netdev_pick_tx(dev, skb);
+		else
+			queue_index = ops->ndo_select_queue(dev, skb);
 		queue_index = dev_cap_txqueue(dev, queue_index);
 	}
 
-- 
1.8.2.3

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

* Re: [PATCH net-next] net: netdev_pick_tx: use get_xps_q if xps map is set
  2013-05-17  8:48 [PATCH net-next] net: netdev_pick_tx: use get_xps_q if xps map is set govindarajulu.v
@ 2013-05-17 13:35 ` Eric Dumazet
  2013-05-17 19:50   ` govind
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Dumazet @ 2013-05-17 13:35 UTC (permalink / raw)
  To: govindarajulu.v; +Cc: davem, xiyou.wangcong, netdev, linux-kernel

On Fri, 2013-05-17 at 14:18 +0530, govindarajulu.v wrote:
> From: "govindarajulu.v" <govindarajulu90@gmail.com>
> 
> netdev_pick_tx ignores the xps map configuration if netdev->ndo_select_queue
> is defined. Most of the drivers define ndo_select_queue. The problem with this
> is, if admin wants kernel to pick tx queue based on xps map (instead of driver
> defined ndo_select_queue), he has to netdev->ndo_select_queue = NULL, compile
> and reload.
> 
> This patch fixes it by checking if dev->xps_maps is defined. If yes it
> proceeds with get_xps_queue. If not it proceeds with netdev->ndo_select_queue
> (if defined).
> 
> Compile test only.

I do not think its right, take a look at
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c , around line 6467

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

* Re: [PATCH net-next] net: netdev_pick_tx: use get_xps_q if xps map is set
  2013-05-17 13:35 ` Eric Dumazet
@ 2013-05-17 19:50   ` govind
  2013-05-17 22:03     ` Eric Dumazet
  0 siblings, 1 reply; 5+ messages in thread
From: govind @ 2013-05-17 19:50 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: davem, xiyou.wangcong, netdev, linux-kernel

On 05/17/2013 07:05 PM, Eric Dumazet wrote:
> On Fri, 2013-05-17 at 14:18 +0530, govindarajulu.v wrote:
>> From: "govindarajulu.v" <govindarajulu90@gmail.com>
>>
>> netdev_pick_tx ignores the xps map configuration if netdev->ndo_select_queue
>> is defined. Most of the drivers define ndo_select_queue. The problem with this
>> is, if admin wants kernel to pick tx queue based on xps map (instead of driver
>> defined ndo_select_queue), he has to netdev->ndo_select_queue = NULL, compile
>> and reload.
>>
>> This patch fixes it by checking if dev->xps_maps is defined. If yes it
>> proceeds with get_xps_queue. If not it proceeds with netdev->ndo_select_queue
>> (if defined).
>>
>> Compile test only.
>
> I do not think its right, take a look at
> drivers/net/ethernet/intel/ixgbe/ixgbe_main.c , around line 6467

I see. In ixgbe_select_queue we use __netdev_pick_tx only if packet is not
FCOE & FIP.

If you see
bnx2x_select_queue in drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c, line 1832
and mlx4_en_select_queue in drivers/net/ethernet/mellanox/mlx4/en_tx.c, line 547.
we cannot have xps working with these drivers.

This needs to be fixed by replacing __skb_tx_hash with __netdev_pick_tx. Am i 
correct?

thanks
//govind

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

* Re: [PATCH net-next] net: netdev_pick_tx: use get_xps_q if xps map is set
  2013-05-17 19:50   ` govind
@ 2013-05-17 22:03     ` Eric Dumazet
  2013-05-18  5:18       ` govind
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Dumazet @ 2013-05-17 22:03 UTC (permalink / raw)
  To: govind; +Cc: davem, xiyou.wangcong, netdev, linux-kernel

On Sat, 2013-05-18 at 01:20 +0530, govind wrote:

> I see. In ixgbe_select_queue we use __netdev_pick_tx only if packet is not
> FCOE & FIP.
> 
> If you see
> bnx2x_select_queue in drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c, line 1832
> and mlx4_en_select_queue in drivers/net/ethernet/mellanox/mlx4/en_tx.c, line 547.
> we cannot have xps working with these drivers.
> 
> This needs to be fixed by replacing __skb_tx_hash with __netdev_pick_tx. Am i 
> correct?

Yes, this seems better.

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

* Re: [PATCH net-next] net: netdev_pick_tx: use get_xps_q if xps map is set
  2013-05-17 22:03     ` Eric Dumazet
@ 2013-05-18  5:18       ` govind
  0 siblings, 0 replies; 5+ messages in thread
From: govind @ 2013-05-18  5:18 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: davem, xiyou.wangcong, netdev, linux-kernel

>On 05/18/2013 03:33 AM, Eric Dumazet wrote:
> On Sat, 2013-05-18 at 01:20 +0530, govind wrote:
>
>> I see. In ixgbe_select_queue we use __netdev_pick_tx only if packet is not
>> FCOE & FIP.
>>
>> If you see
>> bnx2x_select_queue in drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c, line 1832
>> and mlx4_en_select_queue in drivers/net/ethernet/mellanox/mlx4/en_tx.c, line 547.
>> we cannot have xps working with these drivers.
>>
>> This needs to be fixed by replacing __skb_tx_hash with __netdev_pick_tx. Am i
>> correct?
>
> Yes, this seems better.

thanks eric, i will send patch soon.

//govind

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

end of thread, other threads:[~2013-05-18  5:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-17  8:48 [PATCH net-next] net: netdev_pick_tx: use get_xps_q if xps map is set govindarajulu.v
2013-05-17 13:35 ` Eric Dumazet
2013-05-17 19:50   ` govind
2013-05-17 22:03     ` Eric Dumazet
2013-05-18  5:18       ` govind

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