[PATCH net] net/mlx4_en: Fix user prio field in XDP forward

Subsystems: mellanox ethernet driver (mlx4_en), mellanox mlx4 core vpi driver, networking drivers, the rest

STALE3547d

2 messages, 2 authors, 2016-12-22 · open the first message on its own page

[PATCH net] net/mlx4_en: Fix user prio field in XDP forward

From: Tariq Toukan <hidden>
Date: 2016-12-22 12:33:21

The user prio field is wrong (and overflows) in the XDP forward
flow.
This is a result of a bad value for num_tx_rings_p_up, which should
account all XDP TX rings, as they operate for the same user prio.

Signed-off-by: Tariq Toukan <redacted>
Reported-by: Martin KaFai Lau <redacted>
---
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index bcd955339058..edbe200ac2fa 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -1638,7 +1638,8 @@ int mlx4_en_start_port(struct net_device *dev)
 
 	/* Configure tx cq's and rings */
 	for (t = 0 ; t < MLX4_EN_NUM_TX_TYPES; t++) {
-		u8 num_tx_rings_p_up = t == TX ? priv->num_tx_rings_p_up : 1;
+		u8 num_tx_rings_p_up = t == TX ?
+			priv->num_tx_rings_p_up : priv->tx_ring_num[t];
 
 		for (i = 0; i < priv->tx_ring_num[t]; i++) {
 			/* Configure cq */
-- 
1.8.3.1

Re: [PATCH net] net/mlx4_en: Fix user prio field in XDP forward

From: David Miller <davem@davemloft.net>
Date: 2016-12-22 16:21:11

From: Tariq Toukan <redacted>
Date: Thu, 22 Dec 2016 14:32:58 +0200
The user prio field is wrong (and overflows) in the XDP forward
flow.
This is a result of a bad value for num_tx_rings_p_up, which should
account all XDP TX rings, as they operate for the same user prio.

Signed-off-by: Tariq Toukan <redacted>
Reported-by: Martin KaFai Lau <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help