From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id ECCA527D for ; Sat, 2 Mar 2019 09:16:58 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Mar 2019 00:16:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,431,1544515200"; d="scan'208";a="138462382" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.110.206]) by orsmga002.jf.intel.com with ESMTP; 02 Mar 2019 00:16:56 -0800 Date: Sat, 2 Mar 2019 16:14:07 +0800 From: Ye Xiaolong To: Luca Boccassi Cc: dev@dpdk.org, Qi Zhang Message-ID: <20190302081407.GD100586@intel.com> References: <20190301080947.91086-1-xiaolong.ye@intel.com> <20190301080947.91086-2-xiaolong.ye@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) 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: Sat, 02 Mar 2019 08:16:59 -0000 Hi, Luca Thanks for your review. On 03/01, Luca Boccassi wrote: >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]. >> >> 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 >> --- >> 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 >> ><..> > >> --- a/drivers/net/Makefile >> +++ b/drivers/net/Makefile >> @@ -9,6 +9,7 @@ ifeq ($(CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD),d) >> endif >> >> DIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += af_packet >> +DIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_XDP) += af_xdp >> DIRS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark >> DIRS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += atlantic >> DIRS-$(CONFIG_RTE_LIBRTE_AVF_PMD) += avf > >You need a similar change in drivers/net/meson.build will do. > >> 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 = librte_pmd_af_xdp.a >> + >> +EXPORT_MAP := rte_pmd_af_xdp_version.map >> + >> +LIBABIVER := 1 >> + >> + >> +CFLAGS += -O3 >> +# below line should be removed >> +CFLAGS += -I/root/yexl/shared_mks0/linux/tools/include >> +CFLAGS += -I/root/yexl/shared_mks0/linux/tools/lib/bpf > >Leftovers? > Yes, will remove in next version. >> +CFLAGS += $(WERROR_FLAGS) >> +LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring >> +LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs >> +LDLIBS += -lrte_bus_vdev >> + >> +# >> +# all source are stored in SRCS-y >> +# >> +SRCS-$(CONFIG_RTE_LIBRTE_PMD_AF_XDP) += 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() != 'linux' >> + build = false >> +endif >> +sources = 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 > will check the example to see how to handle it correctly. ><..> > >> 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 :-) will change it. > >> + >> + 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) += >> -lrte_mempool_dpaa2 >> endif >> >> _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_XDP) += -lrte_pmd_af_xdp >> -lelf -lbpf > >Are symbols from libelf being used by the PMD? Hmm, it is a leftover of RFC, libelf is no longer needed in this version, will remove it in next version. Thanks, Xiaolong > >> _LDLIBS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += -lrte_pmd_ark >> _LDLIBS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += -lrte_pmd_atlantic >> _LDLIBS-$(CONFIG_RTE_LIBRTE_AVF_PMD) += -lrte_pmd_avf > >-- >Kind regards, >Luca Boccassi