> -----Original Message-----
> From: Stephen Hemminger [mailto:step...@networkplumber.org]
> Sent: Thursday, March 1, 2018 7:45 AM
> To: Zhang, Qi Z <qi.z.zh...@intel.com>
> Cc: dev@dpdk.org; magnus.karls...@intei.com; Topel, Bjorn
> <bjorn.to...@intel.com>
> Subject: Re: [dpdk-dev] [RFC 1/7] net/af_xdp: new PMD driver
>
> On Tue, 27 Feb 2018 17:33:00 +0800
> Qi Zhang <qi.z.zh...@intel.com> 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.