nvmf: verify correct IOSQES and IOCQES on connect
The NVMe spec requires that the I/O queue entry size values in CC are set before any I/O queues may be created. Change-Id: I4f0c9a9c20411223d281993745c85a8431197961 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
43510e1292
commit
2d1c3419ad
@ -271,6 +271,20 @@ spdk_nvmf_session_connect(struct spdk_nvmf_conn *conn,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (1u << session->vcprop.cc.bits.iosqes != sizeof(struct spdk_nvme_cmd)) {
|
||||||
|
SPDK_ERRLOG("Got I/O connect with invalid IOSQES %u\n",
|
||||||
|
session->vcprop.cc.bits.iosqes);
|
||||||
|
INVALID_CONNECT_CMD(qid);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (1u << session->vcprop.cc.bits.iocqes != sizeof(struct spdk_nvme_cpl)) {
|
||||||
|
SPDK_ERRLOG("Got I/O connect with invalid IOCQES %u\n",
|
||||||
|
session->vcprop.cc.bits.iocqes);
|
||||||
|
INVALID_CONNECT_CMD(qid);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* check if we would exceed session connection limit */
|
/* check if we would exceed session connection limit */
|
||||||
if (session->num_connections >= session->max_connections_allowed) {
|
if (session->num_connections >= session->max_connections_allowed) {
|
||||||
SPDK_ERRLOG("connection limit %d\n", session->num_connections);
|
SPDK_ERRLOG("connection limit %d\n", session->num_connections);
|
||||||
|
Loading…
Reference in New Issue
Block a user