net: ethtool: add an extack parameter to new rxfh_context APIs
Currently passed as NULL, but will allow drivers to report back errors when ethnl support for these ops is added. Signed-off-by: Edward Cree <ecree.xilinx@gmail.com> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Link: https://patch.msgid.link/6e0012347d175fdd1280363d7bfa76a2f2777e17.1719502240.git.ecree.xilinx@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>pull/839/head^2^2
parent
847a8ab186
commit
30a32cdf6b
|
|
@ -1004,13 +1004,16 @@ struct ethtool_ops {
|
||||||
struct netlink_ext_ack *extack);
|
struct netlink_ext_ack *extack);
|
||||||
int (*create_rxfh_context)(struct net_device *,
|
int (*create_rxfh_context)(struct net_device *,
|
||||||
struct ethtool_rxfh_context *ctx,
|
struct ethtool_rxfh_context *ctx,
|
||||||
const struct ethtool_rxfh_param *rxfh);
|
const struct ethtool_rxfh_param *rxfh,
|
||||||
|
struct netlink_ext_ack *extack);
|
||||||
int (*modify_rxfh_context)(struct net_device *,
|
int (*modify_rxfh_context)(struct net_device *,
|
||||||
struct ethtool_rxfh_context *ctx,
|
struct ethtool_rxfh_context *ctx,
|
||||||
const struct ethtool_rxfh_param *rxfh);
|
const struct ethtool_rxfh_param *rxfh,
|
||||||
|
struct netlink_ext_ack *extack);
|
||||||
int (*remove_rxfh_context)(struct net_device *,
|
int (*remove_rxfh_context)(struct net_device *,
|
||||||
struct ethtool_rxfh_context *ctx,
|
struct ethtool_rxfh_context *ctx,
|
||||||
u32 rss_context);
|
u32 rss_context,
|
||||||
|
struct netlink_ext_ack *extack);
|
||||||
void (*get_channels)(struct net_device *, struct ethtool_channels *);
|
void (*get_channels)(struct net_device *, struct ethtool_channels *);
|
||||||
int (*set_channels)(struct net_device *, struct ethtool_channels *);
|
int (*set_channels)(struct net_device *, struct ethtool_channels *);
|
||||||
int (*get_dump_flag)(struct net_device *, struct ethtool_dump *);
|
int (*get_dump_flag)(struct net_device *, struct ethtool_dump *);
|
||||||
|
|
|
||||||
|
|
@ -11256,7 +11256,7 @@ static void netdev_rss_contexts_free(struct net_device *dev)
|
||||||
xa_erase(&dev->ethtool->rss_ctx, context);
|
xa_erase(&dev->ethtool->rss_ctx, context);
|
||||||
if (dev->ethtool_ops->create_rxfh_context)
|
if (dev->ethtool_ops->create_rxfh_context)
|
||||||
dev->ethtool_ops->remove_rxfh_context(dev, ctx,
|
dev->ethtool_ops->remove_rxfh_context(dev, ctx,
|
||||||
context);
|
context, NULL);
|
||||||
else
|
else
|
||||||
dev->ethtool_ops->set_rxfh(dev, &rxfh, NULL);
|
dev->ethtool_ops->set_rxfh(dev, &rxfh, NULL);
|
||||||
kfree(ctx);
|
kfree(ctx);
|
||||||
|
|
|
||||||
|
|
@ -1426,12 +1426,15 @@ static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev,
|
||||||
|
|
||||||
if (rxfh.rss_context && ops->create_rxfh_context) {
|
if (rxfh.rss_context && ops->create_rxfh_context) {
|
||||||
if (create)
|
if (create)
|
||||||
ret = ops->create_rxfh_context(dev, ctx, &rxfh_dev);
|
ret = ops->create_rxfh_context(dev, ctx, &rxfh_dev,
|
||||||
|
extack);
|
||||||
else if (rxfh_dev.rss_delete)
|
else if (rxfh_dev.rss_delete)
|
||||||
ret = ops->remove_rxfh_context(dev, ctx,
|
ret = ops->remove_rxfh_context(dev, ctx,
|
||||||
rxfh.rss_context);
|
rxfh.rss_context,
|
||||||
|
extack);
|
||||||
else
|
else
|
||||||
ret = ops->modify_rxfh_context(dev, ctx, &rxfh_dev);
|
ret = ops->modify_rxfh_context(dev, ctx, &rxfh_dev,
|
||||||
|
extack);
|
||||||
} else {
|
} else {
|
||||||
ret = ops->set_rxfh(dev, &rxfh_dev, extack);
|
ret = ops->set_rxfh(dev, &rxfh_dev, extack);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue