* [PATCH] net/af_packet: fix build with old kernel headers
@ 2026-11-06 14:27 Bing Zhao
2026-11-06 14:46 ` Thomas Monjalon
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: Bing Zhao @ 2026-11-06 14:27 UTC (permalink / raw)
To: dev; +Cc: stephen, frank, thomas, david.marchand
The PACKET_IGNORE_OUTGOING socket option is used unconditionally,
but it was only added to the uapi headers in Linux 4.20. The build
fails on distributions shipping older kernel headers, like RHEL 8
(kernel-headers-4.18.0-193.el8, gcc 8.5.0):
../drivers/net/af_packet/rte_eth_af_packet.c:
In function 'rte_pmd_init_internals':
../drivers/net/af_packet/rte_eth_af_packet.c:1057:41:
error: 'PACKET_IGNORE_OUTGOING' undeclared
(first use in this function); did you mean 'PACKET_OUTGOING'?
rc = setsockopt(qsockfd, SOL_PACKET, PACKET_IGNORE_OUTGOING,
^~~~~~~~~~~~~~~~~~~~~~
PACKET_OUTGOING
../drivers/net/af_packet/rte_eth_af_packet.c:1057:41:
note: each undeclared identifier is reported only once
for each function it appears in
Define the constant when the headers lack it, as is already done for
PACKET_FANOUT_FLAG_IGNORE_OUTGOING.
Kernels older than 4.20 also reject the option with ENOPROTOOPT,
which makes the probe of a single-queue port fail when
ignore_outgoing is enabled. In this case, fall back to filtering
outgoing packets in the PMD, as already done for multi-queue ports
on kernels without PACKET_FANOUT_FLAG_IGNORE_OUTGOING support.
DPDK documents Linux 5.4 as the minimum kernel, but the PMD already
tolerates older kernels for multi-queue ports. Do the same here
instead of failing the probe, for example on the 4.18 kernel of
RHEL 8.
Fixes: 3db7aa7868b2 ("net/af_packet: use kernel to filter single-queue Rx")
Signed-off-by: Bing Zhao <bingz@nvidia.com>
---
doc/guides/nics/af_packet.rst | 1 +
drivers/net/af_packet/rte_eth_af_packet.c | 16 ++++++++++++++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/doc/guides/nics/af_packet.rst b/doc/guides/nics/af_packet.rst
index 6282f1e18b..09e79ff392 100644
--- a/doc/guides/nics/af_packet.rst
+++ b/doc/guides/nics/af_packet.rst
@@ -45,6 +45,7 @@ of AF_PACKET for frame reception.
When ``ignore_outgoing`` is set, ``PACKET_IGNORE_OUTGOING`` is set for single-queue ports,
which moves the filtering from the PMD to the kernel.
+This option requires Linux 4.20; on older kernels the PMD does the filtering.
For multi-queue ports ``PACKET_FANOUT_FLAG_IGNORE_OUTGOING`` is set
to achieve the same but this only works from Linux 6.2.
For earlier Linux versions, the PMD does the filtering for multi-queue ports.
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index 44f82c0309..fbaea57615 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -32,6 +32,11 @@
#include <unistd.h>
#include <poll.h>
+/* Added in Linux 4.20. Older kernels reject it with ENOPROTOOPT. */
+#ifndef PACKET_IGNORE_OUTGOING
+#define PACKET_IGNORE_OUTGOING 23
+#endif
+
/* Added in Linux 6.2. Older kernels ignore it. */
#ifndef PACKET_FANOUT_FLAG_IGNORE_OUTGOING
#define PACKET_FANOUT_FLAG_IGNORE_OUTGOING 0x4000
@@ -916,6 +921,7 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
int qsockfd = -1;
unsigned int i, q, rdsize;
int fanout_arg;
+ bool pmd_filter;
for (k_idx = 0; k_idx < kvlist->count; k_idx++) {
pair = &kvlist->pairs[k_idx];
@@ -1053,10 +1059,16 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
#endif
}
+ pmd_filter = ignore_outgoing != 0 && nb_queues > 1;
if (ignore_outgoing != 0 && nb_queues == 1) {
rc = setsockopt(qsockfd, SOL_PACKET, PACKET_IGNORE_OUTGOING,
&ignore_outgoing, sizeof(ignore_outgoing));
- if (rc == -1) {
+ if (rc == -1 && errno == ENOPROTOOPT) {
+ PMD_LOG(INFO,
+ "%s: PACKET_IGNORE_OUTGOING not supported by kernel, filtering in PMD",
+ name);
+ pmd_filter = true;
+ } else if (rc == -1) {
PMD_LOG_ERRNO(ERR,
"%s: could not set PACKET_IGNORE_OUTGOING "
"on AF_PACKET socket for %s",
@@ -1083,7 +1095,7 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
rx_queue = &((*internals)->rx_queue[q]);
rx_queue->framecount = req->tp_frame_nr;
- rx_queue->ignore_outgoing = ignore_outgoing != 0 && nb_queues > 1;
+ rx_queue->ignore_outgoing = pmd_filter;
rx_queue->map = mmap(NULL, 2 * req->tp_block_size * req->tp_block_nr,
PROT_READ | PROT_WRITE, MAP_SHARED | MAP_LOCKED,
--
2.27.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH] net/af_packet: fix build with old kernel headers
2026-11-06 14:27 [PATCH] net/af_packet: fix build with old kernel headers Bing Zhao
@ 2026-11-06 14:46 ` Thomas Monjalon
2026-11-06 16:06 ` Frank Dressler
2026-11-09 15:47 ` [PATCH v2] " Bing Zhao
2 siblings, 0 replies; 14+ messages in thread
From: Thomas Monjalon @ 2026-11-06 14:46 UTC (permalink / raw)
To: Bing Zhao; +Cc: dev, stephen, frank, david.marchand, Kevin Traynor
06/11/2026 15:27, Bing Zhao:
> The PACKET_IGNORE_OUTGOING socket option is used unconditionally,
> but it was only added to the uapi headers in Linux 4.20. The build
> fails on distributions shipping older kernel headers, like RHEL 8
> (kernel-headers-4.18.0-193.el8, gcc 8.5.0):
+Cc Kevin for RHEL compatibility discussion.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] net/af_packet: fix build with old kernel headers
2026-11-06 14:27 [PATCH] net/af_packet: fix build with old kernel headers Bing Zhao
2026-11-06 14:46 ` Thomas Monjalon
@ 2026-11-06 16:06 ` Frank Dressler
2026-11-07 11:11 ` Frank Dressler
2026-11-09 15:47 ` [PATCH v2] " Bing Zhao
2 siblings, 1 reply; 14+ messages in thread
From: Frank Dressler @ 2026-11-06 16:06 UTC (permalink / raw)
To: Bing Zhao, dev; +Cc: stephen, thomas, david.marchand
On 11/6/26 14:27, Bing Zhao wrote:
> The PACKET_IGNORE_OUTGOING socket option is used unconditionally,
> but it was only added to the uapi headers in Linux 4.20. The build
> fails on distributions shipping older kernel headers, like RHEL 8
> (kernel-headers-4.18.0-193.el8, gcc 8.5.0):
>
...
>
> DPDK documents Linux 5.4 as the minimum kernel, but the PMD already
> tolerates older kernels for multi-queue ports. Do the same here
> instead of failing the probe, for example on the 4.18 kernel of
> RHEL 8.
>
> Fixes: 3db7aa7868b2 ("net/af_packet: use kernel to filter
single-queue Rx")
>
> Signed-off-by: Bing Zhao <bingz@nvidia.com>
> ---
> doc/guides/nics/af_packet.rst | 1 +
> drivers/net/af_packet/rte_eth_af_packet.c | 16 ++++++++++++++--
> 2 files changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/doc/guides/nics/af_packet.rst
b/doc/guides/nics/af_packet.rst
> index 6282f1e18b..09e79ff392 100644
Thank you for the patch.
I do not think it is a literal fix since the feature to ignore outgoing
packets in the AF_PACKET PMD was added new in DPDK 26.11 which requires
Kernel >= 5.4 which you mentioned.
It is, of course, a valuable feature to older versions of DPDK and/or
Linux. I added that feature in a patch series. The first patch of that
series adds the feature in a way that does not require
`setsockopt(...PACKET_IGNORE_OUTGOING...)`, doing all the filtering in
the PMD. It is in commit b44eeed1d7. It could be cherry picked to the
stable versions, providing that feature in DPDK versions that still
support the older kernel.
If RHEL 8 uses Linux 4.18, and there is a requirement somewhere that the
current DPDK must be compatible with it, should DPDK's Linux kernel
required be lowered to 4.18 maybe?
According to the docs, the following stable versions [1] are still
support which I have annotated with the documented required Linux kernel
versions [2]:
* 23.11, EOL December 2026, Linux >= 4.14
* 24.11, EOL December 2027, Linux >= 4.19
* 25.11, EOL December 2028, Linux >= 5.4
[1]: Stable Versions: https://core.dpdk.org/roadmap/
[2]: Requirements:
https://doc.dpdk.org/guides-23.11/linux_gsg/sys_reqs.html
https://doc.dpdk.org/guides-24.11/linux_gsg/sys_reqs.html
https://doc.dpdk.org/guides-25.11/linux_gsg/sys_reqs.html
To me this looks like RHEL 8 is simply not compatible with DPDK 25.11 or
newer if it is still using Linux 4.18. Lowering the required version to
4.18 would be odd considering 24.11 requires 4.19 and 25.11 5.4.
If DPDK needs to stay compatible with RHEL 8, would this compatibility
be required in all parts of DPDK or only some? If only parts, which
parts or areas? Maybe these parts and areas then need to be listed
somewhere so that new patches can be developed accordingly.
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] net/af_packet: fix build with old kernel headers
2026-11-06 16:06 ` Frank Dressler
@ 2026-11-07 11:11 ` Frank Dressler
2026-11-08 16:22 ` Stephen Hemminger
0 siblings, 1 reply; 14+ messages in thread
From: Frank Dressler @ 2026-11-07 11:11 UTC (permalink / raw)
To: dev; +Cc: stephen, thomas, david.marchand, ktraynor, Bing Zhao
On 11/6/26 14:27, Bing Zhao wrote:
> The PACKET_IGNORE_OUTGOING socket option is used unconditionally,
> but it was only added to the uapi headers in Linux 4.20. The build
> fails on distributions shipping older kernel headers, like RHEL 8
> (kernel-headers-4.18.0-193.el8, gcc 8.5.0):
On 11/6/26 16:06, Frank Dressler wrote:
> If RHEL 8 uses Linux 4.18, [...]
> If DPDK needs to stay compatible with RHEL 8, [...]
Short version: RHEL itself does't seem to ship any DPDK that is too
new for its kernel. The RHEL 8 compatibility requirement may instead
come from NVIDIA's DOCA, which ships DPDK 26.03 on RHEL 8. If so, the
question is whether upstream DPDK should support that combination, or
whether it is better handled on the DOCA side. Details below.
Bing Zhao, is that the use case behind the patch?
Details:
I read too much into Bing Zhao's statement that the new code does not
build with the RHEL 8 kernel. That statement is true.I incorrectly
assumed RHEL itself ships a DPDK version that is too new for its
kernel, which is not the case.
I went through the DPDK and kernel versions shipped in each RHEL
release [1]. All of them ship a DPDK version whose documented minimum
kernel is at or below the RHEL kernel:
RHEL | Provides || DPDK | Requires
--------+------------++------------+------------
RHEL 10 | Linux 6.12 || DPDK 25.11 | Linux 5.4
|| DPDK 24.11 | Linux 4.19
--------+------------++------------+------------
RHEL 9 | Linux 5.14 || DPDK 25.11 | Linux 5.4
|| DPDK 24.11 | Linux 4.19
|| DPDK 23.11 | Linux 4.14
|| DPDK 22.11 | Linux 4.14
|| DPDK 21.11 | Linux 4.4
--------+------------++------------+------------
RHEL 8 | Linux 4.18 || DPDK 23.11 | Linux 4.14
|| DPDK 21.11 | Linux 4.4
|| DPDK 20.11 | Linux 3.16
|| DPDK 19.11 | Linux 3.16
|| DPDK 18.11 | Linux 3.2
I am not a RHEL user myself.Please correct me if I missed something.
Since Bing Zhao works for NVIDIA I thought of DOCA. DOCA-Host is
provided for RHEL/Rocky 8, 9 and 10 [2], and the DOCA 3.5.0 RHEL 8
repository contains dpdk-community-26.03.0.5 [3]. DPDK 26.03 documents
a minimum kernel of 5.4, while RHEL 8 ships 4.18. That's a mismatch.
So, unless I'm missing something, the RHEL 8 compatibility requirement
comes from DOCA rather than from RHEL.
[1]: https://rpms.remirepo.net/rpmphp/zoom.php?rpm=dpdk
[2]:
https://developer.nvidia.com/doca-downloads?deployment_platform=Host-Server&deployment_package=DOCA-Host&target_os=Linux&Architecture=x86_64&Profile=doca-all&Distribution=RHEL-Rocky&version=8&installer_type=rpm_local
[3]:
https://linux.mellanox.com/public/repo/doca/3.5.0/rhel8/x86_64/Packages/
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] net/af_packet: fix build with old kernel headers
2026-11-07 11:11 ` Frank Dressler
@ 2026-11-08 16:22 ` Stephen Hemminger
2026-11-08 18:51 ` Frank Dressler
0 siblings, 1 reply; 14+ messages in thread
From: Stephen Hemminger @ 2026-11-08 16:22 UTC (permalink / raw)
To: Frank Dressler; +Cc: dev, thomas, david.marchand, ktraynor, Bing Zhao
On Sat, 7 Nov 2026 11:11:54 +0000
Frank Dressler <frank@dressler.pro> wrote:
> On 11/6/26 14:27, Bing Zhao wrote:
>
> > The PACKET_IGNORE_OUTGOING socket option is used unconditionally,
> > but it was only added to the uapi headers in Linux 4.20. The build
> > fails on distributions shipping older kernel headers, like RHEL 8
> > (kernel-headers-4.18.0-193.el8, gcc 8.5.0):
>
> On 11/6/26 16:06, Frank Dressler wrote:
> > If RHEL 8 uses Linux 4.18, [...]
> > If DPDK needs to stay compatible with RHEL 8, [...]
>
> Short version: RHEL itself does't seem to ship any DPDK that is too
> new for its kernel. The RHEL 8 compatibility requirement may instead
> come from NVIDIA's DOCA, which ships DPDK 26.03 on RHEL 8. If so, the
> question is whether upstream DPDK should support that combination, or
> whether it is better handled on the DOCA side. Details below.
>
> Bing Zhao, is that the use case behind the patch?
>
> Details:
> I read too much into Bing Zhao's statement that the new code does not
> build with the RHEL 8 kernel. That statement is true.I incorrectly
> assumed RHEL itself ships a DPDK version that is too new for its
> kernel, which is not the case.
The important parts that were missed here.
- flag should not be accepted if underlying kernel does not support it.
- failure should be at compile time not runtime.
Either remove this part:
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index 44f82c0309..ecd4a9801e 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -32,11 +32,6 @@
#include <unistd.h>
#include <poll.h>
-/* Added in Linux 6.2. Older kernels ignore it. */
-#ifndef PACKET_FANOUT_FLAG_IGNORE_OUTGOING
-#define PACKET_FANOUT_FLAG_IGNORE_OUTGOING 0x4000
-#endif
-
#define ETH_AF_PACKET_IFACE_ARG "iface"
#define ETH_AF_PACKET_NUM_Q_ARG "qpairs"
#define ETH_AF_PACKET_BLOCKSIZE_ARG "blocksz"
Or add a bunch of #ifdef like this.
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index 44f82c0309..6ffdfd8524 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -32,11 +32,6 @@
#include <unistd.h>
#include <poll.h>
-/* Added in Linux 6.2. Older kernels ignore it. */
-#ifndef PACKET_FANOUT_FLAG_IGNORE_OUTGOING
-#define PACKET_FANOUT_FLAG_IGNORE_OUTGOING 0x4000
-#endif
-
#define ETH_AF_PACKET_IFACE_ARG "iface"
#define ETH_AF_PACKET_NUM_Q_ARG "qpairs"
#define ETH_AF_PACKET_BLOCKSIZE_ARG "blocksz"
@@ -44,7 +39,10 @@
#define ETH_AF_PACKET_FRAMECOUNT_ARG "framecnt"
#define ETH_AF_PACKET_QDISC_BYPASS_ARG "qdisc_bypass"
#define ETH_AF_PACKET_FANOUT_MODE_ARG "fanout_mode"
-#define ETH_AF_PACKET_IGNORE_OUTGOING_ARG "ignore_outgoing"
+
+#ifdef PACKET_FANOUT_FLAG_IGNORE_OUTGOING
+#define ETH_AF_PACKET_IGNORE_OUTGOING_ARG "ignore_outgoing"
+#endif
#define DFLT_FRAME_SIZE (1 << 11)
#define DFLT_FRAME_COUNT (1 << 9)
@@ -110,7 +108,9 @@ static const char *valid_arguments[] = {
ETH_AF_PACKET_FRAMECOUNT_ARG,
ETH_AF_PACKET_QDISC_BYPASS_ARG,
ETH_AF_PACKET_FANOUT_MODE_ARG,
+#ifdef ETH_AF_PACKET_IGNORE_OUTGOING_ARG
ETH_AF_PACKET_IGNORE_OUTGOING_ARG,
+#endif
NULL
};
@@ -1002,6 +1002,7 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
goto error;
}
+#ifdef PACKET_FANOUT_FLAG_IGNORE_OUTGOING
/*
* Set the flag opportunistically if multiple queues are requested.
* It takes effect from Linux 6.2. Older kernels ignore it and the
@@ -1009,6 +1010,7 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
*/
if (ignore_outgoing != 0 && nb_queues > 1)
fanout_arg |= PACKET_FANOUT_FLAG_IGNORE_OUTGOING << 16;
+#endif
for (q = 0; q < nb_queues; q++) {
/* Open an AF_PACKET socket for this queue... */
@@ -1053,6 +1055,7 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
#endif
}
+#ifdef PACKET_IGNORE_OUTGOING
if (ignore_outgoing != 0 && nb_queues == 1) {
rc = setsockopt(qsockfd, SOL_PACKET, PACKET_IGNORE_OUTGOING,
&ignore_outgoing, sizeof(ignore_outgoing));
@@ -1064,6 +1067,7 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
goto error;
}
}
+#endif
rc = setsockopt(qsockfd, SOL_PACKET, PACKET_RX_RING, req, sizeof(*req));
if (rc == -1) {
@@ -1314,11 +1318,14 @@ rte_eth_from_packet(struct rte_vdev_device *dev,
fanout_mode = pair->value;
continue;
}
+
+#ifdef ETH_AF_PACKET_IGNORE_OUTGOING_ARG
if (strstr(pair->key, ETH_AF_PACKET_IGNORE_OUTGOING_ARG) != NULL) {
if (parse_uint(pair->key, pair->value, &ignore_outgoing, 1) < 0)
return -1;
continue;
}
+#endif
}
if (framesize > blocksize) {
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH] net/af_packet: fix build with old kernel headers
2026-11-08 16:22 ` Stephen Hemminger
@ 2026-11-08 18:51 ` Frank Dressler
2026-11-08 20:29 ` Stephen Hemminger
0 siblings, 1 reply; 14+ messages in thread
From: Frank Dressler @ 2026-11-08 18:51 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev, thomas, david.marchand, ktraynor, Bing Zhao
On 11/8/26 16:22, Stephen Hemminger wrote:
> On Sat, 7 Nov 2026 11:11:54 +0000
> Frank Dressler <frank@dressler.pro> wrote:
>
>> On 11/6/26 14:27, Bing Zhao wrote:
>>
>> > The PACKET_IGNORE_OUTGOING socket option is used unconditionally,
>> > but it was only added to the uapi headers in Linux 4.20. The build
>> > fails on distributions shipping older kernel headers, like RHEL 8
>> > (kernel-headers-4.18.0-193.el8, gcc 8.5.0):
>>
>> On 11/6/26 16:06, Frank Dressler wrote:
>> > If RHEL 8 uses Linux 4.18, [...]
>> > If DPDK needs to stay compatible with RHEL 8, [...]
>>
>> Short version: RHEL itself does't seem to ship any DPDK that is too
>> new for its kernel. The RHEL 8 compatibility requirement may instead
>> come from NVIDIA's DOCA, which ships DPDK 26.03 on RHEL 8. If so, the
>> question is whether upstream DPDK should support that combination, or
>> whether it is better handled on the DOCA side. Details below.
>>
>> Bing Zhao, is that the use case behind the patch?
>>
>> Details:
>> I read too much into Bing Zhao's statement that the new code does not
>> build with the RHEL 8 kernel. That statement is true.I incorrectly
>> assumed RHEL itself ships a DPDK version that is too new for its
>> kernel, which is not the case.
>
> The important parts that were missed here.
> - flag should not be accepted if underlying kernel does not support it.
> - failure should be at compile time not runtime.
>
> Either remove this part:
>
...>
> Or add a bunch of #ifdef like this.
>
But should these changes go into DPDK or NVIDIA's DOCA?
DPDK's current code requires no patch since the code works with the
kernel versions required by DPDK, i.e. Linux >= v5.4.
NVIDIA's DOCA, however, ships current DPDK to RHEL 8 which comes with
kernel v4.18 that is unsupported since DPDK v24.07. The latest release
is DOCA 3.5.0 which ships DPDK v26.03 to RHEL 8 which is not supported
by DPDK.
I think that NVIDIA should add a patch to DOCA's DPDK version or drop
support for RHEL 8 instead of requiring DPDK to be compatible with Linux
v4.18.
Because if DPDK was required to support all the distributions NVIDIA
ships DOCA for, developers would need to check what kernels all those
distributions ship with to find the oldest one. DPDK's kernel
requirement would then need to be changed from "Kernel version >= 5.4"
to "Kernel version min(5.4, whatever NVIDIA needs) >=".
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] net/af_packet: fix build with old kernel headers
2026-11-08 18:51 ` Frank Dressler
@ 2026-11-08 20:29 ` Stephen Hemminger
0 siblings, 0 replies; 14+ messages in thread
From: Stephen Hemminger @ 2026-11-08 20:29 UTC (permalink / raw)
To: Frank Dressler; +Cc: dev, thomas, david.marchand, ktraynor, Bing Zhao
On Sun, 8 Nov 2026 18:51:35 +0000
Frank Dressler <frank@dressler.pro> wrote:
> But should these changes go into DPDK or NVIDIA's DOCA?
>
> DPDK's current code requires no patch since the code works with the
> kernel versions required by DPDK, i.e. Linux >= v5.4.
>
> NVIDIA's DOCA, however, ships current DPDK to RHEL 8 which comes with
> kernel v4.18 that is unsupported since DPDK v24.07. The latest release
> is DOCA 3.5.0 which ships DPDK v26.03 to RHEL 8 which is not supported
> by DPDK.
If NVIDIA is shipping new DPDK with old distro, then it is there problem.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v2] net/af_packet: fix build with old kernel headers
2026-11-06 14:27 [PATCH] net/af_packet: fix build with old kernel headers Bing Zhao
2026-11-06 14:46 ` Thomas Monjalon
2026-11-06 16:06 ` Frank Dressler
@ 2026-11-09 15:47 ` Bing Zhao
2026-11-09 17:47 ` Stephen Hemminger
2026-11-10 16:51 ` Stephen Hemminger
2 siblings, 2 replies; 14+ messages in thread
From: Bing Zhao @ 2026-11-09 15:47 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Frank Dressler, Thomas Monjalon,
David Marchand, Kevin Traynor
The PACKET_IGNORE_OUTGOING socket option is used unconditionally,
but it was only added to the uapi headers in Linux 4.20. The build
fails on distributions shipping older kernel headers, like RHEL 8
(kernel-headers 4.18.0):
rte_eth_af_packet.c:1057:41: error: 'PACKET_IGNORE_OUTGOING'
undeclared (first use in this function)
DPDK requires Linux 5.4, so the driver does not need to support older
kernels. Check for the symbol at configure time and skip the driver
when the headers lack it, instead of failing the whole build.
Fixes: 3db7aa7868b2 ("net/af_packet: use kernel to filter single-queue Rx")
Signed-off-by: Bing Zhao <bingz@nvidia.com>
---
v2:
- Drop the fallback define and the runtime fallback to PMD filtering.
- Skip the driver in meson when linux/if_packet.h lacks the symbol,
so the problem is reported at build time (Stephen).
doc/guides/nics/af_packet.rst | 2 ++
drivers/net/af_packet/meson.build | 8 ++++++++
2 files changed, 10 insertions(+)
diff --git a/doc/guides/nics/af_packet.rst b/doc/guides/nics/af_packet.rst
index 6282f1e18b..44da26854d 100644
--- a/doc/guides/nics/af_packet.rst
+++ b/doc/guides/nics/af_packet.rst
@@ -72,6 +72,8 @@ Prerequisites
This is a Linux-specific PMD, thus the following prerequisites apply:
* A Linux Kernel;
+* Kernel headers defining ``PACKET_IGNORE_OUTGOING`` (Linux 4.20 or later),
+ otherwise the PMD is not built;
* A Kernel bound interface to attach to (e.g. a tap interface).
Set up an af_packet interface
diff --git a/drivers/net/af_packet/meson.build b/drivers/net/af_packet/meson.build
index f45e4491d4..ce4737010a 100644
--- a/drivers/net/af_packet/meson.build
+++ b/drivers/net/af_packet/meson.build
@@ -4,6 +4,14 @@
if not is_linux
build = false
reason = 'only supported on Linux'
+ subdir_done()
endif
+
+if not cc.has_header_symbol('linux/if_packet.h', 'PACKET_IGNORE_OUTGOING')
+ build = false
+ reason = 'missing symbol "PACKET_IGNORE_OUTGOING" in "linux/if_packet.h"'
+ subdir_done()
+endif
+
sources = files('rte_eth_af_packet.c')
require_iova_in_mbuf = false
--
2.34.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH v2] net/af_packet: fix build with old kernel headers
2026-11-09 15:47 ` [PATCH v2] " Bing Zhao
@ 2026-11-09 17:47 ` Stephen Hemminger
2026-11-10 10:39 ` Thomas Monjalon
2026-11-10 16:51 ` Stephen Hemminger
1 sibling, 1 reply; 14+ messages in thread
From: Stephen Hemminger @ 2026-11-09 17:47 UTC (permalink / raw)
To: Bing Zhao
Cc: dev, Frank Dressler, Thomas Monjalon, David Marchand,
Kevin Traynor
On Mon, 9 Nov 2026 17:47:30 +0200
Bing Zhao <bingz@nvidia.com> wrote:
> The PACKET_IGNORE_OUTGOING socket option is used unconditionally,
> but it was only added to the uapi headers in Linux 4.20. The build
> fails on distributions shipping older kernel headers, like RHEL 8
> (kernel-headers 4.18.0):
>
> rte_eth_af_packet.c:1057:41: error: 'PACKET_IGNORE_OUTGOING'
> undeclared (first use in this function)
>
> DPDK requires Linux 5.4, so the driver does not need to support older
> kernels. Check for the symbol at configure time and skip the driver
> when the headers lack it, instead of failing the whole build.
>
> Fixes: 3db7aa7868b2 ("net/af_packet: use kernel to filter single-queue Rx")
>
> Signed-off-by: Bing Zhao <bingz@nvidia.com>
> ---
No. DPDK should just fail build on older kernels.
Since current DPDK is not tested with those releases, anyone doing that is
working outside the tested environment and has to fix it themselves.
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH v2] net/af_packet: fix build with old kernel headers
2026-11-09 17:47 ` Stephen Hemminger
@ 2026-11-10 10:39 ` Thomas Monjalon
2026-11-10 12:52 ` Frank Dressler
0 siblings, 1 reply; 14+ messages in thread
From: Thomas Monjalon @ 2026-11-10 10:39 UTC (permalink / raw)
To: Bing Zhao, Stephen Hemminger
Cc: dev, Frank Dressler, David Marchand, Kevin Traynor
09/11/2026 18:47, Stephen Hemminger:
> On Mon, 9 Nov 2026 17:47:30 +0200
> Bing Zhao <bingz@nvidia.com> wrote:
>
> > The PACKET_IGNORE_OUTGOING socket option is used unconditionally,
> > but it was only added to the uapi headers in Linux 4.20. The build
> > fails on distributions shipping older kernel headers, like RHEL 8
> > (kernel-headers 4.18.0):
> >
> > rte_eth_af_packet.c:1057:41: error: 'PACKET_IGNORE_OUTGOING'
> > undeclared (first use in this function)
> >
> > DPDK requires Linux 5.4, so the driver does not need to support older
> > kernels. Check for the symbol at configure time and skip the driver
> > when the headers lack it, instead of failing the whole build.
> >
> > Fixes: 3db7aa7868b2 ("net/af_packet: use kernel to filter single-queue Rx")
> >
> > Signed-off-by: Bing Zhao <bingz@nvidia.com>
> > ---
>
> No. DPDK should just fail build on older kernels.
> Since current DPDK is not tested with those releases, anyone doing that is
> working outside the tested environment and has to fix it themselves.
We used to support some old RHEL versions.
Remind that the RHEL kernel is full of backports,
it is not exactly the same as an really old kernel.
I think this solution disabling a driver is acceptable.
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH v2] net/af_packet: fix build with old kernel headers
2026-11-10 10:39 ` Thomas Monjalon
@ 2026-11-10 12:52 ` Frank Dressler
2026-11-10 13:56 ` Thomas Monjalon
0 siblings, 1 reply; 14+ messages in thread
From: Frank Dressler @ 2026-11-10 12:52 UTC (permalink / raw)
To: Thomas Monjalon, Bing Zhao, Stephen Hemminger
Cc: dev, David Marchand, Kevin Traynor
On 11/10/26 10:39, Thomas Monjalon wrote:
> 09/11/2026 18:47, Stephen Hemminger:
>> On Mon, 9 Nov 2026 17:47:30 +0200
>> Bing Zhao <bingz@nvidia.com> wrote:
>>
>>> The PACKET_IGNORE_OUTGOING socket option is used unconditionally,
>>> but it was only added to the uapi headers in Linux 4.20. The build
>>> fails on distributions shipping older kernel headers, like RHEL 8
>>> (kernel-headers 4.18.0):
>>>
>>> rte_eth_af_packet.c:1057:41: error: 'PACKET_IGNORE_OUTGOING'
>>> undeclared (first use in this function)
>>>
>>> DPDK requires Linux 5.4, so the driver does not need to support older
>>> kernels. Check for the symbol at configure time and skip the driver
>>> when the headers lack it, instead of failing the whole build.
>>>
>>> Fixes: 3db7aa7868b2 ("net/af_packet: use kernel to filter single-queue Rx")
>>>
>>> Signed-off-by: Bing Zhao <bingz@nvidia.com>
>>> ---
>>
>> No. DPDK should just fail build on older kernels.
>> Since current DPDK is not tested with those releases, anyone doing that is
>> working outside the tested environment and has to fix it themselves.
>
> We used to support some old RHEL versions.
> Remind that the RHEL kernel is full of backports,
> it is not exactly the same as an really old kernel.
> I think this solution disabling a driver is acceptable.
But does RHEL itself actually have a problem? I could not find an
incompatible DPDK being shipped by them. DOCA ships unsupported DPDK.
If it is RHEL, Redhat could add `-Ddisable_drivers=net/af_packet`. If it
is DOCA, NVIDIA could just add `-Ddisable_drivers=net/af_packet`. DOCA
already only ships a limited set of PMDs in their bundled DPDK.
Or is this change more intended for third-parties cloning and building
DPDK 26.11 on RHEL 8?
If RHEL 8 must be supported, the documented requirements would need to
change then to say that features of Kernel 5.4 may be used but the code
must still build without error on RHEL 8, or something like that.
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH v2] net/af_packet: fix build with old kernel headers
2026-11-10 12:52 ` Frank Dressler
@ 2026-11-10 13:56 ` Thomas Monjalon
2026-11-10 14:23 ` Frank Dressler
0 siblings, 1 reply; 14+ messages in thread
From: Thomas Monjalon @ 2026-11-10 13:56 UTC (permalink / raw)
To: Bing Zhao, Stephen Hemminger, Frank Dressler
Cc: dev, David Marchand, Kevin Traynor, Maxime Coquelin
10/11/2026 13:52, Frank Dressler:
> On 11/10/26 10:39, Thomas Monjalon wrote:
> > 09/11/2026 18:47, Stephen Hemminger:
> >> On Mon, 9 Nov 2026 17:47:30 +0200
> >> Bing Zhao <bingz@nvidia.com> wrote:
> >>
> >>> The PACKET_IGNORE_OUTGOING socket option is used unconditionally,
> >>> but it was only added to the uapi headers in Linux 4.20. The build
> >>> fails on distributions shipping older kernel headers, like RHEL 8
> >>> (kernel-headers 4.18.0):
> >>>
> >>> rte_eth_af_packet.c:1057:41: error: 'PACKET_IGNORE_OUTGOING'
> >>> undeclared (first use in this function)
> >>>
> >>> DPDK requires Linux 5.4, so the driver does not need to support older
> >>> kernels. Check for the symbol at configure time and skip the driver
> >>> when the headers lack it, instead of failing the whole build.
> >>>
> >>> Fixes: 3db7aa7868b2 ("net/af_packet: use kernel to filter single-queue Rx")
> >>>
> >>> Signed-off-by: Bing Zhao <bingz@nvidia.com>
> >>> ---
> >>
> >> No. DPDK should just fail build on older kernels.
> >> Since current DPDK is not tested with those releases, anyone doing that is
> >> working outside the tested environment and has to fix it themselves.
> >
> > We used to support some old RHEL versions.
> > Remind that the RHEL kernel is full of backports,
> > it is not exactly the same as an really old kernel.
> > I think this solution disabling a driver is acceptable.
>
> But does RHEL itself actually have a problem? I could not find an
> incompatible DPDK being shipped by them. DOCA ships unsupported DPDK.
>
> If it is RHEL, Redhat could add `-Ddisable_drivers=net/af_packet`. If it
> is DOCA, NVIDIA could just add `-Ddisable_drivers=net/af_packet`. DOCA
> already only ships a limited set of PMDs in their bundled DPDK.
I don't know why you insist on DOCA, it is not an upstream concern,
and was not mentioned in this thread except by you.
> Or is this change more intended for third-parties cloning and building
> DPDK 26.11 on RHEL 8?
Yes my concern is to allow building a new DPDK easily.
But I am still waiting for a confirmation from our Red Hat friend
that RHEL 8 is still a target.
> If RHEL 8 must be supported, the documented requirements would need to
> change then to say that features of Kernel 5.4 may be used but the code
> must still build without error on RHEL 8, or something like that.
Yes that's something we had in the past.
This has been removed last year:
"Compatibility for recent distribution kernels will be kept, notably RHEL/CentOS 7."
Does it mean we don't care about RHEL 8 users?
If that's what we decide, I'm fine with it.
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH v2] net/af_packet: fix build with old kernel headers
2026-11-10 13:56 ` Thomas Monjalon
@ 2026-11-10 14:23 ` Frank Dressler
0 siblings, 0 replies; 14+ messages in thread
From: Frank Dressler @ 2026-11-10 14:23 UTC (permalink / raw)
To: Thomas Monjalon, Bing Zhao, Stephen Hemminger
Cc: dev, David Marchand, Kevin Traynor, Maxime Coquelin
On 11/10/26 13:56, Thomas Monjalon wrote:
> 10/11/2026 13:52, Frank Dressler:
>> On 11/10/26 10:39, Thomas Monjalon wrote:
>>> 09/11/2026 18:47, Stephen Hemminger:
>>>> On Mon, 9 Nov 2026 17:47:30 +0200
>>>> Bing Zhao <bingz@nvidia.com> wrote:
>>>>
>>>>> The PACKET_IGNORE_OUTGOING socket option is used unconditionally,
>>>>> but it was only added to the uapi headers in Linux 4.20. The build
>>>>> fails on distributions shipping older kernel headers, like RHEL 8
>>>>> (kernel-headers 4.18.0):
>>>>>
>>>>> rte_eth_af_packet.c:1057:41: error: 'PACKET_IGNORE_OUTGOING'
>>>>> undeclared (first use in this function)
>>>>>
>>>>> DPDK requires Linux 5.4, so the driver does not need to support older
>>>>> kernels. Check for the symbol at configure time and skip the driver
>>>>> when the headers lack it, instead of failing the whole build.
>>>>>
>>>>> Fixes: 3db7aa7868b2 ("net/af_packet: use kernel to filter single-queue Rx")
>>>>>
>>>>> Signed-off-by: Bing Zhao <bingz@nvidia.com>
>>>>> ---
>>>>
>>>> No. DPDK should just fail build on older kernels.
>>>> Since current DPDK is not tested with those releases, anyone doing that is
>>>> working outside the tested environment and has to fix it themselves.
>>>
>>> We used to support some old RHEL versions.
>>> Remind that the RHEL kernel is full of backports,
>>> it is not exactly the same as an really old kernel.
>>> I think this solution disabling a driver is acceptable.
>>
>> But does RHEL itself actually have a problem? I could not find an
>> incompatible DPDK being shipped by them. DOCA ships unsupported DPDK.
>>
>> If it is RHEL, Redhat could add `-Ddisable_drivers=net/af_packet`. If it
>> is DOCA, NVIDIA could just add `-Ddisable_drivers=net/af_packet`. DOCA
>> already only ships a limited set of PMDs in their bundled DPDK.
>
> I don't know why you insist on DOCA, it is not an upstream concern,
> and was not mentioned in this thread except by you.
>
I was just wondering about the use case behind the change, because I did
not find it in RHEL since they all seemed to ship with supported DPDK
versions. So I thought it could have been DOCA.
>
>> If RHEL 8 must be supported, the documented requirements would need to
>> change then to say that features of Kernel 5.4 may be used but the code
>> must still build without error on RHEL 8, or something like that.
>
> Yes that's something we had in the past.
> This has been removed last year:
>
> "Compatibility for recent distribution kernels will be kept, notably RHEL/CentOS 7."
>
Thank you, I did not know that.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2] net/af_packet: fix build with old kernel headers
2026-11-09 15:47 ` [PATCH v2] " Bing Zhao
2026-11-09 17:47 ` Stephen Hemminger
@ 2026-11-10 16:51 ` Stephen Hemminger
1 sibling, 0 replies; 14+ messages in thread
From: Stephen Hemminger @ 2026-11-10 16:51 UTC (permalink / raw)
To: Bing Zhao
Cc: dev, Frank Dressler, Thomas Monjalon, David Marchand,
Kevin Traynor
On Mon, 9 Nov 2026 17:47:30 +0200
Bing Zhao <bingz@nvidia.com> wrote:
> The PACKET_IGNORE_OUTGOING socket option is used unconditionally,
> but it was only added to the uapi headers in Linux 4.20. The build
> fails on distributions shipping older kernel headers, like RHEL 8
> (kernel-headers 4.18.0):
>
> rte_eth_af_packet.c:1057:41: error: 'PACKET_IGNORE_OUTGOING'
> undeclared (first use in this function)
>
> DPDK requires Linux 5.4, so the driver does not need to support older
> kernels. Check for the symbol at configure time and skip the driver
> when the headers lack it, instead of failing the whole build.
>
> Fixes: 3db7aa7868b2 ("net/af_packet: use kernel to filter single-queue Rx")
>
> Signed-off-by: Bing Zhao <bingz@nvidia.com>
> ---
I liked the v1 better, looks simplest
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2026-11-10 16:51 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-06 14:27 [PATCH] net/af_packet: fix build with old kernel headers Bing Zhao
2026-11-06 14:46 ` Thomas Monjalon
2026-11-06 16:06 ` Frank Dressler
2026-11-07 11:11 ` Frank Dressler
2026-11-08 16:22 ` Stephen Hemminger
2026-11-08 18:51 ` Frank Dressler
2026-11-08 20:29 ` Stephen Hemminger
2026-11-09 15:47 ` [PATCH v2] " Bing Zhao
2026-11-09 17:47 ` Stephen Hemminger
2026-11-10 10:39 ` Thomas Monjalon
2026-11-10 12:52 ` Frank Dressler
2026-11-10 13:56 ` Thomas Monjalon
2026-11-10 14:23 ` Frank Dressler
2026-11-10 16:51 ` Stephen Hemminger
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.