Skip to content

Commit 8f7ef51

Browse files
jahay1mehmetb0
authored andcommitted
idpf: call set_real_num_queues in idpf_open
BugLink: https://bugs.launchpad.net/bugs/2104873 [ Upstream commit 52c11d3 ] On initial driver load, alloc_etherdev_mqs is called with whatever max queue values are provided by the control plane. However, if the driver is loaded on a system where num_online_cpus() returns less than the max queues, the netdev will think there are more queues than are actually available. Only num_online_cpus() will be allocated, but skb_get_queue_mapping(skb) could possibly return an index beyond the range of allocated queues. Consequently, the packet is silently dropped and it appears as if TX is broken. Set the real number of queues during open so the netdev knows how many queues will be allocated. Fixes: 1c325aa ("idpf: configure resources for TX queues") Signed-off-by: Joshua Hay <[email protected]> Reviewed-by: Madhu Chittim <[email protected]> Tested-by: Samuel Salin <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Noah Wager <[email protected]>
1 parent 413cd67 commit 8f7ef51

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/net/ethernet/intel/idpf/idpf_lib.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2172,8 +2172,13 @@ static int idpf_open(struct net_device *netdev)
21722172
idpf_vport_ctrl_lock(netdev);
21732173
vport = idpf_netdev_to_vport(netdev);
21742174

2175+
err = idpf_set_real_num_queues(vport);
2176+
if (err)
2177+
goto unlock;
2178+
21752179
err = idpf_vport_open(vport);
21762180

2181+
unlock:
21772182
idpf_vport_ctrl_unlock(netdev);
21782183

21792184
return err;

0 commit comments

Comments
 (0)