Skip to content

Commit 21b23da

Browse files
committed
Merge branch 'alx-multiqueue-support'
Tobias Regnery says: ==================== alx: add multi queue support This patchset lays the groundwork for multi queue support in the alx driver and enables multi queue support for the tx path by default. The hardware supports up to 4 tx queues. Benefits are better utilization of multi core cpus and the usage of the msi-x support by default which splits the handling of rx / tx and misc other interrupts. The rx path is a little bit harder because apparently (based on the limited information from the downstream driver) the hardware supports up to 8 rss queues but only has one hardware descriptor ring on the rx side. So the rx path will be part of another patchset. Tested on my AR8161 ethernet adapter with different tests: - there are no regressions observed during my daily usage - iperf tcp and udp tests shows no performance regressions - netperf TCP_RR and UDP_RR shows a slight performance increase of about 1-2% with this patchset applied This work is based on the downstream driver at github.com/qca/alx Changes in V2: - drop unneeded casts in alx_alloc_rx_ring (Patch 1) - add additional information about testing and benefit to the changelog ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 11b8ad3 + d768319 commit 21b23da

File tree

2 files changed

+420
-170
lines changed

2 files changed

+420
-170
lines changed

drivers/net/ethernet/atheros/alx/alx.h

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ struct alx_buffer {
5050
};
5151

5252
struct alx_rx_queue {
53+
struct net_device *netdev;
54+
struct device *dev;
55+
struct alx_napi *np;
56+
5357
struct alx_rrd *rrd;
5458
dma_addr_t rrd_dma;
5559

@@ -58,16 +62,26 @@ struct alx_rx_queue {
5862

5963
struct alx_buffer *bufs;
6064

65+
u16 count;
6166
u16 write_idx, read_idx;
6267
u16 rrd_read_idx;
68+
u16 queue_idx;
6369
};
6470
#define ALX_RX_ALLOC_THRESH 32
6571

6672
struct alx_tx_queue {
73+
struct net_device *netdev;
74+
struct device *dev;
75+
6776
struct alx_txd *tpd;
6877
dma_addr_t tpd_dma;
78+
6979
struct alx_buffer *bufs;
80+
81+
u16 count;
7082
u16 write_idx, read_idx;
83+
u16 queue_idx;
84+
u16 p_reg, c_reg;
7185
};
7286

7387
#define ALX_DEFAULT_TX_WORK 128
@@ -76,6 +90,18 @@ enum alx_device_quirks {
7690
ALX_DEV_QUIRK_MSI_INTX_DISABLE_BUG = BIT(0),
7791
};
7892

93+
struct alx_napi {
94+
struct napi_struct napi;
95+
struct alx_priv *alx;
96+
struct alx_rx_queue *rxq;
97+
struct alx_tx_queue *txq;
98+
int vec_idx;
99+
u32 vec_mask;
100+
char irq_lbl[IFNAMSIZ + 8];
101+
};
102+
103+
#define ALX_MAX_NAPIS 8
104+
79105
#define ALX_FLAG_USING_MSIX BIT(0)
80106
#define ALX_FLAG_USING_MSI BIT(1)
81107

@@ -87,7 +113,6 @@ struct alx_priv {
87113
/* msi-x vectors */
88114
int num_vec;
89115
struct msix_entry *msix_entries;
90-
char irq_lbl[IFNAMSIZ + 8];
91116

92117
/* all descriptor memory */
93118
struct {
@@ -96,6 +121,11 @@ struct alx_priv {
96121
unsigned int size;
97122
} descmem;
98123

124+
struct alx_napi *qnapi[ALX_MAX_NAPIS];
125+
int num_txq;
126+
int num_rxq;
127+
int num_napi;
128+
99129
/* protect int_mask updates */
100130
spinlock_t irq_lock;
101131
u32 int_mask;
@@ -104,10 +134,6 @@ struct alx_priv {
104134
unsigned int rx_ringsz;
105135
unsigned int rxbuf_size;
106136

107-
struct napi_struct napi;
108-
struct alx_tx_queue txq;
109-
struct alx_rx_queue rxq;
110-
111137
struct work_struct link_check_wk;
112138
struct work_struct reset_wk;
113139

0 commit comments

Comments
 (0)