PF interface part of LAG should not allow driver reinit via devlink. The
Bond config will be lost due to driver reinit. ice_devlink_reload_down is
called before PF driver reinit. If PF is attached to bond,
ice_devlink_reload_down returns error.
Fixes: trailer
Reviewed-by: Jacob Keller <[email protected]>
Signed-off-by: Sachin Bahadur <[email protected]>
---
drivers/net/ethernet/intel/ice/ice_devlink.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/intel/ice/ice_devlink.c b/drivers/net/ethernet/intel/ice/ice_devlink.c
index f4e24d11ebd0..5fe88e949b09 100644
--- a/drivers/net/ethernet/intel/ice/ice_devlink.c
+++ b/drivers/net/ethernet/intel/ice/ice_devlink.c
@@ -457,6 +457,10 @@ ice_devlink_reload_down(struct devlink *devlink, bool netns_change,
"Remove all VFs before doing reinit\n");
return -EOPNOTSUPP;
}
+ if (pf->lag && pf->lag->bonded) {
+ NL_SET_ERR_MSG_MOD(extack, "Remove all associated Bonds before doing reinit");
+ return -EBUSY;
+ }
ice_unload(pf);
return 0;
case DEVLINK_RELOAD_ACTION_FW_ACTIVATE:
--
2.25.1
Fri, Nov 17, 2023 at 05:44:27PM CET, [email protected] wrote:
>PF interface part of LAG should not allow driver reinit via devlink. The
>Bond config will be lost due to driver reinit. ice_devlink_reload_down is
Reinit whould remove and re-create netdevices. This patch should not be
needed.
>called before PF driver reinit. If PF is attached to bond,
>ice_devlink_reload_down returns error.
>
>Fixes: trailer
>Reviewed-by: Jacob Keller <[email protected]>
>Signed-off-by: Sachin Bahadur <[email protected]>
>---
> drivers/net/ethernet/intel/ice/ice_devlink.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
>diff --git a/drivers/net/ethernet/intel/ice/ice_devlink.c b/drivers/net/ethernet/intel/ice/ice_devlink.c
>index f4e24d11ebd0..5fe88e949b09 100644
>--- a/drivers/net/ethernet/intel/ice/ice_devlink.c
>+++ b/drivers/net/ethernet/intel/ice/ice_devlink.c
>@@ -457,6 +457,10 @@ ice_devlink_reload_down(struct devlink *devlink, bool netns_change,
> "Remove all VFs before doing reinit\n");
> return -EOPNOTSUPP;
> }
>+ if (pf->lag && pf->lag->bonded) {
>+ NL_SET_ERR_MSG_MOD(extack, "Remove all associated Bonds before doing reinit");
>+ return -EBUSY;
>+ }
> ice_unload(pf);
> return 0;
> case DEVLINK_RELOAD_ACTION_FW_ACTIVATE:
>--
>2.25.1
>
>