From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 562152C55 for ; Fri, 29 Mar 2019 03:09:40 +0100 (CET) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Mar 2019 19:09:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,282,1549958400"; d="scan'208";a="218611797" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.110.206]) by orsmga001.jf.intel.com with ESMTP; 28 Mar 2019 19:09:36 -0700 Date: Fri, 29 Mar 2019 10:05:05 +0800 From: Ye Xiaolong To: Ferruh Yigit Cc: dev@dpdk.org, David Marchand , Andrew Rybchenko , Qi Zhang , Karlsson Magnus , Topel Bjorn , Maxime Coquelin , Stephen Hemminger , Luca Boccassi , Bruce Richardson , Ananyev Konstantin Message-ID: <20190329020505.GB92946@intel.com> References: <20190301080947.91086-1-xiaolong.ye@intel.com> <20190327090027.72170-1-xiaolong.ye@intel.com> <20190327090027.72170-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 v7 1/5] 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, 29 Mar 2019 02:09:40 -0000 Hi, Ferruh Thanks for the comments. On 03/28, Ferruh Yigit wrote: >On 3/27/2019 9:00 AM, 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 > >Hi Xiaolong, > >Mostly looks good, only there are a few comments on minor issues, can you please >check them? > ><...> > >> @@ -474,6 +474,12 @@ M: John W. Linville >> F: drivers/net/af_packet/ >> F: doc/guides/nics/features/afpacket.ini >> >> +Linux AF_XDP >> +M: Xiaolong Ye >> +M: Qi Zhang >> +F: drivers/net/af_xdp/ >> +F: doc/guides/nics/features/af_xdp.rst > >Can you please add .ini file too? Will add. > ><...> > >> +static const char * const valid_arguments[] = { >> + ETH_AF_XDP_IFACE_ARG, >> + ETH_AF_XDP_QUEUE_IDX_ARG, >> + NULL >> +}; > >Minor issue, but can you please keep close the .*ARG defines and this structure, >either move this up or move defines down just above this struct? Got it, I'll put them together. > >> + >> +static struct rte_eth_link pmd_link = { >> + .link_speed = ETH_SPEED_NUM_10G, >> + .link_duplex = ETH_LINK_FULL_DUPLEX, >> + .link_status = ETH_LINK_DOWN, >> + .link_autoneg = ETH_LINK_AUTONEG >> +}; > >Can this variable be const? Will do. > ><...> > >> +static void >> +eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) >> +{ >> + struct pmd_internals *internals = dev->data->dev_private; >> + >> + dev_info->if_index = internals->if_index; >> + dev_info->max_mac_addrs = 1; >> + dev_info->max_rx_pktlen = ETH_FRAME_LEN; >> + dev_info->max_rx_queues = 1; >> + dev_info->max_tx_queues = 1; > >What do you think documenting the only single queue supported limitation? I've mentioned the single queue limitation in af_xdp.rst, or you mean we also need to comment it here? > ><...> > >> +static void remove_xdp_program(struct pmd_internals *internals) >> +{ > >According coding convention it should be: > >static void >remove_xdp_program(struct pmd_internals *internals) >{ > >There is a usage of mixture, can you please update them according convention? > ><...> Will do. > >> + if (parse_parameters(kvlist, if_name, &xsk_queue_idx) < 0) { >> + AF_XDP_LOG(ERR, "Invalid kvargs value\n"); >> + return -EINVAL; >> + } > >At this point we don't know if the user provided a "if_name" value, needs a way >to confirm mandantory devargs provided before continue. > ><...> Got it, will do. > >> +RTE_PMD_REGISTER_VDEV(net_af_xdp, pmd_af_xdp_drv); >> +RTE_PMD_REGISTER_PARAM_STRING(eth_af_xdp, > >s/eth_af_xdp/net_af_xdp Got it. > >> + "iface= " >> + "queue= "); >> + >> +RTE_INIT(af_xdp_init_log) >> +{ >> + af_xdp_logtype = rte_log_register("pmd.net.xdp"); > >why not "pmd.net.af_xdp"? Will do. > ><...> > >> @@ -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 > >Is "-lelf" still required? Will remove it since Bjorn hasn't sent the fix patch to kernel community. Thanks, Xiaolong 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 298F0A0679 for ; Fri, 29 Mar 2019 03:09:42 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F3AED2D13; Fri, 29 Mar 2019 03:09:41 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 562152C55 for ; Fri, 29 Mar 2019 03:09:40 +0100 (CET) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Mar 2019 19:09:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,282,1549958400"; d="scan'208";a="218611797" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.110.206]) by orsmga001.jf.intel.com with ESMTP; 28 Mar 2019 19:09:36 -0700 Date: Fri, 29 Mar 2019 10:05:05 +0800 From: Ye Xiaolong To: Ferruh Yigit Cc: dev@dpdk.org, David Marchand , Andrew Rybchenko , Qi Zhang , Karlsson Magnus , Topel Bjorn , Maxime Coquelin , Stephen Hemminger , Luca Boccassi , Bruce Richardson , Ananyev Konstantin Message-ID: <20190329020505.GB92946@intel.com> References: <20190301080947.91086-1-xiaolong.ye@intel.com> <20190327090027.72170-1-xiaolong.ye@intel.com> <20190327090027.72170-2-xiaolong.ye@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v7 1/5] 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: <20190329020505.xbawexLsUL5-vMGMlh13jWQMHu4pCXm9O_JsLXGwNG0@z> Hi, Ferruh Thanks for the comments. On 03/28, Ferruh Yigit wrote: >On 3/27/2019 9:00 AM, 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 > >Hi Xiaolong, > >Mostly looks good, only there are a few comments on minor issues, can you please >check them? > ><...> > >> @@ -474,6 +474,12 @@ M: John W. Linville >> F: drivers/net/af_packet/ >> F: doc/guides/nics/features/afpacket.ini >> >> +Linux AF_XDP >> +M: Xiaolong Ye >> +M: Qi Zhang >> +F: drivers/net/af_xdp/ >> +F: doc/guides/nics/features/af_xdp.rst > >Can you please add .ini file too? Will add. > ><...> > >> +static const char * const valid_arguments[] = { >> + ETH_AF_XDP_IFACE_ARG, >> + ETH_AF_XDP_QUEUE_IDX_ARG, >> + NULL >> +}; > >Minor issue, but can you please keep close the .*ARG defines and this structure, >either move this up or move defines down just above this struct? Got it, I'll put them together. > >> + >> +static struct rte_eth_link pmd_link = { >> + .link_speed = ETH_SPEED_NUM_10G, >> + .link_duplex = ETH_LINK_FULL_DUPLEX, >> + .link_status = ETH_LINK_DOWN, >> + .link_autoneg = ETH_LINK_AUTONEG >> +}; > >Can this variable be const? Will do. > ><...> > >> +static void >> +eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) >> +{ >> + struct pmd_internals *internals = dev->data->dev_private; >> + >> + dev_info->if_index = internals->if_index; >> + dev_info->max_mac_addrs = 1; >> + dev_info->max_rx_pktlen = ETH_FRAME_LEN; >> + dev_info->max_rx_queues = 1; >> + dev_info->max_tx_queues = 1; > >What do you think documenting the only single queue supported limitation? I've mentioned the single queue limitation in af_xdp.rst, or you mean we also need to comment it here? > ><...> > >> +static void remove_xdp_program(struct pmd_internals *internals) >> +{ > >According coding convention it should be: > >static void >remove_xdp_program(struct pmd_internals *internals) >{ > >There is a usage of mixture, can you please update them according convention? > ><...> Will do. > >> + if (parse_parameters(kvlist, if_name, &xsk_queue_idx) < 0) { >> + AF_XDP_LOG(ERR, "Invalid kvargs value\n"); >> + return -EINVAL; >> + } > >At this point we don't know if the user provided a "if_name" value, needs a way >to confirm mandantory devargs provided before continue. > ><...> Got it, will do. > >> +RTE_PMD_REGISTER_VDEV(net_af_xdp, pmd_af_xdp_drv); >> +RTE_PMD_REGISTER_PARAM_STRING(eth_af_xdp, > >s/eth_af_xdp/net_af_xdp Got it. > >> + "iface= " >> + "queue= "); >> + >> +RTE_INIT(af_xdp_init_log) >> +{ >> + af_xdp_logtype = rte_log_register("pmd.net.xdp"); > >why not "pmd.net.af_xdp"? Will do. > ><...> > >> @@ -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 > >Is "-lelf" still required? Will remove it since Bjorn hasn't sent the fix patch to kernel community. Thanks, Xiaolong