Skip to content

Commit

Permalink
Merge branch 'sfc-siena-fix-some-efx_separate_tx_channels-errors'
Browse files Browse the repository at this point in the history
Íñigo Huguet says:

====================
sfc/siena: fix some efx_separate_tx_channels errors

Trying to load sfc driver with modparam efx_separate_tx_channels=1
resulted in errors during initialization and not being able to use the
NIC. This patches fix a few bugs and make it work again.

This has been already done for sfc, do it also for sfc_siena.
====================

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
kuba-moo committed Jun 2, 2022
2 parents 2440d20 + 25bde57 commit 11049c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions drivers/net/ethernet/sfc/siena/efx_channels.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ int efx_siena_probe_interrupts(struct efx_nic *efx)
efx->n_channels = 1;
efx->n_rx_channels = 1;
efx->n_tx_channels = 1;
efx->tx_channel_offset = 0;
efx->n_xdp_channels = 0;
efx->xdp_channel_offset = efx->n_channels;
rc = pci_enable_msi(efx->pci_dev);
Expand All @@ -319,6 +320,7 @@ int efx_siena_probe_interrupts(struct efx_nic *efx)
efx->n_channels = 1 + (efx_siena_separate_tx_channels ? 1 : 0);
efx->n_rx_channels = 1;
efx->n_tx_channels = 1;
efx->tx_channel_offset = 1;
efx->n_xdp_channels = 0;
efx->xdp_channel_offset = efx->n_channels;
efx->legacy_irq = efx->pci_dev->irq;
Expand Down Expand Up @@ -958,10 +960,6 @@ int efx_siena_set_channels(struct efx_nic *efx)
struct efx_channel *channel;
int rc;

efx->tx_channel_offset =
efx_siena_separate_tx_channels ?
efx->n_channels - efx->n_tx_channels : 0;

if (efx->xdp_tx_queue_count) {
EFX_WARN_ON_PARANOID(efx->xdp_tx_queues);

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/sfc/siena/net_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -1529,7 +1529,7 @@ static inline bool efx_channel_is_xdp_tx(struct efx_channel *channel)

static inline bool efx_channel_has_tx_queues(struct efx_channel *channel)
{
return true;
return channel && channel->channel >= channel->efx->tx_channel_offset;
}

static inline unsigned int efx_channel_num_tx_queues(struct efx_channel *channel)
Expand Down

0 comments on commit 11049c9

Please sign in to comment.