Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'sfc-fixes'

Íñigo Huguet says:

====================
sfc: 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.

v2:
* added Martin's patch instead of a previous mine. Mine one solved some
of the initialization errors, but Martin's solves them also in all
possible cases.
* removed whitespaces cleanup, as requested by Jakub
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+3 -5
+2 -4
drivers/net/ethernet/sfc/efx_channels.c
··· 298 298 efx->n_channels = 1; 299 299 efx->n_rx_channels = 1; 300 300 efx->n_tx_channels = 1; 301 + efx->tx_channel_offset = 0; 301 302 efx->n_xdp_channels = 0; 302 303 efx->xdp_channel_offset = efx->n_channels; 303 304 rc = pci_enable_msi(efx->pci_dev); ··· 319 318 efx->n_channels = 1 + (efx_separate_tx_channels ? 1 : 0); 320 319 efx->n_rx_channels = 1; 321 320 efx->n_tx_channels = 1; 321 + efx->tx_channel_offset = 1; 322 322 efx->n_xdp_channels = 0; 323 323 efx->xdp_channel_offset = efx->n_channels; 324 324 efx->legacy_irq = efx->pci_dev->irq; ··· 955 953 { 956 954 struct efx_channel *channel; 957 955 int rc; 958 - 959 - efx->tx_channel_offset = 960 - efx_separate_tx_channels ? 961 - efx->n_channels - efx->n_tx_channels : 0; 962 956 963 957 if (efx->xdp_tx_queue_count) { 964 958 EFX_WARN_ON_PARANOID(efx->xdp_tx_queues);
+1 -1
drivers/net/ethernet/sfc/net_driver.h
··· 1530 1530 1531 1531 static inline bool efx_channel_has_tx_queues(struct efx_channel *channel) 1532 1532 { 1533 - return true; 1533 + return channel && channel->channel >= channel->efx->tx_channel_offset; 1534 1534 } 1535 1535 1536 1536 static inline unsigned int efx_channel_num_tx_queues(struct efx_channel *channel)