DPDK patches and discussions
 help / color / mirror / Atom feed
From: Marcin Wojtas <mw@semihalf.com>
To: dev@dpdk.org
Cc: jan.medala@outlook.com, jpalider@gmail.com, netanel@amazon.com,
	evgenys@amazon.com, matua@amazon.com, gtzalik@amazon.com,
	igorch@amazon.com, mw@semihalf.com, mk@semihalf.com
Subject: [dpdk-dev] [PATCH v2 2/4] net/ena: fix delayed cleanup of Rx descriptors
Date: Mon, 10 Apr 2017 16:28:09 +0200	[thread overview]
Message-ID: <1491834491-13944-3-git-send-email-mw@semihalf.com> (raw)
In-Reply-To: <1491834491-13944-1-git-send-email-mw@semihalf.com>

From: Michal Krawczyk <mk@semihalf.com>

On RX path, after receiving bunch of packets, variable tracking
available descriptors in HW queue was not updated.

To fix this issue, variable tracking used descriptors must be updated
after receiving packets - it must be reduced by the amount of received
descriptors in current batch.

Additionally, variable next_to_clean in rx_ring must be updated before
entering ena_populate_rx_queue() to keep it up to date with the current
ring state.

Fixes: 1daff5260ff8 ("net/ena: use unmasked head and tail")

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
---
 drivers/net/ena/ena_ethdev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 90cf2ad..b4c713f 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -1575,13 +1575,13 @@ static uint16_t eth_ena_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 		recv_idx++;
 	}
 
-	desc_in_use += 1;
+	rx_ring->next_to_clean = next_to_clean;
+
+	desc_in_use = desc_in_use - completed + 1;
 	/* Burst refill to save doorbells, memory barriers, const interval */
 	if (ring_size - desc_in_use > ENA_RING_DESCS_RATIO(ring_size))
 		ena_populate_rx_queue(rx_ring, ring_size - desc_in_use);
 
-	rx_ring->next_to_clean = next_to_clean;
-
 	return recv_idx;
 }
 
-- 
1.8.3.1

  parent reply	other threads:[~2017-04-10 14:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-10 14:28 [dpdk-dev] [PATCH v2 0/4] Ena PMD fixes Marcin Wojtas
2017-04-10 14:28 ` [dpdk-dev] [PATCH v2 1/4] net/ena: fix incorrect Rx descriptors allocation Marcin Wojtas
2017-04-10 14:28 ` Marcin Wojtas [this message]
2017-04-10 14:28 ` [dpdk-dev] [PATCH v2 3/4] net/ena: cleanup if refilling of rx descriptors fails Marcin Wojtas
2017-04-10 14:28 ` [dpdk-dev] [PATCH v2 4/4] net/ena: calculate partial checksum if DF bit is disabled Marcin Wojtas
2017-04-10 22:20 ` [dpdk-dev] [PATCH v2 0/4] Ena PMD fixes Jakub Palider
2017-04-12 11:22   ` Ferruh Yigit
2017-04-11  8:29 ` Jan M?dala

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=1491834491-13944-3-git-send-email-mw@semihalf.com \
    --to=mw@semihalf.com \
    --cc=dev@dpdk.org \
    --cc=evgenys@amazon.com \
    --cc=gtzalik@amazon.com \
    --cc=igorch@amazon.com \
    --cc=jan.medala@outlook.com \
    --cc=jpalider@gmail.com \
    --cc=matua@amazon.com \
    --cc=mk@semihalf.com \
    --cc=netanel@amazon.com \
    /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).