nfp: devlink: add extended ack report messages

Add descriptive error messages to common devlink failures to
be more user friendly.

Signed-off-by: Ryno Swart <ryno.swart@corigine.com>
Signed-off-by: Louis Peens <louis.peens@corigine.com>
Link: https://lore.kernel.org/r/20231206151209.20296-3-louis.peens@corigine.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Ryno Swart 2023-12-06 17:12:09 +02:00 committed by Jakub Kicinski
parent b0318e2854
commit 2f076ea866

View file

@ -75,8 +75,10 @@ nfp_devlink_port_split(struct devlink *devlink, struct devlink_port *port,
if (ret)
return ret;
if (eth_port.port_lanes % count)
if (eth_port.port_lanes % count) {
NL_SET_ERR_MSG_MOD(extack, "invalid count");
return -EINVAL;
}
/* Special case the 100G CXP -> 2x40G split */
lanes = eth_port.port_lanes / count;
@ -101,8 +103,10 @@ nfp_devlink_port_unsplit(struct devlink *devlink, struct devlink_port *port,
if (ret)
return ret;
if (!eth_port.is_split)
if (!eth_port.is_split) {
NL_SET_ERR_MSG_MOD(extack, "port is not split");
return -EINVAL;
}
/* Special case the 100G CXP -> 2x40G unsplit */
lanes = eth_port.port_lanes;