sfc: read back RX hash config from the NIC when querying it with ethtool -x
Ensures that we report the key and indirection table the NIC is using, rather than (if setting them failed earlier) what we wanted it to use. Signed-off-by: Edward Cree <ecree@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
f74d199519
commit
a707d18851
@@ -2643,6 +2643,56 @@ fail1:
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int efx_ef10_rx_pull_rss_config(struct efx_nic *efx)
|
||||
{
|
||||
struct efx_ef10_nic_data *nic_data = efx->nic_data;
|
||||
MCDI_DECLARE_BUF(inbuf, MC_CMD_RSS_CONTEXT_GET_TABLE_IN_LEN);
|
||||
MCDI_DECLARE_BUF(tablebuf, MC_CMD_RSS_CONTEXT_GET_TABLE_OUT_LEN);
|
||||
MCDI_DECLARE_BUF(keybuf, MC_CMD_RSS_CONTEXT_GET_KEY_OUT_LEN);
|
||||
size_t outlen;
|
||||
int rc, i;
|
||||
|
||||
BUILD_BUG_ON(MC_CMD_RSS_CONTEXT_GET_TABLE_IN_LEN !=
|
||||
MC_CMD_RSS_CONTEXT_GET_KEY_IN_LEN);
|
||||
|
||||
if (nic_data->rx_rss_context == EFX_EF10_RSS_CONTEXT_INVALID)
|
||||
return -ENOENT;
|
||||
|
||||
MCDI_SET_DWORD(inbuf, RSS_CONTEXT_GET_TABLE_IN_RSS_CONTEXT_ID,
|
||||
nic_data->rx_rss_context);
|
||||
BUILD_BUG_ON(ARRAY_SIZE(efx->rx_indir_table) !=
|
||||
MC_CMD_RSS_CONTEXT_GET_TABLE_OUT_INDIRECTION_TABLE_LEN);
|
||||
rc = efx_mcdi_rpc(efx, MC_CMD_RSS_CONTEXT_GET_TABLE, inbuf, sizeof(inbuf),
|
||||
tablebuf, sizeof(tablebuf), &outlen);
|
||||
if (rc != 0)
|
||||
return rc;
|
||||
|
||||
if (WARN_ON(outlen != MC_CMD_RSS_CONTEXT_GET_TABLE_OUT_LEN))
|
||||
return -EIO;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(efx->rx_indir_table); i++)
|
||||
efx->rx_indir_table[i] = MCDI_PTR(tablebuf,
|
||||
RSS_CONTEXT_GET_TABLE_OUT_INDIRECTION_TABLE)[i];
|
||||
|
||||
MCDI_SET_DWORD(inbuf, RSS_CONTEXT_GET_KEY_IN_RSS_CONTEXT_ID,
|
||||
nic_data->rx_rss_context);
|
||||
BUILD_BUG_ON(ARRAY_SIZE(efx->rx_hash_key) !=
|
||||
MC_CMD_RSS_CONTEXT_SET_KEY_IN_TOEPLITZ_KEY_LEN);
|
||||
rc = efx_mcdi_rpc(efx, MC_CMD_RSS_CONTEXT_GET_KEY, inbuf, sizeof(inbuf),
|
||||
keybuf, sizeof(keybuf), &outlen);
|
||||
if (rc != 0)
|
||||
return rc;
|
||||
|
||||
if (WARN_ON(outlen != MC_CMD_RSS_CONTEXT_GET_KEY_OUT_LEN))
|
||||
return -EIO;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(efx->rx_hash_key); ++i)
|
||||
efx->rx_hash_key[i] = MCDI_PTR(
|
||||
keybuf, RSS_CONTEXT_GET_KEY_OUT_TOEPLITZ_KEY)[i];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int efx_ef10_pf_rx_push_rss_config(struct efx_nic *efx, bool user,
|
||||
const u32 *rx_indir_table,
|
||||
const u8 *key)
|
||||
@@ -5643,6 +5693,7 @@ const struct efx_nic_type efx_hunt_a0_vf_nic_type = {
|
||||
.tx_write = efx_ef10_tx_write,
|
||||
.tx_limit_len = efx_ef10_tx_limit_len,
|
||||
.rx_push_rss_config = efx_ef10_vf_rx_push_rss_config,
|
||||
.rx_pull_rss_config = efx_ef10_rx_pull_rss_config,
|
||||
.rx_probe = efx_ef10_rx_probe,
|
||||
.rx_init = efx_ef10_rx_init,
|
||||
.rx_remove = efx_ef10_rx_remove,
|
||||
@@ -5751,6 +5802,7 @@ const struct efx_nic_type efx_hunt_a0_nic_type = {
|
||||
.tx_write = efx_ef10_tx_write,
|
||||
.tx_limit_len = efx_ef10_tx_limit_len,
|
||||
.rx_push_rss_config = efx_ef10_pf_rx_push_rss_config,
|
||||
.rx_pull_rss_config = efx_ef10_rx_pull_rss_config,
|
||||
.rx_probe = efx_ef10_rx_probe,
|
||||
.rx_init = efx_ef10_rx_init,
|
||||
.rx_remove = efx_ef10_rx_remove,
|
||||
|
||||
Reference in New Issue
Block a user