Skip to contentSkip to conversation

docs: net: document guidance of implementing the SR-IOV NDOs

PATCH Superseded Jakub Kicinski 3 participants 4 messages Jun 18, 2024 – Jun 19, 2024

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 docs: net: document guidance of implementing the SR-IOV NDOs

New drivers were prevented from adding ndo_set_vf_* callbacks over the last few years. This was expected to result in broader switchdev adoption, but seems to have had little effect.

Based on recent netdev meeting there is broad support for allowing adding those ops.

There is a problem with the current API supporting a limited number of VFs (100+, which is less than some modern HW supports). We can try to solve it by adding similar functionality on devlink ports, but that'd be another API variation to maintain. So a netlink attribute reshuffling is a more likely outcome.

Document the guidance, make it clear that the API is frozen.

---
CC: [email protected]
CC: [email protected]

---
 Documentation/networking/index.rst |  1 +
 Documentation/networking/sriov.rst | 25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+)
 create mode 100644 Documentation/networking/sriov.rst
Documentation/networking/index.rst +1 -0
index a6443851a142..b4b2a002f183 100644
@@ -105,6 +105,7 @@ Refer to :ref:`netdev-FAQ` for a guide on netdev development process specifics.
    seg6-sysctl
    skbuff
    smc-sysctl
+   sriov
    statistics
    strparser
    switchdev
Documentation/networking/sriov.rst new file +25 -0
new file mode 100644
index 000000000000..652ffb501e6b
@@ -0,0 +1,25 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+===============
+NIC SR-IOV APIs
+===============
+
+Modern NICs are strongly encouraged to focus on implementing the ``switchdev``
+model (see :ref:`switchdev`) to configure forwarding and security of SR-IOV
+functionality.
+
+Legacy API
+==========
+
+The old SR-IOV API is implemented in ``rtnetlink`` Netlink family as part of
+the ``RTM_GETLINK`` and ``RTM_SETLINK`` commands. On the driver side
+it consists of a number of ``ndo_set_vf_*`` and ``ndo_get_vf_*`` callbacks.
+
+Since the legacy APIs does not integrate well with the rest of the stack
+the API is considered frozen, no new functionality or extensions
+will be accepted. New drivers should not implement the uncommon callbacks,
+namely the following callbacks are off limits:
+
+ - ``ndo_get_vf_port``
+ - ``ndo_set_vf_port``
+ - ``ndo_set_vf_rss_query_en``
Signature · 1 line
2.45.2
reviewer
#1 lore raw

Hi Jakub,

some nit editing below:

Quoted 51 lines · Jakub Kicinski

New drivers were prevented from adding ndo_set_vf_* callbacks over the last few years. This was expected to result in broader switchdev adoption, but seems to have had little effect.

Based on recent netdev meeting there is broad support for allowing adding those ops.

There is a problem with the current API supporting a limited number of VFs (100+, which is less than some modern HW supports). We can try to solve it by adding similar functionality on devlink ports, but that'd be another API variation to maintain. So a netlink attribute reshuffling is a more likely outcome.

Document the guidance, make it clear that the API is frozen.

---
CC: [email protected]
CC: [email protected]

---
 Documentation/networking/index.rst |  1 +
 Documentation/networking/sriov.rst | 25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+)
 create mode 100644 Documentation/networking/sriov.rst
Documentation/networking/index.rst +1 -0
index a6443851a142..b4b2a002f183 100644
@@ -105,6 +105,7 @@ Refer to :ref:`netdev-FAQ` for a guide on netdev development process specifics.
    seg6-sysctl
    skbuff
    smc-sysctl
+   sriov
    statistics
    strparser
    switchdev
Documentation/networking/sriov.rst new file +8 -0
new file mode 100644
index 000000000000..652ffb501e6b
@@ -0,0 +1,25 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+===============
+NIC SR-IOV APIs
+===============
+
+Modern NICs are strongly encouraged to focus on implementing the ``switchdev``
+model (see :ref:`switchdev`) to configure forwarding and security of SR-IOV

Documentation/networking/sriov.rst line 18

