From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20078.outbound.protection.outlook.com [40.107.2.78]) by dpdk.org (Postfix) with ESMTP id 988EE5323 for ; Thu, 4 Apr 2019 09:01:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kSfGW/S0t36YlKWBbt5Fw4DnKOY8UQqysf0NBeUU8RY=; b=Y9rg+V4YEcfSDhNKU8TKB+ZlMTmLoY2ywDnfrxrltdSr+8TjiiEoyz+DoCmfwlG9N2iPnujfU60r8ngB19T8v7V4mAWuADk4Z9feWUheXuQECNONyUai6DdfHQC27AsD4G5YN41xo8fWAEP3vYwPhokGZ7zrPGKTm3U9nWhGyOM= Received: from DB7PR08MB3385.eurprd08.prod.outlook.com (20.176.238.90) by DB7PR08MB3642.eurprd08.prod.outlook.com (20.177.120.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.17; Thu, 4 Apr 2019 07:01:15 +0000 Received: from DB7PR08MB3385.eurprd08.prod.outlook.com ([fe80::54da:2a4f:adc2:63fe]) by DB7PR08MB3385.eurprd08.prod.outlook.com ([fe80::54da:2a4f:adc2:63fe%5]) with mapi id 15.20.1750.017; Thu, 4 Apr 2019 07:01:15 +0000 From: "Phil Yang (Arm Technology China)" To: Ye Xiaolong , Ferruh Yigit , Luca Boccassi CC: "dev@dpdk.org" , Stephen Hemminger , Qi Zhang , Karlsson Magnus , Topel Bjorn , Maxime Coquelin , Bruce Richardson , Ananyev Konstantin , David Marchand , Andrew Rybchenko , Olivier Matz , nd , nd Thread-Topic: [dpdk-dev] [PATCH v10 1/1] net/af_xdp: introduce AF XDP PMD driver Thread-Index: AQHU6k54ww64o2cHl02D5HClO+lh9qYrgVcAgAAOx9A= Date: Thu, 4 Apr 2019 07:01:15 +0000 Message-ID: References: <20190301080947.91086-1-xiaolong.ye@intel.com> <20190403165949.44857-1-xiaolong.ye@intel.com> <20190403165949.44857-2-xiaolong.ye@intel.com> <25be95ff-132c-9e3e-fe3d-b5aac3dfb388@intel.com> <181fca1e5a2274ad2e7638c25b459ab7f426f254.camel@debian.org> <20190404055515.GB45121@intel.com> In-Reply-To: <20190404055515.GB45121@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Phil.Yang@arm.com; x-originating-ip: [113.29.88.7] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1a4bfcc1-13ea-4e3f-5cde-08d6b8cb5482 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:DB7PR08MB3642; x-ms-traffictypediagnostic: DB7PR08MB3642: x-ms-exchange-purlcount: 3 nodisclaimer: True x-microsoft-antispam-prvs: x-forefront-prvs: 0997523C40 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(136003)(346002)(396003)(366004)(199004)(189003)(13464003)(26005)(7736002)(7416002)(33656002)(53546011)(229853002)(316002)(110136005)(8676002)(55236004)(4326008)(6506007)(74316002)(25786009)(102836004)(54906003)(76176011)(66066001)(53936002)(2906002)(486006)(6116002)(305945005)(446003)(476003)(3846002)(11346002)(93886005)(81156014)(186003)(9686003)(71190400001)(256004)(52536014)(97736004)(99286004)(6246003)(966005)(478600001)(55016002)(71200400001)(6436002)(81166006)(5660300002)(8936002)(106356001)(86362001)(6306002)(72206003)(7696005)(68736007)(14454004)(105586002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR08MB3642; H:DB7PR08MB3385.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: yfGlUkgrwW0Uj4xo71oRZqzNVq/wOM7JdMltVMUo9oXnz2Dqp+crVO6wi4eNA3ejmubkwLaFaUouCuEesxomw7YG47fOee5EEbhviQO6DXCRdj+QOFqC19F9xdHAgYGVZJx0xhMB/e6x/UPs7sG4xKDYFIsGJHFV85h+BCn/kmefpoTimbqzCBlkLRjFyz560vnfxHiTiE0pyoILSHmRXhu4s6nQof88z1hfXixwygtcdH+Fa0cGYpdHSTB4djAqF9BWrMy06tdhStvjWaQw0AloiTckqkOQO1jY3CJ/4xLsQTJwtyGrkZPu6521iYYx6YNVYyF81dY+F5EhA5up19eIlaZuizcvIUwBqK6h4uvq212VBR9NhWhYRJ7nw7ulHHwfA77fRxFqrGJdTq2W0Dh29NUkRBYScGwPtF+5MYk= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a4bfcc1-13ea-4e3f-5cde-08d6b8cb5482 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Apr 2019 07:01:15.3774 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3642 Subject: Re: [dpdk-dev] [PATCH v10 1/1] net/af_xdp: introduce AF XDP PMD driver X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Apr 2019 07:01:16 -0000 > -----Original Message----- > From: dev On Behalf Of Ye Xiaolong > Sent: Thursday, April 4, 2019 1:55 PM > To: Ferruh Yigit ; Luca Boccassi > Cc: dev@dpdk.org; Stephen Hemminger ; > Qi Zhang ; Karlsson Magnus > ; Topel Bjorn ; > Maxime Coquelin ; Bruce Richardson > ; Ananyev Konstantin > ; David Marchand > ; Andrew Rybchenko > ; Olivier Matz > Subject: Re: [dpdk-dev] [PATCH v10 1/1] net/af_xdp: introduce AF XDP PMD > driver >=20 > Hi, Luca >=20 > On 04/03, Luca Boccassi wrote: > >On Wed, 2019-04-03 at 18:44 +0100, Ferruh Yigit wrote: > >> On 4/3/2019 5:59 PM, Xiaolong Ye wrote: > >> > Add a new PMD driver for AF_XDP which is a proposed faster version > >> > of AF_PACKET interface in Linux. More info about AF_XDP, please > >> > refer to [1] [2]. > >> > > >> > This is the vanilla version PMD which just uses a raw buffer > >> > registered as the umem. > >> > > >> > [1] > >> > https://fosdem.org/2018/schedule/event/af_xdp/ > >> > > >> > [2] > >> > https://lwn.net/Articles/745934/ > >> > > >> > > >> > Signed-off-by: Xiaolong Ye < > >> > xiaolong.ye@intel.com > >> > > > >> > >> I am not able to test functionality but code looks good to me, I can > >> compile via Makefile (with suggested steps in doc) but not able to > >> build with meson, can you please check below comments? > >> > >> <...> > >> > >> > @@ -0,0 +1,21 @@ > >> > +# SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2019 Intel > >> > +Corporation > >> > + > >> > +if host_machine.system() !=3D 'linux' > >> > + build =3D false > >> > +endif > >> > >> After this point, if build is false it shouldn't continue to below > >> checks I think. > >> > >> > + > >> > +bpf_dep =3D dependency('libbpf', required: false) > >> > >> My library is in '/usr/local/lib64/libbpf.so' but this line can't > >> find it. Where does 'dependency()' checks for libraries? > > > >dependency() uses only pkg-config (or cmake or embedded specific tools, > >neither of which applies to bpf), so if you haven't built from bpf-next > >you won't have the pkg-config file installed, and it will fall back to > >the next block. > > > >Side note, there's an issue open upstream in Meson to merge > >dependency() and find_library(), with some traction but it's not done > >yet. > > > >For me building from bpf-next it works fine: > > > >$ PKG_CONFIG_PATH=3D/tmp/bpf/lib64/pkgconfig/ ninja -C build-gcc-shared > >... > >Dependency libbpf found: YES 0.0.2 > >... > >$ lddtree build-gcc-shared/drivers/librte_pmd_af_xdp.so.1.1 > >librte_pmd_af_xdp.so.1.1 =3D> build-gcc- > shared/drivers/librte_pmd_af_xdp.so.1.1 (interpreter =3D> none) > > libm.so.6 =3D> /lib/x86_64-linux-gnu/libm.so.6 > > libdl.so.2 =3D> /lib/x86_64-linux-gnu/libdl.so.2 > > libnuma.so.1 =3D> /lib/x86_64-linux-gnu/libnuma.so.1 > > librte_ethdev.so.12 =3D> build-gcc- > shared/drivers/../lib/librte_ethdev.so.12 > > librte_eal.so.10 =3D> build-gcc-shared/drivers/../lib/librte_eal.so.= 10 > > librte_kvargs.so.1 =3D> build-gcc-shared/drivers/../lib/librte_kvarg= s.so.1 > > librte_net.so.1 =3D> build-gcc-shared/drivers/../lib/librte_net.so.1 > > librte_mbuf.so.5 =3D> build-gcc-shared/drivers/../lib/librte_mbuf.so= .5 > > librte_mempool.so.5 =3D> build-gcc- > shared/drivers/../lib/librte_mempool.so.5 > > librte_ring.so.2 =3D> build-gcc-shared/drivers/../lib/librte_ring.so= .2 > > librte_cmdline.so.2 =3D> build-gcc-shared/drivers/../lib/librte_cmdl= ine.so.2 > > librte_meter.so.2 =3D> build-gcc-shared/drivers/../lib/librte_meter.= so.2 > > librte_bus_pci.so.2 =3D> not found > > librte_pci.so.1 =3D> build-gcc-shared/drivers/../lib/librte_pci.so.1 > > librte_bus_vdev.so.2 =3D> not found > > libbsd.so.0 =3D> /lib/x86_64-linux-gnu/libbsd.so.0 > > librt.so.1 =3D> /lib/x86_64-linux-gnu/librt.so.1 > > libbpf.so.0 =3D> /tmp/bpf/lib64/libbpf.so.0 > > libelf.so.1 =3D> /lib/x86_64-linux-gnu/libelf.so.1 > > libz.so.1 =3D> /lib/x86_64-linux-gnu/libz.so.1 > > libpthread.so.0 =3D> /lib/x86_64-linux-gnu/libpthread.so.0 > > libc.so.6 =3D> /lib/x86_64-linux-gnu/libc.so.6 > > ld-linux-x86-64.so.2 =3D> /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 > > > >> > +if bpf_dep.found() > >> > + build =3D true > >> > +else > >> > + bpf_dep =3D cc.find_library('libbpf', required: false) > >> > >> Also this line can't find it, in log it says "(tried pkgconfig and > >> cmake)" and yes there is no pkgconfig for it, any idea how 'cmake' > >> used? > > > >The issue here is that it should be cc.find_library('bpf' - not > >'libbpf'. I missed this when reviewing, good catch. > > > >That's because find_library just does a compilation test passing the > >value to the compiler as a linker flag - so right now it's passing > >-llibbpf. Fixing this line and the header line below makes it work > >without pkg-config: > > > >$ CPPFLAGS=3D-I/tmp/bpf/include LDFLAGS=3D-L/tmp/bpf/lib64 meson testt .= .. > >Dependency libbpf found: NO (tried pkgconfig and cmake) Library bpf > >found: YES >=20 > After apply the fix in af_xdp pmd's meson.build, now I was able to build > library for af_xdp pmd. >=20 > $ ls drivers/ |grep xdp > a715181@@rte_pmd_af_xdp@sha > a715181@@rte_pmd_af_xdp@sta > a715181@@tmp_rte_pmd_af_xdp@sta > librte_pmd_af_xdp.a > librte_pmd_af_xdp.so > librte_pmd_af_xdp.so.1 > librte_pmd_af_xdp.so.1.1 > libtmp_rte_pmd_af_xdp.a > rte_pmd_af_xdp.pmd.c >=20 > But I found that if I install libbpf to /usr/local/lib64 by default, appl= ication built > by meson build will fail to run: >=20 > $ ./dpdk-testpmd > ./dpdk-testpmd: error while loading shared libraries: libbpf.so.0: cannot= open > shared object file: No such file or directory >=20 > While install libbpf to /usr/lib doesn't have this issue (I was testing o= n ubuntu > system). > Is it a expected behavior? Do we need any fix for it? Hi, Xiaolong I have encountered the same issue on ubuntu-arm64-server with Kernel v5.1.0= -rc3+.=20 If I read correctly, I think Luca's patch can solve this issue. https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id= =3Ddd399ac9e343c7573c47d6820e4a23013c54749d=20 So, will this patch in v5.1-rc4 ? Thanks, Phil >=20 > Thanks, > Xiaolong > > > >> > + if bpf_dep.found() and cc.has_header('xsk.h', dependencies: > >> > bpf_dep) and cc.has_header('linux/if_xdp.h') > >> > >> Should this be 'lib/xsk.h' now? > > > >Yes, this should be 'bpf/xsk.h' > > > >-- > >Kind regards, > >Luca Boccassi From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 0A37DA0679 for ; Thu, 4 Apr 2019 09:01:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 85C795398; Thu, 4 Apr 2019 09:01:17 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20078.outbound.protection.outlook.com [40.107.2.78]) by dpdk.org (Postfix) with ESMTP id 988EE5323 for ; Thu, 4 Apr 2019 09:01:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kSfGW/S0t36YlKWBbt5Fw4DnKOY8UQqysf0NBeUU8RY=; b=Y9rg+V4YEcfSDhNKU8TKB+ZlMTmLoY2ywDnfrxrltdSr+8TjiiEoyz+DoCmfwlG9N2iPnujfU60r8ngB19T8v7V4mAWuADk4Z9feWUheXuQECNONyUai6DdfHQC27AsD4G5YN41xo8fWAEP3vYwPhokGZ7zrPGKTm3U9nWhGyOM= Received: from DB7PR08MB3385.eurprd08.prod.outlook.com (20.176.238.90) by DB7PR08MB3642.eurprd08.prod.outlook.com (20.177.120.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.17; Thu, 4 Apr 2019 07:01:15 +0000 Received: from DB7PR08MB3385.eurprd08.prod.outlook.com ([fe80::54da:2a4f:adc2:63fe]) by DB7PR08MB3385.eurprd08.prod.outlook.com ([fe80::54da:2a4f:adc2:63fe%5]) with mapi id 15.20.1750.017; Thu, 4 Apr 2019 07:01:15 +0000 From: "Phil Yang (Arm Technology China)" To: Ye Xiaolong , Ferruh Yigit , Luca Boccassi CC: "dev@dpdk.org" , Stephen Hemminger , Qi Zhang , Karlsson Magnus , Topel Bjorn , Maxime Coquelin , Bruce Richardson , Ananyev Konstantin , David Marchand , Andrew Rybchenko , Olivier Matz , nd , nd Thread-Topic: [dpdk-dev] [PATCH v10 1/1] net/af_xdp: introduce AF XDP PMD driver Thread-Index: AQHU6k54ww64o2cHl02D5HClO+lh9qYrgVcAgAAOx9A= Date: Thu, 4 Apr 2019 07:01:15 +0000 Message-ID: References: <20190301080947.91086-1-xiaolong.ye@intel.com> <20190403165949.44857-1-xiaolong.ye@intel.com> <20190403165949.44857-2-xiaolong.ye@intel.com> <25be95ff-132c-9e3e-fe3d-b5aac3dfb388@intel.com> <181fca1e5a2274ad2e7638c25b459ab7f426f254.camel@debian.org> <20190404055515.GB45121@intel.com> In-Reply-To: <20190404055515.GB45121@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Phil.Yang@arm.com; x-originating-ip: [113.29.88.7] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1a4bfcc1-13ea-4e3f-5cde-08d6b8cb5482 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:DB7PR08MB3642; x-ms-traffictypediagnostic: DB7PR08MB3642: x-ms-exchange-purlcount: 3 nodisclaimer: True x-microsoft-antispam-prvs: x-forefront-prvs: 0997523C40 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(136003)(346002)(396003)(366004)(199004)(189003)(13464003)(26005)(7736002)(7416002)(33656002)(53546011)(229853002)(316002)(110136005)(8676002)(55236004)(4326008)(6506007)(74316002)(25786009)(102836004)(54906003)(76176011)(66066001)(53936002)(2906002)(486006)(6116002)(305945005)(446003)(476003)(3846002)(11346002)(93886005)(81156014)(186003)(9686003)(71190400001)(256004)(52536014)(97736004)(99286004)(6246003)(966005)(478600001)(55016002)(71200400001)(6436002)(81166006)(5660300002)(8936002)(106356001)(86362001)(6306002)(72206003)(7696005)(68736007)(14454004)(105586002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR08MB3642; H:DB7PR08MB3385.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: yfGlUkgrwW0Uj4xo71oRZqzNVq/wOM7JdMltVMUo9oXnz2Dqp+crVO6wi4eNA3ejmubkwLaFaUouCuEesxomw7YG47fOee5EEbhviQO6DXCRdj+QOFqC19F9xdHAgYGVZJx0xhMB/e6x/UPs7sG4xKDYFIsGJHFV85h+BCn/kmefpoTimbqzCBlkLRjFyz560vnfxHiTiE0pyoILSHmRXhu4s6nQof88z1hfXixwygtcdH+Fa0cGYpdHSTB4djAqF9BWrMy06tdhStvjWaQw0AloiTckqkOQO1jY3CJ/4xLsQTJwtyGrkZPu6521iYYx6YNVYyF81dY+F5EhA5up19eIlaZuizcvIUwBqK6h4uvq212VBR9NhWhYRJ7nw7ulHHwfA77fRxFqrGJdTq2W0Dh29NUkRBYScGwPtF+5MYk= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a4bfcc1-13ea-4e3f-5cde-08d6b8cb5482 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Apr 2019 07:01:15.3774 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3642 Subject: Re: [dpdk-dev] [PATCH v10 1/1] net/af_xdp: introduce AF XDP PMD driver X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190404070115.nN6yFrWOEkoJyJfusaJfjitRp5eXdQ10jR2e0dmcOUY@z> > -----Original Message----- > From: dev On Behalf Of Ye Xiaolong > Sent: Thursday, April 4, 2019 1:55 PM > To: Ferruh Yigit ; Luca Boccassi > Cc: dev@dpdk.org; Stephen Hemminger ; > Qi Zhang ; Karlsson Magnus > ; Topel Bjorn ; > Maxime Coquelin ; Bruce Richardson > ; Ananyev Konstantin > ; David Marchand > ; Andrew Rybchenko > ; Olivier Matz > Subject: Re: [dpdk-dev] [PATCH v10 1/1] net/af_xdp: introduce AF XDP PMD > driver >=20 > Hi, Luca >=20 > On 04/03, Luca Boccassi wrote: > >On Wed, 2019-04-03 at 18:44 +0100, Ferruh Yigit wrote: > >> On 4/3/2019 5:59 PM, Xiaolong Ye wrote: > >> > Add a new PMD driver for AF_XDP which is a proposed faster version > >> > of AF_PACKET interface in Linux. More info about AF_XDP, please > >> > refer to [1] [2]. > >> > > >> > This is the vanilla version PMD which just uses a raw buffer > >> > registered as the umem. > >> > > >> > [1] > >> > https://fosdem.org/2018/schedule/event/af_xdp/ > >> > > >> > [2] > >> > https://lwn.net/Articles/745934/ > >> > > >> > > >> > Signed-off-by: Xiaolong Ye < > >> > xiaolong.ye@intel.com > >> > > > >> > >> I am not able to test functionality but code looks good to me, I can > >> compile via Makefile (with suggested steps in doc) but not able to > >> build with meson, can you please check below comments? > >> > >> <...> > >> > >> > @@ -0,0 +1,21 @@ > >> > +# SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2019 Intel > >> > +Corporation > >> > + > >> > +if host_machine.system() !=3D 'linux' > >> > + build =3D false > >> > +endif > >> > >> After this point, if build is false it shouldn't continue to below > >> checks I think. > >> > >> > + > >> > +bpf_dep =3D dependency('libbpf', required: false) > >> > >> My library is in '/usr/local/lib64/libbpf.so' but this line can't > >> find it. Where does 'dependency()' checks for libraries? > > > >dependency() uses only pkg-config (or cmake or embedded specific tools, > >neither of which applies to bpf), so if you haven't built from bpf-next > >you won't have the pkg-config file installed, and it will fall back to > >the next block. > > > >Side note, there's an issue open upstream in Meson to merge > >dependency() and find_library(), with some traction but it's not done > >yet. > > > >For me building from bpf-next it works fine: > > > >$ PKG_CONFIG_PATH=3D/tmp/bpf/lib64/pkgconfig/ ninja -C build-gcc-shared > >... > >Dependency libbpf found: YES 0.0.2 > >... > >$ lddtree build-gcc-shared/drivers/librte_pmd_af_xdp.so.1.1 > >librte_pmd_af_xdp.so.1.1 =3D> build-gcc- > shared/drivers/librte_pmd_af_xdp.so.1.1 (interpreter =3D> none) > > libm.so.6 =3D> /lib/x86_64-linux-gnu/libm.so.6 > > libdl.so.2 =3D> /lib/x86_64-linux-gnu/libdl.so.2 > > libnuma.so.1 =3D> /lib/x86_64-linux-gnu/libnuma.so.1 > > librte_ethdev.so.12 =3D> build-gcc- > shared/drivers/../lib/librte_ethdev.so.12 > > librte_eal.so.10 =3D> build-gcc-shared/drivers/../lib/librte_eal.so.= 10 > > librte_kvargs.so.1 =3D> build-gcc-shared/drivers/../lib/librte_kvarg= s.so.1 > > librte_net.so.1 =3D> build-gcc-shared/drivers/../lib/librte_net.so.1 > > librte_mbuf.so.5 =3D> build-gcc-shared/drivers/../lib/librte_mbuf.so= .5 > > librte_mempool.so.5 =3D> build-gcc- > shared/drivers/../lib/librte_mempool.so.5 > > librte_ring.so.2 =3D> build-gcc-shared/drivers/../lib/librte_ring.so= .2 > > librte_cmdline.so.2 =3D> build-gcc-shared/drivers/../lib/librte_cmdl= ine.so.2 > > librte_meter.so.2 =3D> build-gcc-shared/drivers/../lib/librte_meter.= so.2 > > librte_bus_pci.so.2 =3D> not found > > librte_pci.so.1 =3D> build-gcc-shared/drivers/../lib/librte_pci.so.1 > > librte_bus_vdev.so.2 =3D> not found > > libbsd.so.0 =3D> /lib/x86_64-linux-gnu/libbsd.so.0 > > librt.so.1 =3D> /lib/x86_64-linux-gnu/librt.so.1 > > libbpf.so.0 =3D> /tmp/bpf/lib64/libbpf.so.0 > > libelf.so.1 =3D> /lib/x86_64-linux-gnu/libelf.so.1 > > libz.so.1 =3D> /lib/x86_64-linux-gnu/libz.so.1 > > libpthread.so.0 =3D> /lib/x86_64-linux-gnu/libpthread.so.0 > > libc.so.6 =3D> /lib/x86_64-linux-gnu/libc.so.6 > > ld-linux-x86-64.so.2 =3D> /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 > > > >> > +if bpf_dep.found() > >> > + build =3D true > >> > +else > >> > + bpf_dep =3D cc.find_library('libbpf', required: false) > >> > >> Also this line can't find it, in log it says "(tried pkgconfig and > >> cmake)" and yes there is no pkgconfig for it, any idea how 'cmake' > >> used? > > > >The issue here is that it should be cc.find_library('bpf' - not > >'libbpf'. I missed this when reviewing, good catch. > > > >That's because find_library just does a compilation test passing the > >value to the compiler as a linker flag - so right now it's passing > >-llibbpf. Fixing this line and the header line below makes it work > >without pkg-config: > > > >$ CPPFLAGS=3D-I/tmp/bpf/include LDFLAGS=3D-L/tmp/bpf/lib64 meson testt .= .. > >Dependency libbpf found: NO (tried pkgconfig and cmake) Library bpf > >found: YES >=20 > After apply the fix in af_xdp pmd's meson.build, now I was able to build > library for af_xdp pmd. >=20 > $ ls drivers/ |grep xdp > a715181@@rte_pmd_af_xdp@sha > a715181@@rte_pmd_af_xdp@sta > a715181@@tmp_rte_pmd_af_xdp@sta > librte_pmd_af_xdp.a > librte_pmd_af_xdp.so > librte_pmd_af_xdp.so.1 > librte_pmd_af_xdp.so.1.1 > libtmp_rte_pmd_af_xdp.a > rte_pmd_af_xdp.pmd.c >=20 > But I found that if I install libbpf to /usr/local/lib64 by default, appl= ication built > by meson build will fail to run: >=20 > $ ./dpdk-testpmd > ./dpdk-testpmd: error while loading shared libraries: libbpf.so.0: cannot= open > shared object file: No such file or directory >=20 > While install libbpf to /usr/lib doesn't have this issue (I was testing o= n ubuntu > system). > Is it a expected behavior? Do we need any fix for it? Hi, Xiaolong I have encountered the same issue on ubuntu-arm64-server with Kernel v5.1.0= -rc3+.=20 If I read correctly, I think Luca's patch can solve this issue. https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id= =3Ddd399ac9e343c7573c47d6820e4a23013c54749d=20 So, will this patch in v5.1-rc4 ? Thanks, Phil >=20 > Thanks, > Xiaolong > > > >> > + if bpf_dep.found() and cc.has_header('xsk.h', dependencies: > >> > bpf_dep) and cc.has_header('linux/if_xdp.h') > >> > >> Should this be 'lib/xsk.h' now? > > > >Yes, this should be 'bpf/xsk.h' > > > >-- > >Kind regards, > >Luca Boccassi