On Thu, Sep 10, 2020 at 01:56:31PM +0100, Lorenz Bauer wrote: > The mapping between bpf_arg_type and bpf_reg_type is encoded in a big > hairy if statement that is hard to follow. The debug output also leaves > to be desired: if a reg_type doesn't match we only print one of the > options, instead printing all the valid ones. > > Convert the if statement into a table which is then used to drive type > checking. If none of the reg_types match we print all options, e.g.: > > R2 type=rdonly_buf expected=fp, pkt, pkt_meta, map_value Acked-by: Martin KaFai Lau <kafai@xxxxxx>