]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit0cbb61dfcfa176d82059cea7d062874c52c24877
treeafd11950231c40ac430673183d03adbb72231c00
parentf2b75750f27d06f10fd09bb119bb9538a765d2b7
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: ec6cf9c19611 ("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