From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f180.google.com (mail-wr0-f180.google.com [209.85.128.180]) by dpdk.org (Postfix) with ESMTP id 215AF2C5 for ; Thu, 18 May 2017 17:43:16 +0200 (CEST) Received: by mail-wr0-f180.google.com with SMTP id l50so38417012wrc.3 for ; Thu, 18 May 2017 08:43:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hisc2Ye8vftf/EwYm315UzdMxHhAlmLx4fFn3yfEOog=; b=F9SGKRoiyhGI0pAjNrPd0kSX8aCsOqlIr+rR1AShNuzYfhj4JQsSyiWfQXzGDxsAWC En1aEPDtw13MULl8jNg5fWkIdeuG8EnLuFkwqc+VaIaTVqzprhUMdjibuSKTKnjNDV3s UIH0dhsHGvISBcsWuU15V1YPvzLfdwCY4pWtx2QxGZdQ34lDFgrve/21tz/6mrROZHen SDfT7L7ctUdBe0EjEYP2jpvSa3oMMxQxwJIuGrwqLn3k4anMPc+H3ugHxlbHWQ3eaF15 ggZ+yO4KEMSl7MPEbchmyyEs/DcqIGtyKY8I5qgQhyCm7ijNbZqEnvO/kzQQi50r4lLe 3Ohw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hisc2Ye8vftf/EwYm315UzdMxHhAlmLx4fFn3yfEOog=; b=o8RGjCzCt6v9ZzMZfK69HWzpwZSyuVSSclK7y1QELUfKZl6eT5Gaa11P1BHpuLK+pn Yodg2SYzAwTRDCsLZ4PXAZuqfmOeIkPrDRE/Bp1ZfoKfMBv2JP2Mt7pje1rIkHV1bNP8 eH3WDelNU6pvpL2QI1+Y6F1AGvJ9CN8mY23aApFZs3nbIwP1ZIM03vleTjqRjXoIY8rG 7UXZENOtCVwz7GR+ddr0g8Jxeu5RbKMrmhFYU+nvIKtDDpQ6/O4PafvEpgvEbyCcA8vV 3rThFKl7IL5/TXz4YdQMRVZ+IauRE2qfMBgjq85auqxXLMJY02KsM87grTxhsrjwBua1 kVvw== X-Gm-Message-State: AODbwcBNe7YnBI1A7lhB8xD0UihvEFtNhrRWTr31+bkdFSHNo81M7ZVl ayalVnsI3B4+slqHdO4TrA== X-Received: by 10.46.88.15 with SMTP id m15mr1262812ljb.116.1495122195632; Thu, 18 May 2017 08:43:15 -0700 (PDT) Received: from hp3.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id m23sm433114lfj.37.2017.05.18.08.43.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 18 May 2017 08:43:15 -0700 (PDT) From: Michal Krawczyk To: stable@dpdk.org Cc: mw@semihalf.com, gtzalik@amazon.com, evgenys@amazon.com, Michal Krawczyk Date: Thu, 18 May 2017 17:41:51 +0200 Message-Id: <1495122111-10373-2-git-send-email-mk@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1495122111-10373-1-git-send-email-mk@semihalf.com> References: <1495122111-10373-1-git-send-email-mk@semihalf.com> Subject: [dpdk-stable] [PATCH 2/2] net/ena: fix delayed cleanup of Rx descriptors X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 May 2017 15:43:16 -0000 [ backported from upstream commit ec78af6bc0556cf2a1133185ca33fb835b38afe0 ] 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") Cc: stable@dpdk.org Signed-off-by: Michal Krawczyk Reviewed-by: Jakub Palider Acked-by: Jan Medala --- 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 f24fd26..1fc3654 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -1559,13 +1559,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; } -- 2.7.4