Fixes a crash in the traffic_mgr example caused by the odp_tm_create() call failing because that code uses the ODP_TM_EGRESS_FN form which was not being checked for.
Signed-off-by: Barry Spinney <spin...@mellanox.com> --- platform/linux-generic/odp_traffic_mngr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_traffic_mngr.c b/platform/linux-generic/odp_traffic_mngr.c index e668bf9..1e302f9 100644 --- a/platform/linux-generic/odp_traffic_mngr.c +++ b/platform/linux-generic/odp_traffic_mngr.c @@ -2629,8 +2629,12 @@ odp_tm_t odp_tm_create(const char *name, return ODP_TM_INVALID; } - if (odp_pktout_queue(egress->pktio, &pktout, 1) != 1) + if (egress->egress_kind == ODP_TM_EGRESS_PKT_IO) { + if (odp_pktout_queue(egress->pktio, &pktout, 1) != 1) + return ODP_TM_INVALID; + } else if (egress->egress_kind != ODP_TM_EGRESS_FN) { return ODP_TM_INVALID; + } tm_system->pktout = pktout; tm_system->name_tbl_id = name_tbl_id; -- 2.1.2