diff options
author | Edward Cree <ecree@solarflare.com> | 2020-07-02 17:29:24 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-07-02 14:47:40 -0700 |
commit | f9cac93e5b3eefc5c6340ba4efd3628f2347e1ef (patch) | |
tree | 7251950f44c3d2702da0a05d35b477fd5befcb1b /drivers/net/ethernet/sfc/tx.c | |
parent | 67e6398e2e058d0ec126f47ac123cca590c7a2ba (diff) | |
download | linux-f9cac93e5b3eefc5c6340ba4efd3628f2347e1ef.tar.gz linux-f9cac93e5b3eefc5c6340ba4efd3628f2347e1ef.tar.bz2 linux-f9cac93e5b3eefc5c6340ba4efd3628f2347e1ef.zip |
sfc: make tx_queues_per_channel variable at runtime
Siena needs four TX queues (csum * highpri), EF10 needs two (csum),
and EF100 only needs one (as checksumming is controlled entirely by
the transmit descriptor). Rather than having various bits of ad-hoc
code to decide which queues to set up etc., put the knowledge of how
many TXQs a channel has in one place.
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/tx.c')
-rw-r--r-- | drivers/net/ethernet/sfc/tx.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c index ed20f6aef435..76ff394f5b58 100644 --- a/drivers/net/ethernet/sfc/tx.c +++ b/drivers/net/ethernet/sfc/tx.c @@ -569,6 +569,10 @@ int efx_setup_tc(struct net_device *net_dev, enum tc_setup_type type, if (type != TC_SETUP_QDISC_MQPRIO) return -EOPNOTSUPP; + /* Only Siena supported highpri queues */ + if (efx_nic_rev(efx) > EFX_REV_SIENA_A0) + return -EOPNOTSUPP; + num_tc = mqprio->num_tc; if (num_tc > EFX_MAX_TX_TC) @@ -585,10 +589,10 @@ int efx_setup_tc(struct net_device *net_dev, enum tc_setup_type type, } if (num_tc > net_dev->num_tc) { + efx->tx_queues_per_channel = 4; /* Initialise high-priority queues as necessary */ efx_for_each_channel(channel, efx) { - efx_for_each_possible_channel_tx_queue(tx_queue, - channel) { + efx_for_each_channel_tx_queue(tx_queue, channel) { if (!(tx_queue->queue & EFX_TXQ_TYPE_HIGHPRI)) continue; if (!tx_queue->buffer) { |