nvmf: Queue pairs can no longer be removed from poll groups

In RDMA, qpairs can't be removed from poll groups because
the poll group defines the completion queue. So don't
allow this operation anymore, even if it were theoretically
possible on other transports.

Change-Id: I69a3d1b336decd2d25e43ddea94f8b2095ef662f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/421174
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
Ben Walker 2018-08-02 15:27:32 -07:00 committed by Jim Harris
parent 53f86e2412
commit ed60507d5e
6 changed files with 3 additions and 97 deletions

View File

@ -180,17 +180,6 @@ void spdk_nvmf_poll_group_destroy(struct spdk_nvmf_poll_group *group);
int spdk_nvmf_poll_group_add(struct spdk_nvmf_poll_group *group,
struct spdk_nvmf_qpair *qpair);
/**
* Remove the given qpair from the poll group.
*
* \param group The group to delete qpair from.
* \param qpair The qpair to remove.
*
* \return 0 on success, -1 on failure.
*/
int spdk_nvmf_poll_group_remove(struct spdk_nvmf_poll_group *group,
struct spdk_nvmf_qpair *qpair);
typedef void (*nvmf_qpair_disconnect_cb)(void *ctx);
/**

View File

@ -635,27 +635,6 @@ spdk_nvmf_poll_group_add(struct spdk_nvmf_poll_group *group,
return rc;
}
int
spdk_nvmf_poll_group_remove(struct spdk_nvmf_poll_group *group,
struct spdk_nvmf_qpair *qpair)
{
int rc = -1;
struct spdk_nvmf_transport_poll_group *tgroup;
TAILQ_REMOVE(&group->qpairs, qpair, link);
qpair->group = NULL;
TAILQ_FOREACH(tgroup, &group->tgroups, link) {
if (tgroup->transport == qpair->transport) {
rc = spdk_nvmf_transport_poll_group_remove(tgroup, qpair);
break;
}
}
return rc;
}
static
void _nvmf_ctrlr_destruct(void *ctx)
{
@ -698,7 +677,9 @@ _spdk_nvmf_qpair_destroy(void *ctx, int status)
/* store the thread of admin_qpair and use it later */
thread = ctrlr->admin_qpair->group->thread;
}
spdk_nvmf_poll_group_remove(qpair->group, qpair);
TAILQ_REMOVE(&qpair->group->qpairs, qpair, link);
qpair->group = NULL;
assert(qpair->state == SPDK_NVMF_QPAIR_DEACTIVATING);
qpair->state = SPDK_NVMF_QPAIR_INACTIVE;

View File

@ -2301,48 +2301,6 @@ spdk_nvmf_rdma_poll_group_add(struct spdk_nvmf_transport_poll_group *group,
return 0;
}
static int
spdk_nvmf_rdma_poll_group_remove(struct spdk_nvmf_transport_poll_group *group,
struct spdk_nvmf_qpair *qpair)
{
struct spdk_nvmf_rdma_poll_group *rgroup;
struct spdk_nvmf_rdma_qpair *rqpair;
struct spdk_nvmf_rdma_device *device;
struct spdk_nvmf_rdma_poller *poller;
struct spdk_nvmf_rdma_qpair *rq, *trq;
rgroup = SPDK_CONTAINEROF(group, struct spdk_nvmf_rdma_poll_group, group);
rqpair = SPDK_CONTAINEROF(qpair, struct spdk_nvmf_rdma_qpair, qpair);
device = rqpair->port->device;
TAILQ_FOREACH(poller, &rgroup->pollers, link) {
if (poller->device == device) {
break;
}
}
if (!poller) {
SPDK_ERRLOG("No poller found for device.\n");
return -1;
}
TAILQ_FOREACH_SAFE(rq, &poller->qpairs, link, trq) {
if (rq == rqpair) {
TAILQ_REMOVE(&poller->qpairs, rqpair, link);
rqpair->poller = NULL;
break;
}
}
if (rq == NULL) {
SPDK_ERRLOG("RDMA qpair cannot be removed from group (not in group).\n");
return -1;
}
return 0;
}
static int
spdk_nvmf_rdma_request_free(struct spdk_nvmf_request *req)
{
@ -2571,7 +2529,6 @@ const struct spdk_nvmf_transport_ops spdk_nvmf_transport_rdma = {
.poll_group_create = spdk_nvmf_rdma_poll_group_create,
.poll_group_destroy = spdk_nvmf_rdma_poll_group_destroy,
.poll_group_add = spdk_nvmf_rdma_poll_group_add,
.poll_group_remove = spdk_nvmf_rdma_poll_group_remove,
.poll_group_poll = spdk_nvmf_rdma_poll_group_poll,
.req_free = spdk_nvmf_rdma_request_free,

View File

@ -147,13 +147,6 @@ spdk_nvmf_transport_poll_group_add(struct spdk_nvmf_transport_poll_group *group,
return group->transport->ops->poll_group_add(group, qpair);
}
int
spdk_nvmf_transport_poll_group_remove(struct spdk_nvmf_transport_poll_group *group,
struct spdk_nvmf_qpair *qpair)
{
return group->transport->ops->poll_group_remove(group, qpair);
}
int
spdk_nvmf_transport_poll_group_poll(struct spdk_nvmf_transport_poll_group *group)
{

View File

@ -103,12 +103,6 @@ struct spdk_nvmf_transport_ops {
int (*poll_group_add)(struct spdk_nvmf_transport_poll_group *group,
struct spdk_nvmf_qpair *qpair);
/**
* Remove a qpair from a poll group
*/
int (*poll_group_remove)(struct spdk_nvmf_transport_poll_group *group,
struct spdk_nvmf_qpair *qpair);
/**
* Poll the group to process I/O
*/
@ -161,9 +155,6 @@ void spdk_nvmf_transport_poll_group_destroy(struct spdk_nvmf_transport_poll_grou
int spdk_nvmf_transport_poll_group_add(struct spdk_nvmf_transport_poll_group *group,
struct spdk_nvmf_qpair *qpair);
int spdk_nvmf_transport_poll_group_remove(struct spdk_nvmf_transport_poll_group *group,
struct spdk_nvmf_qpair *qpair);
int spdk_nvmf_transport_poll_group_poll(struct spdk_nvmf_transport_poll_group *group);
int spdk_nvmf_transport_req_free(struct spdk_nvmf_request *req);

View File

@ -67,11 +67,6 @@ DEFINE_STUB(spdk_nvmf_poll_group_add,
(struct spdk_nvmf_poll_group *group, struct spdk_nvmf_qpair *qpair),
0);
DEFINE_STUB(spdk_nvmf_poll_group_remove,
int,
(struct spdk_nvmf_poll_group *group, struct spdk_nvmf_qpair *qpair),
0);
DEFINE_STUB(spdk_nvmf_subsystem_get_sn,
const char *,
(const struct spdk_nvmf_subsystem *subsystem),