Commit f312cd00 authored by Yanling Song's avatar Yanling Song Committed by Zheng Zengkai
Browse files

net:spnic: Add the get_rxfh_indir_size in ethtool_ops structure.

Ramaxel inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4J0GH


CVE: NA

--------------------------------------------

1.Solve the problem that the indirection table cannot be obtained
  by ethtool - x ethx command.
2.Solve the system oops problem caused by
  ethtool - x ethx default  command.

Signed-off-by: default avatarYanling Song <songyl@ramaxel.com>
Reviewed-by: default avatarXu <Yun&lt;xuyun@ramaxel.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 4728ac82
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -939,6 +939,7 @@ static const struct ethtool_ops spnic_ethtool_ops = {
	.get_module_info	= spnic_get_module_info,
	.get_module_eeprom	= spnic_get_module_eeprom,

	.get_rxfh_indir_size    = spnic_get_rxfh_indir_size,
	.get_rxfh_key_size	= spnic_get_rxfh_key_size,
	.get_rxfh		= spnic_get_rxfh,
	.set_rxfh		= spnic_set_rxfh,
@@ -972,6 +973,7 @@ static const struct ethtool_ops spnicvf_ethtool_ops = {
	.get_channels		= spnic_get_channels,
	.set_channels		= spnic_set_channels,

	.get_rxfh_indir_size	= spnic_get_rxfh_indir_size,
	.get_rxfh_key_size	= spnic_get_rxfh_key_size,
	.get_rxfh		= spnic_get_rxfh,
	.set_rxfh		= spnic_set_rxfh,
+5 −0
Original line number Diff line number Diff line
@@ -681,6 +681,11 @@ static int set_rss_rxfh(struct net_device *netdev, const u32 *indir, const u8 *k
	return 0;
}

u32 spnic_get_rxfh_indir_size(struct net_device *netdev)
{
	return SPNIC_RSS_INDIR_SIZE;
}

u32 spnic_get_rxfh_key_size(struct net_device *netdev)
{
	return SPNIC_RSS_KEY_SIZE;
+2 −0
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@ void spnic_get_channels(struct net_device *netdev, struct ethtool_channels *chan

int spnic_set_channels(struct net_device *netdev, struct ethtool_channels *channels);

u32 spnic_get_rxfh_indir_size(struct net_device *netdev);

u32 spnic_get_rxfh_key_size(struct net_device *netdev);

int spnic_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, u8 *hfunc);