summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRonak Doshi <doshir@vmware.com>2020-06-02 06:02:39 +0300
committerDavid S. Miller <davem@davemloft.net>2020-06-03 01:12:33 +0300
commit11e877b2a8cfd282a1b81f9d4c594b900889a5d8 (patch)
tree9c4abdca674a55f1f04314bab19617be054102a2 /drivers
parent2eed5a8b614bc0197b29da7b21a78d2c564a7098 (diff)
downloadlinux-11e877b2a8cfd282a1b81f9d4c594b900889a5d8.tar.xz
vmxnet3: allow rx flow hash ops only when rss is enabled
It makes sense to allow changes to get/set rx flow hash callback only when rss is enabled. This patch restricts get_rss_hash_opts and set_rss_hash_opts methods to allow querying and configuring different Rx flow hash configurations only when rss is enabled Signed-off-by: Ronak Doshi <doshir@vmware.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/vmxnet3/vmxnet3_ethtool.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/vmxnet3/vmxnet3_ethtool.c b/drivers/net/vmxnet3/vmxnet3_ethtool.c
index 6acaafe169de..def27afa1c69 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethtool.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c
@@ -899,6 +899,12 @@ vmxnet3_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *info,
err = -EOPNOTSUPP;
break;
}
+#ifdef VMXNET3_RSS
+ if (!adapter->rss) {
+ err = -EOPNOTSUPP;
+ break;
+ }
+#endif
err = vmxnet3_get_rss_hash_opts(adapter, info);
break;
default:
@@ -919,6 +925,12 @@ vmxnet3_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *info)
err = -EOPNOTSUPP;
goto done;
}
+#ifdef VMXNET3_RSS
+ if (!adapter->rss) {
+ err = -EOPNOTSUPP;
+ goto done;
+ }
+#endif
switch (info->cmd) {
case ETHTOOL_SRXFH: