Skip to content

Commit 11049c9

Browse files
committed
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/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 2440d20 + 25bde57 commit 11049c9

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

drivers/net/ethernet/sfc/siena/efx_channels.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ int efx_siena_probe_interrupts(struct efx_nic *efx)
299299
efx->n_channels = 1;
300300
efx->n_rx_channels = 1;
301301
efx->n_tx_channels = 1;
302+
efx->tx_channel_offset = 0;
302303
efx->n_xdp_channels = 0;
303304
efx->xdp_channel_offset = efx->n_channels;
304305
rc = pci_enable_msi(efx->pci_dev);
@@ -319,6 +320,7 @@ int efx_siena_probe_interrupts(struct efx_nic *efx)
319320
efx->n_channels = 1 + (efx_siena_separate_tx_channels ? 1 : 0);
320321
efx->n_rx_channels = 1;
321322
efx->n_tx_channels = 1;
323+
efx->tx_channel_offset = 1;
322324
efx->n_xdp_channels = 0;
323325
efx->xdp_channel_offset = efx->n_channels;
324326
efx->legacy_irq = efx->pci_dev->irq;
@@ -958,10 +960,6 @@ int efx_siena_set_channels(struct efx_nic *efx)
958960
struct efx_channel *channel;
959961
int rc;
960962

961-
efx->tx_channel_offset =
962-
efx_siena_separate_tx_channels ?
963-
efx->n_channels - efx->n_tx_channels : 0;
964-
965963
if (efx->xdp_tx_queue_count) {
966964
EFX_WARN_ON_PARANOID(efx->xdp_tx_queues);
967965

drivers/net/ethernet/sfc/siena/net_driver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,7 @@ static inline bool efx_channel_is_xdp_tx(struct efx_channel *channel)
15291529

15301530
static inline bool efx_channel_has_tx_queues(struct efx_channel *channel)
15311531
{
1532-
return true;
1532+
return channel && channel->channel >= channel->efx->tx_channel_offset;
15331533
}
15341534

15351535
static inline unsigned int efx_channel_num_tx_queues(struct efx_channel *channel)

0 commit comments

Comments
 (0)