summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Hay <joshua.a.hay@intel.com>2025-02-05 05:08:11 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-21 16:01:17 +0300
commit16435bbe91479b73b1c7bf11ba012b9a2455cb3e (patch)
tree053b025badc448741bb0b9bca59eddac4306043a
parentb2e2f6cc8752127d61ba7ad82f9c4c6e39128ac8 (diff)
downloadlinux-16435bbe91479b73b1c7bf11ba012b9a2455cb3e.tar.xz
idpf: call set_real_num_queues in idpf_open
[ Upstream commit 52c11d31b5a1d1c747bb5f36cc4808e93e2348f4 ] 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: 1c325aac10a8 ("idpf: configure resources for TX queues") Signed-off-by: Joshua Hay <joshua.a.hay@intel.com> Reviewed-by: Madhu Chittim <madhu.chittim@intel.com> Tested-by: Samuel Salin <Samuel.salin@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/net/ethernet/intel/idpf/idpf_lib.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/idpf/idpf_lib.c b/drivers/net/ethernet/intel/idpf/idpf_lib.c
index b4fbb99bfad2..a3d6b8f198a8 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_lib.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_lib.c
@@ -2159,8 +2159,13 @@ static int idpf_open(struct net_device *netdev)
idpf_vport_ctrl_lock(netdev);
vport = idpf_netdev_to_vport(netdev);
+ err = idpf_set_real_num_queues(vport);
+ if (err)
+ goto unlock;
+
err = idpf_vport_open(vport);
+unlock:
idpf_vport_ctrl_unlock(netdev);
return err;