> -----Original Message-----
> From: Stephen Hemminger [mailto:[email protected]]
> Sent: Thursday, March 1, 2018 7:45 AM
> To: Zhang, Qi Z <[email protected]>
> Cc: [email protected]; [email protected]; Topel, Bjorn
> <[email protected]>
> Subject: Re: [dpdk-dev] [RFC 1/7] net/af_xdp: new PMD driver
> 
> On Tue, 27 Feb 2018 17:33:00 +0800
> Qi Zhang <[email protected]> wrote:
> 
> > +
> > +static uint16_t
> > +eth_af_xdp_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
> > +{
> > +   struct pmd_internals *internals = queue;
> > +   struct xdp_queue *rxq = &internals->rx;
> > +   struct rte_mbuf *mbuf;
> > +   unsigned long dropped = 0;
> > +   unsigned long rx_bytes = 0;
> > +   uint16_t count = 0;
> > +
> > +   nb_pkts = nb_pkts < ETH_AF_XDP_RX_BATCH_SIZE ?
> > +             nb_pkts : ETH_AF_XDP_RX_BATCH_SIZE;
> > +
> 
> Put declarations first.
> Why not iterate if nb_pkts is huge?
Yes, it is not necessary to only read one batch, just for simple 
implementation, will be fixed.
> 
> > +   struct xdp_desc descs[ETH_AF_XDP_RX_BATCH_SIZE];
> > +   void *indexes[ETH_AF_XDP_RX_BATCH_SIZE];
> > +   int rcvd, i;
> > +   /* fill rx ring */
> > +   if (rxq->num_free >= ETH_AF_XDP_RX_BATCH_SIZE) {
> 
> Blank line after declarations before code please.

Reply via email to