nvmf: move RDMA internal structs into rdma.c
Clean up everything that isn't strictly necessary in rdma.h. Change-Id: Ied9acbed5f5b64860eae39816cdcb74620009a79 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
1ade6e1dc0
commit
dcc055e31f
@ -31,6 +31,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "rdma.h"
|
||||||
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <infiniband/verbs.h>
|
#include <infiniband/verbs.h>
|
||||||
@ -46,7 +48,7 @@
|
|||||||
#include <rte_malloc.h>
|
#include <rte_malloc.h>
|
||||||
|
|
||||||
#include "conn.h"
|
#include "conn.h"
|
||||||
#include "rdma.h"
|
#include "request.h"
|
||||||
#include "port.h"
|
#include "port.h"
|
||||||
#include "host.h"
|
#include "host.h"
|
||||||
#include "spdk/assert.h"
|
#include "spdk/assert.h"
|
||||||
@ -63,6 +65,38 @@
|
|||||||
#define NVMF_DEFAULT_TX_SGE 1
|
#define NVMF_DEFAULT_TX_SGE 1
|
||||||
#define NVMF_DEFAULT_RX_SGE 2
|
#define NVMF_DEFAULT_RX_SGE 2
|
||||||
|
|
||||||
|
struct spdk_nvmf_rdma_conn {
|
||||||
|
struct spdk_nvmf_conn conn;
|
||||||
|
|
||||||
|
struct rdma_cm_id *cm_id;
|
||||||
|
struct ibv_context *ctx;
|
||||||
|
struct ibv_comp_channel *comp_channel;
|
||||||
|
struct ibv_cq *cq;
|
||||||
|
struct ibv_qp *qp;
|
||||||
|
|
||||||
|
uint16_t queue_depth;
|
||||||
|
|
||||||
|
STAILQ_HEAD(, spdk_nvmf_rdma_request) rdma_reqs;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct spdk_nvmf_rdma_request {
|
||||||
|
struct spdk_nvmf_request req;
|
||||||
|
STAILQ_ENTRY(spdk_nvmf_rdma_request) link;
|
||||||
|
|
||||||
|
union nvmf_h2c_msg cmd;
|
||||||
|
struct ibv_mr *cmd_mr;
|
||||||
|
|
||||||
|
union nvmf_c2h_msg rsp;
|
||||||
|
struct ibv_mr *rsp_mr;
|
||||||
|
|
||||||
|
struct ibv_sge send_sgl;
|
||||||
|
struct ibv_sge recv_sgl[2];
|
||||||
|
|
||||||
|
struct ibv_mr *bb_mr;
|
||||||
|
uint8_t *bb;
|
||||||
|
uint32_t bb_len;
|
||||||
|
};
|
||||||
|
|
||||||
struct spdk_nvmf_rdma {
|
struct spdk_nvmf_rdma {
|
||||||
struct rte_timer acceptor_timer;
|
struct rte_timer acceptor_timer;
|
||||||
struct rdma_event_channel *acceptor_event_channel;
|
struct rdma_event_channel *acceptor_event_channel;
|
||||||
|
@ -34,45 +34,8 @@
|
|||||||
#ifndef _NVMF_RDMA_H_
|
#ifndef _NVMF_RDMA_H_
|
||||||
#define _NVMF_RDMA_H_
|
#define _NVMF_RDMA_H_
|
||||||
|
|
||||||
#include <infiniband/verbs.h>
|
struct spdk_nvmf_conn;
|
||||||
|
struct spdk_nvmf_request;
|
||||||
#include "nvmf_internal.h"
|
|
||||||
#include "conn.h"
|
|
||||||
#include "request.h"
|
|
||||||
#include "spdk/nvmf_spec.h"
|
|
||||||
#include "spdk/queue.h"
|
|
||||||
|
|
||||||
struct spdk_nvmf_rdma_conn {
|
|
||||||
struct spdk_nvmf_conn conn;
|
|
||||||
|
|
||||||
struct rdma_cm_id *cm_id;
|
|
||||||
struct ibv_context *ctx;
|
|
||||||
struct ibv_comp_channel *comp_channel;
|
|
||||||
struct ibv_cq *cq;
|
|
||||||
struct ibv_qp *qp;
|
|
||||||
|
|
||||||
uint16_t queue_depth;
|
|
||||||
|
|
||||||
STAILQ_HEAD(, spdk_nvmf_rdma_request) rdma_reqs;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct spdk_nvmf_rdma_request {
|
|
||||||
struct spdk_nvmf_request req;
|
|
||||||
STAILQ_ENTRY(spdk_nvmf_rdma_request) link;
|
|
||||||
|
|
||||||
union nvmf_h2c_msg cmd;
|
|
||||||
struct ibv_mr *cmd_mr;
|
|
||||||
|
|
||||||
union nvmf_c2h_msg rsp;
|
|
||||||
struct ibv_mr *rsp_mr;
|
|
||||||
|
|
||||||
struct ibv_sge send_sgl;
|
|
||||||
struct ibv_sge recv_sgl[2];
|
|
||||||
|
|
||||||
struct ibv_mr *bb_mr;
|
|
||||||
uint8_t *bb;
|
|
||||||
uint32_t bb_len;
|
|
||||||
};
|
|
||||||
|
|
||||||
int spdk_nvmf_rdma_init(void);
|
int spdk_nvmf_rdma_init(void);
|
||||||
int spdk_nvmf_rdma_fini(void);
|
int spdk_nvmf_rdma_fini(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user