aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohammed Hawari <mohammed@hawari.fr>2020-08-31 17:23:45 +0200
committerDamjan Marion <dmarion@me.com>2020-08-31 17:16:38 +0000
commitbfed7c047d2807f835cd7b9ef0330d314ac0ebc5 (patch)
treec034863e7b06479f2a554cf2c2f920595d200f8c
parentdfb30d9d30bb781c1e698debaa8053fe580d465e (diff)
rdma: bugfix in the descriptor refill logic. In case of a partial allocation, the remainder modulo 8 must be returned to the pool so that the number of kept buffers is a multiple of 8.
Type: fix Change-Id: Ifd97b03ea220300e7e6fe81a8ff4a25060fea6c1 Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
-rw-r--r--src/plugins/rdma/input.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/rdma/input.c b/src/plugins/rdma/input.c
index 80c211bae15..3842a58a4ab 100644
--- a/src/plugins/rdma/input.c
+++ b/src/plugins/rdma/input.c
@@ -92,7 +92,7 @@ rdma_device_input_refill (vlib_main_t * vm, rdma_device_t * rd,
}
/* partial allocation, round and return rest */
- n_free = n - (n & 7);
+ n_free = n & 7;
n -= n_free;
if (n_free)
vlib_buffer_free_from_ring (vm, rxq->bufs, (slot + n) & mask,