diff options
-rw-r--r-- | include/linux/ethtool.h | 4 | ||||
-rw-r--r-- | net/core/ethtool.c | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 886e127d51a6..de687a97c6e7 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -168,8 +168,8 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings) | |||
168 | * @set_rxfh_indir: Set the contents of the RX flow hash indirection table. | 168 | * @set_rxfh_indir: Set the contents of the RX flow hash indirection table. |
169 | * Will not be called if @get_rxfh_indir_size returns zero. | 169 | * Will not be called if @get_rxfh_indir_size returns zero. |
170 | * @set_rxfh: Set the contents of the RX flow hash indirection table and/or | 170 | * @set_rxfh: Set the contents of the RX flow hash indirection table and/or |
171 | * hash key. Either or both arguments may be %NULL if that attribute | 171 | * hash key. In case only the indirection table or hash key is to be |
172 | * is not to be changed. | 172 | * changed, the other argument will be %NULL. |
173 | * Will only be called if one or both of @get_rxfh_indir_size and | 173 | * Will only be called if one or both of @get_rxfh_indir_size and |
174 | * @get_rxfh_key_size are implemented and return non-zero. | 174 | * @get_rxfh_key_size are implemented and return non-zero. |
175 | * Returns a negative error code or zero. | 175 | * Returns a negative error code or zero. |
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 7156fe5ca876..b8857348bdf3 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c | |||
@@ -802,11 +802,14 @@ static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev, | |||
802 | return -EFAULT; | 802 | return -EFAULT; |
803 | 803 | ||
804 | /* If either indir or hash key is valid, proceed further. | 804 | /* If either indir or hash key is valid, proceed further. |
805 | * It is not valid to request that both be unchanged. | ||
805 | */ | 806 | */ |
806 | if ((user_indir_size && | 807 | if ((user_indir_size && |
807 | user_indir_size != ETH_RXFH_INDIR_NO_CHANGE && | 808 | user_indir_size != ETH_RXFH_INDIR_NO_CHANGE && |
808 | user_indir_size != dev_indir_size) || | 809 | user_indir_size != dev_indir_size) || |
809 | (user_key_size && (user_key_size != dev_key_size))) | 810 | (user_key_size && (user_key_size != dev_key_size)) || |
811 | (user_indir_size == ETH_RXFH_INDIR_NO_CHANGE && | ||
812 | user_key_size == 0)) | ||
810 | return -EINVAL; | 813 | return -EINVAL; |
811 | 814 | ||
812 | if (user_indir_size != ETH_RXFH_INDIR_NO_CHANGE) | 815 | if (user_indir_size != ETH_RXFH_INDIR_NO_CHANGE) |