Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

be2net: Fix non utilization of RX queues

When non power of two MSIX vectors are given to driver, some RX queues
are not utilized. Program RSS table in such a way that all queues
are utilized.

Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Padmanabh Ratnakar and committed by
David S. Miller
e9008ee9 65f8584e

+10 -6
+10 -6
drivers/net/ethernet/emulex/benet/be_main.c
··· 2312 2312 static int be_rx_queues_setup(struct be_adapter *adapter) 2313 2313 { 2314 2314 struct be_rx_obj *rxo; 2315 - int rc, i; 2316 - u8 rsstable[MAX_RSS_QS]; 2315 + int rc, i, j; 2316 + u8 rsstable[128]; 2317 2317 2318 2318 for_all_rx_queues(adapter, rxo, i) { 2319 2319 rc = be_cmd_rxq_create(adapter, &rxo->q, rxo->cq.id, ··· 2325 2325 } 2326 2326 2327 2327 if (be_multi_rxq(adapter)) { 2328 - for_all_rss_queues(adapter, rxo, i) 2329 - rsstable[i] = rxo->rss_id; 2328 + for (j = 0; j < 128; j += adapter->num_rx_qs - 1) { 2329 + for_all_rss_queues(adapter, rxo, i) { 2330 + if ((j + i) >= 128) 2331 + break; 2332 + rsstable[j + i] = rxo->rss_id; 2333 + } 2334 + } 2335 + rc = be_cmd_rss_config(adapter, rsstable, 128); 2330 2336 2331 - rc = be_cmd_rss_config(adapter, rsstable, 2332 - adapter->num_rx_qs - 1); 2333 2337 if (rc) 2334 2338 return rc; 2335 2339 }