DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rafal Kozik <rk@semihalf.com>
To: dev@dpdk.org, keith.wiles@intel.com
Cc: mw@semihalf.com, mk@semihalf.com, gtzalik@amazon.com,
	evgenys@amazon.com, matua@amazon.com, igorch@amazon.com,
	Rafal Kozik <rk@semihalf.com>
Subject: [dpdk-dev] [PATCH 1/5] [pktgen] fix race condition in start
Date: Thu, 10 Jan 2019 17:14:02 +0100	[thread overview]
Message-ID: <1547136846-23319-2-git-send-email-rk@semihalf.com> (raw)
In-Reply-To: <1547136846-23319-1-git-send-email-rk@semihalf.com>

Flag SENDING_PACKETS must be set last.
When it is set before SEND_FOREVER flag, Tx lcores start to call
pktgen_send_pkts. But as current_tx_count is 0 and SEND_FOREVER
is not yet set, SENDING_PACKETS will be cleared.
This causes in some cases that start command will no take effect.

Fixes: f5f901fdf52b ("Update for 1.8 rte_mbuf changes.")

Signed-off-by: Rafal Kozik <rk@semihalf.com>
---
 app/pktgen-cmds.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/pktgen-cmds.c b/app/pktgen-cmds.c
index 95f6ef1..655f6bd 100644
--- a/app/pktgen-cmds.c
+++ b/app/pktgen-cmds.c
@@ -1412,10 +1412,10 @@ pktgen_start_transmitting(port_info_t *info)
 		rte_atomic64_set(&info->current_tx_count,
 				 rte_atomic64_read(&info->transmit_count));
 
-		pktgen_set_port_flags(info, SENDING_PACKETS);
-
 		if (rte_atomic64_read(&info->current_tx_count) == 0)
 			pktgen_set_port_flags(info, SEND_FOREVER);
+
+		pktgen_set_port_flags(info, SENDING_PACKETS);
 	}
 }
 
-- 
2.7.4

  reply	other threads:[~2019-01-10 16:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-10 16:14 [dpdk-dev] [PATCH 0/5][pktgen] fixes and minor features Rafal Kozik
2019-01-10 16:14 ` Rafal Kozik [this message]
2019-01-10 16:14 ` [dpdk-dev] [PATCH 2/5] [pktgen] different PCAP per each queue Rafal Kozik
2019-01-10 16:14 ` [dpdk-dev] [PATCH 3/5] [pktgen] use constants for PCAP creation Rafal Kozik
2019-01-10 16:14 ` [dpdk-dev] [PATCH 4/5] [pktgen] expose number of missed Rx packets Rafal Kozik
2019-01-10 16:14 ` [dpdk-dev] [PATCH 5/5] [pktgen] fix cleanup of not sent packets Rafal Kozik

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=1547136846-23319-2-git-send-email-rk@semihalf.com \
    --to=rk@semihalf.com \
    --cc=dev@dpdk.org \
    --cc=evgenys@amazon.com \
    --cc=gtzalik@amazon.com \
    --cc=igorch@amazon.com \
    --cc=keith.wiles@intel.com \
    --cc=matua@amazon.com \
    --cc=mk@semihalf.com \
    --cc=mw@semihalf.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).