Commit ec6e57be authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller
Browse files

ethtool: rss: don't report key if device doesn't support it



marvell/otx2 and mvpp2 do not support setting different
keys for different RSS contexts. Contexts have separate
indirection tables but key is shared with all other contexts.
This is likely fine, indirection table is the most important
piece.

Don't report the key-related parameters from such drivers.
This prevents driver-errors, e.g. otx2 always writes
the main key, even when user asks to change per-context key.
The second reason is that without this change tracking
the keys by the core gets complicated. Even if the driver
correctly reject setting key with rss_context != 0,
change of the main key would have to be reflected in
the XArray for all additional contexts.

Since the additional contexts don't have their own keys
not including the attributes (in Netlink speak) seems
intuitive. ethtool CLI seems to deal with it just fine.

Having to set the flag in majority of the drivers is
a bit tedious but not reporting the key is a safer
default.

Reviewed-by: default avatarEdward Cree <ecree.xilinx@gmail.com>
Reviewed-by: default avatarJoe Damato <jdamato@fastly.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fb770fe7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5289,6 +5289,7 @@ void bnxt_ethtool_free(struct bnxt *bp)

const struct ethtool_ops bnxt_ethtool_ops = {
	.cap_link_lanes_supported	= 1,
	.rxfh_per_ctx_key		= 1,
	.rxfh_max_num_contexts		= BNXT_MAX_ETH_RSS_CTX + 1,
	.rxfh_indir_space		= BNXT_MAX_RSS_TABLE_ENTRIES_P5,
	.rxfh_priv_size			= sizeof(struct bnxt_rss_ctx),
+1 −0
Original line number Diff line number Diff line
@@ -4725,6 +4725,7 @@ static const struct ethtool_ops ice_ethtool_ops = {
				     ETHTOOL_COALESCE_USE_ADAPTIVE |
				     ETHTOOL_COALESCE_RX_USECS_HIGH,
	.cap_rss_sym_xor_supported = true,
	.rxfh_per_ctx_key	= true,
	.get_link_ksettings	= ice_get_link_ksettings,
	.set_link_ksettings	= ice_set_link_ksettings,
	.get_fec_stats		= ice_get_fec_stats,
+1 −0
Original line number Diff line number Diff line
@@ -2595,6 +2595,7 @@ static void mlx5e_get_ts_stats(struct net_device *netdev,

const struct ethtool_ops mlx5e_ethtool_ops = {
	.cap_rss_ctx_supported	= true,
	.rxfh_per_ctx_key	= true,
	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
				     ETHTOOL_COALESCE_MAX_FRAMES |
				     ETHTOOL_COALESCE_USE_ADAPTIVE |
+1 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ const struct ethtool_ops ef100_ethtool_ops = {

	.get_rxfh_indir_size	= efx_ethtool_get_rxfh_indir_size,
	.get_rxfh_key_size	= efx_ethtool_get_rxfh_key_size,
	.rxfh_per_ctx_key	= true,
	.rxfh_priv_size		= sizeof(struct efx_rss_context_priv),
	.get_rxfh		= efx_ethtool_get_rxfh,
	.set_rxfh		= efx_ethtool_set_rxfh,
+1 −0
Original line number Diff line number Diff line
@@ -267,6 +267,7 @@ const struct ethtool_ops efx_ethtool_ops = {
	.set_rxnfc		= efx_ethtool_set_rxnfc,
	.get_rxfh_indir_size	= efx_ethtool_get_rxfh_indir_size,
	.get_rxfh_key_size	= efx_ethtool_get_rxfh_key_size,
	.rxfh_per_ctx_key	= true,
	.rxfh_priv_size		= sizeof(struct efx_rss_context_priv),
	.get_rxfh		= efx_ethtool_get_rxfh,
	.set_rxfh		= efx_ethtool_set_rxfh,
Loading