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?

> +     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