Message ID | 20231010120845.151531-1-mateusz.polchlopek@intel.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net,v3] docs: fix info about representor identification | expand |
On 10/10/2023 13:08, Mateusz Polchlopek wrote: > Update the "How are representors identified?" documentation > subchapter. For newer kernels driver developers should use > SET_NETDEV_DEVLINK_PORT instead of ndo_get_devlink_port() > callback. > > --- > v3: > - fixed the lack of hyphen in changelog > > v2: > - targeting -net, without IWL > https://lore.kernel.org/netdev/20231009111544.143609-1-mateusz.polchlopek@intel.com/ > > v1: > https://lore.kernel.org/netdev/20231006091412.92156-1-mateusz.polchlopek@intel.com/ > --- > > Fixes: 7712b3e966ea ("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> > --- > Documentation/networking/representors.rst | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/Documentation/networking/representors.rst b/Documentation/networking/representors.rst > index ee1f5cd54496..2d6b7b493fa6 100644 > --- a/Documentation/networking/representors.rst > +++ b/Documentation/networking/representors.rst > @@ -162,9 +162,9 @@ How are representors identified? > The representor netdevice should *not* directly refer to a PCIe device (e.g. > through ``net_dev->dev.parent`` / ``SET_NETDEV_DEV()``), either of the > representee or of the switchdev function. > -Instead, it should implement the ``ndo_get_devlink_port()`` netdevice op, which > -the kernel uses to provide the ``phys_switch_id`` and ``phys_port_name`` sysfs > -nodes. (Some legacy drivers implement ``ndo_get_port_parent_id()`` and > +Instead, driver developers should use ``SET_NETDEV_DEVLINK_PORT`` macro to > +assign devlink port instance to a netdevice before it registers the netdevice. > +(Some legacy drivers implement ``ndo_get_port_parent_id()`` and > ``ndo_get_phys_port_name()`` directly, but this is deprecated.) See > :ref:`Documentation/networking/devlink/devlink-port.rst <devlink_port>` for the > details of this API. I think the text as a whole would be clearer if you kept in the language about the kernel using the devlink port to provide the sysfs nodes. Otherwise the reader will be confused as to why we suddenly start talking about them in the parenthetical. How about: Instead, the driver should use the ``SET_NETDEV_DEVLINK_PORT`` macro to assign a devlink port instance to the netdevice before registering the netdevice; the kernel uses the devlink port to provide the ``phys_switch_id`` and ``phys_port_name`` sysfs nodes. (Some legacy drivers implement ``ndo_get_port_parent_id()`` and -ed
diff --git a/Documentation/networking/representors.rst b/Documentation/networking/representors.rst index ee1f5cd54496..2d6b7b493fa6 100644 --- a/Documentation/networking/representors.rst +++ b/Documentation/networking/representors.rst @@ -162,9 +162,9 @@ How are representors identified? The representor netdevice should *not* directly refer to a PCIe device (e.g. through ``net_dev->dev.parent`` / ``SET_NETDEV_DEV()``), either of the representee or of the switchdev function. -Instead, it should implement the ``ndo_get_devlink_port()`` netdevice op, which -the kernel uses to provide the ``phys_switch_id`` and ``phys_port_name`` sysfs -nodes. (Some legacy drivers implement ``ndo_get_port_parent_id()`` and +Instead, driver developers should use ``SET_NETDEV_DEVLINK_PORT`` macro to +assign devlink port instance to a netdevice before it registers the netdevice. +(Some legacy drivers implement ``ndo_get_port_parent_id()`` and ``ndo_get_phys_port_name()`` directly, but this is deprecated.) See :ref:`Documentation/networking/devlink/devlink-port.rst <devlink_port>` for the details of this API.