Commit 2f076ea8 authored by Ryno Swart's avatar Ryno Swart Committed by Jakub Kicinski

nfp: devlink: add extended ack report messages

Add descriptive error messages to common devlink failures to
be more user friendly.
Signed-off-by: default avatarRyno Swart <ryno.swart@corigine.com>
Signed-off-by: default avatarLouis Peens <louis.peens@corigine.com>
Link: https://lore.kernel.org/r/20231206151209.20296-3-louis.peens@corigine.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent b0318e28
...@@ -75,8 +75,10 @@ nfp_devlink_port_split(struct devlink *devlink, struct devlink_port *port, ...@@ -75,8 +75,10 @@ nfp_devlink_port_split(struct devlink *devlink, struct devlink_port *port,
if (ret) if (ret)
return 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; return -EINVAL;
}
/* Special case the 100G CXP -> 2x40G split */ /* Special case the 100G CXP -> 2x40G split */
lanes = eth_port.port_lanes / count; lanes = eth_port.port_lanes / count;
...@@ -101,8 +103,10 @@ nfp_devlink_port_unsplit(struct devlink *devlink, struct devlink_port *port, ...@@ -101,8 +103,10 @@ nfp_devlink_port_unsplit(struct devlink *devlink, struct devlink_port *port,
if (ret) if (ret)
return 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; return -EINVAL;
}
/* Special case the 100G CXP -> 2x40G unsplit */ /* Special case the 100G CXP -> 2x40G unsplit */
lanes = eth_port.port_lanes; lanes = eth_port.port_lanes;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment