patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@amd.com>
To: longli@linuxonhyperv.com
Cc: dev@dpdk.org, Ajay Sharma <sharmaajay@microsoft.com>,
	Long Li <longli@microsoft.com>,
	stable@dpdk.org, Thomas Monjalon <thomas@monjalon.net>,
	David Marchand <david.marchand@redhat.com>
Subject: Re: [PATCH 2/2] net/mana: optimize completion queue polling by processing a batch at a time
Date: Tue, 2 May 2023 19:23:22 +0100	[thread overview]
Message-ID: <7e8a7552-c707-9579-59ef-248c1ee45443@amd.com> (raw)
In-Reply-To: <1679095964-18532-2-git-send-email-longli@linuxonhyperv.com>

On 3/17/2023 11:32 PM, longli@linuxonhyperv.com wrote:
> -	while (pkt_received < pkts_n &&
> -	       gdma_poll_completion_queue(&rxq->gdma_cq, &comp) == 1) {
> -		struct mana_rxq_desc *desc;
> -		struct mana_rx_comp_oob *oob =
> -			(struct mana_rx_comp_oob *)&comp.completion_data[0];
> -
> -		if (comp.work_queue_number != rxq->gdma_rq.id) {
> -			DRV_LOG(ERR, "rxq comp id mismatch wqid=0x%x rcid=0x%x",
> -				comp.work_queue_number, rxq->gdma_rq.id);
> -			rxq->stats.errors++;
> -			break;
> -		}
> +	num_pkts = gdma_poll_completion_queue(&rxq->gdma_cq, rxq->gdma_comp_buf, pkts_n);
> +	for (uint32_t i = 0; i < num_pkts; i++) {
> +		struct mana_rx_comp_oob *oob = (struct mana_rx_comp_oob *)
> +			rxq->gdma_comp_buf[i].cqe_data;
> +		struct mana_rxq_desc *desc =
> +			&rxq->desc_ring[rxq->desc_ring_tail];


Checkpatch complains about defining variable inside for() [1], but as we
are switching to C99 standard, I don't see any reason to prevent this usage.

I can see relevant checkpatch commit mentions about compiler warning [2]
but not sure if that is still valid with C99 switch, I will send a patch
to discuss this on.



[1]
Warning in drivers/net/mana/rx.c:
Declaring a variable inside for()

[2]
43e73483a4b8 ("devtools: forbid variable declaration inside for")

  reply	other threads:[~2023-05-02 18:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-17 23:32 [PATCH 1/2] net/mana: avoid unnecessary assignments in data path longli
2023-03-17 23:32 ` [PATCH 2/2] net/mana: optimize completion queue polling by processing a batch at a time longli
2023-05-02 18:23   ` Ferruh Yigit [this message]
2023-03-21 11:48 ` [PATCH 1/2] net/mana: avoid unnecessary assignments in data path Ferruh Yigit
2023-03-21 16:31   ` Long Li
2023-05-02 18:32 ` Ferruh Yigit

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=7e8a7552-c707-9579-59ef-248c1ee45443@amd.com \
    --to=ferruh.yigit@amd.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=longli@linuxonhyperv.com \
    --cc=longli@microsoft.com \
    --cc=sharmaajay@microsoft.com \
    --cc=stable@dpdk.org \
    --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).