From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Kicinski Subject: Re: [oss-drivers] Re: [RFC bpf-next PATCH] samples/bpf: xdp1 add XDP hardware offload option Date: Tue, 4 Sep 2018 18:59:57 +0200 Message-ID: <20180904185957.0d344534@cakuba> References: <153607315988.23449.13651086600809900701.stgit@firesoul> <20180904170912.2ca43ffa@cakuba> <20180904184933.5ff1ed19@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Nick Viljoen , oss-drivers@netronome.com, netdev@vger.kernel.org, "John W. Linville" , jhsiao@redhat.com, Quentin Monnet To: Jesper Dangaard Brouer Return-path: Received: from mail-pf1-f196.google.com ([209.85.210.196]:40983 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726167AbeIDV0J (ORCPT ); Tue, 4 Sep 2018 17:26:09 -0400 Received: by mail-pf1-f196.google.com with SMTP id h79-v6so1986277pfk.8 for ; Tue, 04 Sep 2018 10:00:11 -0700 (PDT) In-Reply-To: <20180904184933.5ff1ed19@redhat.com> Sender: netdev-owner@vger.kernel.org List-ID: On Tue, 4 Sep 2018 18:49:33 +0200, Jesper Dangaard Brouer wrote: > On Tue, 4 Sep 2018 17:09:12 +0200 > Jakub Kicinski wrote: > > > On Tue, 04 Sep 2018 16:59:19 +0200, Jesper Dangaard Brouer wrote: > > > Trying to use XDP hardware offloading via XDP_FLAGS_HW_MODE > > > and setting the ifindex in prog_load_attr.ifindex before > > > loading the BPF code via bpf_prog_load_xattr(). > > > > > > This unfortunately does not seem to work... > > > - Am I doing something wrong? > > > > > > Notice, I also disable the map BPF_MAP_TYPE_PERCPU_ARRAY > > > to make sure it was not related to the map (not supporting > > > offloading). > > > > > > Failed with: > > > # ./xdp1 -O $( > > libbpf: load bpf program failed: Invalid argument > > > libbpf: failed to load program 'xdp1' > > > libbpf: failed to load object './xdp1_kern.o' > > > > > > Tested on kernel 4.18.0-2.el8.x86_64 with driver nfp > > > Ethernet controller: Netronome Systems, Inc. Device 4000 > > > > Are you running the BPF capable FW? > > > > https://help.netronome.com/support/solutions/articles/36000050009-agilio-ebpf-2-0-6-extended-berkeley-packet-filter > > I'm likely not running the correct firmware... > > Can you tell me, with the ethtool -i output, if I'm running the > appropriate firmware? > > # ethtool -i enp129s0np1 > driver: nfp > version: 4.18.0-2.el8.x86_64 SMP mod_unl > firmware-version: 0.0.3.5 0.21 nic-2.0.7 nic > expansion-rom-version: > bus-info: 0000:81:00.0 > supports-statistics: yes > supports-test: no > supports-eeprom-access: no > supports-register-dump: yes > supports-priv-flags: no Yup, the BPF firmware says bpf in firmware version. > If this is a firmware version case, then we should really improve the > errors we are giving the user, the -EINVAL can be anything. > > "libbpf: load bpf program failed: Invalid argument" That is true.