From: Barry Spinney <spin...@ezchip.com> This commit causes the traffic_mgr to become part of the ODP linux-generic build.
Signed-off-by: Barry Spinney <spin...@ezchip.com> Signed-off-by: Bill Fischofer <bill.fischo...@linaro.org> --- platform/linux-generic/Makefile.am | 13 ++++++++ platform/linux-generic/include/odp_internal.h | 2 ++ platform/linux-generic/odp_init.c | 5 +++ platform/linux-generic/odp_packet_flags.c | 46 ++++++++++++++++++++++++++- 4 files changed, 65 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index a6b6029..3025809 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -51,6 +51,7 @@ odpinclude_HEADERS = \ $(srcdir)/include/odp/ticketlock.h \ $(srcdir)/include/odp/time.h \ $(srcdir)/include/odp/timer.h \ + $(srcdir)/include/odp/traffic_mngr.h \ $(srcdir)/include/odp/version.h odpplatincludedir= $(includedir)/odp/plat @@ -78,6 +79,7 @@ odpplatinclude_HEADERS = \ $(srcdir)/include/odp/plat/ticketlock_types.h \ $(srcdir)/include/odp/plat/time_types.h \ $(srcdir)/include/odp/plat/timer_types.h \ + $(srcdir)/include/odp/plat/traffic_mngr_types.h \ $(srcdir)/include/odp/plat/version_types.h odpapiincludedir= $(includedir)/odp/api @@ -122,6 +124,7 @@ odpapiinclude_HEADERS = \ $(top_srcdir)/include/odp/api/ticketlock.h \ $(top_srcdir)/include/odp/api/time.h \ $(top_srcdir)/include/odp/api/timer.h \ + $(top_srcdir)/include/odp/api/traffic_mngr.h \ $(top_srcdir)/include/odp/api/version.h noinst_HEADERS = \ @@ -137,16 +140,21 @@ noinst_HEADERS = \ ${srcdir}/include/odp_debug_internal.h \ ${srcdir}/include/odp_forward_typedefs_internal.h \ ${srcdir}/include/odp_internal.h \ + ${srcdir}/include/odp_name_table_internal.h \ ${srcdir}/include/odp_packet_internal.h \ ${srcdir}/include/odp_packet_io_internal.h \ ${srcdir}/include/odp_packet_io_queue.h \ ${srcdir}/include/odp_packet_netmap.h \ ${srcdir}/include/odp_packet_socket.h \ + ${srcdir}/include/odp_pkt_queue_internal.h \ ${srcdir}/include/odp_pool_internal.h \ ${srcdir}/include/odp_queue_internal.h \ ${srcdir}/include/odp_schedule_internal.h \ + ${srcdir}/include/odp_sorted_list_internal.h \ ${srcdir}/include/odp_spin_internal.h \ ${srcdir}/include/odp_timer_internal.h \ + ${srcdir}/include/odp_timer_wheel_internal.h \ + ${srcdir}/include/odp_traffic_mngr_internal.h \ ${srcdir}/include/odp_cpu_internal.h \ ${srcdir}/Makefile.inc @@ -163,6 +171,7 @@ __LIB__libodp_la_SOURCES = \ odp_hash.c \ odp_init.c \ odp_impl.c \ + odp_name_table.c \ odp_packet.c \ odp_packet_flags.c \ odp_packet_io.c \ @@ -171,12 +180,14 @@ __LIB__libodp_la_SOURCES = \ pktio/netmap.c \ pktio/socket.c \ pktio/socket_mmap.c \ + odp_pkt_queue.c \ odp_pool.c \ odp_queue.c \ odp_rwlock.c \ odp_rwlock_recursive.c \ odp_schedule.c \ odp_shared_memory.c \ + odp_sorted_list.c \ odp_spinlock.c \ odp_spinlock_recursive.c \ odp_system_info.c \ @@ -185,6 +196,8 @@ __LIB__libodp_la_SOURCES = \ odp_ticketlock.c \ odp_time.c \ odp_timer.c \ + odp_timer_wheel.c \ + odp_traffic_mngr.c \ odp_version.c \ odp_weak.c \ arch/@ARCH@/odp_cpu_cycles.c diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index 14ba159..74e48a9 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -79,6 +79,8 @@ int odp_schedule_term_local(void); int odp_timer_init_global(void); int odp_timer_disarm_all(void); +int odp_tm_init_global(void); + void _odp_flush_caches(void); #ifdef __cplusplus diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index 5e19d86..7f35962 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -71,6 +71,11 @@ int odp_init_global(const odp_init_t *params, return -1; } + if (odp_tm_init_global()) { + ODP_ERR("ODP traffic manager init failed\n"); + return -1; + } + return 0; } diff --git a/platform/linux-generic/odp_packet_flags.c b/platform/linux-generic/odp_packet_flags.c index dbc3137..3537aa9 100644 --- a/platform/linux-generic/odp_packet_flags.c +++ b/platform/linux-generic/odp_packet_flags.c @@ -129,6 +129,51 @@ int odp_packet_has_flow_hash(odp_packet_t pkt) return pkt_hdr->has_hash; } +odp_packet_color_t odp_packet_color(odp_packet_t pkt) +{ + retflag(pkt, input_flags.color); +} + +void odp_packet_color_set(odp_packet_t pkt, odp_packet_color_t color) +{ + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + if (packet_parse_not_complete(pkt_hdr)) + packet_parse_full(pkt_hdr); + + pkt_hdr->input_flags.color = color; +} + +odp_bool_t odp_packet_drop_eligible(odp_packet_t pkt) +{ + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + if (packet_parse_not_complete(pkt_hdr)) + packet_parse_full(pkt_hdr); + + return !pkt_hdr->input_flags.nodrop; +} + +void odp_packet_drop_eligible_set(odp_packet_t pkt, odp_bool_t drop) +{ + setflag(pkt, input_flags.nodrop, !drop); +} + +int8_t odp_packet_shaper_len_adjust(odp_packet_t pkt) +{ + retflag(pkt, output_flags.shaper_len_adj); +} + +void odp_packet_shaper_len_adjust_set(odp_packet_t pkt, int8_t adj) +{ + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + if (packet_parse_not_complete(pkt_hdr)) + packet_parse_full(pkt_hdr); + + pkt_hdr->output_flags.shaper_len_adj = adj; +} + /* Set Input Flags */ void odp_packet_has_l2_set(odp_packet_t pkt, int val) @@ -222,4 +267,3 @@ void odp_packet_has_flow_hash_clr(odp_packet_t pkt) pkt_hdr->has_hash = 0; } - -- 2.1.4 _______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp