Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lizhongxiao
OpenXG-RAN
Commits
0e5033f1
Commit
0e5033f1
authored
Nov 29, 2023
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Transform app_io_xran_buffers_max_sz_set() to readable code
parent
8ecf9754
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
37 deletions
+38
-37
radio/ETHERNET/oran/5g/app_io_fh_xran-E.c
radio/ETHERNET/oran/5g/app_io_fh_xran-E.c
+35
-34
radio/ETHERNET/oran/5g/app_io_fh_xran.h
radio/ETHERNET/oran/5g/app_io_fh_xran.h
+3
-1
radio/ETHERNET/oran/5g/sample-app-E.c
radio/ETHERNET/oran/5g/sample-app-E.c
+0
-2
No files found.
radio/ETHERNET/oran/5g/app_io_fh_xran-E.c
View file @
0e5033f1
...
...
@@ -38,9 +38,38 @@
#include "common/utils/assertions.h"
/* buffers size */
uint32_t
nFpgaToSW_FTH_RxBufferLen
;
uint32_t
nSW_ToFpga_FTH_TxBufferLen
;
uint32_t
get_nSW_ToFpga_FTH_TxBufferLen
(
int
mu
,
int
sections
)
{
uint32_t
xran_max_sections_per_slot
=
RTE_MAX
(
sections
,
XRAN_MIN_SECTIONS_PER_SLOT
);
uint32_t
overhead
=
xran_max_sections_per_slot
*
(
RTE_PKTMBUF_HEADROOM
+
sizeof
(
struct
rte_ether_hdr
)
+
sizeof
(
struct
xran_ecpri_hdr
)
+
sizeof
(
struct
radio_app_common_hdr
)
+
sizeof
(
struct
data_section_hdr
));
if
(
mu
<=
1
)
{
return
13168
+
overhead
;
/* 273*12*4 + 64* + ETH AND ORAN HDRs */
}
else
if
(
mu
==
3
)
{
return
3328
+
overhead
;
}
else
{
assert
(
false
&&
"numerology not supported
\n
"
);
}
}
uint32_t
get_nFpgaToSW_FTH_RxBufferLen
(
int
mu
)
{
/* note: previous code checked MTU:
* mu <= 1: return mtu > XRAN_MTU_DEFAULT ? 13168 : XRAN_MTU_DEFAULT;
* mu == 3: return mtu > XRAN_MTU_DEFAULT ? 3328 : XRAN_MTU_DEFAULT;
* but I don't understand the interest: if the buffer is a big bigger, there
* is no problem, or we could just set the MTU size as buffer size?!
* Go with Max for the moment
*/
if
(
mu
<=
1
)
{
return
13168
;
/* 273*12*4 + 64*/
}
else
if
(
mu
==
3
)
{
return
3328
;
}
else
{
assert
(
false
&&
"numerology not supported
\n
"
);
}
}
static
struct
bbu_xran_io_if
*
p_app_io_xran_if
;
...
...
@@ -108,6 +137,9 @@ app_io_xran_fh_rx_prach_callback(void *pCallbackTag, xran_status_t status)
int32_t
app_io_xran_interface
(
uint32_t
o_xu_id
,
RuntimeConfig
*
p_o_xu_cfg
,
UsecaseConfig
*
p_use_cfg
)
{
uint32_t
nFpgaToSW_FTH_RxBufferLen
=
get_nFpgaToSW_FTH_RxBufferLen
(
p_o_xu_cfg
->
mu_number
);
uint32_t
nSW_ToFpga_FTH_TxBufferLen
=
get_nSW_ToFpga_FTH_TxBufferLen
(
p_o_xu_cfg
->
mu_number
,
p_o_xu_cfg
->
max_sections_per_slot
);
xran_status_t
status
;
struct
bbu_xran_io_if
*
psBbuIo
=
app_io_xran_if_get
();
struct
xran_io_shared_ctrl
*
psIoCtrl
=
app_io_xran_if_ctrl_get
(
o_xu_id
);
...
...
@@ -399,34 +431,3 @@ void app_io_xran_if_stop(void)
iAssert
(
status
==
XRAN_STATUS_SUCCESS
);
}
}
int32_t
app_io_xran_buffers_max_sz_set
(
RuntimeConfig
*
p_o_xu_cfg
)
{
uint32_t
xran_max_sections_per_slot
=
RTE_MAX
(
p_o_xu_cfg
->
max_sections_per_slot
,
XRAN_MIN_SECTIONS_PER_SLOT
);
uint32_t
overhead
=
xran_max_sections_per_slot
*
(
RTE_PKTMBUF_HEADROOM
+
sizeof
(
struct
rte_ether_hdr
)
+
sizeof
(
struct
xran_ecpri_hdr
)
+
sizeof
(
struct
radio_app_common_hdr
)
+
sizeof
(
struct
data_section_hdr
));
if
(
p_o_xu_cfg
->
mu_number
<=
1
){
nSW_ToFpga_FTH_TxBufferLen
=
13168
+
/* 273*12*4 + 64* + ETH AND ORAN HDRs */
overhead
;
if
(
p_o_xu_cfg
->
mtu
>
XRAN_MTU_DEFAULT
)
{
nFpgaToSW_FTH_RxBufferLen
=
13168
;
/* 273*12*4 + 64*/
}
else
{
nFpgaToSW_FTH_RxBufferLen
=
XRAN_MTU_DEFAULT
;
/* 273*12*4 + 64*/
}
}
else
if
(
p_o_xu_cfg
->
mu_number
==
3
)
{
nSW_ToFpga_FTH_TxBufferLen
=
3328
+
overhead
;
if
(
p_o_xu_cfg
->
mtu
>
XRAN_MTU_DEFAULT
)
{
nFpgaToSW_FTH_RxBufferLen
=
3328
;
}
else
{
nFpgaToSW_FTH_RxBufferLen
=
XRAN_MTU_DEFAULT
;
}
}
else
{
printf
(
"given numerology is not supported %d
\n
"
,
p_o_xu_cfg
->
mu_number
);
exit
(
-
1
);
}
printf
(
"nSW_ToFpga_FTH_TxBufferLen %d
\n
"
,
nSW_ToFpga_FTH_TxBufferLen
);
return
0
;
}
radio/ETHERNET/oran/5g/app_io_fh_xran.h
View file @
0e5033f1
...
...
@@ -125,10 +125,12 @@ void app_io_xran_if_free(void);
struct
xran_io_shared_ctrl
*
app_io_xran_if_ctrl_get
(
uint32_t
o_xu_id
);
int32_t
app_io_xran_interface
(
uint32_t
o_xu_id
,
RuntimeConfig
*
p_o_xu_cfg
,
UsecaseConfig
*
p_use_cfg
);
int32_t
app_io_xran_buffers_max_sz_set
(
RuntimeConfig
*
p_o_xu_cfg
);
void
app_io_xran_if_stop
(
void
);
uint32_t
get_nSW_ToFpga_FTH_TxBufferLen
(
int
mu
,
int
sections
);
uint32_t
get_nFpgaToSW_FTH_RxBufferLen
(
int
mu
);
#ifdef __cplusplus
}
#endif
...
...
radio/ETHERNET/oran/5g/sample-app-E.c
View file @
0e5033f1
...
...
@@ -603,8 +603,6 @@ int *oai_main(int argc, char *argv[])
/** process all the O-RU|O-DU for use case */
for
(
o_xu_id
=
0
;
o_xu_id
<
p_usecaseConfiguration
->
oXuNum
;
o_xu_id
++
)
{
RuntimeConfig
*
p_o_xu_cfg
=
p_startupConfiguration
[
o_xu_id
];
if
(
o_xu_id
==
0
)
app_io_xran_buffers_max_sz_set
(
p_o_xu_cfg
);
if
(
p_o_xu_cfg
->
ant_file
[
0
]
==
NULL
)
{
printf
(
"it looks like test vector for antennas were not provided
\n
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment