Re: [PATCH net-next] libbpf: add function to setup XDP
From: Alexei Starovoitov
Date: Sat Dec 09 2017 - 12:49:50 EST
On Sat, Dec 09, 2017 at 09:34:46AM -0700, David Ahern wrote:
> On 12/9/17 7:43 AM, Eric Leblond wrote:
> > + /* started nested attribute for XDP */
> > + nla = (struct nlattr *)(((char *)&req)
> > + + NLMSG_ALIGN(req.nh.nlmsg_len));
> > + nla->nla_type = NLA_F_NESTED | 43/*IFLA_XDP*/;
>
> as a part of the move into libbpf can the magic numbers be replaced by
> the names directly and there as a comment?
In general it would be nice to use names instead of numbers,
but it's much bigger change then this patch, since it would require
copying and syncing a bunch of headers into tools/ which may not be such
a good idea in the end.
Only removal of min() looks a bit suspicious to me.
Eric, is it because it now comes from some header?