Commit 0eb9cfe5 authored by Rúben Soares Silva's avatar Rúben Soares Silva

Change TX_DATA.request data buffer to be allocated on the stack with 2MB,...

Change TX_DATA.request data buffer to be allocated on the stack with 2MB, instead of using malloc and free each time
parent 16a8ca05
......@@ -1278,27 +1278,21 @@ int fapi_nr_pack_and_send_p7_message(vnf_p7_t *vnf_p7, nfapi_p7_message_header_t
{
uint8_t FAPI_buffer[1024 * 64];
// Check if TX_DATA request, if true, need to pack to data_buf
if (header->message_id
== NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST) {
//uint8_t FAPI_data_buffer[1024 * 64];
size_t buffer_size = 0xFFFFFF ;
uint8_t *FAPI_data_buffer = (uint8_t *)malloc(buffer_size);
if (header->message_id == NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST) {
uint8_t FAPI_data_buffer[1024 * 1024 * 2];//2MB
uint32_t data_len = 0;
int32_t len_FAPI = aerial_pack_tx_data_request(header,
FAPI_buffer,
FAPI_data_buffer,
sizeof(FAPI_buffer),
buffer_size,
&vnf_p7->_public.codec_config,
&data_len);
if (len_FAPI <=0) {
LOG_E(NFAPI_VNF,"Problem packing TX_DATA_request\n");
free(FAPI_data_buffer);
FAPI_buffer,
FAPI_data_buffer,
sizeof(FAPI_buffer),
sizeof(FAPI_data_buffer),
&vnf_p7->_public.codec_config,
&data_len);
if (len_FAPI <= 0) {
LOG_E(NFAPI_VNF, "Problem packing TX_DATA_request\n");
return len_FAPI;
}
else{
} else {
int retval = aerial_send_P7_msg_with_data(FAPI_buffer, len_FAPI, FAPI_data_buffer, data_len, header);
free(FAPI_data_buffer);
return retval;
}
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment