File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
drivers/net/ethernet/intel/ice Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -89,8 +89,13 @@ static int ice_vsi_alloc_arrays(struct ice_vsi *vsi)
89
89
if (!vsi -> rx_rings )
90
90
goto err_rings ;
91
91
92
- /* XDP will have vsi->alloc_txq Tx queues as well, so double the size */
93
- vsi -> txq_map = devm_kcalloc (dev , (2 * vsi -> alloc_txq ),
92
+ /* txq_map needs to have enough space to track both Tx (stack) rings
93
+ * and XDP rings; at this point vsi->num_xdp_txq might not be set,
94
+ * so use num_possible_cpus() as we want to always provide XDP ring
95
+ * per CPU, regardless of queue count settings from user that might
96
+ * have come from ethtool's set_channels() callback;
97
+ */
98
+ vsi -> txq_map = devm_kcalloc (dev , (vsi -> alloc_txq + num_possible_cpus ()),
94
99
sizeof (* vsi -> txq_map ), GFP_KERNEL );
95
100
96
101
if (!vsi -> txq_map )
You can’t perform that action at this time.
0 commit comments