[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220519175832.huxwykgksqyeopvw@kafai-mbp>
Date: Thu, 19 May 2022 10:58:32 -0700
From: Martin KaFai Lau <kafai@...com>
To: Mat Martineau <mathew.j.martineau@...ux.intel.com>
Cc: Alexei Starovoitov <alexei.starovoitov@...il.com>,
Geliang Tang <geliangtang@...il.com>,
Geliang Tang <geliang.tang@...e.com>,
Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
MPTCP Upstream <mptcp@...ts.linux.dev>,
Nicolas Rybowski <nicolas.rybowski@...sares.net>,
Matthieu Baerts <matthieu.baerts@...sares.net>
Subject: Re: [PATCH bpf-next v4 1/7] bpf: add bpf_skc_to_mptcp_sock_proto
On Wed, May 18, 2022 at 05:38:43PM -0700, Mat Martineau wrote:
> On Tue, 17 May 2022, Alexei Starovoitov wrote:
>
> > On Mon, May 16, 2022 at 10:26 PM Geliang Tang <geliangtang@...il.com> wrote:
> > >
> > > Martin KaFai Lau <kafai@...com> 于2022年5月17日周二 09:07写道:
> > > >
> > > > On Fri, May 13, 2022 at 03:48:21PM -0700, Mat Martineau wrote:
> > > > [ ... ]
> > > >
> > > > > diff --git a/include/net/mptcp.h b/include/net/mptcp.h
> > > > > index 8b1afd6f5cc4..2ba09de955c7 100644
> > > > > --- a/include/net/mptcp.h
> > > > > +++ b/include/net/mptcp.h
> > > > > @@ -284,4 +284,10 @@ static inline int mptcpv6_init(void) { return 0; }
> > > > > static inline void mptcpv6_handle_mapped(struct sock *sk, bool mapped) { }
> > > > > #endif
> > > > >
> > > > > +#if defined(CONFIG_MPTCP) && defined(CONFIG_BPF_SYSCALL)
> > > > > +struct mptcp_sock *bpf_mptcp_sock_from_subflow(struct sock *sk);
> > > > Can this be inline ?
> > >
> > > This function can't be inline since it uses struct mptcp_subflow_context.
> > >
> > > mptcp_subflow_context is defined in net/mptcp/protocol.h, and we don't
> > > want to export it to user space in net/mptcp/protocol.h.
> >
> > The above function can be made static inline in a header file.
> > That doesn't automatically expose it to user space.
> >
>
> True, it's not a question of userspace exposure. But making this one
> function inline involves a bunch of churn in the (non-BPF) mptcp headers
> that I'd rather avoid. The definitions in protocol.h are there because they
> aren't relevant outside of the mptcp subsystem code.
>
> Does making this one function inline benefit BPF, specifically, in a
> meaningful way?
I believe this is similar to the already inlined mptcp_subflow_ctx().
> If not, I'd like to leave it as-is.
Sure, it is fine to leave it if the churn is too much.
Was suggesting because all other bpf_skc_to_* cast helpers
don't have this call-out. Just in case if those cast helpers will be
inlined by verifier in the future, this won't be the only one that
got left behind.
Powered by blists - more mailing lists