Hi @niloysh,
I cannot see any gtp5g interface in /proc
If I try to create a new gtp5g interface following the instructions here (Step 3), I get the following.
This error happened due to “bind: Address already in use”, you have to clean like below
sudo ./run.sh Clean
and also make sure there is no interface of gtp5g not exist by ifconfig cli command
The free5gc UPF function created a upfgtp interface that is being used.
I am not sure what the relation between this upfgtp and gtp5g interface is.
I would like to see the tx and rx statistics per PDR.
You should familiar with Linux kernel programming & concepts. If you are not familiar then start with understanding the gtp5g kernel module. If you want to know the relationship between free5GC/NFs/UPF and gtp5g then add more debug prints yourself in gtp5g or increase the debug prints through /proc/gtp5g/debug.
For your case, you can add TX and RX of uplink and downlink by
struct gtp5g_pdr {
struct hlist_node hlist_id;
struct hlist_node hlist_i_teid;
struct hlist_node hlist_addr;
struct hlist_node hlist_related_far;
struct hlist_node hlist_related_qer;
u16 id;
u32 precedence;
u8 *outer_header_removal;
struct gtp5g_pdi *pdi;
u32 *far_id;
struct gtp5g_far *far;
u32 *qer_id;
struct gtp5g_qer *qer;
// AF_UNIX socket for buffer
struct sockaddr_un addr_unix;
struct socket *sock_for_buf;
u16 af;
struct in_addr role_addr_ipv4;
struct sock *sk;
struct net_device *dev;
struct rcu_head rcu_head;
/* Drop Count */
u64 ul_drop_cnt;
u64 dl_drop_cnt;
};
Add a counter in PDR like below,
u64 ul_cnt;
u64 dl_cnt;
You can refer to the ul_drop_cnt & dl_drop_cnt how it was used in the gtp5g kernel module, likewise, you have to implement your requirements.