diff options
author | Benoît Ganne <bganne@cisco.com> | 2020-07-07 13:29:16 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2020-07-09 15:32:51 +0000 |
commit | 52e9aaf0b55e7742a39d75e5dffb813a3b0c011d (patch) | |
tree | 8e7076d00cef04143d56a5a8466aab2460aaa190 /src/plugins/dpdk/device/dpdk.h | |
parent | ea7e7087d21151c89056152579e37510234880d6 (diff) |
dpdk: add txq struct and fix dpdk tx lock
This introduces a txq structure mirroring the rxq structure.
This fixes the case when #txq > #rxq, because lock must be per txq.
Type: fix
Fixes: dfb19cabe20ccf1cbd1aa714f493ccd322839b91
Change-Id: Ic1bce64d2b08b9a98c8242a1ba1bfcdbda322bec
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/plugins/dpdk/device/dpdk.h')
-rw-r--r-- | src/plugins/dpdk/device/dpdk.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/plugins/dpdk/device/dpdk.h b/src/plugins/dpdk/device/dpdk.h index 0ace4f3a0ed..963bc811ee1 100644 --- a/src/plugins/dpdk/device/dpdk.h +++ b/src/plugins/dpdk/device/dpdk.h @@ -156,13 +156,21 @@ typedef struct typedef struct { CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); - clib_spinlock_t lock; u8 buffer_pool_index; } dpdk_rx_queue_t; typedef struct { CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); + clib_spinlock_t lock; +} dpdk_tx_queue_t; + +typedef struct +{ + CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); + + dpdk_rx_queue_t *rx_queues; + dpdk_tx_queue_t *tx_queues; /* Instance ID to access internal device array. */ u32 device_index; @@ -173,18 +181,16 @@ typedef struct /* next node index if we decide to steal the rx graph arc */ u32 per_interface_next_index; + u16 rx_q_used; + u16 tx_q_used; + u16 flags; + /* DPDK device port number */ dpdk_portid_t port_id; dpdk_pmd_t pmd:8; i8 cpu_socket; - u16 flags; - - dpdk_rx_queue_t *rx_queues; - u16 tx_q_used; - CLIB_CACHE_LINE_ALIGN_MARK (cacheline1); - u16 rx_q_used; u16 nb_tx_desc; u16 nb_rx_desc; |