Re: [PATCH bpf-next v2 1/2] net/smc: Introduce BPF injection capability for SMC

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

 





On 28.02.23 09:50, D. Wythe wrote:


On 2/27/23 3:58 PM, Wenjia Zhang wrote:


On 21.02.23 13:18, D. Wythe wrote:
From: "D. Wythe" <alibuda@xxxxxxxxxxxxxxxxx>

This PATCH attempts to introduce BPF injection capability for SMC.
As we all know that the SMC protocol is not suitable for all scenarios,
especially for short-lived. However, for most applications, they cannot
guarantee that there are no such scenarios at all. Therefore, apps
may need some specific strategies to decide shall we need to use SMC
or not, for example, apps can limit the scope of the SMC to a specific
IP address or port.

...

+static int bpf_smc_passive_sk_ops_check_member(const struct btf_type *t,
+                           const struct btf_member *member,
+                           const struct bpf_prog *prog)
+{
+    return 0;
+}

Please check the right pointer type of check_member:

int (*check_member)(const struct btf_type *t,
             const struct btf_member *member);


Hi Wenjia,

That's weird. the prototype of check_member on
latested net-next and bpf-next is:

struct bpf_struct_ops {
     const struct bpf_verifier_ops *verifier_ops;
     int (*init)(struct btf *btf);
     int (*check_member)(const struct btf_type *t,
                 const struct btf_member *member,
                 const struct bpf_prog *prog);
     int (*init_member)(const struct btf_type *t,
                const struct btf_member *member,
                void *kdata, const void *udata);
     int (*reg)(void *kdata);
     void (*unreg)(void *kdata);
     const struct btf_type *type;
     const struct btf_type *value_type;
     const char *name;
     struct btf_func_model func_models[BPF_STRUCT_OPS_MAX_NR_MEMBERS];
     u32 type_id;
     u32 value_id;
};

I wonder if there is any code out of sync?

And also I found that this patch is too complex and mixed with the code of two modules (smc & bpf).
I will split them out for easier review today.

Best wishes
D. Wythe


Good question, the base I used is the current torvalds tree, maybe some code there is still not up-to-date.

But it would be great if you can split them out for better review.

Thanks
Wenjia



[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