Subject: Re: [bpf-next v2 PATCH 2/3] samples/bpf: make xdp_fwd more practically usable via devmap lookup

From: Jesper Dangaard Brouer <[email-masked]>
Date: Thu, 8 Aug 2019 17:58:14 +0200

On Thu, 08 Aug 2019 17:46:46 +0200
Jesper Dangaard Brouer <[email-masked]> wrote:

> @@ -103,8 +112,17 @@ int main(int argc, char **argv)
>  			return 1;
>  		}
>  
> -		if (bpf_prog_load_xattr(&prog_load_attr, &obj, &prog_fd))
> +		err = bpf_prog_load_xattr(&prog_load_attr, &obj, &prog_fd);
> +		if (err) {
> +			if (err == -22) {

Darn - I forgot this, need to be changed.
I'll send a V3.

> +				printf("Does kernel support devmap lookup?\n");
> +				/* If not, the error message will be:
> +				 * "cannot pass map_type 14 into func
> +				 * bpf_map_lookup_elem#1"
> +				 */
> +			}
>  			return 1;

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer