summaryrefslogtreecommitdiffstats
path: root/src/plugins/dev_octeon/queue.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2024-03-29 21:33:03 +0100
committerFlorin Coras <florin.coras@gmail.com>2024-04-05 19:33:32 +0000
commitdf47a0812ab9365b2de10a7aabcf4b29a255c088 (patch)
tree176b5b7103e8716442043f7d8026ae1bf8681407 /src/plugins/dev_octeon/queue.c
parentd1364402b6964cc5b2e83490bfe516e0d34becd8 (diff)
octeon: fix memory ordering issue in tx batch free
Type: fix Fixes: 01fe7ab Change-Id: I4425e809f0977521ddecf91b58b26fe4519dd6e0 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/dev_octeon/queue.c')
-rw-r--r--src/plugins/dev_octeon/queue.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/plugins/dev_octeon/queue.c b/src/plugins/dev_octeon/queue.c
index 9378fc3b7c7..d6ae794fb8d 100644
--- a/src/plugins/dev_octeon/queue.c
+++ b/src/plugins/dev_octeon/queue.c
@@ -57,12 +57,20 @@ oct_tx_queue_alloc (vlib_main_t *vm, vnet_dev_tx_queue_t *txq)
oct_txq_t *ctq = vnet_dev_get_tx_queue_data (txq);
vnet_dev_port_t *port = txq->port;
vnet_dev_t *dev = port->dev;
+ u32 sz = sizeof (void *) * ROC_CN10K_NPA_BATCH_ALLOC_MAX_PTRS;
+ vnet_dev_rv_t rv;
log_debug (dev, "tx_queue_alloc: queue %u alocated", txq->queue_id);
- return vnet_dev_dma_mem_alloc (
- vm, dev, sizeof (void *) * ROC_CN10K_NPA_BATCH_ALLOC_MAX_PTRS, 128,
- (void **) &ctq->ba_buffer);
+ rv = vnet_dev_dma_mem_alloc (vm, dev, sz, 128, (void **) &ctq->ba_buffer);
+
+ if (rv != VNET_DEV_OK)
+ return rv;
+
+ clib_memset_u64 (ctq->ba_buffer, OCT_BATCH_ALLOC_IOVA0_MASK,
+ ROC_CN10K_NPA_BATCH_ALLOC_MAX_PTRS);
+
+ return rv;
}
void