[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241223020027.GA36000@j66a10360.sqa.eu95>
Date: Mon, 23 Dec 2024 10:00:27 +0800
From: "D. Wythe" <alibuda@...ux.alibaba.com >
To: Martin KaFai Lau <martin.lau@...ux.dev>
Cc: "D. Wythe" <alibuda@...ux.alibaba.com>, kgraul@...ux.ibm.com,
wenjia@...ux.ibm.com, jaka@...ux.ibm.com, ast@...nel.org,
daniel@...earbox.net, andrii@...nel.org, pabeni@...hat.com,
song@...nel.org, sdf@...gle.com, haoluo@...gle.com, yhs@...com,
edumazet@...gle.com, john.fastabend@...il.com, kpsingh@...nel.org,
jolsa@...nel.org, guwen@...ux.alibaba.com, kuba@...nel.org,
davem@...emloft.net, netdev@...r.kernel.org,
linux-s390@...r.kernel.org, linux-rdma@...r.kernel.org,
bpf@...r.kernel.org
Subject: Re: [PATCH bpf-next v3 3/5] net/smc: bpf: register smc_ops info
struct_ops
On Thu, Dec 19, 2024 at 02:48:12PM -0800, Martin KaFai Lau wrote:
> On 12/17/24 6:44 PM, D. Wythe wrote:
> >+static int smc_bpf_ops_check_member(const struct btf_type *t,
> >+ const struct btf_member *member,
> >+ const struct bpf_prog *prog)
> >+{
> >+ u32 moff = __btf_member_bit_offset(t, member) / 8;
> >+
> >+ switch (moff) {
> >+ case offsetof(struct smc_ops, name):
> >+ case offsetof(struct smc_ops, flags):
> >+ case offsetof(struct smc_ops, set_option):
> >+ case offsetof(struct smc_ops, set_option_cond):
> >+ break;
> >+ default:
> >+ return -EINVAL;
> >+ }
> >+
> >+ return 0;
> >+}
>
> The whole smc_bpf_ops_check_member() should not be needed.
Got it, thanks for that.
D. Wythe
Powered by blists - more mailing lists