Skip to content

Commit a258c80

Browse files
halfboy93kuba-moo
authored andcommitted
docs: fix info about representor identification
Update the "How are representors identified?" documentation subchapter. For newer kernels driver should use SET_NETDEV_DEVLINK_PORT instead of ndo_get_devlink_port() callback. Fixes: 7712b3e ("Merge branch 'net-fix-netdev-to-devlink_port-linkage-and-expose-to-user'") Signed-off-by: Mateusz Polchlopek <mateusz.polchlopek@intel.com> Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Reviewed-by: Edward Cree <ecree.xilinx@gmail.com> Link: https://lore.kernel.org/r/20231012123144.15768-1-mateusz.polchlopek@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 0f4d44f commit a258c80

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

Documentation/networking/representors.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,11 @@ How are representors identified?
162162
The representor netdevice should *not* directly refer to a PCIe device (e.g.
163163
through ``net_dev->dev.parent`` / ``SET_NETDEV_DEV()``), either of the
164164
representee or of the switchdev function.
165-
Instead, it should implement the ``ndo_get_devlink_port()`` netdevice op, which
166-
the kernel uses to provide the ``phys_switch_id`` and ``phys_port_name`` sysfs
167-
nodes. (Some legacy drivers implement ``ndo_get_port_parent_id()`` and
165+
Instead, the driver should use the ``SET_NETDEV_DEVLINK_PORT`` macro to
166+
assign a devlink port instance to the netdevice before registering the
167+
netdevice; the kernel uses the devlink port to provide the ``phys_switch_id``
168+
and ``phys_port_name`` sysfs nodes.
169+
(Some legacy drivers implement ``ndo_get_port_parent_id()`` and
168170
``ndo_get_phys_port_name()`` directly, but this is deprecated.) See
169171
:ref:`Documentation/networking/devlink/devlink-port.rst <devlink_port>` for the
170172
details of this API.

0 commit comments

Comments
 (0)