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
ea28029a
Commit
ea28029a
authored
Feb 07, 2025
by
Franck Messaoudi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update: formatting some files
parent
e64d6c81
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
33 deletions
+27
-33
src/upf_app/SessionManager.h
src/upf_app/SessionManager.h
+6
-6
src/upf_app/bpf/protocols/udp.h
src/upf_app/bpf/protocols/udp.h
+1
-1
src/upf_app/bpf/rules/pdr/pfcp_session_lookup_xdp_kernel.c
src/upf_app/bpf/rules/pdr/pfcp_session_lookup_xdp_kernel.c
+4
-4
src/upf_app/bpf/rules/qer/qer_tc_kernel.c
src/upf_app/bpf/rules/qer/qer_tc_kernel.c
+16
-19
src/upf_app/bpf/rules/qer/qos_flow.h
src/upf_app/bpf/rules/qer/qos_flow.h
+0
-3
No files found.
src/upf_app/SessionManager.h
View file @
ea28029a
...
...
@@ -59,12 +59,12 @@ class SessionManager {
virtual
~
SessionManager
();
/*---------------------------------------------------------------------------------------------------------------*/
// /**
// * @brief Create a Session object in BPF map.
// *
// * @param pSession The session object to be created.
// */
// void createSession(std::shared_ptr<SessionBpf> pSession);
// /**
// * @brief Create a Session object in BPF map.
// *
// * @param pSession The session object to be created.
// */
// void createSession(std::shared_ptr<SessionBpf> pSession);
/*---------------------------------------------------------------------------------------------------------------*/
/**
...
...
src/upf_app/bpf/protocols/udp.h
View file @
ea28029a
...
...
@@ -7,7 +7,7 @@
#include <linux/if_ether.h>
//#define UDP_CSUM_OFFSET (sizeof(struct ethhdr) + offsetof(struct udphdr,
//check))
//
check))
// static u32 udp_handle(
// struct xdp_md* ctx, struct udphdr* udph, u32 src_ip, u32 dest_ip);
...
...
src/upf_app/bpf/rules/pdr/pfcp_session_lookup_xdp_kernel.c
View file @
ea28029a
...
...
@@ -422,7 +422,7 @@ int xdp_handle_downlink(struct xdp_md* ctx) {
return
XDP_DROP
;
}
// struct iphdr* iph = (struct iphdr*) ((void*) ethh + sizeof(*ethh));
// struct iphdr* iph = (struct iphdr*) ((void*) ethh + sizeof(*ethh));
struct
iphdr
*
iph
=
(
void
*
)
(
ethh
+
1
);
if
((
void
*
)
(
iph
+
1
)
>
data_end
)
{
...
...
@@ -430,7 +430,7 @@ int xdp_handle_downlink(struct xdp_md* ctx) {
return
XDP_DROP
;
}
bpf_debug
(
"xxxxxxxxxxxx ip_dest: 0x%x"
,
iph
->
daddr
);
bpf_debug
(
"xxxxxxxxxxxx ip_dest: 0x%x"
,
iph
->
daddr
);
u32
ip_dest
=
bpf_htonl
(
iph
->
daddr
);
struct
session_id
*
session
=
bpf_map_lookup_elem
(
&
m_session_mapping
,
&
ip_dest
);
...
...
@@ -472,9 +472,9 @@ int xdp_handle_shaping(struct xdp_md* ctx) {
return
XDP_DROP
;
}
//struct iphdr* iph = (struct iphdr*) ((void*) ethh + sizeof(*ethh));
//
struct iphdr* iph = (struct iphdr*) ((void*) ethh + sizeof(*ethh));
struct
iphdr
*
iph
=
(
void
*
)
(
ethh
+
1
);
if
((
void
*
)
(
iph
+
1
)
>
data_end
)
{
bpf_debug
(
"Error: Invalid IPv4 Packet"
);
return
XDP_DROP
;
...
...
src/upf_app/bpf/rules/qer/qer_tc_kernel.c
View file @
ea28029a
...
...
@@ -35,13 +35,12 @@
#define TARGET_INTF 644
//---------------------------------------------------------------------------------------------------------------
static
__always_inline
u32
egress_sdf_filter
(
struct
__sk_buff
*
skb
)
{
void
*
data
=
(
void
*
)(
long
)
skb
->
data
;
static
__always_inline
u32
egress_sdf_filter
(
struct
__sk_buff
*
skb
)
{
void
*
data
=
(
void
*
)
(
long
)
skb
->
data
;
void
*
data_end
=
(
void
*
)
(
long
)
skb
->
data_end
;
struct
ethhdr
*
ethh
=
data
;
if
((
void
*
)
(
ethh
+
1
)
>
data_end
)
{
bpf_debug
(
"Error: Invalid Ethernet header"
);
return
TC_ACT_SHOT
;
...
...
@@ -81,13 +80,13 @@ static __always_inline u32 egress_sdf_filter(
struct
filter_key
*
key
=
{
0
};
u8
protocol
=
iph_inner
->
protocol
;
//
bpf_debug("Create Key for SDF Filter Map");
//
bpf_debug("Create Key for SDF Filter Map");
key
->
src_ip
=
iph_inner
->
saddr
;
key
->
dst_ip
=
iph_inner
->
daddr
;
key
->
protocol
=
protocol
;
switch
(
protocol
)
{
case
IPPROTO_UDP
:
{
// Extract UDP header
...
...
@@ -141,11 +140,10 @@ static __always_inline u32 egress_sdf_filter(
}
//---------------------------------------------------------------------------------------------------------------
static
__always_inline
u32
ipv4_sdf_filter
(
struct
__sk_buff
*
skb
)
{
void
*
data
=
(
void
*
)(
long
)
skb
->
data
;
void
*
data_end
=
(
void
*
)(
long
)
skb
->
data_end
;
static
__always_inline
u32
ipv4_sdf_filter
(
struct
__sk_buff
*
skb
)
{
void
*
data
=
(
void
*
)
(
long
)
skb
->
data
;
void
*
data_end
=
(
void
*
)
(
long
)
skb
->
data_end
;
struct
ethhdr
*
ethh
=
data
;
if
((
void
*
)
(
ethh
+
1
)
>
data_end
)
{
...
...
@@ -160,7 +158,7 @@ ipv4_sdf_filter(struct __sk_buff* skb) {
return
TC_ACT_SHOT
;
}
u8
protocol
=
iph
->
protocol
;
u8
protocol
=
iph
->
protocol
;
switch
(
protocol
)
{
case
IPPROTO_UDP
:
{
...
...
@@ -182,15 +180,14 @@ ipv4_sdf_filter(struct __sk_buff* skb) {
}
}
//---------------------------------------------------------------------------------------------------------------
SEC
(
"tc/egress"
)
int
tc_filter_traffic
(
struct
__sk_buff
*
skb
)
{
bpf_debug
(
"==========< tc/egress: Filter Traffic >==========
\n
"
);
void
*
data
=
(
void
*
)(
long
)
skb
->
data
;
void
*
data_end
=
(
void
*
)(
long
)
skb
->
data_end
;
void
*
data
=
(
void
*
)
(
long
)
skb
->
data
;
void
*
data_end
=
(
void
*
)
(
long
)
skb
->
data_end
;
struct
ethhdr
*
ethh
=
data
;
...
...
@@ -243,12 +240,12 @@ int tc_redirect_traffic(struct __sk_buff* skb) {
int
key
=
DOWNLINK
,
*
ifindex
;
ifindex
=
bpf_map_lookup_elem
(
&
m_egress_ifindex
,
&
key
);
if
(
ifindex
)
{
bpf_debug
(
"TC_REDIRECT: Redirecting packet to N3 tc layer"
);
return
bpf_redirect
(
*
ifindex
,
0
);
}
bpf_debug
(
"TC Packets not redirected! Drop them"
);
return
TC_ACT_SHOT
;
}
...
...
src/upf_app/bpf/rules/qer/qos_flow.h
View file @
ea28029a
...
...
@@ -27,7 +27,6 @@
// uint64_t qfi;
// };
struct
s_fiveQosFlow
{
uint8_t
gate
;
uint64_t
mbr
;
...
...
@@ -35,6 +34,4 @@ struct s_fiveQosFlow {
uint8_t
qfi
;
};
#endif //__QOS_FLOW_H__
\ No newline at end of file
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