Commit bccffcf7 authored by Tobias Regnery's avatar Tobias Regnery Committed by David S. Miller

alx: extend data structures for multi queue support

Extend the driver data structures to be able to handle multiple queues.

Based on the downstream driver at github.com/qca/alx
Signed-off-by: default avatarTobias Regnery <tobias.regnery@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8c2a4c8e
...@@ -50,6 +50,10 @@ struct alx_buffer { ...@@ -50,6 +50,10 @@ struct alx_buffer {
}; };
struct alx_rx_queue { struct alx_rx_queue {
struct net_device *netdev;
struct device *dev;
struct alx_napi *np;
struct alx_rrd *rrd; struct alx_rrd *rrd;
dma_addr_t rrd_dma; dma_addr_t rrd_dma;
...@@ -58,16 +62,26 @@ struct alx_rx_queue { ...@@ -58,16 +62,26 @@ struct alx_rx_queue {
struct alx_buffer *bufs; struct alx_buffer *bufs;
u16 count;
u16 write_idx, read_idx; u16 write_idx, read_idx;
u16 rrd_read_idx; u16 rrd_read_idx;
u16 queue_idx;
}; };
#define ALX_RX_ALLOC_THRESH 32 #define ALX_RX_ALLOC_THRESH 32
struct alx_tx_queue { struct alx_tx_queue {
struct net_device *netdev;
struct device *dev;
struct alx_txd *tpd; struct alx_txd *tpd;
dma_addr_t tpd_dma; dma_addr_t tpd_dma;
struct alx_buffer *bufs; struct alx_buffer *bufs;
u16 count;
u16 write_idx, read_idx; u16 write_idx, read_idx;
u16 queue_idx;
u16 p_reg, c_reg;
}; };
#define ALX_DEFAULT_TX_WORK 128 #define ALX_DEFAULT_TX_WORK 128
...@@ -76,6 +90,18 @@ enum alx_device_quirks { ...@@ -76,6 +90,18 @@ enum alx_device_quirks {
ALX_DEV_QUIRK_MSI_INTX_DISABLE_BUG = BIT(0), 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_MSIX BIT(0)
#define ALX_FLAG_USING_MSI BIT(1) #define ALX_FLAG_USING_MSI BIT(1)
...@@ -96,6 +122,11 @@ struct alx_priv { ...@@ -96,6 +122,11 @@ struct alx_priv {
unsigned int size; unsigned int size;
} descmem; } descmem;
struct alx_napi *qnapi[ALX_MAX_NAPIS];
int num_txq;
int num_rxq;
int num_napi;
/* protect int_mask updates */ /* protect int_mask updates */
spinlock_t irq_lock; spinlock_t irq_lock;
u32 int_mask; u32 int_mask;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment