O-RAN E Maintenance Release contribution for ODULOW
[o-du/phy.git] / fhi_lib / test / test_xran / chain_tests.cc
index 8631bdd..6757656 100644 (file)
@@ -1,6 +1,6 @@
 /******************************************************************************
 *
-*   Copyright (c) 2019 Intel.
+*   Copyright (c) 2020 Intel.
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
@@ -42,7 +42,7 @@ extern "C"
 void tx_cp_dl_cb(struct rte_timer *tim, void *arg);
 void tx_cp_ul_cb(struct rte_timer *tim, void *arg);
 int xran_process_tx_sym(void *arg);
-int process_mbuf(struct rte_mbuf *pkt);
+int process_mbuf(struct rte_mbuf *pkt, void *arg, struct xran_eaxc_info *p_cid);
 
 
 /* wrapper functions for performace tests */
@@ -83,15 +83,17 @@ void xran_ut_rx_up_ul()
 
 
 /* call back functions */
-int send_mbuf_up(struct rte_mbuf *mbuf, uint16_t type)
+int send_mbuf_up(struct rte_mbuf *mbuf, uint16_t type, uint16_t vf_id)
 {
     rte_pktmbuf_free(mbuf);
+
     return (1);
 }
 
-int send_mbuf_cp_perf(struct rte_mbuf *mbuf, uint16_t type)
+int send_mbuf_cp_perf(struct rte_mbuf *mbuf, uint16_t type, uint16_t vf_id)
 {
     rte_pktmbuf_free(mbuf);
+    /*  TODO: need to free chained mbufs */
     return (1);
 }
 
@@ -115,6 +117,11 @@ void utcp_fh_rx_callback(void *pCallbackTag, xran_status_t status)
     return;
 }
 
+void utcp_fh_srs_callback(void *pCallbackTag, xran_status_t status)
+{
+    return;
+}
+
 void utcp_fh_rx_prach_callback(void *pCallbackTag, xran_status_t status)
 {
     rte_pause();
@@ -225,9 +232,9 @@ protected:
 /* C-Plane DL chain (tx_cp_dl_cb) only */
 TEST_P(TestChain, CPlaneDLPerf)
 {
-    xranlib->Init(&m_xranConf);
-    xranlib->Open(send_mbuf_cp_perf, send_mbuf_up,
-            (void *)utcp_fh_rx_callback, (void *)utcp_fh_rx_prach_callback);
+    xranlib->Init(0, &m_xranConf);
+    xranlib->Open(0, send_mbuf_cp_perf, send_mbuf_up,
+            (void *)utcp_fh_rx_callback, (void *)utcp_fh_rx_prach_callback, (void *)utcp_fh_srs_callback);
 
     performance("C", module_name, xran_ut_tx_cp_dl);
 
@@ -238,9 +245,9 @@ TEST_P(TestChain, CPlaneDLPerf)
 /* C-Plane UL chain (tx_cp_ul_cb) only */
 TEST_P(TestChain, CPlaneULPerf)
 {
-    xranlib->Init(&m_xranConf);
-    xranlib->Open(send_mbuf_cp_perf, send_mbuf_up,
-            (void *)utcp_fh_rx_callback, (void *)utcp_fh_rx_prach_callback);
+    xranlib->Init(0, &m_xranConf);
+    xranlib->Open(0, send_mbuf_cp_perf, send_mbuf_up,
+            (void *)utcp_fh_rx_callback, (void *)utcp_fh_rx_prach_callback, (void *)utcp_fh_srs_callback);
 
     performance("C", module_name, xran_ut_tx_cp_ul);
 
@@ -253,15 +260,15 @@ TEST_P(TestChain, UPlaneDLPerf)
 {
     bool flag_cpen;
 
-    xranlib->Init(&m_xranConf);
+    xranlib->Init(0, &m_xranConf);
 
     /* save current CP enable flag */
     flag_cpen = xranlib->is_cpenable()?true:false;
 
     /* need to disable CP to make U-Plane work without CP */
     xranlib->apply_cpenable(false);
-    xranlib->Open(send_mbuf_cp_perf, send_mbuf_up,
-            (void *)utcp_fh_rx_callback, (void *)utcp_fh_rx_prach_callback);
+    xranlib->Open(0, send_mbuf_cp_perf, send_mbuf_up,
+            (void *)utcp_fh_rx_callback, (void *)utcp_fh_rx_prach_callback, (void *)utcp_fh_srs_callback);
 
     performance("C", module_name, xran_ut_tx_up_dl);
 
@@ -277,15 +284,15 @@ TEST_P(TestChain, APlaneDLPerf)
 {
     bool flag_cpen;
 
-    xranlib->Init(&m_xranConf);
+    xranlib->Init(0, &m_xranConf);
 
     /* save current CP enable flag */
     flag_cpen = xranlib->is_cpenable()?true:false;
 
     /* Enable CP by force to make UP work by CP's section information */
     xranlib->apply_cpenable(true);
-    xranlib->Open(send_mbuf_cp_perf, send_mbuf_up,
-            (void *)utcp_fh_rx_callback, (void *)utcp_fh_rx_prach_callback);
+    xranlib->Open(0, send_mbuf_cp_perf, send_mbuf_up,
+            (void *)utcp_fh_rx_callback, (void *)utcp_fh_rx_prach_callback, (void *)utcp_fh_srs_callback);
 
     performance("C", module_name, xran_ut_tx_cpup_dl);