nvmf: eliminate redundant CID in spdk_nvmf_request
Change-Id: I58ac25c1a7e0d4f1fe32349fff74178843cb5b20 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
08cc45fec4
commit
8e6ef319f6
@ -1138,14 +1138,12 @@ nvmf_recv(struct spdk_nvmf_conn *conn, struct ibv_wc *wc)
|
||||
{
|
||||
struct nvme_qp_rx_desc *rx_desc;
|
||||
struct nvme_qp_tx_desc *tx_desc;
|
||||
struct spdk_nvmf_capsule_cmd *cap_hdr;
|
||||
struct spdk_nvmf_request *req;
|
||||
int ret;
|
||||
|
||||
rx_desc = (struct nvme_qp_rx_desc *)wc->wr_id;
|
||||
cap_hdr = &rx_desc->cmd.nvmf_cmd;
|
||||
|
||||
if (wc->byte_len < sizeof(*cap_hdr)) {
|
||||
if (wc->byte_len < sizeof(struct spdk_nvmf_capsule_cmd)) {
|
||||
SPDK_ERRLOG("recv length less than capsule header\n");
|
||||
return -1;
|
||||
}
|
||||
@ -1163,11 +1161,10 @@ nvmf_recv(struct spdk_nvmf_conn *conn, struct ibv_wc *wc)
|
||||
req->conn = conn;
|
||||
req->tx_desc = tx_desc;
|
||||
req->rx_desc = rx_desc;
|
||||
req->cid = cap_hdr->cid;
|
||||
req->cmd = &rx_desc->cmd;
|
||||
|
||||
ret = spdk_nvmf_request_prep_data(req,
|
||||
rx_desc->bb, wc->byte_len - sizeof(*cap_hdr),
|
||||
rx_desc->bb, wc->byte_len - sizeof(struct spdk_nvmf_capsule_cmd),
|
||||
rx_desc->bb, rx_desc->bb_sgl.length);
|
||||
if (ret < 0) {
|
||||
SPDK_ERRLOG("prep_data failed\n");
|
||||
|
@ -57,7 +57,7 @@ spdk_nvmf_request_complete(struct spdk_nvmf_request *req)
|
||||
response->sqid = 0;
|
||||
response->status.p = 0;
|
||||
response->sqhd = req->conn->sq_head;
|
||||
response->cid = req->cid;
|
||||
response->cid = req->cmd->nvme_cmd.cid;
|
||||
|
||||
SPDK_TRACELOG(SPDK_TRACE_NVMF,
|
||||
"cpl: cdw0=0x%x rsvd1=0x%x sqhd=0x%x sqid=0x%x cid=0x%x status=0x%x\n",
|
||||
|
@ -61,7 +61,6 @@ struct spdk_nvmf_request {
|
||||
struct spdk_nvmf_conn *conn;
|
||||
struct nvme_qp_tx_desc *tx_desc;
|
||||
struct nvme_qp_rx_desc *rx_desc;
|
||||
uint16_t cid; /* command identifier */
|
||||
uint64_t remote_addr;
|
||||
uint32_t rkey;
|
||||
uint32_t length;
|
||||
|
Loading…
x
Reference in New Issue
Block a user