From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexei Starovoitov Subject: Re: [PATCH net-next] libbpf: add function to setup XDP Date: Sat, 9 Dec 2017 09:49:38 -0800 Message-ID: <20171209174936.o7jpoptuwisvjx3n@ast-mbp> References: <20171209144315.25890-1-eric@regit.org> <446f0215-542c-d482-109b-20149a7ff28f@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Eric Leblond , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net To: David Ahern Return-path: Content-Disposition: inline In-Reply-To: <446f0215-542c-d482-109b-20149a7ff28f@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org 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?