patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Yuanhan Liu <yliu@fridaylinux.org>
To: Michal Krawczyk <mk@semihalf.com>
Cc: dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] patch 'net/ena: fix cleanup of the Tx bufs' has been queued to LTS release 16.11.3
Date: Sat, 15 Jul 2017 19:17:08 +0800	[thread overview]
Message-ID: <1500117433-28932-2-git-send-email-yliu@fridaylinux.org> (raw)
In-Reply-To: <1500117433-28932-1-git-send-email-yliu@fridaylinux.org>

Hi,

FYI, your patch has been queued to LTS release 16.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/19/17. So please
shout if anyone has objections.

Thanks.

	--yliu

---
>From 577a2e5599698a9d63721b5eacfbd73b83618155 Mon Sep 17 00:00:00 2001
From: Michal Krawczyk <mk@semihalf.com>
Date: Tue, 4 Jul 2017 15:51:52 +0200
Subject: [PATCH] net/ena: fix cleanup of the Tx bufs

[ upstream commit 207a514ce516f8ab3c1ad2b0f930f045b90b773c ]

After cleanup of the mbuf on Tx path, queue was still pointing to this
mbuf and upon cleanup of the Tx buffers, it was being freed second time.

Moreover, to make sure that upon interrupt all mbufs will be freed,
whole ring is being cleaned up instead of part of it - originally only
range between head and tail was being cleaned up.

Fixes: 1173fca25af9 ("ena: add polling-mode driver")

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

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 1fc3654..6efe0c3 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -677,11 +677,10 @@ static void ena_rx_queue_release_bufs(struct ena_ring *ring)
 
 static void ena_tx_queue_release_bufs(struct ena_ring *ring)
 {
-	unsigned int ring_mask = ring->ring_size - 1;
+	unsigned int i;
 
-	while (ring->next_to_clean != ring->next_to_use) {
-		struct ena_tx_buffer *tx_buf =
-			&ring->tx_buffer_info[ring->next_to_clean & ring_mask];
+	for (i = 0; i < ring->ring_size; ++i) {
+		struct ena_tx_buffer *tx_buf = &ring->tx_buffer_info[i];
 
 		if (tx_buf->mbuf)
 			rte_pktmbuf_free(tx_buf->mbuf);
@@ -1683,6 +1682,7 @@ static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		/* Free whole mbuf chain  */
 		mbuf = tx_info->mbuf;
 		rte_pktmbuf_free(mbuf);
+		tx_info->mbuf = NULL;
 
 		/* Put back descriptor to the ring for reuse */
 		tx_ring->empty_tx_reqs[next_to_clean & ring_mask] = req_id;
-- 
2.7.4

  reply	other threads:[~2017-07-15 11:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-15 11:17 [dpdk-stable] patch 'net/bonding: change link status check to no-wait' " Yuanhan Liu
2017-07-15 11:17 ` Yuanhan Liu [this message]
2017-07-15 11:17 ` [dpdk-stable] patch 'net/bonding: fix number of bonding Tx/Rx queues' " Yuanhan Liu
2017-07-15 11:17 ` [dpdk-stable] patch 'vhost: fix TCP checksum' " Yuanhan Liu
2017-07-15 11:17 ` [dpdk-stable] patch 'vhost: fix IP " Yuanhan Liu
2017-07-15 11:17 ` [dpdk-stable] patch 'net/virtio: do not falsely claim to do " Yuanhan Liu
2017-07-15 11:17 ` [dpdk-stable] patch 'net/virtio: do not claim to support LRO' " Yuanhan Liu

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=1500117433-28932-2-git-send-email-yliu@fridaylinux.org \
    --to=yliu@fridaylinux.org \
    --cc=mk@semihalf.com \
    --cc=stable@dpdk.org \
    /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).