Commit 07ca24ec authored by Ben Walker's avatar Ben Walker Committed by Tomasz Zawadzki
Browse files

thread: Add spdk_thread_get_interrupt_fd_group that returns spdk_fd_group



Return the real spdk_fd_group object so it can later be nested.

Change-Id: I84c8a174c7d177799fa484b350269082c61b18a5
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15474


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarJohn Levon <levon@movementarian.org>
parent 059073c4
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#include <sys/epoll.h>
#endif

#include "spdk/fd_group.h"
#include "spdk/stdinc.h"
#include "spdk/assert.h"
#include "spdk/cpuset.h"
@@ -874,6 +875,17 @@ int spdk_interrupt_set_event_types(struct spdk_interrupt *intr,
 */
int spdk_thread_get_interrupt_fd(struct spdk_thread *thread);

/**
 * Return an fd_group that becomes ready whenever any of the registered
 * interrupt file descriptors are ready
 *
 *
 * \param thread The thread to get.
 *
 * \return The spdk_fd_group of the thread itself.
 */
struct spdk_fd_group *spdk_thread_get_interrupt_fd_group(struct spdk_thread *thread);

/**
 * Set SPDK run as event driven mode
 *
+1 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@
	spdk_interrupt_unregister;
	spdk_interrupt_set_event_types;
	spdk_thread_get_interrupt_fd;
	spdk_thread_get_interrupt_fd_group;
	spdk_interrupt_mode_enable;
	spdk_interrupt_mode_is_enabled;
	spdk_spin_init;
+6 −0
Original line number Diff line number Diff line
@@ -2877,6 +2877,12 @@ spdk_thread_get_interrupt_fd(struct spdk_thread *thread)
	return spdk_fd_group_get_fd(thread->fgrp);
}

struct spdk_fd_group *
spdk_thread_get_interrupt_fd_group(struct spdk_thread *thread)
{
	return thread->fgrp;
}

static bool g_interrupt_mode = false;

int