Subject: Re: [RFC PATCH 4/5] mlx4: add support for fast rx drop bpf program

From: Johannes Berg <[email-masked]>
Date: Sat, 02 Apr 2016 20:40:55 +0200

On Fri, 2016-04-01 at 18:21 -0700, Brenden Blanco wrote:

> +static int mlx4_bpf_set(struct net_device *dev, int fd)
> +{
[...]
> +		if (prog->type != BPF_PROG_TYPE_PHYS_DEV) {
> +			bpf_prog_put(prog);
> +			return -EINVAL;
> +		}
> +	}

Why wouldn't this check be done in the generic code that calls
ndo_bpf_set()?

johannes