Commit 812df69b authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

net: liquidio: reject unsupported coalescing params

Set ethtool_ops->supported_coalesce_params to let
the core reject unsupported coalescing parameters.

This driver did not previously reject unsupported parameters.
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 659d0760
...@@ -3097,7 +3097,17 @@ static int lio_set_fecparam(struct net_device *netdev, ...@@ -3097,7 +3097,17 @@ static int lio_set_fecparam(struct net_device *netdev,
return 0; return 0;
} }
#define LIO_ETHTOOL_COALESCE (ETHTOOL_COALESCE_RX_USECS | \
ETHTOOL_COALESCE_MAX_FRAMES | \
ETHTOOL_COALESCE_USE_ADAPTIVE | \
ETHTOOL_COALESCE_RX_MAX_FRAMES_LOW | \
ETHTOOL_COALESCE_TX_MAX_FRAMES_LOW | \
ETHTOOL_COALESCE_RX_MAX_FRAMES_HIGH | \
ETHTOOL_COALESCE_TX_MAX_FRAMES_HIGH | \
ETHTOOL_COALESCE_PKT_RATE_RX_USECS)
static const struct ethtool_ops lio_ethtool_ops = { static const struct ethtool_ops lio_ethtool_ops = {
.supported_coalesce_params = LIO_ETHTOOL_COALESCE,
.get_link_ksettings = lio_get_link_ksettings, .get_link_ksettings = lio_get_link_ksettings,
.set_link_ksettings = lio_set_link_ksettings, .set_link_ksettings = lio_set_link_ksettings,
.get_fecparam = lio_get_fecparam, .get_fecparam = lio_get_fecparam,
...@@ -3128,6 +3138,7 @@ static const struct ethtool_ops lio_ethtool_ops = { ...@@ -3128,6 +3138,7 @@ static const struct ethtool_ops lio_ethtool_ops = {
}; };
static const struct ethtool_ops lio_vf_ethtool_ops = { static const struct ethtool_ops lio_vf_ethtool_ops = {
.supported_coalesce_params = LIO_ETHTOOL_COALESCE,
.get_link_ksettings = lio_get_link_ksettings, .get_link_ksettings = lio_get_link_ksettings,
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.get_drvinfo = lio_get_vf_drvinfo, .get_drvinfo = lio_get_vf_drvinfo,
......
...@@ -211,6 +211,11 @@ bool ethtool_convert_link_mode_to_legacy_u32(u32 *legacy_u32, ...@@ -211,6 +211,11 @@ bool ethtool_convert_link_mode_to_legacy_u32(u32 *legacy_u32,
ETHTOOL_COALESCE_TX_MAX_FRAMES_IRQ) ETHTOOL_COALESCE_TX_MAX_FRAMES_IRQ)
#define ETHTOOL_COALESCE_USE_ADAPTIVE \ #define ETHTOOL_COALESCE_USE_ADAPTIVE \
(ETHTOOL_COALESCE_USE_ADAPTIVE_RX | ETHTOOL_COALESCE_USE_ADAPTIVE_TX) (ETHTOOL_COALESCE_USE_ADAPTIVE_RX | ETHTOOL_COALESCE_USE_ADAPTIVE_TX)
#define ETHTOOL_COALESCE_PKT_RATE_RX_USECS \
(ETHTOOL_COALESCE_USE_ADAPTIVE_RX | \
ETHTOOL_COALESCE_RX_USECS_LOW | ETHTOOL_COALESCE_RX_USECS_HIGH | \
ETHTOOL_COALESCE_PKT_RATE_LOW | ETHTOOL_COALESCE_PKT_RATE_HIGH | \
ETHTOOL_COALESCE_RATE_SAMPLE_INTERVAL)
/** /**
* struct ethtool_ops - optional netdev operations * struct ethtool_ops - optional netdev operations
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment