nvmf/tcp: Remove forward declaration of nvme_tcp_req from nvme_tcp.h
This type was actually two entirely different types for the initiator and the target, so just make it void. Change-Id: I15512d9d4efd790dce0fa4323b7230de66144bc6 Signed-off-by: Ben Walker <benjamin.walker@intel.com> Reviewed-on: https://review.gerrithub.io/c/442438 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
b5abed7ea3
commit
d3e3f7622b
@ -67,7 +67,6 @@
|
|||||||
((*((uint8_t *)(B)+3)) = (uint8_t)((uint32_t)(D) >> 24)))
|
((*((uint8_t *)(B)+3)) = (uint8_t)((uint32_t)(D) >> 24)))
|
||||||
|
|
||||||
struct nvme_tcp_qpair;
|
struct nvme_tcp_qpair;
|
||||||
struct nvme_tcp_req;
|
|
||||||
typedef void (*nvme_tcp_qpair_xfer_complete_cb)(void *cb_arg);
|
typedef void (*nvme_tcp_qpair_xfer_complete_cb)(void *cb_arg);
|
||||||
|
|
||||||
struct nvme_tcp_pdu {
|
struct nvme_tcp_pdu {
|
||||||
@ -102,11 +101,12 @@ struct nvme_tcp_pdu {
|
|||||||
uint32_t data_len;
|
uint32_t data_len;
|
||||||
struct nvme_tcp_qpair *tqpair;
|
struct nvme_tcp_qpair *tqpair;
|
||||||
|
|
||||||
struct nvme_tcp_req *tcp_req; /* data tied to a tcp request */
|
|
||||||
uint32_t writev_offset;
|
uint32_t writev_offset;
|
||||||
TAILQ_ENTRY(nvme_tcp_pdu) tailq;
|
TAILQ_ENTRY(nvme_tcp_pdu) tailq;
|
||||||
uint32_t remaining;
|
uint32_t remaining;
|
||||||
uint32_t padding_len;
|
uint32_t padding_len;
|
||||||
|
|
||||||
|
void *ctx; /* data tied to a tcp request */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum nvme_tcp_pdu_recv_state {
|
enum nvme_tcp_pdu_recv_state {
|
||||||
|
@ -964,7 +964,7 @@ nvme_tcp_c2h_data_payload_handle(struct nvme_tcp_qpair *tqpair,
|
|||||||
struct spdk_nvme_cpl cpl = {};
|
struct spdk_nvme_cpl cpl = {};
|
||||||
uint8_t flags;
|
uint8_t flags;
|
||||||
|
|
||||||
tcp_req = pdu->tcp_req;
|
tcp_req = pdu->ctx;
|
||||||
assert(tcp_req != NULL);
|
assert(tcp_req != NULL);
|
||||||
|
|
||||||
SPDK_DEBUGLOG(SPDK_LOG_NVME, "enter\n");
|
SPDK_DEBUGLOG(SPDK_LOG_NVME, "enter\n");
|
||||||
@ -1231,7 +1231,7 @@ nvme_tcp_c2h_data_hdr_handle(struct nvme_tcp_qpair *tqpair, struct nvme_tcp_pdu
|
|||||||
|
|
||||||
nvme_tcp_pdu_set_data_buf(pdu, tcp_req);
|
nvme_tcp_pdu_set_data_buf(pdu, tcp_req);
|
||||||
pdu->data_len = c2h_data->datal;
|
pdu->data_len = c2h_data->datal;
|
||||||
pdu->tcp_req = tcp_req;
|
pdu->ctx = tcp_req;
|
||||||
|
|
||||||
nvme_tcp_qpair_set_recv_state(tqpair, NVME_TCP_PDU_RECV_STATE_AWAIT_PDU_PAYLOAD);
|
nvme_tcp_qpair_set_recv_state(tqpair, NVME_TCP_PDU_RECV_STATE_AWAIT_PDU_PAYLOAD);
|
||||||
return;
|
return;
|
||||||
|
@ -1348,7 +1348,7 @@ spdk_nvmf_tcp_capsule_cmd_hdr_handle(struct spdk_nvmf_tcp_transport *ttransport,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pdu->tcp_req = tcp_req;
|
pdu->ctx = tcp_req;
|
||||||
spdk_nvmf_tcp_req_set_state(tcp_req, TCP_REQUEST_STATE_NEW);
|
spdk_nvmf_tcp_req_set_state(tcp_req, TCP_REQUEST_STATE_NEW);
|
||||||
spdk_nvmf_tcp_req_process(ttransport, tcp_req);
|
spdk_nvmf_tcp_req_process(ttransport, tcp_req);
|
||||||
return;
|
return;
|
||||||
@ -1365,7 +1365,7 @@ spdk_nvmf_tcp_capsule_cmd_payload_handle(struct spdk_nvmf_tcp_transport *ttransp
|
|||||||
enum spdk_nvme_tcp_term_req_fes fes;
|
enum spdk_nvme_tcp_term_req_fes fes;
|
||||||
|
|
||||||
capsule_cmd = &pdu->hdr.capsule_cmd;
|
capsule_cmd = &pdu->hdr.capsule_cmd;
|
||||||
tcp_req = pdu->tcp_req;
|
tcp_req = pdu->ctx;
|
||||||
assert(tcp_req != NULL);
|
assert(tcp_req != NULL);
|
||||||
if (capsule_cmd->common.pdo > SPDK_NVME_TCP_PDU_PDO_MAX_OFFSET) {
|
if (capsule_cmd->common.pdo > SPDK_NVME_TCP_PDU_PDO_MAX_OFFSET) {
|
||||||
SPDK_ERRLOG("Expected ICReq capsule_cmd pdu offset <= %d, got %c\n",
|
SPDK_ERRLOG("Expected ICReq capsule_cmd pdu offset <= %d, got %c\n",
|
||||||
@ -1447,7 +1447,7 @@ spdk_nvmf_tcp_h2c_data_hdr_handle(struct spdk_nvmf_tcp_transport *ttransport,
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
pdu->tcp_req = tcp_req;
|
pdu->ctx = tcp_req;
|
||||||
pdu->data_len = h2c_data->datal;
|
pdu->data_len = h2c_data->datal;
|
||||||
iov_index = pdu->hdr.h2c_data.datao / ttransport->transport.opts.io_unit_size;
|
iov_index = pdu->hdr.h2c_data.datao / ttransport->transport.opts.io_unit_size;
|
||||||
pdu->data = tcp_req->req.iov[iov_index].iov_base + (pdu->hdr.h2c_data.datao %
|
pdu->data = tcp_req->req.iov[iov_index].iov_base + (pdu->hdr.h2c_data.datao %
|
||||||
@ -1574,7 +1574,7 @@ spdk_nvmf_tcp_h2c_data_payload_handle(struct spdk_nvmf_tcp_transport *ttransport
|
|||||||
{
|
{
|
||||||
struct nvme_tcp_req *tcp_req;
|
struct nvme_tcp_req *tcp_req;
|
||||||
|
|
||||||
tcp_req = pdu->tcp_req;
|
tcp_req = pdu->ctx;
|
||||||
assert(tcp_req != NULL);
|
assert(tcp_req != NULL);
|
||||||
|
|
||||||
SPDK_DEBUGLOG(SPDK_LOG_NVMF_TCP, "enter\n");
|
SPDK_DEBUGLOG(SPDK_LOG_NVMF_TCP, "enter\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user