Skip to content

Commit 5a9ef19

Browse files
ffainellidavem330
authored andcommitted
net: systemport: Fixed queue mapping in internal ring map
We would not be transmitting using the correct SYSTEMPORT transmit queue during ndo_select_queue() which looks up the internal TX ring map because while establishing the mapping we would be off by 4, so for instance, when we populate switch port mappings we would be doing: switch port 0, queue 0 -> ring index #0 switch port 0, queue 1 -> ring index #1 ... switch port 0, queue 3 -> ring index #3 switch port 1, queue 0 -> ring index #8 (4 + 4 * 1) ... instead of using ring index #4. This would cause our ndo_select_queue() to use the fallback queue mechanism which would pick up an incorrect ring for that switch port. Fix this by using the correct switch queue number instead of SYSTEMPORT queue number. Fixes: 25c4407 ("net: systemport: Simplify queue mapping logic") Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8f1880c commit 5a9ef19

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/net/ethernet/broadcom/bcmsysport.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2323,7 +2323,7 @@ static int bcm_sysport_map_queues(struct notifier_block *nb,
23232323
ring->switch_queue = qp;
23242324
ring->switch_port = port;
23252325
ring->inspect = true;
2326-
priv->ring_map[q + port * num_tx_queues] = ring;
2326+
priv->ring_map[qp + port * num_tx_queues] = ring;
23272327
qp++;
23282328
}
23292329

@@ -2338,7 +2338,7 @@ static int bcm_sysport_unmap_queues(struct notifier_block *nb,
23382338
struct net_device *slave_dev;
23392339
unsigned int num_tx_queues;
23402340
struct net_device *dev;
2341-
unsigned int q, port;
2341+
unsigned int q, qp, port;
23422342

23432343
priv = container_of(nb, struct bcm_sysport_priv, dsa_notifier);
23442344
if (priv->netdev != info->master)
@@ -2364,7 +2364,8 @@ static int bcm_sysport_unmap_queues(struct notifier_block *nb,
23642364
continue;
23652365

23662366
ring->inspect = false;
2367-
priv->ring_map[q + port * num_tx_queues] = NULL;
2367+
qp = ring->switch_queue;
2368+
priv->ring_map[qp + port * num_tx_queues] = NULL;
23682369
}
23692370

23702371
return 0;

0 commit comments

Comments
 (0)