Re: [PATCH v11 net-next 3/8] net: ena: Add device reload capability through devlink
From: Jiri Pirko <jiri@resnulli.us>
Date: 2025-05-26 09:51:19
From: Jiri Pirko <jiri@resnulli.us>
Date: 2025-05-26 09:51:19
Mon, May 26, 2025 at 08:09:13AM +0200, darinzon@amazon.com wrote: [..]
+static int ena_devlink_reload_down(struct devlink *devlink,
+ bool netns_change,
+ enum devlink_reload_action action,
+ enum devlink_reload_limit limit,
+ struct netlink_ext_ack *extack)
+{
+ struct ena_adapter *adapter = ENA_DEVLINK_PRIV(devlink);
+
+ if (netns_change) {
+ NL_SET_ERR_MSG_MOD(extack,
+ "Namespace change is not supported");
+ return -EOPNOTSUPP;
+ }
+
+ if (action != DEVLINK_RELOAD_ACTION_DRIVER_REINIT) {
+ NL_SET_ERR_MSG_MOD(extack,
+ "Action is not supported");Why you need this check? devlink_reload_action_is_supported() is checking that in devlink_nl_reload_doit()
+ return -EOPNOTSUPP;
+ }
+ if (limit != DEVLINK_RELOAD_LIMIT_UNSPEC) {
+ NL_SET_ERR_MSG_MOD(extack,
+ "Driver reload doesn't support limitations");Same here.
+ return -EOPNOTSUPP; + } + + rtnl_lock(); + ena_destroy_device(adapter, false); + rtnl_unlock(); + + return 0; +}
[..]