sfc: decouple TXQ type from label
Make it possible to have an arbitrary mapping from types to labels, because when we add inner-csum-offload TXQs there will no longer be a convenient nesting hierarchy of NIC types (EF10 will have inner-csum TXQs, while Siena will have HIGHPRI). Correct a misleading comment on efx_hard_start_xmit(). Signed-off-by: Edward Cree <ecree@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
4a681bf345
commit
12804793b1
@@ -151,7 +151,7 @@ static int efx_allocate_msix_channels(struct efx_nic *efx,
|
||||
*/
|
||||
|
||||
n_xdp_tx = num_possible_cpus();
|
||||
n_xdp_ev = DIV_ROUND_UP(n_xdp_tx, EFX_TXQ_TYPES);
|
||||
n_xdp_ev = DIV_ROUND_UP(n_xdp_tx, EFX_MAX_TXQ_PER_CHANNEL);
|
||||
|
||||
vec_count = pci_msix_vec_count(efx->pci_dev);
|
||||
if (vec_count < 0)
|
||||
@@ -179,7 +179,7 @@ static int efx_allocate_msix_channels(struct efx_nic *efx,
|
||||
efx->xdp_tx_queue_count = 0;
|
||||
} else {
|
||||
efx->n_xdp_channels = n_xdp_ev;
|
||||
efx->xdp_tx_per_channel = EFX_TXQ_TYPES;
|
||||
efx->xdp_tx_per_channel = EFX_MAX_TXQ_PER_CHANNEL;
|
||||
efx->xdp_tx_queue_count = n_xdp_tx;
|
||||
n_channels += n_xdp_ev;
|
||||
netif_dbg(efx, drv, efx->net_dev,
|
||||
@@ -520,7 +520,7 @@ static struct efx_channel *efx_alloc_channel(struct efx_nic *efx, int i)
|
||||
channel->channel = i;
|
||||
channel->type = &efx_default_channel_type;
|
||||
|
||||
for (j = 0; j < EFX_TXQ_TYPES; j++) {
|
||||
for (j = 0; j < EFX_MAX_TXQ_PER_CHANNEL; j++) {
|
||||
tx_queue = &channel->tx_queue[j];
|
||||
tx_queue->efx = efx;
|
||||
tx_queue->queue = -1;
|
||||
@@ -594,7 +594,7 @@ struct efx_channel *efx_copy_channel(const struct efx_channel *old_channel)
|
||||
channel->napi_str.state = 0;
|
||||
memset(&channel->eventq, 0, sizeof(channel->eventq));
|
||||
|
||||
for (j = 0; j < EFX_TXQ_TYPES; j++) {
|
||||
for (j = 0; j < EFX_MAX_TXQ_PER_CHANNEL; j++) {
|
||||
tx_queue = &channel->tx_queue[j];
|
||||
if (tx_queue->channel)
|
||||
tx_queue->channel = channel;
|
||||
@@ -894,7 +894,7 @@ int efx_set_channels(struct efx_nic *efx)
|
||||
xdp_queue_number, tx_queue->queue);
|
||||
/* We may have a few left-over XDP TX
|
||||
* queues owing to xdp_tx_queue_count
|
||||
* not dividing evenly by EFX_TXQ_TYPES.
|
||||
* not dividing evenly by EFX_MAX_TXQ_PER_CHANNEL.
|
||||
* We still allocate and probe those
|
||||
* TXQs, but never use them.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user