rdma: prevent loopback of broadcast packets

TX queues must be created before RX queues on Mellanox cards in order to
not receive our own broadcast packets.

Type: fix

Change-Id: I32ae25a47d819f715feda621a5ecddcf4efd71ba
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit df213385d391f21d99eaeaf066f0130a20f7ccde)
This commit is contained in:
Benoît Ganne
2019-10-04 15:28:12 +02:00
committed by Andrew Yourtchenko
parent 4787d18b19
commit 43b36af1fc

View File

@ -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)