diff options
author | Marvin Liu <yong.liu@intel.com> | 2022-08-16 06:49:09 +0000 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2022-09-15 23:12:55 +0000 |
commit | 0654242d1ef51566f0d58445a16053cf376e5a6e (patch) | |
tree | ff86c0b35806f76dfd95e98bf85e5bdf3521a2e4 /src/vnet/session/session.h | |
parent | 6e1eaad216c41ce1cb4af13a2214f4d86e094414 (diff) |
session: support dma option
add dma support to session, acclerate host-stack with dma
Type: feature
Signed-off-by: Marvin Liu <yong.liu@intel.com>
Signed-off-by: Junfeng Wang <drenfong.wang@intel.com>
Change-Id: I3d492921d69d9e3e0b34d33adc33fba3bde9e1cc
Diffstat (limited to 'src/vnet/session/session.h')
-rw-r--r-- | src/vnet/session/session.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/vnet/session/session.h b/src/vnet/session/session.h index 68ed8431605..a68e51239bd 100644 --- a/src/vnet/session/session.h +++ b/src/vnet/session/session.h @@ -21,6 +21,7 @@ #include <vnet/session/session_debug.h> #include <svm/message_queue.h> #include <svm/fifo_segment.h> +#include <vlib/dma/dma.h> #define foreach_session_input_error \ _(NO_SESSION, "No session drops") \ @@ -85,6 +86,13 @@ typedef enum session_wrk_flags_ SESSION_WRK_F_ADAPTIVE = 1 << 0, } __clib_packed session_wrk_flag_t; +#define DMA_TRANS_SIZE 1024 +typedef struct +{ + u32 *pending_tx_buffers; + u16 *pending_tx_nexts; +} session_dma_transfer; + typedef struct session_worker_ { CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); @@ -155,6 +163,15 @@ typedef struct session_worker_ /** List head for first worker evts pending handling on main */ clib_llist_index_t evts_pending_main; + int config_index; + u8 dma_enabled; + session_dma_transfer *dma_trans; + u16 trans_head; + u16 trans_tail; + u16 trans_size; + u16 batch_num; + vlib_dma_batch_t *batch; + #if SESSION_DEBUG /** last event poll time by thread */ clib_time_type_t last_event_poll; @@ -237,6 +254,9 @@ typedef struct session_main_ /** Session ssvm segment configs*/ uword wrk_mqs_segment_size; + /** Session enable dma*/ + u8 dma_enabled; + /** Session table size parameters */ u32 configured_v4_session_table_buckets; u32 configured_v4_session_table_memory; |