mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
eth: ena: migrate to new RXFH callbacks
Migrate to new callbacks added by commit 9bb00786fc ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").
The driver has no other RXNFC functionality so the SET callback can
be now removed.
Reviewed-by: David Arinzon <darinzon@amazon.com>
Link: https://patch.msgid.link/20250617014555.434790-4-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
82113468a0
commit
e7860a6e18
|
|
@ -721,9 +721,11 @@ static u16 ena_flow_data_to_flow_hash(u32 hash_fields)
|
|||
return data;
|
||||
}
|
||||
|
||||
static int ena_get_rss_hash(struct ena_com_dev *ena_dev,
|
||||
struct ethtool_rxnfc *cmd)
|
||||
static int ena_get_rxfh_fields(struct net_device *netdev,
|
||||
struct ethtool_rxfh_fields *cmd)
|
||||
{
|
||||
struct ena_adapter *adapter = netdev_priv(netdev);
|
||||
struct ena_com_dev *ena_dev = adapter->ena_dev;
|
||||
enum ena_admin_flow_hash_proto proto;
|
||||
u16 hash_fields;
|
||||
int rc;
|
||||
|
|
@ -772,9 +774,12 @@ static int ena_get_rss_hash(struct ena_com_dev *ena_dev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int ena_set_rss_hash(struct ena_com_dev *ena_dev,
|
||||
struct ethtool_rxnfc *cmd)
|
||||
static int ena_set_rxfh_fields(struct net_device *netdev,
|
||||
const struct ethtool_rxfh_fields *cmd,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct ena_adapter *adapter = netdev_priv(netdev);
|
||||
struct ena_com_dev *ena_dev = adapter->ena_dev;
|
||||
enum ena_admin_flow_hash_proto proto;
|
||||
u16 hash_fields;
|
||||
|
||||
|
|
@ -816,26 +821,6 @@ static int ena_set_rss_hash(struct ena_com_dev *ena_dev,
|
|||
return ena_com_fill_hash_ctrl(ena_dev, proto, hash_fields);
|
||||
}
|
||||
|
||||
static int ena_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *info)
|
||||
{
|
||||
struct ena_adapter *adapter = netdev_priv(netdev);
|
||||
int rc = 0;
|
||||
|
||||
switch (info->cmd) {
|
||||
case ETHTOOL_SRXFH:
|
||||
rc = ena_set_rss_hash(adapter->ena_dev, info);
|
||||
break;
|
||||
case ETHTOOL_SRXCLSRLDEL:
|
||||
case ETHTOOL_SRXCLSRLINS:
|
||||
default:
|
||||
netif_err(adapter, drv, netdev,
|
||||
"Command parameter %d is not supported\n", info->cmd);
|
||||
rc = -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int ena_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *info,
|
||||
u32 *rules)
|
||||
{
|
||||
|
|
@ -847,9 +832,6 @@ static int ena_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *info,
|
|||
info->data = adapter->num_io_queues;
|
||||
rc = 0;
|
||||
break;
|
||||
case ETHTOOL_GRXFH:
|
||||
rc = ena_get_rss_hash(adapter->ena_dev, info);
|
||||
break;
|
||||
case ETHTOOL_GRXCLSRLCNT:
|
||||
case ETHTOOL_GRXCLSRULE:
|
||||
case ETHTOOL_GRXCLSRLALL:
|
||||
|
|
@ -1098,11 +1080,12 @@ static const struct ethtool_ops ena_ethtool_ops = {
|
|||
.get_strings = ena_get_ethtool_strings,
|
||||
.get_ethtool_stats = ena_get_ethtool_stats,
|
||||
.get_rxnfc = ena_get_rxnfc,
|
||||
.set_rxnfc = ena_set_rxnfc,
|
||||
.get_rxfh_indir_size = ena_get_rxfh_indir_size,
|
||||
.get_rxfh_key_size = ena_get_rxfh_key_size,
|
||||
.get_rxfh = ena_get_rxfh,
|
||||
.set_rxfh = ena_set_rxfh,
|
||||
.get_rxfh_fields = ena_get_rxfh_fields,
|
||||
.set_rxfh_fields = ena_set_rxfh_fields,
|
||||
.get_channels = ena_get_channels,
|
||||
.set_channels = ena_set_channels,
|
||||
.get_tunable = ena_get_tunable,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user