DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Chengwen Feng <fengchengwen@huawei.com>,
	Kevin Laatz <kevin.laatz@intel.com>,
	Bruce Richardson <bruce.richardson@intel.com>
Subject: [RFC 4/6] dma/skeleton: avoid use of pthread_cancel
Date: Wed, 24 Sep 2025 09:51:11 -0700	[thread overview]
Message-ID: <20250924165527.268645-5-stephen@networkplumber.org> (raw)
In-Reply-To: <20250924165527.268645-1-stephen@networkplumber.org>

Can use exit_flag to do controlled shutdown of the control thread.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/dma/skeleton/skeleton_dmadev.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/dma/skeleton/skeleton_dmadev.c b/drivers/dma/skeleton/skeleton_dmadev.c
index e287802eb9..62a25f9d34 100644
--- a/drivers/dma/skeleton/skeleton_dmadev.c
+++ b/drivers/dma/skeleton/skeleton_dmadev.c
@@ -5,8 +5,6 @@
 #include <inttypes.h>
 #include <stdlib.h>
 
-#include <pthread.h>
-
 #include <bus_vdev_driver.h>
 #include <rte_cycles.h>
 #include <rte_eal.h>
@@ -215,10 +213,9 @@ skeldma_stop(struct rte_dma_dev *dev)
 {
 	struct skeldma_hw *hw = dev->data->dev_private;
 
+	/* setting exit flag causes cpuwork_thread to exit polling loop */
 	hw->exit_flag = true;
-	rte_delay_ms(1);
 
-	(void)pthread_cancel((pthread_t)hw->thread.opaque_id);
 	rte_thread_join(hw->thread, NULL);
 
 	return 0;
-- 
2.47.3


  parent reply	other threads:[~2025-09-24 16:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-24 16:51 [RFC 0/6] get rid " Stephen Hemminger
2025-09-24 16:51 ` [RFC 1/6] eal: avoid using pthread_cancel Stephen Hemminger
2025-09-24 16:51 ` [RFC 2/6] eventdev: avoid use of pthread_cancel Stephen Hemminger
2025-09-24 16:51 ` [RFC 3/6] raw/ifpga: " Stephen Hemminger
2025-09-24 16:51 ` Stephen Hemminger [this message]
2025-09-25  1:20   ` [RFC 4/6] dma/skeleton: " fengchengwen
2025-09-24 16:51 ` [RFC 5/6] intel/ipn3ke: " Stephen Hemminger
2025-09-24 16:51 ` [RFC 6/6] intel/iavf: remove " Stephen Hemminger
2025-09-25 15:11   ` Bruce Richardson

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=20250924165527.268645-5-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=kevin.laatz@intel.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).