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 <xiaolong...@intel.com>
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 <linvi...@tuxdriver.com> > F: drivers/net/af_packet/ > F: doc/guides/nics/features/afpacket.ini > > +Linux AF_XDP > +M: Xiaolong Ye <xiaolong...@intel.com> > +M: Qi Zhang <qi.z.zh...@intel.com> > +F: drivers/net/af_xdp/ > +F: doc/guides/nics/features/af_xdp.rst Can you please add .ini file too? <...> > +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? > + > +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? <...> > +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? <...> > +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? <...> > + 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. <...> > +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 > + "iface=<string> " > + "queue=<int> "); > + > +RTE_INIT(af_xdp_init_log) > +{ > + af_xdp_logtype = rte_log_register("pmd.net.xdp"); why not "pmd.net.af_xdp"? <...> > @@ -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?