X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=o-du%2Fphy.git;a=blobdiff_plain;f=fhi_lib%2Ftest%2Ftest_xran%2Fu_plane_performance.cc;fp=fhi_lib%2Ftest%2Ftest_xran%2Fu_plane_performance.cc;h=757a9b9af73f4d842a5aac05aa16437e1c65fbeb;hp=ef31d7e82b81c4f51e3cfc0e06b141d5120f7a4c;hb=2de97529a4c5a1922214ba0e6f0fb84cacbd0bc7;hpb=81a09690b36b3a4e89b4dae34f30933de13f7f90 diff --git a/fhi_lib/test/test_xran/u_plane_performance.cc b/fhi_lib/test/test_xran/u_plane_performance.cc index ef31d7e..757a9b9 100644 --- a/fhi_lib/test/test_xran/u_plane_performance.cc +++ b/fhi_lib/test/test_xran/u_plane_performance.cc @@ -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. @@ -20,13 +20,90 @@ #include "common.hpp" #include "xran_common.h" +#include "xran_up_api.h" #include "xran_fh_o_du.h" #include "ethernet.h" #include -const std::string module_name = "u-plane"; +const std::string module_name = "U-Plane"; + + /*union xran_test { + struct { + struct xran_cp_radioapp_common_header cmnhdr; + struct xran_radioapp_udComp_header udComp; + uint8_t reserved; + }field; + struct { + uint32_t data_one; + uint32_t data_two; + }all_data; + };*/ + void fucntional_dl(struct rte_mbuf *test_buffer, char * iq_offset) + { + enum xran_pkt_dir direction = XRAN_DIR_DL; + uint16_t section_id = 7; + enum xran_input_byte_order iq_buf_byte_order = XRAN_CPU_LE_BYTE_ORDER; + uint8_t frame_id = 99; + uint8_t subframe_id = 9; + uint8_t slot_id = 10; + uint8_t symbol_no = 7; + int prb_start = 0; + int prb_num = 66; + uint8_t CC_ID = 0; + uint8_t RU_Port_ID = 0; + uint8_t seq_id =0; + uint32_t do_copy = 0; + uint8_t compMeth = 0; + enum xran_comp_hdr_type staticEn = XRAN_COMP_HDR_TYPE_DYNAMIC; + uint8_t iqWidth = 16; + int32_t prep_bytes; + + prep_bytes = prepare_symbol_ex(direction, + section_id, + test_buffer, + (uint8_t *)iq_offset, + compMeth, + iqWidth, + iq_buf_byte_order, + frame_id, + subframe_id, + slot_id, + symbol_no, + prb_start, + prb_num, + CC_ID, + RU_Port_ID, + seq_id, + do_copy, + staticEn); + + /*union xran_cp_radioapp_section_ext11 *ext11 = NULL; + struct xran_sectionext11_info *params = NULL; + int i; + ext11 = (union xran_cp_radioapp_section_ext11 *)(iq_offset); + params = (struct xran_sectionext11_info *)(iq_offset+100); + + params->RAD = 1; + params->disableBFWs = 1; + params->numBundPrb = 1; + params->bfwCompMeth = 2; + + for(i = 0; i< 10000; i++) + { + ext11->data_field.data_field1 = (XRAN_CP_SECTIONEXTCMD_11 << 24) | (params->RAD << 7) | (params->disableBFWs << 8); + //ext11->data_field.data_field1 = (XRAN_CP_SECTIONEXTCMD_11 << 24)' + //ext11->all_bits.RAD = params->RAD; + //ext11->all_bits.disableBFWs = params->disableBFWs; + ext11->data_field.data_field2 = (params->bfwCompMeth << 4) | params->numBundPrb; + //ext11->all_bits.numBundPrb = params->numBundPrb; + //ext11->all_bits.bfwCompMeth = params->bfwCompMeth; + + }*/ + //printf("ext11->data_field.data_field1 is %d\n", ext11->data_field.data_field1); + //ASSERT_EQ(prep_bytes, 3168); + } class U_planePerf : public KernelTests { @@ -36,22 +113,21 @@ protected: struct rte_mbuf *test_buffer; char * iq_offset; - struct rte_mempool *test_eth_mbuf_pool; void SetUp() override { /* Parameters stored in the functional section will be used. GTest will call TEST_P (including SetUp and TearDown) for each case in the section. */ init_test("u_plane_performace"); - test_eth_mbuf_pool = rte_pktmbuf_pool_create("mempool", NUM_MBUFS, - MBUF_CACHE, 0, MBUF_POOL_ELEMENT, rte_socket_id()); + test_buffer = (struct rte_mbuf*)rte_pktmbuf_alloc(_eth_mbuf_pool); /* buffer size defined as the maximum size of all inputs/outputs in BYTE */ - const int buffer_size = 9600; - test_buffer = (struct rte_mbuf*)rte_pktmbuf_alloc(test_eth_mbuf_pool); - + if(test_buffer == NULL) { + std::cout << __func__ << ":" << __LINE__ << " Failed to allocatte a packet buffer!" << std::endl; + return; + } iq_offset = rte_pktmbuf_mtod(test_buffer, char * ); - iq_offset = iq_offset + sizeof(struct ether_hdr) + + iq_offset = iq_offset + sizeof(struct rte_ether_hdr) + sizeof (struct xran_ecpri_hdr) + sizeof (struct radio_app_common_hdr) + sizeof(struct data_section_hdr); @@ -63,47 +139,12 @@ protected: rte_pktmbuf_free(test_buffer); } - void fucntional_dl(F function, int32_t* request, int32_t* response) - { - enum xran_pkt_dir direction = XRAN_DIR_DL; - uint16_t section_id = 0; - enum xran_input_byte_order iq_buf_byte_order = XRAN_CPU_LE_BYTE_ORDER; - uint8_t frame_id = 0; - uint8_t subframe_id = 0; - uint8_t slot_id = 0; - uint8_t symbol_no = 0; - int prb_start = 0; - int prb_num = 66; - uint8_t CC_ID = 0; - uint8_t RU_Port_ID = 0; - uint8_t seq_id =0; - uint32_t do_copy = 0; - - int32_t prep_bytes; - prep_bytes = prepare_symbol_ex(direction, - section_id, - test_buffer, - (struct rb_map *)iq_offset, - iq_buf_byte_order, - frame_id, - subframe_id, - slot_id, - symbol_no, - prb_start, - prb_num, - CC_ID, - RU_Port_ID, - seq_id, - do_copy); - - //ASSERT_EQ(prep_bytes, 3168); - } }; -TEST_P(U_planePerf, Test_DL) +TEST_P(U_planePerf, Perf) { - performance("C", module_name, fucntional_dl, &request, &response); + performance("C", module_name, &fucntional_dl, test_buffer, iq_offset); } INSTANTIATE_TEST_CASE_P(UnitTest, U_planePerf,