Add per core statistic(rx/tx) counters for event mode worker. Signed-off-by: Volodymyr Fialko <vfia...@marvell.com> --- examples/ipsec-secgw/ipsec_worker.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/examples/ipsec-secgw/ipsec_worker.c b/examples/ipsec-secgw/ipsec_worker.c index 2661f0275f..f94ab10a5b 100644 --- a/examples/ipsec-secgw/ipsec_worker.c +++ b/examples/ipsec-secgw/ipsec_worker.c @@ -494,7 +494,7 @@ process_ipsec_ev_inbound(struct ipsec_ctx *ctx, struct route_table *rt, drop_pkt_and_exit: RTE_LOG(ERR, IPSEC, "Inbound packet dropped\n"); - rte_pktmbuf_free(pkt); + free_pkts(&pkt, 1); ev->mbuf = NULL; return PKT_DROPPED; } @@ -601,7 +601,7 @@ process_ipsec_ev_outbound(struct ipsec_ctx *ctx, struct route_table *rt, drop_pkt_and_exit: RTE_LOG(ERR, IPSEC, "Outbound packet dropped\n"); - rte_pktmbuf_free(pkt); + free_pkts(&pkt, 1); ev->mbuf = NULL; return PKT_DROPPED; } @@ -816,6 +816,7 @@ ipsec_ev_vector_process(struct lcore_conf_ev_tx_int_port_wrkr *lconf, pkt = vec->mbufs[0]; ev_vector_attr_init(vec); + core_stats_update_rx(vec->nb_elem); if (is_unprotected_port(pkt->port)) ret = process_ipsec_ev_inbound_vector(&lconf->inbound, &lconf->rt, vec); @@ -824,6 +825,7 @@ ipsec_ev_vector_process(struct lcore_conf_ev_tx_int_port_wrkr *lconf, &lconf->rt, vec); if (likely(ret > 0)) { + core_stats_update_tx(vec->nb_elem); vec->nb_elem = ret; rte_event_eth_tx_adapter_enqueue(links[0].eventdev_id, links[0].event_port_id, @@ -1136,6 +1138,7 @@ ipsec_wrkr_non_burst_int_port_app_mode(struct eh_event_link_info *links, ipsec_ev_vector_process(&lconf, links, &ev); continue; case RTE_EVENT_TYPE_ETHDEV: + core_stats_update_rx(1); if (is_unprotected_port(ev.mbuf->port)) ret = process_ipsec_ev_inbound(&lconf.inbound, &lconf.rt, links, &ev); @@ -1157,6 +1160,7 @@ ipsec_wrkr_non_burst_int_port_app_mode(struct eh_event_link_info *links, continue; } + core_stats_update_tx(1); /* * Since tx internal port is available, events can be * directly enqueued to the adapter and it would be -- 2.25.1