Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752243AbdLLCXN (ORCPT ); Mon, 11 Dec 2017 21:23:13 -0500 Received: from www62.your-server.de ([213.133.104.62]:38333 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751956AbdLLCXK (ORCPT ); Mon, 11 Dec 2017 21:23:10 -0500 Subject: Re: [PATCH net-next] libbpf: add function to setup XDP To: David Ahern , Eric Leblond , Jakub Kicinski Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ast@kernel.org References: <20171209144315.25890-1-eric@regit.org> <20171209155715.78ef02e1@cakuba.netronome.com> <1512938058.10027.7.camel@regit.org> <49b37939-ebd4-fe92-eeab-e5d2713cadb8@gmail.com> From: Daniel Borkmann Message-ID: <0cd75e2c-7937-af1d-f13c-dc98909c4513@iogearbox.net> Date: Tue, 12 Dec 2017 03:23:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <49b37939-ebd4-fe92-eeab-e5d2713cadb8@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1605 Lines: 41 On 12/10/2017 10:07 PM, David Ahern wrote: > On 12/10/17 1:34 PM, Eric Leblond wrote: >>> Would it be possible to print out or preferably return to the caller >>> the ext ack error message? A couple of drivers are using it for XDP >>> mis-configuration reporting instead of printks. We should encourage >>> other to do the same and support it in all user space since ext ack >>> msgs lead to much better user experience. >> >> I've seen the kind of messages displayed by reading at kernel log. They >> are really useful and it looks almost mandatory to be able to display >> them. >> >> Kernel code seems to not have a parser for the ext ack error message. >> Did I miss something here ? >> >> Looking at tc code, it seems it is using libmnl to parse them and I >> doubt it is a good idea to use that in libbpf as it is introducing a >> dependency. >> >> Does someone has an existing parsing code or should I write on my own ? > > I had worked on extack for libbpf but seem to have lost the changes. > > Look at the commits here: > https://github.com/dsahern/iproute2/commits/ext-ack > > I suggest using this: > > https://github.com/dsahern/iproute2/commit/b61e4c7dd54a5d3ff98640da4b480441cee497b2 > > to bring in nlattr from lib/nlattr (as I recall lib/nlattr can not be > used directly). From there, use this one: > > https://github.com/dsahern/iproute2/commit/261f7251e6704d565b91e310faabbbb7e18d14a1 > > to see what is needed for extack support. > > Really not that much code to add. +1, ext ack support would improve troubleshooting a lot here; please add and respin. Thanks, Eric!