ice: fix building withouto XDP
Subsystems (3)
PATCH 1/1 ice: fix building withouto XDP
From: Arnd Bergmann <[email protected]>
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.
--- drivers/net/ethernet/intel/ice/ice_base.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/intel/ice/ice_base.c +2 -0
@@ -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 }/**
Signature · 1 line
2.39.2
Quoted 9 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The newly added function fails to build when struct
xsk_cb_descis 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 typeHide this part in the same #ifdef that controls the structure definition.
Hey Arnd,
this has been fixed by Vladimir:
https://lore.kernel.org/netdev/[email protected]/
in a way that we don't have to wrap driver code with ifdefs.
Thanks!
Quoted 30 lines
Fixes d68d707dcbbf ("ice: Support XDP hints in AF_XDP ZC mode")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/net/ethernet/intel/ice/ice_base.c | 2 ++ 1 file changed, 2 insertions(+)drivers/net/ethernet/intel/ice/ice_base.c +2
-0@@ -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 }/** Signature · 1 line
2.39.2
Quoted 9 lines · Maciej Fijalkowski
Quoted 8 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The newly added function fails to build when struct
xsk_cb_descis 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
Quoted 8 lines
Quoted 1 line
Hide this part in the same #ifdef that controls the structure definition.
Hey Arnd,
this has been fixed by Vladimir:
https://lore.kernel.org/netdev/[email protected]/in a way that we don't have to wrap driver code with ifdefs.
Ok, sounds good.
Arnd
Dear Arnd,
Thank you for your patch. There is a small typo in the commit message summary: withouto → without
Kind regards,
Paul