Skip to content

Commit 4fdda95

Browse files
ecree-solarflaredavem330
authored andcommitted
sfc: don't report RX hash keys to ethtool when RSS wasn't enabled
If we failed to set up RSS on EF10 (e.g. because firmware declared RX_RSS_LIMITED), ethtool --show-nfc $dev rx-flow-hash ... should report no fields, rather than confusingly reporting what fields we _would_ be hashing on if RSS was working. Fixes: dcb4123 ("sfc: disable RSS when unsupported") Signed-off-by: Edward Cree <ecree@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent aa9773b commit 4fdda95

4 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎drivers/net/ethernet/sfc/ef10.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1323,7 +1323,8 @@ static int efx_ef10_init_nic(struct efx_nic *efx)
13231323
}
13241324

13251325
/* don't fail init if RSS setup doesn't work */
1326-
efx->type->rx_push_rss_config(efx, false, efx->rx_indir_table);
1326+
rc = efx->type->rx_push_rss_config(efx, false, efx->rx_indir_table);
1327+
efx->rss_active = (rc == 0);
13271328

13281329
return 0;
13291330
}

‎drivers/net/ethernet/sfc/ethtool.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,8 @@ efx_ethtool_get_rxnfc(struct net_device *net_dev,
975975

976976
case ETHTOOL_GRXFH: {
977977
info->data = 0;
978+
if (!efx->rss_active) /* No RSS */
979+
return 0;
978980
switch (info->flow_type) {
979981
case UDP_V4_FLOW:
980982
if (efx->rx_hash_udp_4tuple)

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,7 @@ struct vfdi_status;
860860
* @rx_hash_key: Toeplitz hash key for RSS
861861
* @rx_indir_table: Indirection table for RSS
862862
* @rx_scatter: Scatter mode enabled for receives
863+
* @rss_active: RSS enabled on hardware
863864
* @rx_hash_udp_4tuple: UDP 4-tuple hashing enabled
864865
* @int_error_count: Number of internal errors seen recently
865866
* @int_error_expire: Time at which error count will be expired
@@ -998,6 +999,7 @@ struct efx_nic {
998999
u8 rx_hash_key[40];
9991000
u32 rx_indir_table[128];
10001001
bool rx_scatter;
1002+
bool rss_active;
10011003
bool rx_hash_udp_4tuple;
10021004

10031005
unsigned int_error_count;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ static int siena_init_nic(struct efx_nic *efx)
403403
efx_writeo(efx, &temp, FR_AZ_RX_CFG);
404404

405405
siena_rx_push_rss_config(efx, false, efx->rx_indir_table);
406+
efx->rss_active = true;
406407

407408
/* Enable event logging */
408409
rc = efx_mcdi_log_ctrl(efx, true, false, 0);

0 commit comments

Comments
 (0)