Quoted 10 lines
Documentation/networking/sriov.rst new file +10 -0
+functionality.
+
+Legacy API
+==========
+
+The old SR-IOV API is implemented in ``rtnetlink`` Netlink family as part of
+the ``RTM_GETLINK`` and ``RTM_SETLINK`` commands. On the driver side
+it consists of a number of ``ndo_set_vf_*`` and ``ndo_get_vf_*`` callbacks.
+
+Since the legacy APIs does not integrate well with the rest of the stack

do not

Documentation/networking/sriov.rst line 19

Quoted 1 line
Documentation/networking/sriov.rst new file +1 -0
+the API is considered frozen, no new functionality or extensions

frozen; no

Documentation/networking/sriov.rst line 20

Quoted 1 line
Documentation/networking/sriov.rst new file +1 -0
+will be accepted. New drivers should not implement the uncommon callbacks,
                                                                   callbacks;
Quoted 5 lines
Documentation/networking/sriov.rst new file +5 -0
+namely the following callbacks are off limits:
+
+ - ``ndo_get_vf_port``
+ - ``ndo_set_vf_port``
+ - ``ndo_set_vf_rss_query_en``
Signature · 1 line
~Randy
#2 lore raw
In reply to Jakub Kicinski
Quoted 82 lines

-----Original Message-----
From: Jakub Kicinski <[email protected]>
Sent: Wednesday, June 19, 2024 12:58 AM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; netdev- [email protected]; Jakub Kicinski <[email protected]>; [email protected]; [email protected]
Subject: [PATCH net-next] docs: net: document guidance of implementing the SR-IOV NDOs

New drivers were prevented from adding ndo_set_vf_* callbacks over the last few years. This was expected to result in broader switchdev adoption, but seems to have had little effect. Based on recent netdev meeting there is broad support for allowing adding those ops.

There is a problem with the current API supporting a limited number of VFs (100+, which is less than some modern HW supports).
We can try to solve it by adding similar functionality on devlink ports, but that'd be another API variation to maintain.
So a netlink attribute reshuffling is a more likely outcome.

Document the guidance, make it clear that the API is frozen.

---
CC: [email protected]
CC: [email protected]
---
Documentation/networking/index.rst | 1 + Documentation/networking/sriov.rst | 25 +++++++++++++++++++++++++

2 files changed, 26 insertions(+)

create mode 100644 Documentation/networking/sriov.rst

Documentation/networking/index.rst +0 -0
index a6443851a142..b4b2a002f183 100644
@@ -105,6 +105,7 @@ Refer to :ref:`netdev-FAQ` for a guide on netdev

development process specifics.
seg6-sysctl
skbuff
smc-sysctl

Documentation/networking/index.rst +1 -0
+   sriov
   statistics
   strparser
   switchdev
Documentation/networking/sriov.rst new file +25 -1
new file mode 100644
index 000000000000..652ffb501e6b
@@ -0,0 +1,25 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+===============
+NIC SR-IOV APIs
+===============
+
+Modern NICs are strongly encouraged to focus on implementing the
+``switchdev`` model (see :ref:`switchdev`) to configure forwarding and
+security of SR-IOV functionality.
+
+Legacy API
+==========
+
+The old SR-IOV API is implemented in ``rtnetlink`` Netlink family as
+part of the ``RTM_GETLINK`` and ``RTM_SETLINK`` commands. On the driver
+side it consists of a number of ``ndo_set_vf_*`` and ``ndo_get_vf_*`` callbacks.
+
+Since the legacy APIs does not integrate well with the rest of the
+stack the API is considered frozen, no new functionality or extensions
+will be accepted. New drivers should not implement the uncommon
+callbacks, namely the following callbacks are off limits:
+
+ - ``ndo_get_vf_port``
+ - ``ndo_set_vf_port``
+ - ``ndo_set_vf_rss_query_en``
--
Quoted 2 lines

2.45.2

Does this mean
ndo_set_vf_mac
ndo_set_vf_vlan
etc
will be allowed for new drivers ?

Thanks,
Sunil.

author maintainer
#3 lore raw
Quoted 5 lines · On Wed, 19 Jun 2024 16:37:02 +0000 Sunil Kovvuri Goutham wrote:

Does this mean
ndo_set_vf_mac
ndo_set_vf_vlan
etc
will be allowed for new drivers ?

Yup!