From: Bing Zhao <bingz@nvidia.com>
To: <dev@dpdk.org>
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Frank Dressler <frank@dressler.pro>,
Thomas Monjalon <thomas@monjalon.net>,
David Marchand <david.marchand@redhat.com>,
Kevin Traynor <ktraynor@redhat.com>
Subject: [PATCH v2] net/af_packet: fix build with old kernel headers
Date: Mon, 9 Nov 2026 17:47:30 +0200 [thread overview]
Message-ID: <20261109154730.146345-1-bingz@nvidia.com> (raw)
In-Reply-To: <20261106142756.241131-1-bingz@nvidia.com>
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
next prev parent reply other threads:[~2026-11-09 15:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Bing Zhao [this message]
2026-11-09 17:47 ` [PATCH v2] " 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261109154730.146345-1-bingz@nvidia.com \
--to=bingz@nvidia.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=frank@dressler.pro \
--cc=ktraynor@redhat.com \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.