nfp: fill splittable of devlink_port_attrs correctly
authorDiana Wang <na.wang@corigine.com>
Thu, 17 Nov 2022 15:37:43 +0000 (16:37 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 19 Nov 2022 03:41:20 +0000 (19:41 -0800)
commit4abd9600b9d15d3d92a9ac25cf200422a4c415ee
treeafd11950231c40ac430673183d03adbb72231c00
parent5619537284f1017e9f6c7500b02b859b3830a06d
nfp: fill splittable of devlink_port_attrs correctly

The error is reflected in that it shows wrong splittable status of
port when executing "devlink port show".
The reason which leads the error is that the assigned operation of
splittable is just a simple negation operation of split and it does
not consider port lanes quantity. A splittable port should have
several lanes that can be split(lanes quantity > 1).
If without the judgement, it will show wrong message for some
firmware, such as 2x25G, 2x10G.

Fixes: a0f49b548652 ("devlink: Add a new devlink port split ability attribute and pass to netlink")
Signed-off-by: Diana Wang <na.wang@corigine.com>
Reviewed-by: Louis Peens <louis.peens@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/netronome/nfp/nfp_devlink.c