For this patch series: Reviewed-by: Yi He <yi...@linaro.org>
On 22 May 2017 at 19:56, Matias Elo <matias....@nokia.com> wrote: > Both ixgbe and i40e dpdk drivers have a minimum supported rx burst size of > four. Additionally, update driver names to match dpdk v17.02. > > Signed-off-by: Matias Elo <matias....@nokia.com> > --- > platform/linux-generic/include/odp_packet_dpdk.h | 4 ++-- > platform/linux-generic/pktio/dpdk.c | 21 > +++++++++++++++------ > 2 files changed, 17 insertions(+), 8 deletions(-) > > diff --git a/platform/linux-generic/include/odp_packet_dpdk.h > b/platform/linux-generic/include/odp_packet_dpdk.h > index 4d7e0fc..cdbd9bb 100644 > --- a/platform/linux-generic/include/odp_packet_dpdk.h > +++ b/platform/linux-generic/include/odp_packet_dpdk.h > @@ -30,12 +30,12 @@ ODP_STATIC_ASSERT((DPDK_NB_MBUF % > DPDK_MEMPOOL_CACHE_SIZE == 0) && > , "DPDK mempool cache size failure"); > #endif > > -#define DPDK_IXGBE_MIN_RX_BURST 4 > +#define DPDK_MIN_RX_BURST 4 > > /** Cache for storing packets */ > struct pkt_cache_t { > /** array for storing extra RX packets */ > - struct rte_mbuf *pkt[DPDK_IXGBE_MIN_RX_BURST]; > + struct rte_mbuf *pkt[DPDK_MIN_RX_BURST]; > unsigned idx; /**< head of cache */ > unsigned count; /**< packets in cache */ > }; > diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/ > pktio/dpdk.c > index 6ac89bd..2ce5a98 100644 > --- a/platform/linux-generic/pktio/dpdk.c > +++ b/platform/linux-generic/pktio/dpdk.c > @@ -29,6 +29,10 @@ > #include <rte_ethdev.h> > #include <rte_string_fns.h> > > +/* DPDK poll mode drivers requiring minimum RX burst size */ > +#define IXGBE_DRV_NAME "net_ixgbe" > +#define I40E_DRV_NAME "net_i40e" > + > static int disable_pktio; /** !0 this pktio disabled, 0 enabled */ > > /* Has dpdk_pktio_init() been called */ > @@ -502,8 +506,13 @@ static int dpdk_open(odp_pktio_t id ODP_UNUSED, > pkt_dpdk->vdev_sysc_promisc = 1; > rte_eth_promiscuous_disable(pkt_dpdk->port_id); > > - if (!strcmp(dev_info.driver_name, "rte_ixgbe_pmd")) > - pkt_dpdk->min_rx_burst = DPDK_IXGBE_MIN_RX_BURST; > + /* Drivers requiring minimum burst size. Supports also *_vf > versions > + * of the drivers. */ > + if (!strncmp(dev_info.driver_name, IXGBE_DRV_NAME, > + strlen(IXGBE_DRV_NAME)) || > + !strncmp(dev_info.driver_name, I40E_DRV_NAME, > + strlen(I40E_DRV_NAME))) > + pkt_dpdk->min_rx_burst = DPDK_MIN_RX_BURST; > else > pkt_dpdk->min_rx_burst = 0; > > @@ -731,10 +740,10 @@ static int dpdk_recv(pktio_entry_t *pktio_entry, int > index, > if (!pkt_dpdk->lockless_rx) > odp_ticketlock_lock(&pkt_dpdk->rx_lock[index]); > /** > - * ixgbe_pmd has a minimum supported RX burst size > ('min_rx_burst'). If > - * 'num' < 'min_rx_burst', 'min_rx_burst' is used as > rte_eth_rx_burst() > - * argument and the possibly received extra packets are cached for > the > - * next dpdk_recv_queue() call to use. > + * ixgbe and i40e drivers have a minimum supported RX burst size > + * ('min_rx_burst'). If 'num' < 'min_rx_burst', 'min_rx_burst' is > used > + * as rte_eth_rx_burst() argument and the possibly received extra > + * packets are cached for the next dpdk_recv_queue() call to use. > * > * Either use cached packets or receive new ones. Not both during > the > * same call. */ > -- > 2.7.4 > >