DPDK patches and discussions
 help / color / mirror / Atom feed
From: fengchengwen <fengchengwen@huawei.com>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: <thomas@monjalon.net>, <dev@dpdk.org>, <kevin.laatz@intel.com>
Subject: Re: [PATCH] examples/dma: support DMA dequeue when no packet received
Date: Mon, 25 Jul 2022 20:31:15 +0800	[thread overview]
Message-ID: <1135ec65-7a65-520e-9b17-c57b413aea9a@huawei.com> (raw)
In-Reply-To: <Yt5p9qgMWovoQbEW@bricha3-MOBL.ger.corp.intel.com>

On 2022/7/25 18:01, Bruce Richardson wrote:
> On Mon, Jul 25, 2022 at 04:12:12PM +0800, Chengwen Feng wrote:

...

>> -		if (nb_rx == 0)
>> +		if (nb_rx == 0 && copy_mode != COPY_MODE_DMA_NUM)
>>  			continue;
>>  
>>  		port_statistics.rx[rx_config->rxtx_port] += nb_rx;
> 
> With this change, we would work through the all the receive packet
> processing code, and calling all it's functions, just witha packet count of
> zero. I therefore wonder if it would be cleaner to do the dma_dequeue
> immediately here on receiving zero, and then jumping to handle those
> dequeued packets. Something like the diff below.
> 
> /Bruce

Hi Bruce,

  Thank your review, already fix in V2.

> 
> @@ -408,8 +408,13 @@ dma_rx_port(struct rxtx_port_config *rx_config)
>                 nb_rx = rte_eth_rx_burst(rx_config->rxtx_port, i,
>                         pkts_burst, MAX_PKT_BURST);
>  
> -               if (nb_rx == 0)
> +               if (nb_rx == 0) {
> +                       if (copy_mode == COPY_MODE_DMA_NUM &&
> +                                       (nb_rx = dma_dequeue(pkts_burst, pkts_burst_copy,
> +                                               MAX_PKT_BURST, rx_config->dmadev_ids[i])) > 0)
> +                               goto handle_tx;
>                         continue;
> +               }
>  
>                 port_statistics.rx[rx_config->rxtx_port] += nb_rx;
>  
> @@ -450,6 +455,7 @@ dma_rx_port(struct rxtx_port_config *rx_config)
>                                         pkts_burst_copy[j]);
>                 }
>  
> +handle_tx:
>                 rte_mempool_put_bulk(dma_pktmbuf_pool,
>                         (void *)pkts_burst, nb_rx);
> 
> 
> .
> 


      reply	other threads:[~2022-07-25 12:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-25  8:12 Chengwen Feng
2022-07-25 10:01 ` Bruce Richardson
2022-07-25 12:31   ` fengchengwen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1135ec65-7a65-520e-9b17-c57b413aea9a@huawei.com \
    --to=fengchengwen@huawei.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=kevin.laatz@intel.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).