[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240103102458.3687963-1-arnd@kernel.org>
Date: Wed, 3 Jan 2024 11:24:45 +0100
From: Arnd Bergmann <arnd@...nel.org>
To: Jesse Brandeburg <jesse.brandeburg@...el.com>,
Tony Nguyen <anthony.l.nguyen@...el.com>,
Jakub Kicinski <kuba@...nel.org>
Cc: Arnd Bergmann <arnd@...db.de>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
Maciej Fijalkowski <maciej.fijalkowski@...el.com>,
Simon Horman <horms@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Larysa Zaremba <larysa.zaremba@...el.com>,
Piotr Raczynski <piotr.raczynski@...el.com>,
Amritha Nambiar <amritha.nambiar@...el.com>,
Alexei Starovoitov <ast@...nel.org>,
intel-wired-lan@...ts.osuosl.org,
netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] ice: fix building withouto XDP
From: Arnd Bergmann <arnd@...db.de>
The newly added function fails to build when struct xsk_cb_desc is
not defined:
drivers/net/ethernet/intel/ice/ice_base.c: In function 'ice_xsk_pool_fill_cb':
drivers/net/ethernet/intel/ice/ice_base.c:525:16: error: variable 'desc' has initializer but incomplete type
Hide this part in the same #ifdef that controls the structure definition.
Fixes: d68d707dcbbf ("ice: Support XDP hints in AF_XDP ZC mode")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
drivers/net/ethernet/intel/ice/ice_base.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/intel/ice/ice_base.c b/drivers/net/ethernet/intel/ice/ice_base.c
index 6e3694145f59..0d1aeb7ca108 100644
--- a/drivers/net/ethernet/intel/ice/ice_base.c
+++ b/drivers/net/ethernet/intel/ice/ice_base.c
@@ -521,6 +521,7 @@ static int ice_setup_rx_ctx(struct ice_rx_ring *ring)
static void ice_xsk_pool_fill_cb(struct ice_rx_ring *ring)
{
+#ifdef CONFIG_XDP_SOCKETS
void *ctx_ptr = &ring->pkt_ctx;
struct xsk_cb_desc desc = {};
@@ -530,6 +531,7 @@ static void ice_xsk_pool_fill_cb(struct ice_rx_ring *ring)
sizeof(struct xdp_buff);
desc.bytes = sizeof(ctx_ptr);
xsk_pool_fill_cb(ring->xsk_pool, &desc);
+#endif
}
/**
--
2.39.2
Powered by blists - more mailing lists