summaryrefslogtreecommitdiffstats
path: root/src/plugins/rdma
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/rdma')
-rw-r--r--src/plugins/rdma/device.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/plugins/rdma/device.c b/src/plugins/rdma/device.c
index d68bfaa1cf7..32b7ea55006 100644
--- a/src/plugins/rdma/device.c
+++ b/src/plugins/rdma/device.c
@@ -534,16 +534,21 @@ rdma_dev_init (vlib_main_t * vm, rdma_device_t * rd, u32 rxq_size,
ethernet_mac_address_generate (rd->hwaddr.bytes);
+ /*
+ * /!\ WARNING /!\ creation order is important
+ * We *must* create TX queues *before* RX queues, otherwise we will receive
+ * the broacast packets we sent
+ */
+ for (i = 0; i < tm->n_vlib_mains; i++)
+ if ((err = rdma_txq_init (vm, rd, i, txq_size)))
+ return err;
+
for (i = 0; i < rxq_num; i++)
if ((err = rdma_rxq_init (vm, rd, i, rxq_size)))
return err;
if ((err = rdma_rxq_finalize (vm, rd)))
return err;
- for (i = 0; i < tm->n_vlib_mains; i++)
- if ((err = rdma_txq_init (vm, rd, i, txq_size)))
- return err;
-
if ((rd->mr = ibv_reg_mr (rd->pd, (void *) bm->buffer_mem_start,
bm->buffer_mem_size,
IBV_ACCESS_LOCAL_WRITE)) == 0)