+/******************************************************************************\r
+*\r
+* Copyright (c) 2019 Intel.\r
+*\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+*\r
+*******************************************************************************/\r
+\r
+\r
+#include "common.hpp"\r
+\r
+#include "xran_common.h"\r
+#include "xran_fh_o_du.h"\r
+#include "ethernet.h"\r
+\r
+#include <stdint.h>\r
+\r
+const std::string module_name = "u-plane";\r
+\r
+class U_planePerf : public KernelTests\r
+{\r
+\r
+protected:\r
+ int32_t request;\r
+ int32_t response;\r
+\r
+ struct rte_mbuf *test_buffer;\r
+ char * iq_offset;\r
+ struct rte_mempool *test_eth_mbuf_pool;\r
+\r
+ void SetUp() override\r
+ {\r
+ /* Parameters stored in the functional section will be used. GTest will call\r
+ TEST_P (including SetUp and TearDown) for each case in the section. */\r
+ init_test("u_plane_performace");\r
+ test_eth_mbuf_pool = rte_pktmbuf_pool_create("mempool", NUM_MBUFS,\r
+ MBUF_CACHE, 0, MBUF_POOL_ELEMENT, rte_socket_id());\r
+\r
+ /* buffer size defined as the maximum size of all inputs/outputs in BYTE */\r
+ const int buffer_size = 9600;\r
+ test_buffer = (struct rte_mbuf*)rte_pktmbuf_alloc(test_eth_mbuf_pool);\r
+\r
+ iq_offset = rte_pktmbuf_mtod(test_buffer, char * );\r
+ iq_offset = iq_offset + sizeof(struct ether_hdr) +\r
+ sizeof (struct xran_ecpri_hdr) +\r
+ sizeof (struct radio_app_common_hdr) +\r
+ sizeof(struct data_section_hdr);\r
+ }\r
+\r
+ /* It's called after an execution of the each test case.*/\r
+ void TearDown() override\r
+ {\r
+ rte_pktmbuf_free(test_buffer);\r
+ }\r
+\r
+ void fucntional_dl(F function, int32_t* request, int32_t* response)\r
+ {\r
+ enum xran_pkt_dir direction = XRAN_DIR_DL;\r
+ uint16_t section_id = 0;\r
+ enum xran_input_byte_order iq_buf_byte_order = XRAN_CPU_LE_BYTE_ORDER;\r
+ uint8_t frame_id = 0;\r
+ uint8_t subframe_id = 0;\r
+ uint8_t slot_id = 0;\r
+ uint8_t symbol_no = 0;\r
+ int prb_start = 0;\r
+ int prb_num = 66;\r
+ uint8_t CC_ID = 0;\r
+ uint8_t RU_Port_ID = 0;\r
+ uint8_t seq_id =0;\r
+ uint32_t do_copy = 0;\r
+\r
+ int32_t prep_bytes;\r
+\r
+ prep_bytes = prepare_symbol_ex(direction,\r
+ section_id,\r
+ test_buffer,\r
+ (struct rb_map *)iq_offset,\r
+ iq_buf_byte_order,\r
+ frame_id,\r
+ subframe_id,\r
+ slot_id,\r
+ symbol_no,\r
+ prb_start,\r
+ prb_num,\r
+ CC_ID,\r
+ RU_Port_ID,\r
+ seq_id,\r
+ do_copy);\r
+\r
+ //ASSERT_EQ(prep_bytes, 3168);\r
+ }\r
+};\r
+\r
+TEST_P(U_planePerf, Test_DL)\r
+{\r
+ performance("C", module_name, fucntional_dl, &request, &response);\r
+}\r
+\r
+INSTANTIATE_TEST_CASE_P(UnitTest, U_planePerf,\r
+ testing::ValuesIn(get_sequence(U_planePerf::get_number_of_cases("u_plane_performance"))));\r
+\r
+\r