From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id 262B32BF4 for ; Fri, 1 Mar 2019 16:38:28 +0100 (CET) Received: by mail-wr1-f65.google.com with SMTP id t18so26360655wrx.2 for ; Fri, 01 Mar 2019 07:38:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:content-transfer-encoding:user-agent:mime-version; bh=qHqr6bEo+c/shIxZBPSjRRlAEAtgnu1tR8jQyUa5kOg=; b=kncH9rhipjFUTYqszYXIh/Q0sjuCgaWCVc+yKgXWyGfIshNuScMDyOlYx9uzb6ZvP2 9pO51LU9mmKjT6CNIpQUU1VAY79LevJEa44xjzX3RtNl9EsX2cAipYp4rt9IhoP+fG8O oaafJK7zohApj2tY/SDMgu+idF53hodbSjtD36VhJRVWL1sIL7lwC+rmrm0LaKCz+I5i bcwCqTbqEGeMDxf9Dv56JhYG2Ds2/hT6vxGKk2I/uXeBi/lgDoGg0FPrxcjM2TXPFQdU F/q4yIvUrWBgb696nPhvpWvNed0vbshzqGBP4mI6jpYwwtqQ75VD3alBCMQKzPueSmVe Pu5g== X-Gm-Message-State: APjAAAUY1NsLvworcWHx9UB6IR/hMG4aFxT5hFLYX4VqFcERh7j8OKaB V724JOl0TWticNd6f6KRVRg= X-Google-Smtp-Source: APXvYqxHv0vf1YFnNnKaMcsVinAhr/uq8To0MFSYsFHpw1/eY06Yw7kTYX7wanHEgJlEORe2o2Vhiw== X-Received: by 2002:adf:de83:: with SMTP id w3mr3790009wrl.56.1551454707587; Fri, 01 Mar 2019 07:38:27 -0800 (PST) Received: from localhost ([2a01:4b00:f419:6f00:b00c:66c8:99df:336]) by smtp.gmail.com with ESMTPSA id t69sm14261323wmt.16.2019.03.01.07.38.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2019 07:38:26 -0800 (PST) Message-ID: From: Luca Boccassi To: Xiaolong Ye , dev@dpdk.org Cc: Qi Zhang Date: Fri, 01 Mar 2019 15:38:26 +0000 In-Reply-To: <20190301080947.91086-2-xiaolong.ye@intel.com> References: <20190301080947.91086-1-xiaolong.ye@intel.com> <20190301080947.91086-2-xiaolong.ye@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.30.5-1 MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v1 1/6] 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: Fri, 01 Mar 2019 15:38:28 -0000 On Fri, 2019-03-01 at 16:09 +0800, 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]. >=20 > This is the vanilla version PMD which just uses a raw buffer > registered as > the umem. >=20 > [1] https://fosdem.org/2018/schedule/event/af_xdp/ > [2] https://lwn.net/Articles/745934/ >=20 > Signed-off-by: Xiaolong Ye > --- > MAINTAINERS | 6 + > config/common_base | 5 + > doc/guides/nics/af_xdp.rst | 43 + > doc/guides/rel_notes/release_18_11.rst | 7 + > drivers/net/Makefile | 1 + > drivers/net/af_xdp/Makefile | 31 + > drivers/net/af_xdp/meson.build | 7 + > drivers/net/af_xdp/rte_eth_af_xdp.c | 903 > ++++++++++++++++++ > drivers/net/af_xdp/rte_pmd_af_xdp_version.map | 4 + > mk/rte.app.mk | 1 + > 10 files changed, 1008 insertions(+) > create mode 100644 doc/guides/nics/af_xdp.rst > create mode 100644 drivers/net/af_xdp/Makefile > create mode 100644 drivers/net/af_xdp/meson.build > create mode 100644 drivers/net/af_xdp/rte_eth_af_xdp.c > create mode 100644 drivers/net/af_xdp/rte_pmd_af_xdp_version.map >=20 <..> > --- a/drivers/net/Makefile > +++ b/drivers/net/Makefile > @@ -9,6 +9,7 @@ ifeq ($(CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD),d) > endif > =20 > DIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) +=3D af_packet > +DIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_XDP) +=3D af_xdp > DIRS-$(CONFIG_RTE_LIBRTE_ARK_PMD) +=3D ark > DIRS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) +=3D atlantic > DIRS-$(CONFIG_RTE_LIBRTE_AVF_PMD) +=3D avf You need a similar change in drivers/net/meson.build > diff --git a/drivers/net/af_xdp/Makefile > b/drivers/net/af_xdp/Makefile > new file mode 100644 > index 000000000..e3755fff2 > --- /dev/null > +++ b/drivers/net/af_xdp/Makefile > @@ -0,0 +1,31 @@ > +# SPDX-License-Identifier: BSD-3-Clause > +# Copyright(c) 2018 Intel Corporation > + > +include $(RTE_SDK)/mk/rte.vars.mk > + > +# > +# library name > +# > +LIB =3D librte_pmd_af_xdp.a > + > +EXPORT_MAP :=3D rte_pmd_af_xdp_version.map > + > +LIBABIVER :=3D 1 > + > + > +CFLAGS +=3D -O3 > +# below line should be removed > +CFLAGS +=3D -I/root/yexl/shared_mks0/linux/tools/include > +CFLAGS +=3D -I/root/yexl/shared_mks0/linux/tools/lib/bpf Leftovers? > +CFLAGS +=3D $(WERROR_FLAGS) > +LDLIBS +=3D -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring > +LDLIBS +=3D -lrte_ethdev -lrte_net -lrte_kvargs > +LDLIBS +=3D -lrte_bus_vdev > + > +# > +# all source are stored in SRCS-y > +# > +SRCS-$(CONFIG_RTE_LIBRTE_PMD_AF_XDP) +=3D rte_eth_af_xdp.c > + > +include $(RTE_SDK)/mk/rte.lib.mk > diff --git a/drivers/net/af_xdp/meson.build > b/drivers/net/af_xdp/meson.build > new file mode 100644 > index 000000000..4b6652685 > --- /dev/null > +++ b/drivers/net/af_xdp/meson.build > @@ -0,0 +1,7 @@ > +# SPDX-License-Identifier: BSD-3-Clause > +# Copyright(c) 2018 Intel Corporation > + > +if host_machine.system() !=3D 'linux' > + build =3D false > +endif > +sources =3D files('rte_eth_af_xdp.c') You need to add a dependency() on libbpf, and given upstream doesn't ship a pkg-config file yet a fallback to find_library, so that the pmd can be linked against it. Check other PMDs to see how dependencies are handled, like drivers/net/pcap/meson.build <..> > diff --git a/drivers/net/af_xdp/rte_pmd_af_xdp_version.map > b/drivers/net/af_xdp/rte_pmd_af_xdp_version.map > new file mode 100644 > index 000000000..ef3539840 > --- /dev/null > +++ b/drivers/net/af_xdp/rte_pmd_af_xdp_version.map > @@ -0,0 +1,4 @@ > +DPDK_2.0 { 2.0 is a bit old :-) > + > + local: *; > +}; > diff --git a/mk/rte.app.mk b/mk/rte.app.mk > index d0ab942d5..db3271c7b 100644 > --- a/mk/rte.app.mk > +++ b/mk/rte.app.mk > @@ -143,6 +143,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL) +=3D > -lrte_mempool_dpaa2 > endif > =20 > _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) +=3D -lrte_pmd_af_packet > +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_XDP) +=3D -lrte_pmd_af_xdp > -lelf -lbpf Are symbols from libelf being used by the PMD? > _LDLIBS-$(CONFIG_RTE_LIBRTE_ARK_PMD) +=3D -lrte_pmd_ark > _LDLIBS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) +=3D -lrte_pmd_atlantic > _LDLIBS-$(CONFIG_RTE_LIBRTE_AVF_PMD) +=3D -lrte_pmd_avf --=20 Kind regards, Luca Boccassi