Re: [PATCH bpf-next] mptcp: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 11, 2022 at 03:07:31PM +0200, Jiri Olsa wrote:
> The btf_sock_ids array needs struct mptcp_sock BTF ID for
> the bpf_skc_to_mptcp_sock helper.
> 
> When CONFIG_MPTCP is disabled, the 'struct mptcp_sock' is not
> defined and resolve_btfids will complain with:
> 
>   BTFIDS  vmlinux
> WARN: resolve_btfids: unresolved symbol mptcp_sock
BTF_TYPE_EMIT(struct mptcp_sock) did not help here because
'struct mptcp_sock' is not defined anywhere in the include/ ?  :(

> 
> Adding empty difinition for struct mptcp_sock when CONFIG_MPTCP
> is disabled.
> 
> Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
> ---
>  include/net/mptcp.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/net/mptcp.h b/include/net/mptcp.h
> index ac9cf7271d46..25741a52c666 100644
> --- a/include/net/mptcp.h
> +++ b/include/net/mptcp.h
> @@ -59,6 +59,10 @@ struct mptcp_addr_info {
>  	};
>  };
>  
> +#if !IS_ENABLED(CONFIG_MPTCP)
> +struct mptcp_sock { };
> +#endif
Considering a similar case in the existing 'struct mptcp_out_options',
this seems reasonable.

Acked-by: Martin KaFai Lau <kafai@xxxxxx>

> +
>  struct mptcp_out_options {
>  #if IS_ENABLED(CONFIG_MPTCP)
>  	u16 suboptions;
> -- 
> 2.35.3
> 



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux