Merge branch 'sfc-siena-fix-some-efx_separate_tx_channels-errors'
Íñ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/20220601063603.15362-1-ihuguet@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
11049c9e71
@ -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);
|
||||
@ -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;
|
||||
@ -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);
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user