Skip to content

Commit d768319

Browse files
Toreg87davem330
authored andcommitted
alx: enable multiple tx queues
Enable multiple tx queues by default based on the number of online cpus. The hardware supports up to four tx queues. Based on the downstream driver at github.com/qca/alx Signed-off-by: Tobias Regnery <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f58e0f7 commit d768319

File tree

1 file changed

+6
-2
lines changed
  • drivers/net/ethernet/atheros/alx

1 file changed

+6
-2
lines changed

drivers/net/ethernet/atheros/alx/main.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ static bool alx_enable_msix(struct alx_priv *alx)
834834
{
835835
int i, err, num_vec, num_txq, num_rxq;
836836

837-
num_txq = 1;
837+
num_txq = min_t(int, num_online_cpus(), ALX_MAX_TX_QUEUES);
838838
num_rxq = 1;
839839
num_vec = max_t(int, num_txq, num_rxq) + 1;
840840

@@ -1241,6 +1241,9 @@ static int __alx_open(struct alx_priv *alx, bool resume)
12411241
if (err)
12421242
goto out_free_rings;
12431243

1244+
netif_set_real_num_tx_queues(alx->dev, alx->num_txq);
1245+
netif_set_real_num_rx_queues(alx->dev, alx->num_rxq);
1246+
12441247
/* clear old interrupts */
12451248
alx_write_mem32(&alx->hw, ALX_ISR, ~(u32)ALX_ISR_DIS);
12461249

@@ -1749,7 +1752,8 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
17491752
goto out_pci_release;
17501753
}
17511754

1752-
netdev = alloc_etherdev(sizeof(*alx));
1755+
netdev = alloc_etherdev_mqs(sizeof(*alx),
1756+
ALX_MAX_TX_QUEUES, 1);
17531757
if (!netdev) {
17541758
err = -ENOMEM;
17551759
goto out_pci_release;

0 commit comments

Comments
 (0)