netlink(kernel) returns the string values in a c-style
manner terminating with null.
when converting to go string these need to be removed
as done in other places in the project.
keeping the null terminating char prevents comparing
devlink dev/port string attributes as the `==` string
operand will fail.
Signed-off-by: Adrian Chiris <adrianc@nvidia.com>
Add APIs to add and delete a devlink port of specified flavour for a
given devlink device.
Extended test to accept devlink device and sf number parameters from the
test command line.
Signed-off-by: Parav Pandit <parav@nvidia.com>
Add a command to get information about a specific devlink port
referenced by device name and port index(bus, device, port index).
Signed-off-by: Parav Pandit <parav@mellanox.com>
Devlink device currently has legacy and switchdev mode.
Add an API to set devlink device mode for discovered devlink device.
Signed-off-by: Parav Pandit <parav@mellanox.com>
Add a command to get information about a specific devlink device
referenced by device name (bus, device).
Remove unused setupDevlinkKModule().
Signed-off-by: Parav Pandit <parav@mellanox.com>
This patch adds very basic support for getting information about
devlink devices which are typically PCI devices which exposes Networking
switch or legacy devices.
This information includes bus name, device name and eswitch modes.
This is done through devlink family of commands via generic netlink
sockets provided by Linux kernel.
DevlinkDevice represents a devlink device which is identified by bus
name and device name (unlike interface index for netdevices).
It contains the DevlinkDevAttrs device attributes.
Currently only eswitch attributes are queried. In future more attributes
such as port, shared buffer, traffic class will be added.
Signed-off-by: Parav Pandit <parav@mellanox.com>