[PATCH 10/33] net/ena/hal: added a bus parameter to ena memcpy macro
shaibran at amazon.com
shaibran at amazon.com
Mon Mar 4 10:01:13 CET 2024
From: Shai Brandes <shaibran at amazon.com>
ENA_MEMCPY_TO_DEVICE_64 macro needs pci bus id in order
to write to the device memory when using llq.
Signed-off-by: Shai Brandes <shaibran at amazon.com>
Reviewed-by: Amit Bernstein <amitbern at amazon.com>
---
drivers/net/ena/hal/ena_eth_com.c | 3 ++-
drivers/net/ena/hal/ena_plat_dpdk.h | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ena/hal/ena_eth_com.c b/drivers/net/ena/hal/ena_eth_com.c
index 32090259cd..d6811c7b48 100644
--- a/drivers/net/ena/hal/ena_eth_com.c
+++ b/drivers/net/ena/hal/ena_eth_com.c
@@ -74,7 +74,8 @@ static int ena_com_write_bounce_buffer_to_dev(struct ena_com_io_sq *io_sq,
wmb();
/* The line is completed. Copy it to dev */
- ENA_MEMCPY_TO_DEVICE_64(io_sq->desc_addr.pbuf_dev_addr + dst_offset,
+ ENA_MEMCPY_TO_DEVICE_64(io_sq->bus,
+ io_sq->desc_addr.pbuf_dev_addr + dst_offset,
bounce_buffer,
llq_info->desc_list_entry_size);
diff --git a/drivers/net/ena/hal/ena_plat_dpdk.h b/drivers/net/ena/hal/ena_plat_dpdk.h
index 14bf582a45..5f7cbd1ee7 100644
--- a/drivers/net/ena/hal/ena_plat_dpdk.h
+++ b/drivers/net/ena/hal/ena_plat_dpdk.h
@@ -301,11 +301,12 @@ ena_mem_alloc_coherent(struct rte_eth_dev_data *data, size_t size,
#define ENA_WAIT_EVENTS_DESTROY(admin_queue) ((void)(admin_queue))
/* The size must be 8 byte align */
-#define ENA_MEMCPY_TO_DEVICE_64(dst, src, size) \
+#define ENA_MEMCPY_TO_DEVICE_64(bus, dst, src, size) \
do { \
int count, i; \
uint64_t *to = (uint64_t *)(dst); \
const uint64_t *from = (const uint64_t *)(src); \
+ (void)(bus); \
count = (size) / 8; \
for (i = 0; i < count; i++, from++, to++) \
rte_write64_relaxed(*from, to); \
--
2.17.1
More information about the dev
mailing list