DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/3] rte_interrupts: add rte_eal_intr_exit to shut down IRQ thread
@ 2016-02-13 21:38 Matthew Hall
  2016-02-13 21:38 ` [dpdk-dev] [PATCH 2/3] eal_interrupts: mark EAL interrupt thread as a daemon thread Matthew Hall
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Matthew Hall @ 2016-02-13 21:38 UTC (permalink / raw)
  To: dev

There is no good way to shut down this thread from an application signal
handler. Here we add an rte_eal_intr_exit() function to allow this.

Signed-off-by: Matthew Hall <mhall@mhcomputing.net>
---
 lib/librte_eal/common/include/rte_eal.h      |  9 +++++++++
 lib/librte_eal/linuxapp/eal/eal_interrupts.c | 11 +++++++++++
 2 files changed, 20 insertions(+)

diff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h
index d2816a8..1533eeb 100644
--- a/lib/librte_eal/common/include/rte_eal.h
+++ b/lib/librte_eal/common/include/rte_eal.h
@@ -165,6 +165,15 @@ int rte_eal_init(int argc, char **argv);
 typedef void	(*rte_usage_hook_t)(const char * prgname);
 
 /**
+ * Shut down the EAL interrupt thread.
+ *
+ * This function can be called from a signal handler during application
+ * shutdown.
+ *
+ */
+int rte_eal_intr_exit(void);
+
+/**
  * Add application usage routine callout from the eal_usage() routine.
  *
  * This function allows the application to include its usage message
diff --git a/lib/librte_eal/linuxapp/eal/eal_interrupts.c b/lib/librte_eal/linuxapp/eal/eal_interrupts.c
index b33ccdb..aa332a1 100644
--- a/lib/librte_eal/linuxapp/eal/eal_interrupts.c
+++ b/lib/librte_eal/linuxapp/eal/eal_interrupts.c
@@ -892,6 +892,17 @@ rte_eal_intr_init(void)
 		if (ret_1 != 0)
 			RTE_LOG(ERR, EAL,
 			"Failed to set thread name for interrupt handling\n");
+
+int
+rte_eal_intr_exit(void)
+{
+	int ret = 0;
+
+	ret = pthread_cancel(intr_thread);
+	if (ret != 0) {
+		RTE_LOG(ERR, EAL,
+			"Failed to cancel thread for interrupt handling\n");
+		return -ret;
 	}
 
 	return -ret;
-- 
2.5.0

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-07-11  4:07 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-13 21:38 [dpdk-dev] [PATCH 1/3] rte_interrupts: add rte_eal_intr_exit to shut down IRQ thread Matthew Hall
2016-02-13 21:38 ` [dpdk-dev] [PATCH 2/3] eal_interrupts: mark EAL interrupt thread as a daemon thread Matthew Hall
2016-02-13 21:38 ` [dpdk-dev] [PATCH 3/3] rte_epoll_wait: allow EINTR to be passed to caller Matthew Hall
2016-02-28 21:17 ` [dpdk-dev] [PATCH 1/3] rte_interrupts: add rte_eal_intr_exit to shut down IRQ thread Thomas Monjalon
2016-03-08 15:09   ` Thomas Monjalon
2016-03-09  9:05 ` Liang, Cunming
2016-03-17 22:55 ` [dpdk-dev] [dpdk-dev, " Matthew Hall
2016-03-21  7:58   ` Liang, Cunming
2016-03-22  7:39     ` Matthew Hall
2016-03-23  3:24       ` Liang, Cunming
2016-07-08 17:36         ` Thomas Monjalon
2016-07-11  4:07           ` Liang, Cunming

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).