diff options
author | Benoît Ganne <bganne@cisco.com> | 2019-08-21 15:11:43 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-08-26 14:10:36 +0000 |
commit | e7e8bf37f100b20acb99957572f1796f648c2853 (patch) | |
tree | 393bd5d4e67a7ee12d53fe53d6e32c9be064a73d /src/plugins/rdma/rdma.h | |
parent | 92f190a802b6999ce68696032e556aa75171e1cc (diff) |
rdma: use rings for buffers management
Refactor rdma driver for improved performance and prepare for raw
datapath access.
Type: refactor
Change-Id: Iae31872055a6947708ea9f430bd1dc083ea63b5a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/plugins/rdma/rdma.h')
-rw-r--r-- | src/plugins/rdma/rdma.h | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/src/plugins/rdma/rdma.h b/src/plugins/rdma/rdma.h index c7df6f72fdf..0aae4985276 100644 --- a/src/plugins/rdma/rdma.h +++ b/src/plugins/rdma/rdma.h @@ -37,40 +37,47 @@ enum typedef struct { CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); - u32 size; - u32 n_enq; struct ibv_cq *cq; struct ibv_wq *wq; + u32 *bufs; + u32 size; + u32 head; + u32 tail; } rdma_rxq_t; typedef struct { CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); - u32 size; - u32 n_enq; + clib_spinlock_t lock; struct ibv_cq *cq; struct ibv_qp *qp; - clib_spinlock_t lock; + u32 *bufs; + u32 size; + u32 head; + u32 tail; } rdma_txq_t; typedef struct { CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); + + /* following fields are accessed in datapath */ + rdma_rxq_t *rxqs; + rdma_txq_t *txqs; u32 flags; u32 per_interface_next_index; - - u32 dev_instance; u32 sw_if_index; u32 hw_if_index; + u32 lkey; /* cache of mr->lkey */ + u8 pool; /* buffer pool index */ - u32 async_event_clib_file_index; - - rdma_rxq_t *rxqs; - rdma_txq_t *txqs; - + /* fields below are not accessed in datapath */ + vlib_pci_device_info_t *pci; u8 *name; + u8 *linux_ifname; mac_address_t hwaddr; - vlib_pci_addr_t pci_addr; + u32 async_event_clib_file_index; + u32 dev_instance; struct ibv_context *ctx; struct ibv_pd *pd; @@ -80,7 +87,6 @@ typedef struct struct ibv_flow *flow_ucast; struct ibv_flow *flow_mcast; - /* error */ clib_error_t *error; } rdma_device_t; |