diff mbox

[PATCH/API-NEXTv2,2/3] linux-generic: traffic_mngr: add pktio interface to odp_tm_egress_t struct

Message ID 1467115556-8187-2-git-send-email-bala.manoharan@linaro.org
State New
Headers show

Commit Message

Balasubramanian Manoharan June 28, 2016, 12:05 p.m. UTC
Code changes for replacing odp_pktout_queue_t with odp_pktio_t in TM system

Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>
---
 platform/linux-generic/include/odp_traffic_mngr_internal.h | 2 +-
 platform/linux-generic/odp_traffic_mngr.c                  | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/platform/linux-generic/include/odp_traffic_mngr_internal.h b/platform/linux-generic/include/odp_traffic_mngr_internal.h
index 3586889..3e13a0a 100644
--- a/platform/linux-generic/include/odp_traffic_mngr_internal.h
+++ b/platform/linux-generic/include/odp_traffic_mngr_internal.h
@@ -379,7 +379,7 @@  typedef struct {
 	tm_queue_info_t priority_info[ODP_TM_MAX_PRIORITIES];
 
 	tm_random_data_t tm_random_data;
-
+	odp_pktout_queue_t pktout;
 	uint64_t   current_time;
 	uint8_t    tm_idx;
 	uint8_t    first_enq;
diff --git a/platform/linux-generic/odp_traffic_mngr.c b/platform/linux-generic/odp_traffic_mngr.c
index 1fa2d27..54c3517 100644
--- a/platform/linux-generic/odp_traffic_mngr.c
+++ b/platform/linux-generic/odp_traffic_mngr.c
@@ -2106,7 +2106,7 @@  static void tm_send_pkt(tm_system_t *tm_system, uint32_t max_sends)
 
 		tm_system->egress_pkt_desc = EMPTY_PKT_DESC;
 		if (tm_system->egress.egress_kind == ODP_TM_EGRESS_PKT_IO)
-			odp_pktout_send(tm_system->egress.pktout, &odp_pkt, 1);
+			odp_pktout_send(tm_system->pktout, &odp_pkt, 1);
 		else if (tm_system->egress.egress_kind == ODP_TM_EGRESS_FN)
 			tm_system->egress.egress_fcn(odp_pkt);
 		else
@@ -2424,6 +2424,7 @@  int odp_tm_capabilities(odp_tm_capabilities_t capabilities[] ODP_UNUSED,
 	cap_ptr->max_tm_queues                 = ODP_TM_MAX_TM_QUEUES;
 	cap_ptr->max_levels                    = ODP_TM_MAX_LEVELS;
 	cap_ptr->tm_queue_shaper_supported     = true;
+	cap_ptr->egress_fcn_supported          = true;
 	cap_ptr->tm_queue_wred_supported       = true;
 	cap_ptr->tm_queue_dual_slope_supported = true;
 	cap_ptr->vlan_marking_supported        = true;
@@ -2605,6 +2606,7 @@  odp_tm_t odp_tm_create(const char            *name,
 	tm_system_t *tm_system;
 	odp_bool_t create_fail;
 	odp_tm_t odp_tm;
+	odp_pktout_queue_t pktout;
 	uint32_t malloc_len, max_num_queues, max_queued_pkts, max_timers;
 	uint32_t max_tm_queues, max_sorted_lists;
 	int rc;
@@ -2625,6 +2627,10 @@  odp_tm_t odp_tm_create(const char            *name,
 		return ODP_TM_INVALID;
 	}
 
+	if (odp_pktout_queue(egress->pktio, &pktout, 1) != 1)
+		return ODP_TM_INVALID;
+
+	tm_system->pktout = pktout;
 	tm_system->name_tbl_id = name_tbl_id;
 	max_tm_queues = requirements->max_tm_queues;
 	memcpy(&tm_system->egress, egress, sizeof(odp_tm_egress_t));