diff mbox series

ice: fix building withouto XDP

Message ID 20240103102458.3687963-1-arnd@kernel.org (mailing list archive)
State Not Applicable
Delegated to: Netdev Maintainers
Headers show
Series ice: fix building withouto XDP | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1113 this patch: 1113
netdev/cc_maintainers success CCed 10 of 10 maintainers
netdev/build_clang success Errors and warnings before: 1140 this patch: 1140
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 1140 this patch: 1140
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Arnd Bergmann Jan. 3, 2024, 10:24 a.m. UTC
From: Arnd Bergmann <arnd@arndb.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@arndb.de>
---
 drivers/net/ethernet/intel/ice/ice_base.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Fijalkowski, Maciej Jan. 3, 2024, 10:54 a.m. UTC | #1
On Wed, Jan 03, 2024 at 11:24:45AM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.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.

Hey Arnd,

this has been fixed by Vladimir:
https://lore.kernel.org/netdev/20231219110205.1289506-1-vladimir.oltean@nxp.com/

in a way that we don't have to wrap driver code with ifdefs.

Thanks!

> 
> Fixes: d68d707dcbbf ("ice: Support XDP hints in AF_XDP ZC mode")
> Signed-off-by: Arnd Bergmann <arnd@arndb.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
>
Arnd Bergmann Jan. 3, 2024, 11:19 a.m. UTC | #2
On Wed, Jan 3, 2024, at 11:54, Maciej Fijalkowski wrote:
> On Wed, Jan 03, 2024 at 11:24:45AM +0100, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.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.
>
> Hey Arnd,
>
> this has been fixed by Vladimir:
> https://lore.kernel.org/netdev/20231219110205.1289506-1-vladimir.oltean@nxp.com/
>
> in a way that we don't have to wrap driver code with ifdefs.

Ok, sounds good.

    Arnd
Paul Menzel Jan. 3, 2024, 4:02 p.m. UTC | #3
Dear Arnd,


Thank you for your patch. There is a small typo in the commit message 
summary: withouto → without


Kind regards,

Paul
diff mbox series

Patch

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
 }
 
 /**