aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/ethtool.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/sfc/ethtool.c')
-rw-r--r--drivers/net/ethernet/sfc/ethtool.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/net/ethernet/sfc/ethtool.c b/drivers/net/ethernet/sfc/ethtool.c
index cad258a78708..4835bc0d0de8 100644
--- a/drivers/net/ethernet/sfc/ethtool.c
+++ b/drivers/net/ethernet/sfc/ethtool.c
@@ -1086,19 +1086,29 @@ static u32 efx_ethtool_get_rxfh_indir_size(struct net_device *net_dev)
1086 0 : ARRAY_SIZE(efx->rx_indir_table)); 1086 0 : ARRAY_SIZE(efx->rx_indir_table));
1087} 1087}
1088 1088
1089static int efx_ethtool_get_rxfh(struct net_device *net_dev, u32 *indir, u8 *key) 1089static int efx_ethtool_get_rxfh(struct net_device *net_dev, u32 *indir, u8 *key,
1090 u8 *hfunc)
1090{ 1091{
1091 struct efx_nic *efx = netdev_priv(net_dev); 1092 struct efx_nic *efx = netdev_priv(net_dev);
1092 1093
1093 memcpy(indir, efx->rx_indir_table, sizeof(efx->rx_indir_table)); 1094 if (hfunc)
1095 *hfunc = ETH_RSS_HASH_TOP;
1096 if (indir)
1097 memcpy(indir, efx->rx_indir_table, sizeof(efx->rx_indir_table));
1094 return 0; 1098 return 0;
1095} 1099}
1096 1100
1097static int efx_ethtool_set_rxfh(struct net_device *net_dev, 1101static int efx_ethtool_set_rxfh(struct net_device *net_dev, const u32 *indir,
1098 const u32 *indir, const u8 *key) 1102 const u8 *key, const u8 hfunc)
1099{ 1103{
1100 struct efx_nic *efx = netdev_priv(net_dev); 1104 struct efx_nic *efx = netdev_priv(net_dev);
1101 1105
1106 /* We do not allow change in unsupported parameters */
1107 if (key ||
1108 (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP))
1109 return -EOPNOTSUPP;
1110 if (!indir)
1111 return 0;
1102 memcpy(efx->rx_indir_table, indir, sizeof(efx->rx_indir_table)); 1112 memcpy(efx->rx_indir_table, indir, sizeof(efx->rx_indir_table));
1103 efx->type->rx_push_rss_config(efx); 1113 efx->type->rx_push_rss_config(efx);
1104 return 0; 1114 return 0;