Commit 9f627961 authored by Ben Walker's avatar Ben Walker Committed by Tomasz Zawadzki
Browse files

event: Move RPC server initialization to init



I'm not sure whether this should go into lib/init or to lib/rpc
directly, but I've chosen lib/init for now.

This is to support applications that want to run the SPDK JSON
RPC server, but aren't using the SPDK application framework.

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


Reviewed-by: default avatarTom Nabarro <tom.nabarro@outlook.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
parent dc9374dd
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@
#include "spdk/stdinc.h"

#include "spdk/cpuset.h"
#include "spdk/init.h"
#include "spdk/queue.h"
#include "spdk/log.h"
#include "spdk/thread.h"
@@ -82,8 +83,6 @@ typedef void (*spdk_app_shutdown_cb)(void);
 */
typedef void (*spdk_sighandler_t)(int signal);

#define SPDK_DEFAULT_RPC_ADDR "/var/tmp/spdk.sock"

/**
 * \brief Event framework initialization options
 */
+17 −0
Original line number Diff line number Diff line
@@ -45,6 +45,23 @@
extern "C" {
#endif

#define SPDK_DEFAULT_RPC_ADDR "/var/tmp/spdk.sock"

/**
 * Create the SPDK JSON-RPC server and listen at the provided address. The RPC server is optional and is
 * independent of subsystem initialization. The RPC server can be started and stopped at any time.
 *
 * \param listen_addr Path to a unix domain socket to listen on
 *
 * \return Negated errno on failure. 0 on success.
 */
int spdk_rpc_initialize(const char *listen_addr);

/**
 * Shut down the SPDK JSON-RPC target
 */
void spdk_rpc_finish(void);

typedef void (*spdk_subsystem_init_fn)(int rc, void *ctx);

/**
+0 −3
Original line number Diff line number Diff line
@@ -170,9 +170,6 @@ void spdk_app_json_config_load(const char *json_config_file, const char *rpc_add
			       spdk_app_init_fn cb_fn, void *cb_arg,
			       bool stop_on_error);

int spdk_rpc_initialize(const char *listen_addr);
void spdk_rpc_finish(void);

struct spdk_governor_capabilities {
	bool freq_change;
	bool freq_getset;
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ SO_MINOR := 0
CFLAGS += $(ENV_CFLAGS)

LIBNAME = event
C_SRCS = app.c reactor.c rpc.c json_config.c log_rpc.c \
C_SRCS = app.c reactor.c json_config.c log_rpc.c \
	 app_rpc.c scheduler_static.c

# Do not compile schedulers and governors based on DPDK env
+0 −2
Original line number Diff line number Diff line
@@ -26,8 +26,6 @@
	spdk_for_each_reactor;
	spdk_reactor_set_interrupt_mode;
	spdk_app_json_config_load;
	spdk_rpc_initialize;
	spdk_rpc_finish;

	local: *;
};
Loading