Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
oai-upf-6g
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
OpenXG
oai-upf-6g
Commits
846cfacd
Commit
846cfacd
authored
Oct 16, 2025
by
Franck Messaoudi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update: enboard the upf_cfg within the constructor
parent
47bb9838
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
7 deletions
+63
-7
src/upf_app/programs/pfcp_session_lookup_xdp_user.cpp
src/upf_app/programs/pfcp_session_lookup_xdp_user.cpp
+56
-6
src/upf_app/programs/pfcp_session_lookup_xdp_user.h
src/upf_app/programs/pfcp_session_lookup_xdp_user.h
+7
-1
No files found.
src/upf_app/programs/pfcp_session_lookup_xdp_user.cpp
View file @
846cfacd
...
@@ -29,13 +29,61 @@ int is_little_endian2() {
...
@@ -29,13 +29,61 @@ int is_little_endian2() {
/*---------------------------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------------------------*/
PFCP_Session_LookupProgram
::
PFCP_Session_LookupProgram
(
PFCP_Session_LookupProgram
::
PFCP_Session_LookupProgram
(
const
std
::
string
&
gtpInterface
,
const
std
::
string
&
udpInterface
)
const
std
::
string
&
gtpInterface
,
const
std
::
string
&
udpInterface
,
const
upf_config
&
upf_cfg
)
:
mGTPInterface
(
gtpInterface
),
mUDPInterface
(
udpInterface
)
{
:
mGTPInterface
(
gtpInterface
),
mUDPInterface
(
udpInterface
)
{
struct
pfcp_session_lookup_xdp_kernel_c
*
skel
=
nullptr
;
int
ret
=
-
1
;
Logger
::
upf_app
().
info
(
"Initializing PFCP Session Lookup BPF program..."
);
// create the open function (callable)
auto
open_fn
=
[
&
upf_cfg
,
this
]()
->
pfcp_session_lookup_xdp_kernel_c
*
{
struct
pfcp_session_lookup_xdp_kernel_c
*
skel
=
pfcp_session_lookup_xdp_kernel_c__open
();
if
(
!
skel
)
{
Logger
::
upf_app
().
error
(
"Failed to open BPF skeleton"
);
return
nullptr
;
}
// configure maps / rodata here (same pattern as kernel perf)
uint32_t
max_rules_match_pdr
=
upf_cfg
.
max_pdrs_per_pdu_session
*
upf_cfg
.
max_pdu_session
;
bpf_map__set_max_entries
(
skel
->
maps
.
m_upf_interfaces
,
upf_cfg
.
max_upf_interfaces
);
bpf_map__set_max_entries
(
skel
->
maps
.
m_redirect_interfaces
,
upf_cfg
.
max_upf_redirect_interfaces
);
bpf_map__set_max_entries
(
skel
->
maps
.
m_session_mapping
,
upf_cfg
.
max_pdu_session
);
bpf_map__set_max_entries
(
skel
->
maps
.
m_session_pdrs
,
upf_cfg
.
max_pdrs_per_pdu_session
);
bpf_map__set_max_entries
(
skel
->
maps
.
m_sdf_filter
,
upf_cfg
.
max_sdf_filters_per_pdu_session
);
bpf_map__set_max_entries
(
skel
->
maps
.
m_arp_table
,
upf_cfg
.
max_arp_entries
);
bpf_map__set_max_entries
(
skel
->
maps
.
m_rules_match_pdr
,
upf_cfg
.
max_pdrs_per_pdu_session
*
upf_cfg
.
max_pdu_session
);
// optionally set rodata fields:
if
(
skel
->
rodata
)
{
skel
->
rodata
->
max_upf_interfaces
=
upf_cfg
.
max_upf_interfaces
;
skel
->
rodata
->
max_upf_redirect_interfaces
=
upf_cfg
.
max_upf_redirect_interfaces
;
skel
->
rodata
->
max_pdu_session
=
upf_cfg
.
max_pdu_session
;
skel
->
rodata
->
max_pdrs_per_pdu_session
=
upf_cfg
.
max_pdrs_per_pdu_session
;
skel
->
rodata
->
max_sdf_filters_per_pdu_session
=
upf_cfg
.
max_sdf_filters_per_pdu_session
;
skel
->
rodata
->
max_arp_entries
=
upf_cfg
.
max_arp_entries
;
}
return
skel
;
};
// now create the lifecycle object with a callable open_fn (not a raw skel)
mpLifeCycle
=
std
::
make_shared
<
PFCP_Session_LookupProgramLifeCycle
>
(
mpLifeCycle
=
std
::
make_shared
<
PFCP_Session_LookupProgramLifeCycle
>
(
pfcp_session_lookup_xdp_kernel_c__ope
n
,
open_f
n
,
pfcp_session_lookup_xdp_kernel_c__load
,
/* load */
pfcp_session_lookup_xdp_kernel_c__load
,
pfcp_session_lookup_xdp_kernel_c__attach
,
/* attach */
pfcp_session_lookup_xdp_kernel_c__attach
,
pfcp_session_lookup_xdp_kernel_c__destroy
);
/* destroy*/
pfcp_session_lookup_xdp_kernel_c__destroy
);
}
}
/*---------------------------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------------------------*/
...
@@ -118,7 +166,8 @@ void PFCP_Session_LookupProgram::setup(bool isQosEnabled) {
...
@@ -118,7 +166,8 @@ void PFCP_Session_LookupProgram::setup(bool isQosEnabled) {
"Link Non-GTP XDP Section to interface %s"
,
mUDPInterface
.
c_str
());
"Link Non-GTP XDP Section to interface %s"
,
mUDPInterface
.
c_str
());
if
(
isQosEnabled
)
{
if
(
isQosEnabled
)
{
Logger
::
upf_app
().
debug
(
Logger
::
upf_app
().
debug
(
"QoS enforcement is enabled in the configuration. A TC BPF section is "
"QoS enforcement is enabled in the configuration. A TC BPF section "
"is "
"created "
);
"created "
);
mpLifeCycle
->
link
(
XDPSection
::
Shaping
,
mUDPInterface
.
c_str
());
mpLifeCycle
->
link
(
XDPSection
::
Shaping
,
mUDPInterface
.
c_str
());
}
else
{
}
else
{
...
@@ -216,6 +265,7 @@ void PFCP_Session_LookupProgram::removeFramedRoute(FramedRoutingKeyBPF key) {
...
@@ -216,6 +265,7 @@ void PFCP_Session_LookupProgram::removeFramedRoute(FramedRoutingKeyBPF key) {
}
}
}
}
/*---------------------------------------------------------------------------------------------------------------*/
void
PFCP_Session_LookupProgram
::
setFramedRouting
(
bool
enable
)
{
void
PFCP_Session_LookupProgram
::
setFramedRouting
(
bool
enable
)
{
uint8_t
value
=
(
enable
)
?
1
:
0
;
uint8_t
value
=
(
enable
)
?
1
:
0
;
uint8_t
key
=
0
;
uint8_t
key
=
0
;
...
...
src/upf_app/programs/pfcp_session_lookup_xdp_user.h
View file @
846cfacd
...
@@ -12,6 +12,11 @@
...
@@ -12,6 +12,11 @@
#include "interfaces.h"
#include "interfaces.h"
#include <framed_routing_bpf.h>
#include <framed_routing_bpf.h>
#include "upf_config.hpp"
using
namespace
oai
::
config
;
extern
upf_config
upf_cfg
;
class
BPFMaps
;
class
BPFMaps
;
class
BPFMap
;
class
BPFMap
;
class
SessionManager
;
class
SessionManager
;
...
@@ -26,7 +31,8 @@ using PFCP_Session_LookupProgramLifeCycle =
...
@@ -26,7 +31,8 @@ using PFCP_Session_LookupProgramLifeCycle =
class
PFCP_Session_LookupProgram
{
class
PFCP_Session_LookupProgram
{
public:
public:
explicit
PFCP_Session_LookupProgram
(
explicit
PFCP_Session_LookupProgram
(
const
std
::
string
&
gtpInterface
,
const
std
::
string
&
udpInterface
);
const
std
::
string
&
gtpInterface
,
const
std
::
string
&
udpInterface
,
const
upf_config
&
upf_cfg
);
virtual
~
PFCP_Session_LookupProgram
();
virtual
~
PFCP_Session_LookupProgram
();
void
setup
(
bool
isQosEnabled
);
void
setup
(
bool
isQosEnabled
);
std
::
shared_ptr
<
BPFMaps
>
getMaps
();
std
::
shared_ptr
<
BPFMaps
>
getMaps
();
...
...
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