aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/odp/odp_packet.h
diff options
context:
space:
mode:
authorMichal Mazur <mkm@semihalf.com>2017-08-21 15:01:42 +0200
committerMichal Mazur <mkm@semihalf.com>2017-12-14 15:18:05 +0100
commit4c34d6c16947c5e1465319d9d44dbdaaa2f04c4e (patch)
tree47aecd5a2719916187f319357efde738674ae788 /src/plugins/odp/odp_packet.h
parent7e1f3998634c89aa6344468d26df0de519578a5f (diff)
Read ODP configuration from VPP startup config
1) Allow to setup size of allocated memory, number of packets in the pool, number of packets in transmit burst and delay in scheduler mode from VPP startup file. More details are in template: src/vpp/conf/startup.conf 2) Separate Rx mode from Tx mode. Traffic Manager is not supported. 3) Devices defined in VPP startup are automatically created at start. Change-Id: I1f8a3c2900f56cb23ce6997d311cfe55e1c2078c Signed-off-by: Michal Mazur <mkm@semihalf.com>
Diffstat (limited to 'src/plugins/odp/odp_packet.h')
-rwxr-xr-xsrc/plugins/odp/odp_packet.h29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/plugins/odp/odp_packet.h b/src/plugins/odp/odp_packet.h
index 81b4a8e2..a80ab326 100755
--- a/src/plugins/odp/odp_packet.h
+++ b/src/plugins/odp/odp_packet.h
@@ -14,12 +14,29 @@
#define APPL_MODE_PKT_BURST 0
#define APPL_MODE_PKT_QUEUE 1
#define APPL_MODE_PKT_SCHED 2
+#define APPL_MODE_PKT_TM 3
#define MAX_WORKERS 32
#define MAX_QUEUES (MAX_WORKERS + 1)
typedef struct
{
+ u16 num_tx_queues;
+ u16 num_rx_queues;
+ u8 tx_mode;
+ u8 rx_mode;
+} odp_if_mode_t;
+
+typedef struct
+{
+ u8 *name;
+ odp_if_mode_t mode;
+ u8 hw_addr[6];
+ u8 set_hw_addr;
+} odp_if_config_t;
+
+typedef struct
+{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
u8 *host_if_name;
volatile u32 *lockp;
@@ -31,13 +48,11 @@ typedef struct
u32 next_tx_frame;
u32 per_interface_next_index;
u8 is_admin_up;
- u32 mode;
odp_queue_t rxq[MAX_QUEUES];
odp_pktin_queue_t inq[MAX_QUEUES];
odp_pktout_queue_t outq[MAX_QUEUES];
odp_queue_t txq[MAX_QUEUES];
- u16 rx_queues;
- u16 tx_queues;
+ odp_if_mode_t m;
} odp_packet_if_t;
typedef struct
@@ -58,10 +73,14 @@ typedef struct
extern odp_packet_main_t *odp_packet_main;
extern vnet_device_class_t odp_packet_device_class;
extern vlib_node_registration_t odp_packet_input_node;
+extern u32 rx_sched_wait;
+extern u32 tx_burst_size;
+extern u32 num_pkts_in_pool;
+extern odp_if_mode_t def_if_mode;
u32 odp_packet_create_if (vlib_main_t * vm, u8 * host_if_name,
- u8 * hw_addr_set, u32 * sw_if_index, u32 mode,
- u32 rx_queues);
+ u8 * hw_addr_set, u32 * sw_if_index,
+ odp_if_mode_t * mode);
u32 odp_packet_delete_if (vlib_main_t * vm, u8 * host_if_name);
u32 drop_err_pkts (odp_packet_t pkt_tbl[], u32 len);