Skip to contentSkip to conversation

kni: flag deprecated status at build time

PATCH Superseded Bruce Richardson 3 participants 17 messages Oct 5, 2022 – Oct 10, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 kni: flag deprecated status at build time

To ensure all users are aware of KNI's deprecated status at build time we can take the following actions:

1. disable the library by default. It can be re-enabled by setting disabled_libs to the empty string (or other string not including 'kni')

2. add support for a list of deprecated libs to the lib/meson.build file so the error message for KNI being disabled includes the fact that it is a deprecated library.

3. for the dependent NIC driver, drivers/net/kni, modify its disabled message to also reference the fact that KNI is disabled.

NOTE: This is part of the deprecation process for KNI agreed by the DPDK technical board.[1]

[1] http://mails.dpdk.org/archives/dev/2022-June/243596.html

---
 doc/guides/prog_guide/kernel_nic_interface.rst | 4 ++++
 drivers/net/kni/meson.build                    | 5 +++++
 lib/meson.build                                | 7 +++++++
 meson_options.txt                              | 2 +-
 4 files changed, 17 insertions(+), 1 deletion(-)
doc/guides/prog_guide/kernel_nic_interface.rst +4 -0
index 03b5bca958..6a564f61ca 100644
@@ -14,6 +14,10 @@ Kernel NIC Interface
    For an alternative to KNI, that does not require any out-of-tree Linux kernel modules,
    or a custom library, see :ref:`virtio_user_as_exception_path`.
 
+.. note::
+
+   KNI is disabled by default in the DPDK build.
+   To re-enable the library, remove 'kni' from the "disable_libs" meson option when configuring a build.
 
 The DPDK Kernel NIC Interface (KNI) allows userspace applications access to the Linux* control plane.
 
drivers/net/kni/meson.build +5 -0
index 2acc989694..2deb2c4166 100644
@@ -6,6 +6,11 @@ if is_windows
     reason = 'not supported on Windows'
     subdir_done()
 endif
+if not dpdk_conf.has('kni')
+    build = false
+    reason = 'needs deprecated lib, "kni"'
+    subdir_done()
+endif
 
 deps += 'kni'
 sources = files('rte_eth_kni.c')
lib/meson.build +7 -0
index c648f7d800..264a1671df 100644
@@ -85,6 +85,7 @@ optional_libs = [
         'vhost',
 ]
 
+deprecated_libs = ['kni']
 disabled_libs = []
 opt_disabled_libs = run_command(list_dir_globs, get_option('disable_libs'),
         check: true).stdout().split()
@@ -133,7 +134,13 @@ foreach l:libraries
     if disabled_libs.contains(l)
         build = false
         reason = 'explicitly disabled via build config'
+        if deprecated_libs.contains(l)
+            reason += ' (deprecated lib)'
+        endif
     else
+        if deprecated_libs.contains(l)
+            warning('Enabling deprecated library, "@0@"'.format(l))
+        endif
         subdir(l)
     endif
     if name != l
meson_options.txt +1 -1
index 8640f599ae..39af78787c 100644
@@ -8,7 +8,7 @@ option('developer_mode', type: 'feature', description:
        'turn on additional build checks relevant for DPDK developers')
 option('disable_drivers', type: 'string', value: '', description:
        'Comma-separated list of drivers to explicitly disable.')
-option('disable_libs', type: 'string', value: '', description:
+option('disable_libs', type: 'string', value: 'kni', description:
        'Comma-separated list of libraries to explicitly disable. [NOTE: not all libs can be disabled]')
 option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>', description:
        'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.')
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/2 kni: add deprecation warning at runtime

When KNI is being used at runtime, output a warning message about its deprecated status. This is part of the deprecation process for KNI agreed by the DPDK technical board.[1]

[1] http://mails.dpdk.org/archives/dev/2022-June/243596.html

---
 doc/guides/rel_notes/deprecation.rst | 6 ++----
 lib/kni/rte_kni.c                    | 2 ++
 2 files changed, 4 insertions(+), 4 deletions(-)
