On 5/22/20 10:11 AM, Lorenzo Bianconi wrote:
> @@ -307,8 +354,23 @@ static int cpu_map_kthread_run(void *data)
>       return 0;
>  }
>  
> -static struct bpf_cpu_map_entry *__cpu_map_entry_alloc(u32 qsize, u32 cpu,
> -                                                    int map_id)
> +static int __cpu_map_load_bpf_program(struct bpf_cpu_map_entry *rcpu,
> +                                   u32 prog_id)
> +{
> +     struct bpf_prog *prog;
> +
> +     /* TODO attach type */
> +     prog = bpf_prog_by_id(prog_id);
> +     if (IS_ERR(prog) || prog->type != BPF_PROG_TYPE_XDP)
> +             return -EINVAL;

Add check that expected_attach_type is NOT set since it uses existing
xdp programs which should not have it set.

Reply via email to