aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/odp/odp_packet.h
diff options
context:
space:
mode:
authorMichal Mazur <mkm@semihalf.com>2017-08-11 21:18:05 +0200
committerMichal Mazur <mkm@semihalf.com>2017-12-14 15:18:05 +0100
commitd830f80364a33f81c4b534eca902ac7600cbfc05 (patch)
treeaba9311089548d1189f6ada0118251c97c26ff7f /src/plugins/odp/odp_packet.h
parentc322d05e95fe19ff91dc4b44b83beef3088f5523 (diff)
Create worker threads using ODP API (direct in/out mode)
This patch allows VPP to run multiple worker threads compatible with ODP. By default a single thread is assigned to each interface but this can be changed using "set interface rx-placement" command. Only Direct input/output mode without RSS is supported. Change-Id: Ia6af7e5af4950159eb28b7d56bc9c8d34b80f8d4 Signed-off-by: Michal Mazur <mkm@semihalf.com>
Diffstat (limited to 'src/plugins/odp/odp_packet.h')
-rwxr-xr-xsrc/plugins/odp/odp_packet.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/odp/odp_packet.h b/src/plugins/odp/odp_packet.h
index e511f404..f9c793bd 100755
--- a/src/plugins/odp/odp_packet.h
+++ b/src/plugins/odp/odp_packet.h
@@ -5,6 +5,7 @@
*/
#include <odp_api.h>
+#include <odp/helper/odph_api.h>
#define SHM_PKT_BUF_SIZE 1598
#define SHM_PKT_POOL_BUF_SIZE 1856
@@ -14,6 +15,8 @@
#define APPL_MODE_PKT_QUEUE 1
#define APPL_MODE_PKT_SCHED 2
+#define MAX_WORKERS 32
+
typedef struct
{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
@@ -41,6 +44,8 @@ typedef struct
odp_instance_t instance;
odp_pool_t pool;
u32 if_count;
+ u32 thread_cnt;
+ odph_odpthread_t thread_tbl[MAX_WORKERS];
} odp_packet_main_t;
extern odp_packet_main_t *odp_packet_main;