doc/guides/rel_notes/deprecation.rst +2 -4
index 6c2fc15c77..8d99ce5f2f 100644
@@ -44,10 +44,8 @@ Deprecation Notices
   applications - other technologies such as virtio-user are recommended instead.
   Following the DPDK technical board
   `decision <https://mails.dpdk.org/archives/dev/2021-January/197077.html>`_
-  and `refinement <http://mails.dpdk.org/archives/dev/2022-June/243596.html>`_:
-
-  * Some deprecation warnings will be added in DPDK 22.11.
-  * The KNI kernel module, library and PMD will be removed from the DPDK 23.11.
+  and `refinement <http://mails.dpdk.org/archives/dev/2022-June/243596.html>`_,
+  the KNI kernel module, library and PMD will be removed from the DPDK 23.11 release.
 
 * lib: will fix extending some enum/define breaking the ABI. There are multiple
   samples in DPDK that enum/define terminated with a ``.*MAX.*`` value which is
lib/kni/rte_kni.c +2 -0
index 7971c56bb4..eb7c10ff19 100644
@@ -96,6 +96,8 @@ static volatile int kni_fd = -1;
 int
 rte_kni_init(unsigned int max_kni_ifaces __rte_unused)
 {
+	RTE_LOG(WARNING, KNI, "WARNING: KNI is deprecated and will be removed in DPDK 23.11\n");
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
 	if (rte_eal_iova_mode() != RTE_IOVA_PA) {
 		RTE_LOG(ERR, KNI, "KNI requires IOVA as PA\n");
Signature · 1 line
2.34.1
#2 lore raw
In reply to Bruce Richardson
Quoted 19 lines

From: Bruce Richardson [mailto:[email protected]]
Sent: Wednesday, 5 October 2022 16.35

To ensure all users are aware of KNI's deprecated status at build time we can take the following actions:

1. disable the library by default. It can be re-enabled by setting disabled_libs to the empty string (or other string not including 'kni')

2. add support for a list of deprecated libs to the lib/meson.build file
so the error message for KNI being disabled includes the fact that
it
is a deprecated library.

3. for the dependent NIC driver, drivers/net/kni, modify its disabled message to also reference the fact that KNI is disabled.

Quoted 8 lines

NOTE: This is part of the deprecation process for KNI agreed by the DPDK
technical board.[1]

[1] http://mails.dpdk.org/archives/dev/2022-June/243596.html

---

Probably not required, but cannot hurt either:

#3 lore raw
In reply to Bruce Richardson
Quoted 8 lines · Bruce Richardson

To ensure all users are aware of KNI's deprecated status at build time we can take the following actions:

1. disable the library by default. It can be re-enabled by setting disabled_libs to the empty string (or other string not including 'kni')

Quoted 6 lines

2. add support for a list of deprecated libs to the lib/meson.build file so the error message for KNI being disabled includes the fact that it is a deprecated library.

3. for the dependent NIC driver, drivers/net/kni, modify its disabled message to also reference the fact that KNI is disabled.

Let's say I want to re-enable the net/kni driver.
How should I do this?

Passing -Denable_drivers=net/kni results in only getting net/kni. Passing -Denable_drivers=*/* gives the same result as passing none:
net/kni is disabled because relying on a deprecated lib.

Quoted 7 lines

NOTE: This is part of the deprecation process for KNI agreed by the DPDK technical board.[1]

[1] http://mails.dpdk.org/archives/dev/2022-June/243596.html

Signature · 1 line
David Marchand
#4 lore raw
Quoted 17 lines · David Marchand
Quoted 8 lines · Bruce Richardson

To ensure all users are aware of KNI's deprecated status at build time we can take the following actions:

1. disable the library by default. It can be re-enabled by setting disabled_libs to the empty string (or other string not including 'kni')

Quoted 6 lines

2. add support for a list of deprecated libs to the lib/meson.build file so the error message for KNI being disabled includes the fact that it is a deprecated library.

3. for the dependent NIC driver, drivers/net/kni, modify its disabled message to also reference the fact that KNI is disabled.

Quoted 7 lines

Let's say I want to re-enable the net/kni driver.
How should I do this?

Passing -Denable_drivers=net/kni results in only getting net/kni. Passing -Denable_drivers=*/* gives the same result as passing none:
net/kni is disabled because relying on a deprecated lib.

Well, the error message still says that the library part is missing and that is why is has been disabled. In terms of enabling the library itself, from the doc part of the patch:

+.. note::
+
+ KNI is disabled by default in the DPDK build.
+ To re-enable the library, remove 'kni' from the "disable_libs" meson option when configuring a build.

I can similarly add a note to the net/kni documentation to say that it will be disabled by default because KNI is, and to re-enable it just enable KNI lib as described there. Is something like that needed, you think?

/Bruce

#5 lore raw
In reply to Bruce Richardson

Hello Bruce,

drivers/net/kni/meson.build if is_windows · line 9

Quoted 9 lines · Bruce Richardson
drivers/net/kni/meson.build +1 -0
index 2acc989694..2deb2c4166 100644
@@ -6,6 +6,11 @@ if is_windows
     reason = 'not supported on Windows'
     subdir_done()
 endif
+if not dpdk_conf.has('kni')

I think it should be:

if not dpdk_conf.has('RTE_LIB_KNI')

And to reply to your recent comment, I don't think we need to update this driver documentation.
The meson log is enough to figure out why net/kni is disabled.

Quoted 7 lines
drivers/net/kni/meson.build +4 -0
+    build = false
+    reason = 'needs deprecated lib, "kni"'
+    subdir_done()
+endif
 
 deps += 'kni'
 sources = files('rte_eth_kni.c')
Signature · 1 line
David Marchand
#6 lore raw
Quoted 16 lines · David Marchand

Hello Bruce,

drivers/net/kni/meson.build if is_windows · line 9

Quoted 9 lines · Bruce Richardson
drivers/net/kni/meson.build +1 -0
index 2acc989694..2deb2c4166 100644
@@ -6,6 +6,11 @@ if is_windows
     reason = 'not supported on Windows'
     subdir_done()
 endif
+if not dpdk_conf.has('kni')

I think it should be:

Quoted 2 lines

if not dpdk_conf.has('RTE_LIB_KNI')

Ah, yes it should, sorry. Thanks for catching that. Will do V2 with this fixed.

/Bruce

#7 lore raw

PATCH v2 1/3 kni: flag deprecated status at build time

In reply to Bruce Richardson

To ensure all users are aware of KNI's deprecated status at build time we can take the following actions:

1. disable the library by default. It can be re-enabled by setting disabled_libs to the empty string (or other string not including 'kni')

2. add support for a list of deprecated libs to the lib/meson.build file so the error message for KNI being disabled includes the fact that it is a deprecated library.

3. for the dependent NIC driver, drivers/net/kni, modify its disabled message to also reference the fact that KNI is disabled.

NOTE: This is part of the deprecation process for KNI agreed by the DPDK technical board.[1]

[1] http://mails.dpdk.org/archives/dev/2022-June/243596.html

---
V2: correct dpdk_conf lookup key to RTE_LIB_KNI

---
 doc/guides/prog_guide/kernel_nic_interface.rst | 4 ++++
 drivers/net/kni/meson.build                    | 5 +++++
 lib/meson.build                                | 7 +++++++
 meson_options.txt                              | 2 +-
 4 files changed, 17 insertions(+), 1 deletion(-)
doc/guides/prog_guide/kernel_nic_interface.rst +4 -0
index 03b5bca958..6a564f61ca 100644
@@ -14,6 +14,10 @@ Kernel NIC Interface
    For an alternative to KNI, that does not require any out-of-tree Linux kernel modules,
    or a custom library, see :ref:`virtio_user_as_exception_path`.
 
+.. note::
+
+   KNI is disabled by default in the DPDK build.
+   To re-enable the library, remove 'kni' from the "disable_libs" meson option when configuring a build.
 
 The DPDK Kernel NIC Interface (KNI) allows userspace applications access to the Linux* control plane.
 
drivers/net/kni/meson.build +5 -0
index 2acc989694..6289aa6cc3 100644
@@ -6,6 +6,11 @@ if is_windows
     reason = 'not supported on Windows'
     subdir_done()
 endif
+if not dpdk_conf.has('RTE_LIB_KNI')
+    build = false
+    reason = 'needs deprecated lib, "kni"'
+    subdir_done()
+endif
 
 deps += 'kni'
 sources = files('rte_eth_kni.c')
lib/meson.build +7 -0
index c648f7d800..264a1671df 100644
@@ -85,6 +85,7 @@ optional_libs = [
         'vhost',
 ]
 
+deprecated_libs = ['kni']
 disabled_libs = []
 opt_disabled_libs = run_command(list_dir_globs, get_option('disable_libs'),
         check: true).stdout().split()
@@ -133,7 +134,13 @@ foreach l:libraries
     if disabled_libs.contains(l)
         build = false
         reason = 'explicitly disabled via build config'
+        if deprecated_libs.contains(l)
+            reason += ' (deprecated lib)'
+        endif
     else
+        if deprecated_libs.contains(l)
+            warning('Enabling deprecated library, "@0@"'.format(l))
+        endif
         subdir(l)
     endif
     if name != l
meson_options.txt +1 -1
index 8640f599ae..39af78787c 100644
@@ -8,7 +8,7 @@ option('developer_mode', type: 'feature', description:
        'turn on additional build checks relevant for DPDK developers')
 option('disable_drivers', type: 'string', value: '', description:
        'Comma-separated list of drivers to explicitly disable.')
-option('disable_libs', type: 'string', value: '', description:
+option('disable_libs', type: 'string', value: 'kni', description:
        'Comma-separated list of libraries to explicitly disable. [NOTE: not all libs can be disabled]')
 option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>', description:
        'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.')

--
2.34.1

#8 lore raw

PATCH v2 2/3 kni: add deprecation warning at runtime

When KNI is being used at runtime, output a warning message about its deprecated status. This is part of the deprecation process for KNI agreed by the DPDK technical board.[1]

[1] http://mails.dpdk.org/archives/dev/2022-June/243596.html

---
 doc/guides/rel_notes/deprecation.rst | 6 ++----
 lib/kni/rte_kni.c                    | 2 ++
 2 files changed, 4 insertions(+), 4 deletions(-)
doc/guides/rel_notes/deprecation.rst +2 -4
index 7c74725968..41e81be6ae 100644
@@ -37,10 +37,8 @@ Deprecation Notices
   applications - other technologies such as virtio-user are recommended instead.
   Following the DPDK technical board
   `decision <https://mails.dpdk.org/archives/dev/2021-January/197077.html>`_
-  and `refinement <http://mails.dpdk.org/archives/dev/2022-June/243596.html>`_:
-
-  * Some deprecation warnings will be added in DPDK 22.11.
-  * The KNI kernel module, library and PMD will be removed from the DPDK 23.11.
+  and `refinement <http://mails.dpdk.org/archives/dev/2022-June/243596.html>`_,
+  the KNI kernel module, library and PMD will be removed from the DPDK 23.11 release.
 
 * lib: will fix extending some enum/define breaking the ABI. There are multiple
   samples in DPDK that enum/define terminated with a ``.*MAX.*`` value which is
lib/kni/rte_kni.c +2 -0
index 7971c56bb4..eb7c10ff19 100644
@@ -96,6 +96,8 @@ static volatile int kni_fd = -1;
 int
 rte_kni_init(unsigned int max_kni_ifaces __rte_unused)
 {
+	RTE_LOG(WARNING, KNI, "WARNING: KNI is deprecated and will be removed in DPDK 23.11\n");
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
 	if (rte_eal_iova_mode() != RTE_IOVA_PA) {
 		RTE_LOG(ERR, KNI, "KNI requires IOVA as PA\n");
Signature · 1 line
2.34.1
Reviewed-by on v2 2/3
#9 lore raw

Re: [PATCH v2 2/3] kni: add deprecation warning at runtime

Quoted 8 lines · Bruce Richardson

When KNI is being used at runtime, output a warning message about its deprecated status. This is part of the deprecation process for KNI agreed by the DPDK technical board.[1]

[1] http://mails.dpdk.org/archives/dev/2022-June/243596.html

Signature · 1 line
David Marchand
#10 lore raw

PATCH v2 3/3 devtools: enable kni library for test builds

In reply to Bruce Richardson

While KNI (or any other deprecated library) may be disabled by default, for build testing we need it enabled. Therefore explicitly set "disable_libs" build parameter to empty for any DPDK build where the value is not being explicitly set by the script.

---
 devtools/test-meson-builds.sh | 5 +++++
 1 file changed, 5 insertions(+)
devtools/test-meson-builds.sh +5 -0
index e20a1c1df3..3a308bc9af 100755
@@ -109,6 +109,11 @@ config () # <dir> <builddir> <meson options>
 		return
 	fi
 	options=
+	# deprecated libs may be disabled by default, so for complete builds ensure
+	# no libs are disabled
+	if ! echo $* | grep -q -- 'disable_libs' ; then
+		options="$options -Ddisable_libs="
+	fi
 	if echo $* | grep -qw -- '--default-library=shared' ; then
 		options="$options -Dexamples=all"
 	else
Signature · 1 line
2.34.1
#11 lore raw

Re: [PATCH v2 3/3] devtools: enable kni library for test builds

Quoted 5 lines · Bruce Richardson

While KNI (or any other deprecated library) may be disabled by default, for build testing we need it enabled. Therefore explicitly set "disable_libs" build parameter to empty for any DPDK build where the value is not being explicitly set by the script.

We also need an update in .ci/linux-build.sh so that KNI is still tested in GHA (esp. by ovsrobot).
It will help catch issues earlier than maintainers using test-meson-builds.sh.

Signature · 1 line
David Marchand
Reviewed-by on v2 1/3
#12 lore raw
In reply to Bruce Richardson
Quoted 15 lines · Bruce Richardson

To ensure all users are aware of KNI's deprecated status at build time we can take the following actions:

1. disable the library by default. It can be re-enabled by setting disabled_libs to the empty string (or other string not including 'kni')

2. add support for a list of deprecated libs to the lib/meson.build file so the error message for KNI being disabled includes the fact that it is a deprecated library.

3. for the dependent NIC driver, drivers/net/kni, modify its disabled message to also reference the fact that KNI is disabled.

Quoted 6 lines

NOTE: This is part of the deprecation process for KNI agreed by the DPDK technical board.[1]

[1] http://mails.dpdk.org/archives/dev/2022-June/243596.html

I suppose you wanted to go as simple as possible but let me suggest something. If you think it is not worth, I am ok with the current patch and you can add:

The suggestion:

By exposing the deprecated lib list to meson.build, we can make the deprecation warning as part of {drivers,lib}/meson.build. Then the other components depending on a deprecated library don't need to be updated.
Like:

drivers/meson.build +3 -0
index f6ba5ba4fb..f7ef22c9e6 100644
@@ -133,6 +133,9 @@ foreach subpath:subdirs
                 if not is_variable('shared_rte_' + d)
                     build = false
                     reason = 'missing internal dependency, "@0@"'.format(d)
+                    if dpdk_libs_deprecated.contains(d)
+                        reason += ' (deprecated lib)'
+                    endif
                     message('Disabling @1@ [@2@]: missing internal

dependency "@0@"'

                             .format(d, name, 'drivers/' + drv_path))
                 else
drivers/net/kni/meson.build +0 -5
index 6289aa6cc3..2acc989694 100644
@@ -6,11 +6,6 @@ if is_windows
     reason = 'not supported on Windows'
     subdir_done()
 endif
-if not dpdk_conf.has('RTE_LIB_KNI')
-    build = false
-    reason = 'needs deprecated lib, "kni"'
-    subdir_done()
-endif
 
 deps += 'kni'
 sources = files('rte_eth_kni.c')
lib/meson.build +7 -3
index 264a1671df..a17a5a986a 100644
@@ -85,7 +85,8 @@ optional_libs = [
         'vhost',
 ]
 
-deprecated_libs = ['kni']
+dpdk_libs_deprecated += ['kni']
+
 disabled_libs = []
 opt_disabled_libs = run_command(list_dir_globs, get_option('disable_libs'),
         check: true).stdout().split()
@@ -134,11 +135,11 @@ foreach l:libraries
     if disabled_libs.contains(l)
         build = false
         reason = 'explicitly disabled via build config'
-        if deprecated_libs.contains(l)
+        if dpdk_libs_deprecated.contains(l)
             reason += ' (deprecated lib)'
         endif
     else
-        if deprecated_libs.contains(l)
+        if dpdk_libs_deprecated.contains(l)
             warning('Enabling deprecated library, "@0@"'.format(l))
         endif
         subdir(l)
@@ -156,6 +157,9 @@ foreach l:libraries
         if not is_variable('shared_rte_' + d)
             build = false
             reason = 'missing internal dependency, "@0@"'.format(d)
+            if dpdk_libs_deprecated.contains(d)
+                reason += ' (deprecated lib)'
+            endif
             message('Disabling @1@ [@2@]: missing internal dependency "@0@"'
                     .format(d, name, 'lib/' + l))
         else
meson.build +1 -0
index 8b1b09ead5..8a2d64efef 100644
@@ -42,6 +42,7 @@ dpdk_chkinc_headers = []
 dpdk_driver_classes = []
 dpdk_drivers = []
 dpdk_extra_ldflags = []
+dpdk_libs_deprecated = []
 dpdk_libs_disabled = []
 dpdk_drvs_disabled = []
 testpmd_drivers_sources = []
#13 lore raw

PATCH v3 1/3 kni: flag deprecated status at build time

In reply to Bruce Richardson

To ensure all users are aware of KNI's deprecated status at build time we can take the following actions:

1. disable the library by default. It can be re-enabled by setting disabled_libs to the empty string (or other string not including 'kni')

2. add support for a list of deprecated libs to the lib/meson.build file so the error message for KNI being disabled includes the fact that it is a deprecated library.

3. for the dependent NIC driver, drivers/net/kni, modify the driver build code to similarly flag the deprecation in the reason why the driver is not being built..

NOTE: This is part of the deprecation process for KNI agreed by the DPDK technical board.[1]

[1] http://mails.dpdk.org/archives/dev/2022-June/243596.html

---
V3: Incorporate code from David M. to generalise the driver dependency
handling of deprecated libs.
V2: correct dpdk_conf lookup key to RTE_LIB_KNI

---
 doc/guides/prog_guide/kernel_nic_interface.rst |  4 ++++
 drivers/meson.build                            |  3 +++
 lib/meson.build                                | 11 +++++++++++
 meson.build                                    |  1 +
 meson_options.txt                              |  2 +-
 5 files changed, 20 insertions(+), 1 deletion(-)
doc/guides/prog_guide/kernel_nic_interface.rst +4 -0
index 03b5bca958..6a564f61ca 100644
@@ -14,6 +14,10 @@ Kernel NIC Interface
    For an alternative to KNI, that does not require any out-of-tree Linux kernel modules,
    or a custom library, see :ref:`virtio_user_as_exception_path`.
 
+.. note::
+
+   KNI is disabled by default in the DPDK build.
+   To re-enable the library, remove 'kni' from the "disable_libs" meson option when configuring a build.
 
 The DPDK Kernel NIC Interface (KNI) allows userspace applications access to the Linux* control plane.
 
drivers/meson.build +3 -0
index f6ba5ba4fb..f7ef22c9e6 100644
@@ -133,6 +133,9 @@ foreach subpath:subdirs
                 if not is_variable('shared_rte_' + d)
                     build = false
                     reason = 'missing internal dependency, "@0@"'.format(d)
+                    if dpdk_libs_deprecated.contains(d)
+                        reason += ' (deprecated lib)'
+                    endif
                     message('Disabling @1@ [@2@]: missing internal dependency "@0@"'
                             .format(d, name, 'drivers/' + drv_path))
                 else
lib/meson.build +11 -0
index c648f7d800..a17a5a986a 100644
@@ -85,6 +85,8 @@ optional_libs = [
         'vhost',
 ]
 
+dpdk_libs_deprecated += ['kni']
+
 disabled_libs = []
 opt_disabled_libs = run_command(list_dir_globs, get_option('disable_libs'),
         check: true).stdout().split()
@@ -133,7 +135,13 @@ foreach l:libraries
     if disabled_libs.contains(l)
         build = false
         reason = 'explicitly disabled via build config'
+        if dpdk_libs_deprecated.contains(l)
+            reason += ' (deprecated lib)'
+        endif
     else
+        if dpdk_libs_deprecated.contains(l)
+            warning('Enabling deprecated library, "@0@"'.format(l))
+        endif
         subdir(l)
     endif
     if name != l
@@ -149,6 +157,9 @@ foreach l:libraries
         if not is_variable('shared_rte_' + d)
             build = false
             reason = 'missing internal dependency, "@0@"'.format(d)
+            if dpdk_libs_deprecated.contains(d)
+                reason += ' (deprecated lib)'
+            endif
             message('Disabling @1@ [@2@]: missing internal dependency "@0@"'
                     .format(d, name, 'lib/' + l))
         else
meson.build +1 -0
index cf3343a547..1d35a255c3 100644
@@ -40,6 +40,7 @@ dpdk_chkinc_headers = []
 dpdk_driver_classes = []
 dpdk_drivers = []
 dpdk_extra_ldflags = []
+dpdk_libs_deprecated = []
 dpdk_libs_disabled = []
 dpdk_drvs_disabled = []
 testpmd_drivers_sources = []
meson_options.txt +1 -1
index 8640f599ae..39af78787c 100644
@@ -8,7 +8,7 @@ option('developer_mode', type: 'feature', description:
        'turn on additional build checks relevant for DPDK developers')
 option('disable_drivers', type: 'string', value: '', description:
        'Comma-separated list of drivers to explicitly disable.')
-option('disable_libs', type: 'string', value: '', description:
+option('disable_libs', type: 'string', value: 'kni', description:
        'Comma-separated list of libraries to explicitly disable. [NOTE: not all libs can be disabled]')
 option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>', description:
        'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.')
Signature · 1 line
2.34.1
#14 lore raw

PATCH v3 2/3 kni: add deprecation warning at runtime

When KNI is being used at runtime, output a warning message about its deprecated status. This is part of the deprecation process for KNI agreed by the DPDK technical board.[1]

[1] http://mails.dpdk.org/archives/dev/2022-June/243596.html

---
 doc/guides/rel_notes/deprecation.rst | 6 ++----
 lib/kni/rte_kni.c                    | 2 ++
 2 files changed, 4 insertions(+), 4 deletions(-)
doc/guides/rel_notes/deprecation.rst +2 -4
index 7c74725968..41e81be6ae 100644
@@ -37,10 +37,8 @@ Deprecation Notices
   applications - other technologies such as virtio-user are recommended instead.
   Following the DPDK technical board
   `decision <https://mails.dpdk.org/archives/dev/2021-January/197077.html>`_
-  and `refinement <http://mails.dpdk.org/archives/dev/2022-June/243596.html>`_:
-
-  * Some deprecation warnings will be added in DPDK 22.11.
-  * The KNI kernel module, library and PMD will be removed from the DPDK 23.11.
+  and `refinement <http://mails.dpdk.org/archives/dev/2022-June/243596.html>`_,
+  the KNI kernel module, library and PMD will be removed from the DPDK 23.11 release.
 
 * lib: will fix extending some enum/define breaking the ABI. There are multiple
   samples in DPDK that enum/define terminated with a ``.*MAX.*`` value which is
lib/kni/rte_kni.c +2 -0
index 7971c56bb4..eb7c10ff19 100644
@@ -96,6 +96,8 @@ static volatile int kni_fd = -1;
 int
 rte_kni_init(unsigned int max_kni_ifaces __rte_unused)
 {
+	RTE_LOG(WARNING, KNI, "WARNING: KNI is deprecated and will be removed in DPDK 23.11\n");
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
 	if (rte_eal_iova_mode() != RTE_IOVA_PA) {
 		RTE_LOG(ERR, KNI, "KNI requires IOVA as PA\n");
Signature · 1 line
2.34.1
#15 lore raw

PATCH v3 3/3 devtools: enable kni library for test builds

In reply to Bruce Richardson

While KNI (or any other deprecated library) may be disabled by default, for build testing we need it enabled. Therefore explicitly set "disable_libs" build parameter to empty for any DPDK build where the value is not being explicitly set by the script.

---
V3: Add disable_libs parameter clearing to CI jobs

---
 .ci/linux-build.sh            | 2 ++
 devtools/test-meson-builds.sh | 5 +++++
 2 files changed, 7 insertions(+)
.ci/linux-build.sh +2 -0
index 06104eca22..14148fef4a 100755
@@ -107,6 +107,8 @@ OPTS="$OPTS -Dcheck_includes=true"
 if [ "$MINI" = "true" ]; then
     OPTS="$OPTS -Denable_drivers=net/null"
     OPTS="$OPTS -Ddisable_libs=*"
+else
+    OPTS="$OPTS -Ddisable_libs="
 fi
 
 if [ "$ASAN" = "true" ]; then
devtools/test-meson-builds.sh +5 -0
index e20a1c1df3..3a308bc9af 100755
@@ -109,6 +109,11 @@ config () # <dir> <builddir> <meson options>
 		return
 	fi
 	options=
+	# deprecated libs may be disabled by default, so for complete builds ensure
+	# no libs are disabled
+	if ! echo $* | grep -q -- 'disable_libs' ; then
+		options="$options -Ddisable_libs="
+	fi
 	if echo $* | grep -qw -- '--default-library=shared' ; then
 		options="$options -Dexamples=all"
 	else
Signature · 1 line
2.34.1
#16 lore raw
In reply to Bruce Richardson
Quoted 21 lines · Bruce Richardson

To ensure all users are aware of KNI's deprecated status at build time we can take the following actions:

1. disable the library by default. It can be re-enabled by setting disabled_libs to the empty string (or other string not including 'kni')

2. add support for a list of deprecated libs to the lib/meson.build file so the error message for KNI being disabled includes the fact that it is a deprecated library.

3. for the dependent NIC driver, drivers/net/kni, modify the driver build code to similarly flag the deprecation in the reason why the driver is not being built..

NOTE: This is part of the deprecation process for KNI agreed by the DPDK technical board.[1]

[1] http://mails.dpdk.org/archives/dev/2022-June/243596.html

Quoted 7 lines

---
V3: Incorporate code from David M. to generalise the driver dependency
handling of deprecated libs.
V2: correct dpdk_conf lookup key to RTE_LIB_KNI

Thomas had some last minute offlist comments that I handled (he was asking for introducing the deprecated library handling first, then marking kni as deprecated).
I handled it and reworked the patches, the end-result is the same.

Series applied, thanks Bruce!

Signature · 1 line
David Marchand