[PATCH v2 31/83] net/tap: move alignment attribute on types

Stephen Hemminger stephen at networkplumber.org
Thu May 2 20:33:55 CEST 2024


On Mon, 15 Apr 2024 13:03:53 -0700
Tyler Retzlaff <roretzla at linux.microsoft.com> wrote:

> Move location of __rte_aligned(a) to new conventional location. The new
> placement between {struct,union} and the tag allows the desired
> alignment to be imparted on the type regardless of the toolchain being
> used for both C and C++. Additionally, it avoids confusion by Doxygen
> when generating documentation.
> 
> Signed-off-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
> Acked-by: Morten Brørup <mb at smartsharesystems.com>
> ---
>  drivers/net/tap/tap_bpf.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/tap/tap_bpf.h b/drivers/net/tap/tap_bpf.h
> index 0d38bc1..d843792 100644
> --- a/drivers/net/tap/tap_bpf.h
> +++ b/drivers/net/tap/tap_bpf.h
> @@ -50,7 +50,7 @@ enum bpf_map_type {
>  };
>  
>  /* union of anonymous structs used with TAP BPF commands */
> -union bpf_attr {
> +union __rte_aligned(8) bpf_attr {
>  	/* BPF_MAP_CREATE command */
>  	struct {
>  		__u32	map_type;
> @@ -84,7 +84,7 @@ enum bpf_map_type {
>  		__u32		kern_version;
>  		__u32		prog_flags;
>  	};
> -} __rte_aligned(8);
> +};
>  
>  #ifndef __NR_bpf
>  # if defined(__i386__)

This file is removed in the BPF fix patchset.


More information about the dev mailing list