diff mbox series

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

Message ID 20240618192818.554646-1-kuba@kernel.org (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net-next] docs: net: document guidance of implementing the SR-IOV NDOs | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 845 this patch: 845
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 849 this patch: 849
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 854 this patch: 854
netdev/checkpatch warning WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-06-19--21-00 (tests: 657)

Commit Message

Jakub Kicinski June 18, 2024, 7:28 p.m. UTC
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.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: corbet@lwn.net
CC: linux-doc@vger.kernel.org
---
 Documentation/networking/index.rst |  1 +
 Documentation/networking/sriov.rst | 25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+)
 create mode 100644 Documentation/networking/sriov.rst

Comments

Randy Dunlap June 18, 2024, 8:25 p.m. UTC | #1
Hi Jakub,

some nit editing below:

On 6/18/24 12:28 PM, Jakub Kicinski wrote:
> 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.
> 
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> CC: corbet@lwn.net
> CC: linux-doc@vger.kernel.org
> ---
>  Documentation/networking/index.rst |  1 +
>  Documentation/networking/sriov.rst | 25 +++++++++++++++++++++++++
>  2 files changed, 26 insertions(+)
>  create mode 100644 Documentation/networking/sriov.rst
> 
> diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst
> index a6443851a142..b4b2a002f183 100644
> --- a/Documentation/networking/index.rst
> +++ b/Documentation/networking/index.rst
> @@ -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
> diff --git a/Documentation/networking/sriov.rst b/Documentation/networking/sriov.rst
> new file mode 100644
> index 000000000000..652ffb501e6b
> --- /dev/null
> +++ b/Documentation/networking/sriov.rst
> @@ -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

                         do not

> +the API is considered frozen, no new functionality or extensions

                         frozen; no

> +will be accepted. New drivers should not implement the uncommon callbacks,

                                                                   callbacks;

> +namely the following callbacks are off limits:
> +
> + - ``ndo_get_vf_port``
> + - ``ndo_set_vf_port``
> + - ``ndo_set_vf_rss_query_en``
Sunil Kovvuri Goutham June 19, 2024, 4:37 p.m. UTC | #2
>-----Original Message-----
>From: Jakub Kicinski <kuba@kernel.org>
>Sent: Wednesday, June 19, 2024 12:58 AM
>To: davem@davemloft.net
>Cc: netdev@vger.kernel.org; edumazet@google.com; pabeni@redhat.com; netdev-
>driver-reviewers@vger.kernel.org; Jakub Kicinski <kuba@kernel.org>;
>corbet@lwn.net; linux-doc@vger.kernel.org
>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.
>
>Signed-off-by: Jakub Kicinski <kuba@kernel.org>
>---
>CC: corbet@lwn.net
>CC: linux-doc@vger.kernel.org
>---
> Documentation/networking/index.rst |  1 +  Documentation/networking/sriov.rst
>| 25 +++++++++++++++++++++++++
> 2 files changed, 26 insertions(+)
> create mode 100644 Documentation/networking/sriov.rst
>
>diff --git a/Documentation/networking/index.rst
>b/Documentation/networking/index.rst
>index a6443851a142..b4b2a002f183 100644
>--- a/Documentation/networking/index.rst
>+++ b/Documentation/networking/index.rst
>@@ -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
>diff --git a/Documentation/networking/sriov.rst
>b/Documentation/networking/sriov.rst
>new file mode 100644
>index 000000000000..652ffb501e6b
>--- /dev/null
>+++ b/Documentation/networking/sriov.rst
>@@ -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``
>--
>2.45.2
>

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

Thanks,
Sunil.
Jakub Kicinski June 19, 2024, 4:59 p.m. UTC | #3
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!
diff mbox series

Patch

diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst
index a6443851a142..b4b2a002f183 100644
--- a/Documentation/networking/index.rst
+++ b/Documentation/networking/index.rst
@@ -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
diff --git a/Documentation/networking/sriov.rst b/Documentation/networking/sriov.rst
new file mode 100644
index 000000000000..652ffb501e6b
--- /dev/null
+++ b/Documentation/networking/sriov.rst
@@ -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``