* [PATCH] net/txgbe: remove the build dependency on security
@ 2025-11-21 6:19 Jiawen Wu
2025-11-26 21:39 ` Stephen Hemminger
0 siblings, 1 reply; 2+ messages in thread
From: Jiawen Wu @ 2025-11-21 6:19 UTC (permalink / raw)
To: dev; +Cc: zaiyuwang, Jiawen Wu
Now lib security is enabled by default, and cannot be disabled if the
driver is intended to be used. But there are some functional scenarios
where lib security should be disabled, just like to enale Tx descriptor
hardware check. See commit 0eabdfcd4af4 ("net/txgbe: enable Tx
descriptor error interrupt").
So remove the build dependency on lib security for the driver.
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
drivers/net/txgbe/meson.build | 8 ++++++--
drivers/net/txgbe/txgbe_rxtx.c | 15 ++++++++++++++-
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/drivers/net/txgbe/meson.build b/drivers/net/txgbe/meson.build
index 5cdec017ed..57b2f6dbf1 100644
--- a/drivers/net/txgbe/meson.build
+++ b/drivers/net/txgbe/meson.build
@@ -14,17 +14,21 @@ sources = files(
'txgbe_ethdev_vf.c',
'txgbe_fdir.c',
'txgbe_flow.c',
- 'txgbe_ipsec.c',
'txgbe_ptypes.c',
'txgbe_pf.c',
'txgbe_rxtx.c',
'txgbe_tm.c',
)
-deps += ['hash', 'security']
+deps += ['hash']
cflags += no_wvla_cflag
+if dpdk_conf.has('RTE_LIB_SECURITY')
+ sources += files('txgbe_ipsec.c')
+ deps += 'security'
+endif
+
if arch_subdir == 'x86'
sources += files('txgbe_rxtx_vec_sse.c')
elif arch_subdir == 'arm'
diff --git a/drivers/net/txgbe/txgbe_rxtx.c b/drivers/net/txgbe/txgbe_rxtx.c
index 78199ea00b..e9b9f17c84 100644
--- a/drivers/net/txgbe/txgbe_rxtx.c
+++ b/drivers/net/txgbe/txgbe_rxtx.c
@@ -21,7 +21,9 @@
#include <rte_debug.h>
#include <rte_ethdev.h>
#include <ethdev_driver.h>
+#ifdef RTE_LIB_SECURITY
#include <rte_security_driver.h>
+#endif
#include <rte_memzone.h>
#include <rte_atomic.h>
#include <rte_mempool.h>
@@ -342,6 +344,17 @@ txgbe_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
return nb_tx;
}
+static uint64_t *
+txgbe_security_dynfield(struct rte_mbuf *tx_pkt)
+{
+#ifdef RTE_LIB_SECURITY
+ return rte_security_dynfield(tx_pkt);
+#else
+ UNREFERENCED_PARAMETER(tx_pkt);
+ return NULL;
+#endif
+}
+
static inline void
txgbe_set_xmit_ctx(struct txgbe_tx_queue *txq,
volatile struct txgbe_tx_ctx_desc *ctx_txd,
@@ -1102,7 +1115,7 @@ txgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
txgbe_set_xmit_ctx(txq, ctx_txd, tx_ol_req,
tx_offload,
- rte_security_dynfield(tx_pkt));
+ txgbe_security_dynfield(tx_pkt));
txe->last_id = tx_last;
tx_id = txe->next_id;
--
2.48.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] net/txgbe: remove the build dependency on security
2025-11-21 6:19 [PATCH] net/txgbe: remove the build dependency on security Jiawen Wu
@ 2025-11-26 21:39 ` Stephen Hemminger
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2025-11-26 21:39 UTC (permalink / raw)
To: Jiawen Wu; +Cc: dev, zaiyuwang
On Fri, 21 Nov 2025 14:19:51 +0800
Jiawen Wu <jiawenwu@trustnetic.com> wrote:
> Now lib security is enabled by default, and cannot be disabled if the
> driver is intended to be used. But there are some functional scenarios
> where lib security should be disabled, just like to enale Tx descriptor
> hardware check. See commit 0eabdfcd4af4 ("net/txgbe: enable Tx
> descriptor error interrupt").
>
> So remove the build dependency on lib security for the driver.
>
> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
I would like a review by other maintainers.
Several other drivers including cn10k, cn20k, ixgbe already have
similar dependencies. Can't the security library just have stubs
to always return NULL if not used.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-26 21:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-21 6:19 [PATCH] net/txgbe: remove the build dependency on security Jiawen Wu
2025-11-26 21:39 ` Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).