Skip to content

Commit 30a32cd

Browse files
Edward Creekuba-moo
authored andcommitted
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 <[email protected]> Reviewed-by: Przemek Kitszel <[email protected]> Link: https://patch.msgid.link/6e0012347d175fdd1280363d7bfa76a2f2777e17.1719502240.git.ecree.xilinx@gmail.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 847a8ab commit 30a32cd

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

include/linux/ethtool.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,13 +1004,16 @@ struct ethtool_ops {
10041004
struct netlink_ext_ack *extack);
10051005
int (*create_rxfh_context)(struct net_device *,
10061006
struct ethtool_rxfh_context *ctx,
1007-
const struct ethtool_rxfh_param *rxfh);
1007+
const struct ethtool_rxfh_param *rxfh,
1008+
struct netlink_ext_ack *extack);
10081009
int (*modify_rxfh_context)(struct net_device *,
10091010
struct ethtool_rxfh_context *ctx,
1010-
const struct ethtool_rxfh_param *rxfh);
1011+
const struct ethtool_rxfh_param *rxfh,
1012+
struct netlink_ext_ack *extack);
10111013
int (*remove_rxfh_context)(struct net_device *,
10121014
struct ethtool_rxfh_context *ctx,
1013-
u32 rss_context);
1015+
u32 rss_context,
1016+
struct netlink_ext_ack *extack);
10141017
void (*get_channels)(struct net_device *, struct ethtool_channels *);
10151018
int (*set_channels)(struct net_device *, struct ethtool_channels *);
10161019
int (*get_dump_flag)(struct net_device *, struct ethtool_dump *);

net/core/dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11256,7 +11256,7 @@ static void netdev_rss_contexts_free(struct net_device *dev)
1125611256
xa_erase(&dev->ethtool->rss_ctx, context);
1125711257
if (dev->ethtool_ops->create_rxfh_context)
1125811258
dev->ethtool_ops->remove_rxfh_context(dev, ctx,
11259-
context);
11259+
context, NULL);
1126011260
else
1126111261
dev->ethtool_ops->set_rxfh(dev, &rxfh, NULL);
1126211262
kfree(ctx);

net/ethtool/ioctl.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,12 +1426,15 @@ static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev,
14261426

14271427
if (rxfh.rss_context && ops->create_rxfh_context) {
14281428
if (create)
1429-
ret = ops->create_rxfh_context(dev, ctx, &rxfh_dev);
1429+
ret = ops->create_rxfh_context(dev, ctx, &rxfh_dev,
1430+
extack);
14301431
else if (rxfh_dev.rss_delete)
14311432
ret = ops->remove_rxfh_context(dev, ctx,
1432-
rxfh.rss_context);
1433+
rxfh.rss_context,
1434+
extack);
14331435
else
1434-
ret = ops->modify_rxfh_context(dev, ctx, &rxfh_dev);
1436+
ret = ops->modify_rxfh_context(dev, ctx, &rxfh_dev,
1437+
extack);
14351438
} else {
14361439
ret = ops->set_rxfh(dev, &rxfh_dev, extack);
14371440
}

0 commit comments

Comments
 (0)