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
zzha zzha
OpenXG-RAN
Commits
817e5cbc
Commit
817e5cbc
authored
Aug 11, 2022
by
Manish
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Read C/U plane dpdk device from config file
parent
d4afd251
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
9 deletions
+24
-9
targets/ARCH/ETHERNET/oran/5g/xran_lib_wrap.cpp
targets/ARCH/ETHERNET/oran/5g/xran_lib_wrap.cpp
+23
-8
targets/ARCH/ETHERNET/oran/5g/xran_lib_wrap.hpp
targets/ARCH/ETHERNET/oran/5g/xran_lib_wrap.hpp
+1
-1
No files found.
targets/ARCH/ETHERNET/oran/5g/xran_lib_wrap.cpp
View file @
817e5cbc
...
@@ -21,6 +21,20 @@
...
@@ -21,6 +21,20 @@
#include "xran_lib_wrap.hpp"
#include "xran_lib_wrap.hpp"
#include <fstream>
json
read_json_from_file
(
const
std
::
string
&
filename
)
{
json
result
;
std
::
ifstream
json_stream
(
filename
);
if
(
!
json_stream
.
is_open
())
throw
missing_config_file_exception
();
json_stream
>>
result
;
return
result
;
}
...
@@ -383,8 +397,6 @@ xranLibWraper::xranLibWraper()
...
@@ -383,8 +397,6 @@ xranLibWraper::xranLibWraper()
// From xran_io_cfg of xran_fh_o_du.h
// From xran_io_cfg of xran_fh_o_du.h
uint8_t
id_
=
0
;
uint8_t
id_
=
0
;
uint8_t
num_vfs_
=
2
;
uint8_t
num_vfs_
=
2
;
const
char
*
VF_UPlane
=
"0000:b3:02.0"
;
// why not m_dpdk_dev_up ?
const
char
*
VF_CPlane
=
"0000:b3:02.1"
;
// why not m_dpdk_dev_cp ?
// From xran_eaxcid_config of xran_fh_o_du.h
// From xran_eaxcid_config of xran_fh_o_du.h
uint8_t
bit_cuPortId_
=
12
;
//(??) bitnum_bandsec + bitnum_ccid + bitnum_ruport;
uint8_t
bit_cuPortId_
=
12
;
//(??) bitnum_bandsec + bitnum_ccid + bitnum_ruport;
...
@@ -407,11 +419,11 @@ xranLibWraper::xranLibWraper()
...
@@ -407,11 +419,11 @@ xranLibWraper::xranLibWraper()
// Independent
// Independent
m_nSlots
=
20
;
// If mu=0 is 10, if mu=1 is 20
m_nSlots
=
20
;
// If mu=0 is 10, if mu=1 is 20
m_du_mac
[
0
]
=
0x00
;
m_du_mac
[
1
]
=
0x11
;
m_du_mac
[
2
]
=
0x22
;
m_du_mac
[
3
]
=
0x33
;
m_du_mac
[
4
]
=
0x44
;
m_du_mac
[
5
]
=
0x55
;
m_du_mac
[
0
]
=
0x00
;
m_du_mac
[
1
]
=
0x11
;
m_du_mac
[
2
]
=
0x22
;
m_du_mac
[
3
]
=
0x33
;
m_du_mac
[
4
]
=
0x44
;
m_du_mac
[
5
]
=
0x55
;
m_ru_mac
[
0
]
=
0x00
;
m_ru_mac
[
1
]
=
0x11
;
m_ru_mac
[
2
]
=
0x22
;
m_ru_mac
[
3
]
=
0x33
;
m_ru_mac
[
4
]
=
0x44
;
m_ru_mac
[
5
]
=
0x66
;
//
m_ru_mac[0]=0x00; m_ru_mac[1]=0x11; m_ru_mac[2]=0x22; m_ru_mac[3]=0x33; m_ru_mac[4]=0x44; m_ru_mac[5]=0x66;
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
int
i
,
temp
;
int
i
,
temp
,
j
;
std
::
string
tmpstr
;
std
::
string
tmpstr
;
unsigned
int
tmp_mac
[
6
];
unsigned
int
tmp_mac
[
6
];
...
@@ -424,9 +436,10 @@ xranLibWraper::xranLibWraper()
...
@@ -424,9 +436,10 @@ xranLibWraper::xranLibWraper()
/* DPDK configuration */
/* DPDK configuration */
m_dpdk_dev_up
=
get_globalcfg
<
std
::
string
>
(
XRAN_UT_KEY_GLOBALCFG_IO
,
"dpdk_dev_up"
);
m_dpdk_dev_up
=
get_globalcfg
<
std
::
string
>
(
XRAN_UT_KEY_GLOBALCFG_IO
,
"dpdk_dev_up"
);
m_dpdk_dev_cp
=
get_globalcfg
<
std
::
string
>
(
XRAN_UT_KEY_GLOBALCFG_IO
,
"dpdk_dev_cp"
);
m_dpdk_dev_cp
=
get_globalcfg
<
std
::
string
>
(
XRAN_UT_KEY_GLOBALCFG_IO
,
"dpdk_dev_cp"
);
m_xranInit
.
io_cfg
.
dpdk_dev
[
XRAN_CP_VF
]
=
(
m_dpdk_dev_cp
==
""
)
?
NULL
:
(
char
*
)
&
m_dpdk_dev_cp
[
0
];
m_xranInit
.
io_cfg
.
dpdk_dev
[
XRAN_UP_VF
]
=
(
m_dpdk_dev_cp
==
""
)
?
NULL
:
(
char
*
)
&
m_dpdk_dev_up
[
0
];
std
::
cout
<<
"UP_VF ["
<<
m_xranInit
.
io_cfg
.
dpdk_dev
[
XRAN_UP_VF
]
<<
"], CP_VF ["
<<
m_xranInit
.
io_cfg
.
dpdk_dev
[
XRAN_CP_VF
]
<<
"]"
<<
std
::
endl
;
m_xranInit
.
io_cfg
.
num_vfs
=
num_vfs_
;
m_xranInit
.
io_cfg
.
num_vfs
=
num_vfs_
;
m_xranInit
.
io_cfg
.
dpdk_dev
[
XRAN_UP_VF
]
=
const_cast
<
char
*>
(
VF_UPlane
);
m_xranInit
.
io_cfg
.
dpdk_dev
[
XRAN_CP_VF
]
=
const_cast
<
char
*>
(
VF_CPlane
);
printf
(
"wrapper.hpp: m_xranInit.io_cfg.dpdk_dev[%d] =%s, m_xranInit.io_cfg.dpdk_dev[%d]=%s
\n
"
,
XRAN_UP_VF
,
m_xranInit
.
io_cfg
.
dpdk_dev
[
XRAN_UP_VF
],
XRAN_CP_VF
,
m_xranInit
.
io_cfg
.
dpdk_dev
[
XRAN_CP_VF
]);
printf
(
"wrapper.hpp: m_xranInit.io_cfg.dpdk_dev[%d] =%s, m_xranInit.io_cfg.dpdk_dev[%d]=%s
\n
"
,
XRAN_UP_VF
,
m_xranInit
.
io_cfg
.
dpdk_dev
[
XRAN_UP_VF
],
XRAN_CP_VF
,
m_xranInit
.
io_cfg
.
dpdk_dev
[
XRAN_CP_VF
]);
...
@@ -467,8 +480,10 @@ xranLibWraper::xranLibWraper()
...
@@ -467,8 +480,10 @@ xranLibWraper::xranLibWraper()
std
::
sscanf
(
ru_mac_str
.
c_str
(),
"%02x:%02x:%02x:%02x:%02x:%02x"
,
std
::
sscanf
(
ru_mac_str
.
c_str
(),
"%02x:%02x:%02x:%02x:%02x:%02x"
,
&
tmp_mac
[
0
],
&
tmp_mac
[
1
],
&
tmp_mac
[
2
],
&
tmp_mac
[
0
],
&
tmp_mac
[
1
],
&
tmp_mac
[
2
],
&
tmp_mac
[
3
],
&
tmp_mac
[
4
],
&
tmp_mac
[
5
]);
&
tmp_mac
[
3
],
&
tmp_mac
[
4
],
&
tmp_mac
[
5
]);
for
(
j
=
0
;
j
<
XRAN_VF_MAX
;
j
++
)
{
for
(
i
=
0
;
i
<
6
;
i
++
)
for
(
i
=
0
;
i
<
6
;
i
++
)
m_ru_mac
[
i
]
=
(
uint8_t
)
tmp_mac
[
i
];
m_ru_mac
[
j
][
i
]
=
(
uint8_t
)
tmp_mac
[
i
];
}
m_xranInit
.
p_o_du_addr
=
(
int8_t
*
)
m_du_mac
;
m_xranInit
.
p_o_du_addr
=
(
int8_t
*
)
m_du_mac
;
m_xranInit
.
p_o_ru_addr
=
(
int8_t
*
)
m_ru_mac
;
m_xranInit
.
p_o_ru_addr
=
(
int8_t
*
)
m_ru_mac
;
m_xranInit
.
cp_vlan_tag
=
get_globalcfg
<
int
>
(
XRAN_UT_KEY_GLOBALCFG_IO
,
"cp_vlan_tag"
);
m_xranInit
.
cp_vlan_tag
=
get_globalcfg
<
int
>
(
XRAN_UT_KEY_GLOBALCFG_IO
,
"cp_vlan_tag"
);
...
...
targets/ARCH/ETHERNET/oran/5g/xran_lib_wrap.hpp
View file @
817e5cbc
...
@@ -104,7 +104,7 @@ protected:
...
@@ -104,7 +104,7 @@ protected:
void
*
m_xranhandle
;
void
*
m_xranhandle
;
uint8_t
m_du_mac
[
6
];
// = { 0x00,0x11, 0x22, 0x33, 0x44, 0x55 }; // Sofia: this is hard coded here and then it is read from the conf file
uint8_t
m_du_mac
[
6
];
// = { 0x00,0x11, 0x22, 0x33, 0x44, 0x55 }; // Sofia: this is hard coded here and then it is read from the conf file
uint8_t
m_ru_mac
[
6
];
//= { 0x00,0x11, 0x22, 0x33, 0x44, 0x66 }; // Sofia: this is hard coded here and then it is read from the conf file
uint8_t
m_ru_mac
[
XRAN_VF_MAX
][
6
];
//= { 0x00,0x11, 0x22, 0x33, 0x44, 0x66 }; // Sofia: this is hard coded here and then it is read from the conf file
bool
m_bSub6
;
bool
m_bSub6
;
uint32_t
m_nSlots
;
// = 20;
uint32_t
m_nSlots
;
// = 20;
...
...
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