Skip to content

Commit

Permalink
Merge branch 'alx-multiqueue-support'
Browse files Browse the repository at this point in the history
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 <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Nov 16, 2016
2 parents 11b8ad3 + d768319 commit 21b23da
Show file tree
Hide file tree
Showing 2 changed files with 420 additions and 170 deletions.
36 changes: 31 additions & 5 deletions drivers/net/ethernet/atheros/alx/alx.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ struct alx_buffer {
};

struct alx_rx_queue {
struct net_device *netdev;
struct device *dev;
struct alx_napi *np;

struct alx_rrd *rrd;
dma_addr_t rrd_dma;

Expand All @@ -58,16 +62,26 @@ struct alx_rx_queue {

struct alx_buffer *bufs;

u16 count;
u16 write_idx, read_idx;
u16 rrd_read_idx;
u16 queue_idx;
};
#define ALX_RX_ALLOC_THRESH 32

struct alx_tx_queue {
struct net_device *netdev;
struct device *dev;

struct alx_txd *tpd;
dma_addr_t tpd_dma;

struct alx_buffer *bufs;

u16 count;
u16 write_idx, read_idx;
u16 queue_idx;
u16 p_reg, c_reg;
};

#define ALX_DEFAULT_TX_WORK 128
Expand All @@ -76,6 +90,18 @@ enum alx_device_quirks {
ALX_DEV_QUIRK_MSI_INTX_DISABLE_BUG = BIT(0),
};

struct alx_napi {
struct napi_struct napi;
struct alx_priv *alx;
struct alx_rx_queue *rxq;
struct alx_tx_queue *txq;
int vec_idx;
u32 vec_mask;
char irq_lbl[IFNAMSIZ + 8];
};

#define ALX_MAX_NAPIS 8

#define ALX_FLAG_USING_MSIX BIT(0)
#define ALX_FLAG_USING_MSI BIT(1)

Expand All @@ -87,7 +113,6 @@ struct alx_priv {
/* msi-x vectors */
int num_vec;
struct msix_entry *msix_entries;
char irq_lbl[IFNAMSIZ + 8];

/* all descriptor memory */
struct {
Expand All @@ -96,6 +121,11 @@ struct alx_priv {
unsigned int size;
} descmem;

struct alx_napi *qnapi[ALX_MAX_NAPIS];
int num_txq;
int num_rxq;
int num_napi;

/* protect int_mask updates */
spinlock_t irq_lock;
u32 int_mask;
Expand All @@ -104,10 +134,6 @@ struct alx_priv {
unsigned int rx_ringsz;
unsigned int rxbuf_size;

struct napi_struct napi;
struct alx_tx_queue txq;
struct alx_rx_queue rxq;

struct work_struct link_check_wk;
struct work_struct reset_wk;

Expand Down
Loading

0 comments on commit 21b23da

Please sign in to comment.