Commit 03788f93 authored by Ben Walker's avatar Ben Walker Committed by Daniel Verkamp
Browse files

nvmf: Rename spdk_nvmf_session to spdk_nvmf_ctrlr



This is just a rename - the functionality hasn't changed.
Use the same terminology as the specification (which is controller)
so those familiar with the specification can more easily
approach the code base.

This is still conceptually equivalent to a "session" in the
networking sense.

Change-Id: I388b56df62d19560224c4adc2a03c71eae6fed0d
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/371746


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 5e79d6b8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -146,7 +146,7 @@ disconnect_event(void *arg1, void *arg2)
{
	struct spdk_nvmf_conn *conn = arg1;

	spdk_nvmf_session_disconnect(conn);
	spdk_nvmf_ctrlr_disconnect(conn);
}

static void
+4 −4
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ int spdk_nvmf_tgt_fini(void);
int spdk_nvmf_check_pools(void);

struct spdk_nvmf_subsystem;
struct spdk_nvmf_session;
struct spdk_nvmf_ctrlr;
struct spdk_nvmf_conn;
struct spdk_nvmf_request;
struct spdk_bdev;
@@ -84,7 +84,7 @@ struct spdk_nvmf_subsystem_allowed_listener {

/*
 * The NVMf subsystem, as indicated in the specification, is a collection
 * of virtual controller sessions.  Any individual controller session has
 * of controllers.  Any individual controller has
 * access to all the NVMe device/namespaces maintained by the subsystem.
 */
struct spdk_nvmf_subsystem {
@@ -107,7 +107,7 @@ struct spdk_nvmf_subsystem {
	spdk_nvmf_subsystem_connect_fn		connect_cb;
	spdk_nvmf_subsystem_disconnect_fn	disconnect_cb;

	TAILQ_HEAD(, spdk_nvmf_session)		sessions;
	TAILQ_HEAD(, spdk_nvmf_ctrlr)		ctrlrs;

	TAILQ_HEAD(, spdk_nvmf_host)		hosts;

@@ -172,6 +172,6 @@ void spdk_nvmf_acceptor_poll(void);

void spdk_nvmf_handle_connect(struct spdk_nvmf_request *req);

void spdk_nvmf_session_disconnect(struct spdk_nvmf_conn *conn);
void spdk_nvmf_ctrlr_disconnect(struct spdk_nvmf_conn *conn);

#endif
+3 −3
Original line number Diff line number Diff line
@@ -37,9 +37,9 @@ include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
CFLAGS += $(ENV_CFLAGS)
LIBNAME = nvmf

C_SRCS = subsystem.c nvmf.c \
	 request.c session.c transport.c \
	 ctrlr_discovery.c ctrlr_bdev.c
C_SRCS = ctrlr.c ctrlr_discovery.c ctrlr_bdev.c \
	 subsystem.c nvmf.c \
	 request.c transport.c

C_SRCS-$(CONFIG_RDMA) += rdma.c

+205 −205

File changed and moved.

Preview size limit exceeded, changes collapsed.

+26 −27
Original line number Diff line number Diff line
@@ -31,8 +31,8 @@
 *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef NVMF_SESSION_H
#define NVMF_SESSION_H
#ifndef SPDK_NVMF_CTRLR_H
#define SPDK_NVMF_CTRLR_H

#include "spdk/stdinc.h"

@@ -40,7 +40,7 @@
#include "spdk/queue.h"

/* define a virtual controller limit to the number of QPs supported */
#define MAX_SESSION_IO_QUEUES 64
#define MAX_QPAIRS_PER_CTRLR 64

struct spdk_nvmf_transport;
struct spdk_nvmf_request;
@@ -52,7 +52,7 @@ enum conn_type {

struct spdk_nvmf_conn {
	const struct spdk_nvmf_transport	*transport;
	struct spdk_nvmf_session		*sess;
	struct spdk_nvmf_ctrlr			*ctrlr;
	enum conn_type				type;

	uint16_t				qid;
@@ -63,11 +63,10 @@ struct spdk_nvmf_conn {
};

/*
 * This structure maintains the NVMf virtual controller session
 * state. Each NVMf session permits some number of connections.
 * At least one admin connection and additional IOQ connections.
 * This structure represents an NVMe-oF controller,
 * which is like a "session" in networking terms.
 */
struct spdk_nvmf_session {
struct spdk_nvmf_ctrlr {
	uint16_t			cntlid;
	struct spdk_nvmf_subsystem 	*subsys;

@@ -95,44 +94,44 @@ struct spdk_nvmf_session {
	uint8_t hostid[16];
	const struct spdk_nvmf_transport	*transport;

	TAILQ_ENTRY(spdk_nvmf_session) 		link;
	TAILQ_ENTRY(spdk_nvmf_ctrlr) 		link;
};

void spdk_nvmf_session_connect(struct spdk_nvmf_conn *conn,
void spdk_nvmf_ctrlr_connect(struct spdk_nvmf_conn *conn,
			     struct spdk_nvmf_fabric_connect_cmd *cmd,
			     struct spdk_nvmf_fabric_connect_data *data,
			     struct spdk_nvmf_fabric_connect_rsp *rsp);

struct spdk_nvmf_conn *spdk_nvmf_session_get_conn(struct spdk_nvmf_session *session, uint16_t qid);
struct spdk_nvmf_conn *spdk_nvmf_ctrlr_get_conn(struct spdk_nvmf_ctrlr *ctrlr, uint16_t qid);

struct spdk_nvmf_request *spdk_nvmf_conn_get_request(struct spdk_nvmf_conn *conn, uint16_t cid);

void
spdk_nvmf_property_get(struct spdk_nvmf_session *session,
spdk_nvmf_property_get(struct spdk_nvmf_ctrlr *ctrlr,
		       struct spdk_nvmf_fabric_prop_get_cmd *cmd,
		       struct spdk_nvmf_fabric_prop_get_rsp *response);

void
spdk_nvmf_property_set(struct spdk_nvmf_session *session,
spdk_nvmf_property_set(struct spdk_nvmf_ctrlr *ctrlr,
		       struct spdk_nvmf_fabric_prop_set_cmd *cmd,
		       struct spdk_nvme_cpl *rsp);

int spdk_nvmf_session_poll(struct spdk_nvmf_session *session);
int spdk_nvmf_ctrlr_poll(struct spdk_nvmf_ctrlr *ctrlr);

void spdk_nvmf_session_destruct(struct spdk_nvmf_session *session);
void spdk_nvmf_ctrlr_destruct(struct spdk_nvmf_ctrlr *ctrlr);

int spdk_nvmf_session_set_features_host_identifier(struct spdk_nvmf_request *req);
int spdk_nvmf_session_get_features_host_identifier(struct spdk_nvmf_request *req);
int spdk_nvmf_ctrlr_set_features_host_identifier(struct spdk_nvmf_request *req);
int spdk_nvmf_ctrlr_get_features_host_identifier(struct spdk_nvmf_request *req);

int spdk_nvmf_session_set_features_keep_alive_timer(struct spdk_nvmf_request *req);
int spdk_nvmf_session_get_features_keep_alive_timer(struct spdk_nvmf_request *req);
int spdk_nvmf_ctrlr_set_features_keep_alive_timer(struct spdk_nvmf_request *req);
int spdk_nvmf_ctrlr_get_features_keep_alive_timer(struct spdk_nvmf_request *req);

int spdk_nvmf_session_set_features_number_of_queues(struct spdk_nvmf_request *req);
int spdk_nvmf_session_get_features_number_of_queues(struct spdk_nvmf_request *req);
int spdk_nvmf_ctrlr_set_features_number_of_queues(struct spdk_nvmf_request *req);
int spdk_nvmf_ctrlr_get_features_number_of_queues(struct spdk_nvmf_request *req);

int spdk_nvmf_session_set_features_async_event_configuration(struct spdk_nvmf_request *req);
int spdk_nvmf_session_get_features_async_event_configuration(struct spdk_nvmf_request *req);
int spdk_nvmf_ctrlr_set_features_async_event_configuration(struct spdk_nvmf_request *req);
int spdk_nvmf_ctrlr_get_features_async_event_configuration(struct spdk_nvmf_request *req);

int spdk_nvmf_session_async_event_request(struct spdk_nvmf_request *req);
int spdk_nvmf_ctrlr_async_event_request(struct spdk_nvmf_request *req);

#endif
Loading