Re: [PATCH bpf-next v3 3/5] net/smc: bpf: register smc_ops info struct_ops

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

 



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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux