30 struct ibv_wc wc[VLIB_FRAME_SIZE];
34 n = ibv_poll_cq (txq->
cq, VLIB_FRAME_SIZE, wc);
38 tail = wc[n - 1].wr_id;
50 struct ibv_send_wr wr[VLIB_FRAME_SIZE], *w = wr;
51 struct ibv_sge sge[VLIB_FRAME_SIZE], *s = sge;
58 n = n_left_from =
clib_min (n_left_from, txq->
size - slot);
65 memset (w, 0, n_left_from *
sizeof (w[0]));
100 s[3].lkey = rd->
lkey;
102 w[0].next = &w[0] + 1;
103 w[0].sg_list = &s[0];
105 w[0].opcode = IBV_WR_SEND;
107 w[1].next = &w[1] + 1;
108 w[1].sg_list = &s[1];
110 w[1].opcode = IBV_WR_SEND;
112 w[2].next = &w[2] + 1;
113 w[2].sg_list = &s[2];
115 w[2].opcode = IBV_WR_SEND;
117 w[3].next = &w[3] + 1;
118 w[3].sg_list = &s[3];
120 w[3].opcode = IBV_WR_SEND;
136 s[0].lkey = rd->
lkey;
138 w[0].next = &w[0] + 1;
139 w[0].sg_list = &s[0];
141 w[0].opcode = IBV_WR_SEND;
151 w[-1].wr_id = txq->
tail + n_left_from;
153 w[-1].send_flags = IBV_SEND_SIGNALED;
157 n_left_from = w - wr;
159 txq->
tail += n_left_from;
181 n_left_from = frame->n_vectors;
185 for (i = 0; i < 5 && n_left_from > 0; i++)
190 n_left_from -= n_enq;
200 RDMA_TX_ERROR_NO_FREE_SLOTS, n_left_from);
203 return frame->n_vectors - n_left_from;
static uword vlib_buffer_get_current_va(vlib_buffer_t *b)
static void vlib_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Free buffers Frees the entire buffer chain for each buffer.
static void vlib_error_count(vlib_main_t *vm, uword node_index, uword counter, uword increment)
static_always_inline void rdma_device_output_free(vlib_main_t *vm, rdma_txq_t *txq)
static_always_inline void clib_spinlock_unlock_if_init(clib_spinlock_t *p)
u16 current_length
Nbytes between current data and the end of this buffer.
#define static_always_inline
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define VNET_DEVICE_CLASS_TX_FN(devclass)
static void vlib_buffer_free_from_ring(vlib_main_t *vm, u32 *ring, u32 start, u32 ring_size, u32 n_buffers)
Free buffers from ring.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static_always_inline u32 rmda_device_output_tx(vlib_main_t *vm, const rdma_device_t *rd, rdma_txq_t *txq, u32 n_left_from, u32 *bi)
#define CLIB_PREFETCH(addr, size, type)
VNET_DEVICE_CLASS_TX_FN() rdma_device_class(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static uword is_pow2(uword x)
static_always_inline void vlib_buffer_copy_indices(u32 *dst, u32 *src, u32 n_indices)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static_always_inline void vlib_get_buffers(vlib_main_t *vm, u32 *bi, vlib_buffer_t **b, int count)
Translate array of buffer indices into buffer pointers.
#define CLIB_CACHE_LINE_BYTES
static_always_inline void clib_spinlock_lock_if_init(clib_spinlock_t *p)