Git Product home page Git Product logo

gtp5g's Introduction

gtp5g - 5G compatible GTP kernel module

gtp5g is a customized Linux kernel module gtp5g to handle packet by PFCP IEs such as PDR and FAR. For detailed information, please reference to 3GPP specification TS 29.281 and TS 29.244.

Notice

Due to the evolution of Linux kernel, this module would not work with every kernel version. Please run this module with kernel version 5.0.0-23-generic, upper than 5.4 (Ubuntu 20.04) or RHEL8.

Usage

Compile

git clone https://github.com/free5gc/gtp5g.git && cd gtp5g
make clean && make

Install kernel module

Install the module to the system and load automatically at boot

sudo make install

Remove kernel module

Remove the kernel module from the system

sudo make uninstall

Check Rules

Get PDR/FAR/QER information by "/proc"

# if UPF used legacy netlink struct without SEID, need use #SEID=0 to query related info as below:
echo #interfaceName #SEID #PDRID > /proc/gtp5g/pdr
echo #interfaceName #SEID #FARID > /proc/gtp5g/far
echo #interfaceName #SEID #QERID > /proc/gtp5g/qer
cat /proc/gtp5g/pdr
cat /proc/gtp5g/far
cat /proc/gtp5g/qer

Enable/Disable QoS (Default is disabled)

Support Session AMBR and MFBR.

  1. Check whether QoS is enabled or disabled. (1 means enabled, 0 means disabled)
    cat /proc/gtp5g/qos
    
  2. Enable or disable QoS
    • enable
      echo 1 >  /proc/gtp5g/qos
      
    • disable
      echo 0 >  /proc/gtp5g/qos
      

Enable/Disable GTP-U Sequence Number (Default is enabled)

Support GTP-U Sequence Number.

  1. Check whether GTP-U Sequence Number is enabled or disabled. (1 means enabled, 0 means disabled)
    cat /proc/gtp5g/seq
    
  2. Enable or disable GTP-U Sequence Number
    • enable
      echo 1 >  /proc/gtp5g/seq
      
    • disable
      echo 0 >  /proc/gtp5g/seq
      

Log Related

  1. check log
    dmesg
    
  2. update log level
    # [number] is 0~4 
    # e.g. echo 4 > /proc/gtp5g/dbg
    echo [number] > /proc/gtp5g/dbg
    

Tools

gtp5g's People

Contributors

abousselmi avatar afcidk avatar awandke avatar bjoern-r avatar cdonatom avatar chen042531 avatar edingroot avatar free5gc-org avatar ianchen0119 avatar jessetu75 avatar john721 avatar leohung-free5gc avatar louisroyer avatar lucasoshiro avatar matsumu-y avatar mrlnc avatar muthuramanecs03g avatar niloysh avatar ravens avatar robertttbs avatar roy-hu avatar shouheinishi avatar shugo-h avatar tim-ywliu avatar yahsieh avatar zedr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

gtp5g's Issues

[Bugs] Some GTP-U packet cause infinity loop in gtp5g

Describe the bug

The GTP-U packet where the length of extention header is 0, the gtp5g is stucked.

To Reproduce

  1. This patch is applied to free5gc codes,
diff --git a/test/registration_test.go b/test/registration_test.go
index 19a75ef..26a57ca 100644
--- a/test/registration_test.go
+++ b/test/registration_test.go
@@ -230,7 +230,7 @@ func TestRegistration(t *testing.T) {

        // Send the dummy packet
        // ping IP(tunnel IP) from 10.60.0.2(127.0.0.1) to 10.60.0.20(127.0.0.8)
-       gtpHdr, err := hex.DecodeString("32ff00340000000100000000")
+       gtpHdr, err := hex.DecodeString("36ff003400000001000000ff00")
        assert.Nil(t, err)
        icmpData, err := hex.DecodeString("8c870d0000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637")
        assert.Nil(t, err)
  1. Start ./test.sh TestRegistration

Expected behavior

Don't stuck gtp5g

Environment (please complete the following information):

  • gtp5g Version: a9dc486
  • OS: Ubuntu 20.04
  • Kernel version: 5.4.0-147-generic

Trace File

[341332.419921] watchdog: BUG: soft lockup - CPU#2 stuck for 22s! [test.test:159349]
[341332.420101] Modules linked in: veth gtp5g(OE) udp_diag tcp_diag inet_diag udp_tunnel ufs qnx4 hfsplus hfs minix ntfs msdos jfs xfs sctp vmw_vsock_vmci_transport vsock nls_iso8859_1 dm_multipath scsi_dh_rdac scsi_dh_emc scsi_dh_alua binfmt_misc intel_rapl_msr intel_rapl_common isst_if_mbox_msr isst_if_common nfit vmw_balloon input_leds joydev serio_raw rapl vmw_vmci mac_hid sch_fq_codel msr ramoops reed_solomon efi_pstore ip_tables x_tables autofs4 btrfs zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 multipath linear vmwgfx ttm crct10dif_pclmul crc32_pclmul drm_kms_helper ghash_clmulni_intel aesni_intel syscopyarea sysfillrect sysimgblt crypto_simd fb_sys_fops cryptd drm psmouse vmxnet3 glue_helper vmw_pvscsi i2c_piix4 pata_acpi [last unloaded: gtp5g]
[341332.420144] CPU: 2 PID: 159349 Comm: test.test Tainted: G           OE     5.4.0-147-generic #164-Ubuntu
[341332.420145] Hardware name: VMware, Inc. VMware7,1/440BX Desktop Reference Platform, BIOS VMW71.00V.18227214.B64.2106252220 06/25/2021
[341332.420152] RIP: 0010:gtp5g_encap_recv+0x156/0xef0 [gtp5g]
[341332.420154] Code: 95 00 44 39 e8 0f 82 b6 01 00 00 44 89 ea 41 80 7c 16 ff 00 0f 84 11 01 00 00 41 8b 7c 24 70 41 8b 74 24 74 41 8d 4d 01 89 f8 <29> f0 39 c1 76 c8 48 89 55 88 39 f9 0f 87 f2 03 00 00 29 fe 4c 89
[341332.420155] RSP: 0018:ffffb65f80108be0 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13
[341332.420156] RAX: 0000000000000061 RBX: ffff94aeb17cf8c0 RCX: 0000000000000015
[341332.420157] RDX: 0000000000000014 RSI: 0000000000000000 RDI: 0000000000000061
[341332.420157] RBP: ffffb65f80108c60 R08: 0000000000006808 R09: 0000000000000011
[341332.420158] R10: 0000000000000061 R11: 0000000000000000 R12: ffff94aeb1503700
[341332.420158] R13: 0000000000000014 R14: ffff94aeaa958c24 R15: 00000000000000ff
[341332.420159] FS:  00007f4959adb700(0000) GS:ffff94aeb7b00000(0000) knlGS:0000000000000000
[341332.420160] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[341332.420161] CR2: 0000000001ef6310 CR3: 000000022b490001 CR4: 00000000007606e0
[341332.420190] PKRU: 55555554
[341332.420191] Call Trace:
[341332.420193]  <IRQ>
[341332.420198]  ? fib_validate_source+0x47/0xf0
[341332.420201]  ? check_urr+0x4d0/0x4d0 [gtp5g]
[341332.420203]  udp_queue_rcv_one_skb+0x1fc/0x520
[341332.420205]  udp_queue_rcv_skb+0x3f/0x1a0
[341332.420206]  udp_unicast_rcv_skb.isra.0+0x76/0x90
[341332.420207]  __udp4_lib_rcv+0x582/0xbe0
[341332.420216]  ? __wake_up_common+0x7e/0x140
[341332.420217]  udp_rcv+0x1a/0x20
[341332.420221]  ip_protocol_deliver_rcu+0xe9/0x1b0
[341332.420222]  ip_local_deliver_finish+0x48/0x50
[341332.420223]  ip_local_deliver+0x73/0xf0
[341332.420224]  ? ip_rcv_finish_core.isra.0+0x69/0x3b0
[341332.420225]  ip_rcv_finish+0x85/0xa0
[341332.420226]  ip_rcv+0xbc/0xd0
[341332.420227]  ? trigger_load_balance+0xad/0x210
[341332.420231]  __netif_receive_skb_one_core+0x88/0xa0
[341332.420232]  __netif_receive_skb+0x18/0x60
[341332.420233]  process_backlog+0xa9/0x160
[341332.420234]  net_rx_action+0x142/0x390
[341332.420240]  __do_softirq+0xd1/0x2c1
[341332.420241]  do_softirq_own_stack+0x2a/0x40
[341332.420242]  </IRQ>
[341332.420245]  do_softirq.part.0+0x46/0x50
[341332.420246]  __local_bh_enable_ip+0x50/0x60
[341332.420248]  ip_finish_output2+0x192/0x580
[341332.420249]  __ip_finish_output+0xf3/0x270
[341332.420250]  ip_finish_output+0x2d/0xb0
[341332.420251]  ip_output+0x75/0xf0
[341332.420252]  ? __ip_make_skb+0x31e/0x430
[341332.420253]  ip_local_out+0x3d/0x50
[341332.420254]  ip_send_skb+0x19/0x40
[341332.420255]  udp_send_skb.isra.0+0x161/0x380
[341332.420256]  udp_sendmsg+0xb09/0xd50
[341332.420257]  ? ip_reply_glue_bits+0x50/0x50
[341332.420261]  ? x2apic_send_IPI+0x4d/0x60
[341332.420264]  ? native_smp_send_reschedule+0x2a/0x40
[341332.420266]  ? ttwu_do_wakeup+0x1e/0x150
[341332.420268]  ? _cond_resched+0x19/0x30
[341332.420271]  ? aa_sk_perm+0x43/0x1b0
[341332.420273]  inet_sendmsg+0x65/0x70
[341332.420275]  ? security_socket_sendmsg+0x35/0x50
[341332.420276]  ? inet_sendmsg+0x65/0x70
[341332.420279]  sock_sendmsg+0x5e/0x70
[341332.420280]  sock_write_iter+0x93/0xf0
[341332.420286]  new_sync_write+0x125/0x1c0
[341332.420288]  __vfs_write+0x29/0x40
[341332.420289]  vfs_write+0xb9/0x1a0
[341332.420290]  ksys_write+0x67/0xe0
[341332.420291]  __x64_sys_write+0x1a/0x20
[341332.420293]  do_syscall_64+0x57/0x190
[341332.420294]  entry_SYSCALL_64_after_hwframe+0x5c/0xc1
[341332.420295] RIP: 0033:0x40484e
[341332.420297] Code: 48 89 6c 24 38 48 8d 6c 24 38 e8 0d 00 00 00 48 8b 6c 24 38 48 83 c4 40 c3 cc cc cc 49 89 f2 48 89 fa 48 89 ce 48 89 df 0f 05 <48> 3d 01 f0 ff ff 76 15 48 f7 d8 48 89 c1 48 c7 c0 ff ff ff ff 48
[341332.420297] RSP: 002b:000000c000adf660 EFLAGS: 00000202 ORIG_RAX: 0000000000000001
[341332.420304] RAX: ffffffffffffffda RBX: 000000000000001f RCX: 000000000040484e
[341332.420304] RDX: 0000000000000059 RSI: 000000c0000ac800 RDI: 000000000000001f
[341332.420305] RBP: 000000c000adf6a0 R08: 0000000000000000 R09: 0000000000000000
[341332.420306] R10: 0000000000000000 R11: 0000000000000202 R12: 000000c000adf7e0
[341332.420306] R13: 0000000000000000 R14: 000000c0006036c0 R15: 000000c00005e800

[Bugs] RCU warnings with debug kernel

Describe the bug

We enable RCU and lock debugging options of the Linux kernel.
And run TestPaging with this debug kernel.
We see some RCU and lock warnings.

To Reproduce

  • Build and use debug kernel.
  • exec ./test.sh TestPaging

Environment (please complete the following information):

  • free5GC Version: commit id bef19d5b95756
  • gtp5g Version: commit id 1ecacd6
  • OS: Ubuntu 20.04.3 LTS
  • Kernel version: 5.4.157
  • go version: go version go1.14.4 linux/amd64
  • c compiler version (Option): 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)

Configuration File

config-5.4.157.gz

Log File

[  275.088296] [gtp5g] gtp5g_encap_enable_socket: enable gtp5g for the fd(11) type(5)
[  275.095202] upfgtp:[gtp5g] gtp5g_newlink: Registered a new 5G GTP interface

[  320.641030] =============================
[  320.641032] WARNING: suspicious RCU usage
[  320.641037] 5.4.157 #1 Tainted: G           OE
[  320.641040] -----------------------------
[  320.641043] include/linux/rcupdate.h:274 Illegal context switch in RCU read-side critical section!
[  320.641046]
               other info that might help us debug this:

[  320.641049]
               rcu_scheduler_active = 2, debug_locks = 1
[  320.641053] 4 locks held by free5gc-upfd/7884:
[  320.641055]  #0: ffffffff9a6e8af8 (cb_lock){++++}, at: genl_rcv+0x1a/0x40
[  320.641070]  #1: ffffffff9a6e8bb0 (genl_mutex){+.+.}, at: genl_rcv_msg+0x6d/0xa0
[  320.641077]  #2: ffffffff9a6cca50 (rtnl_mutex){+.+.}, at: rtnl_lock+0x17/0x20
[  320.641087]  #3: ffffffff9a4a13a0 (rcu_read_lock){....}, at: gtp5g_genl_add_far+0x26/0x1b0 [gtp5g]
[  320.641102]
               stack backtrace:
[  320.641107] CPU: 0 PID: 7884 Comm: free5gc-upfd Kdump: loaded Tainted: G           OE     5.4.157 #1
[  320.641110] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 09/21/2015
[  320.641113] Call Trace:
[  320.641124]  dump_stack+0x98/0xd2
[  320.641133]  lockdep_rcu_suspicious+0xeb/0xf5
[  320.641143]  ___might_sleep+0x113/0x1a0
[  320.641148]  __might_sleep+0x4b/0x80
[  320.641158]  apparmor_socket_create+0x58/0x2d0
[  320.641167]  security_socket_create+0x3d/0x60
[  320.641175]  __sock_create+0x69/0x350
[  320.641184]  sock_create+0x34/0x40
[  320.641190]  unix_sock_client_update+0x74/0x170 [gtp5g]
[  320.641199]  far_fill.isra.0+0x39f/0x700 [gtp5g]
[  320.641205]  ? seid_and_u32id_to_hex_str+0xc1/0x170 [gtp5g]
[  320.641220]  gtp5g_gnl_add_far+0xd5/0x770 [gtp5g]
[  320.641233]  ? gtp5g_genl_add_far+0x26/0x1b0 [gtp5g]
[  320.641246]  gtp5g_genl_add_far+0x8c/0x1b0 [gtp5g]
[  320.641252]  genl_family_rcv_msg+0x1b9/0x480
[  320.641257]  ? genl_rcv_msg+0x6d/0xa0
[  320.641273]  genl_rcv_msg+0x4c/0xa0
[  320.641277]  ? genl_family_rcv_msg+0x480/0x480
[  320.641282]  netlink_rcv_skb+0x50/0x120
[  320.641291]  genl_rcv+0x29/0x40
[  320.641296]  netlink_unicast+0x187/0x220
[  320.641304]  netlink_sendmsg+0x238/0x3f0
[  320.641315]  sock_sendmsg+0x65/0x70
[  320.641320]  __sys_sendto+0x116/0x1a0
[  320.641336]  ? _raw_spin_unlock_irq+0x2d/0x40
[  320.641344]  ? lockdep_hardirqs_on+0xfb/0x190
[  320.641353]  ? trace_hardirqs_off_caller+0x17/0xe0
[  320.641357]  ? lockdep_hardirqs_on+0xfb/0x190
[  320.641365]  __x64_sys_sendto+0x29/0x30
[  320.641373]  do_syscall_64+0x5f/0x230
[  320.641378]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
[  320.641382] RIP: 0033:0x7f36c84c2844
[  320.641386] Code: c2 f7 ff ff 44 8b 4c 24 2c 4c 8b 44 24 20 89 c5 44 8b 54 24 28 48 8b 54 24 18 b8 2c 00 00 00 48 8b 74 24 10 8b 7c 24 08 0f 05 <48> 3d 00 f0 ff ff 77 30 89 ef 48 89 44 24 08 e8 e8 f7 ff ff 48 8b
[  320.641389] RSP: 002b:00007ffd61f4acc0 EFLAGS: 00000293 ORIG_RAX: 000000000000002c
[  320.641392] RAX: ffffffffffffffda RBX: 0000000000001000 RCX: 00007f36c84c2844
[  320.641395] RDX: 0000000000000054 RSI: 00007ffd61f4bd90 RDI: 000000000000000e
[  320.641397] RBP: 0000000000000000 R08: 00007f36c82ab9e0 R09: 000000000000000c
[  320.641399] R10: 0000000000000000 R11: 0000000000000293 R12: 00007ffd61f4bd00
[  320.641401] R13: 0000000000000000 R14: 0000000000001000 R15: 0000000000000000
[  320.641418] BUG: sleeping function called from invalid context at security/apparmor/include/cred.h:164
[  320.641562] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 7884, name: free5gc-upfd
[  320.641626] 4 locks held by free5gc-upfd/7884:
[  320.641629]  #0: ffffffff9a6e8af8 (cb_lock){++++}, at: genl_rcv+0x1a/0x40
[  320.641636]  #1: ffffffff9a6e8bb0 (genl_mutex){+.+.}, at: genl_rcv_msg+0x6d/0xa0
[  320.641643]  #2: ffffffff9a6cca50 (rtnl_mutex){+.+.}, at: rtnl_lock+0x17/0x20
[  320.641650]  #3: ffffffff9a4a13a0 (rcu_read_lock){....}, at: gtp5g_genl_add_far+0x26/0x1b0 [gtp5g]
[  320.641660] CPU: 0 PID: 7884 Comm: free5gc-upfd Kdump: loaded Tainted: G           OE     5.4.157 #1
[  320.641663] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 09/21/2015
[  320.641665] Call Trace:
[  320.641670]  dump_stack+0x98/0xd2
[  320.641675]  ___might_sleep.cold+0xb3/0xc4
[  320.641681]  __might_sleep+0x4b/0x80
[  320.641687]  apparmor_socket_create+0x58/0x2d0
[  320.641695]  security_socket_create+0x3d/0x60
[  320.641702]  __sock_create+0x69/0x350
[  320.641710]  sock_create+0x34/0x40
[  320.641717]  unix_sock_client_update+0x74/0x170 [gtp5g]
[  320.641725]  far_fill.isra.0+0x39f/0x700 [gtp5g]
[  320.641732]  ? seid_and_u32id_to_hex_str+0xc1/0x170 [gtp5g]
[  320.641746]  gtp5g_gnl_add_far+0xd5/0x770 [gtp5g]
[  320.641759]  ? gtp5g_genl_add_far+0x26/0x1b0 [gtp5g]
[  320.641772]  gtp5g_genl_add_far+0x8c/0x1b0 [gtp5g]
[  320.641778]  genl_family_rcv_msg+0x1b9/0x480
[  320.641784]  ? genl_rcv_msg+0x6d/0xa0
[  320.641799]  genl_rcv_msg+0x4c/0xa0
[  320.641803]  ? genl_family_rcv_msg+0x480/0x480
[  320.641808]  netlink_rcv_skb+0x50/0x120
[  320.641818]  genl_rcv+0x29/0x40
[  320.641822]  netlink_unicast+0x187/0x220
[  320.641830]  netlink_sendmsg+0x238/0x3f0
[  320.641841]  sock_sendmsg+0x65/0x70
[  320.641846]  __sys_sendto+0x116/0x1a0
[  320.641862]  ? _raw_spin_unlock_irq+0x2d/0x40
[  320.641866]  ? lockdep_hardirqs_on+0xfb/0x190
[  320.641871]  ? trace_hardirqs_off_caller+0x17/0xe0
[  320.641876]  ? lockdep_hardirqs_on+0xfb/0x190
[  320.641883]  __x64_sys_sendto+0x29/0x30
[  320.641887]  do_syscall_64+0x5f/0x230
[  320.641892]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
[  320.641895] RIP: 0033:0x7f36c84c2844
[  320.641898] Code: c2 f7 ff ff 44 8b 4c 24 2c 4c 8b 44 24 20 89 c5 44 8b 54 24 28 48 8b 54 24 18 b8 2c 00 00 00 48 8b 74 24 10 8b 7c 24 08 0f 05 <48> 3d 00 f0 ff ff 77 30 89 ef 48 89 44 24 08 e8 e8 f7 ff ff 48 8b
[  320.641900] RSP: 002b:00007ffd61f4acc0 EFLAGS: 00000293 ORIG_RAX: 000000000000002c
[  320.641903] RAX: ffffffffffffffda RBX: 0000000000001000 RCX: 00007f36c84c2844
[  320.641906] RDX: 0000000000000054 RSI: 00007ffd61f4bd90 RDI: 000000000000000e
[  320.641908] RBP: 0000000000000000 R08: 00007f36c82ab9e0 R09: 000000000000000c
[  320.641910] R10: 0000000000000000 R11: 0000000000000293 R12: 00007ffd61f4bd00
[  320.641912] R13: 0000000000000000 R14: 0000000000001000 R15: 0000000000000000

[  321.739723] =============================
[  321.739725] WARNING: suspicious RCU usage
[  321.739730] 5.4.157 #1 Tainted: G        W  OE
[  321.739732] -----------------------------
[  321.739736] kernel/sched/core.c:6854 Illegal context switch in RCU-bh read-side critical section!
[  321.739738]
               other info that might help us debug this:

[  321.739740]
               rcu_scheduler_active = 2, debug_locks = 1
[  321.739744] 3 locks held by nc/7977:
[  321.739746]  #0: ffffffff9a4a1360 (rcu_read_lock_bh){....}, at: ip_finish_output2+0xa5/0xa20
[  321.739761]  #1: ffffffff9a4a1360 (rcu_read_lock_bh){....}, at: __dev_queue_xmit+0x72/0xde0
[  321.739771]  #2: ffffffff9a4a13a0 (rcu_read_lock){....}, at: gtp5g_dev_xmit+0x8a/0x4b0 [gtp5g]
[  321.739786]
               stack backtrace:
[  321.739790] CPU: 3 PID: 7977 Comm: nc Kdump: loaded Tainted: G        W  OE     5.4.157 #1
[  321.739793] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 09/21/2015
[  321.739796] Call Trace:
[  321.739808]  dump_stack+0x98/0xd2
[  321.739816]  lockdep_rcu_suspicious+0xeb/0xf5
[  321.739826]  ___might_sleep+0x150/0x1a0
[  321.739831]  __might_sleep+0x4b/0x80
[  321.739841]  kmem_cache_alloc_trace+0x292/0x360
[  321.739847]  ? unix_sock_send+0x92/0x1e0 [gtp5g]
[  321.739858]  unix_sock_send+0x92/0x1e0 [gtp5g]
[  321.739875]  gtp5g_dev_xmit+0x38f/0x4b0 [gtp5g]
[  321.739882]  ? __lock_acquire+0x258/0x1990
[  321.739898]  dev_hard_start_xmit+0xa8/0x2e0
[  321.739908]  __dev_queue_xmit+0xac3/0xde0
[  321.739914]  ? ___neigh_create+0x76d/0xb50
[  321.739925]  dev_queue_xmit+0x10/0x20
[  321.739929]  ? dev_queue_xmit+0x10/0x20
[  321.739933]  neigh_direct_output+0x11/0x20
[  321.739937]  ip_finish_output2+0x21e/0xa20
[  321.739943]  ? __cgroup_bpf_run_filter_skb+0x489/0x640
[  321.739952]  __ip_finish_output+0x136/0x3e0
[  321.739955]  ? __ip_finish_output+0x136/0x3e0
[  321.739962]  ip_finish_output+0x2d/0xb0
[  321.739968]  ip_output+0x7c/0x250
[  321.739975]  ? __ip_finish_output+0x3e0/0x3e0
[  321.739982]  ip_local_out+0x41/0x70
[  321.739988]  ip_send_skb+0x19/0x40
[  321.739994]  udp_send_skb.isra.0+0x258/0x3c0
[  321.740003]  udp_sendmsg+0xbd4/0x1040
[  321.740009]  ? ip_reply_glue_bits+0x50/0x50
[  321.740020]  ? __lock_acquire+0x258/0x1990
[  321.740031]  ? __might_sleep+0x4b/0x80
[  321.740039]  ? debug_lockdep_rcu_enabled+0x1d/0x20
[  321.740048]  ? aa_sk_perm+0x7b/0x2b0
[  321.740056]  inet_sendmsg+0x65/0x70
[  321.740060]  ? inet_sendmsg+0x65/0x70
[  321.740067]  sock_sendmsg+0x5e/0x70
[  321.740072]  sock_write_iter+0x96/0xf0
[  321.740085]  new_sync_write+0x128/0x1c0
[  321.740099]  __vfs_write+0x29/0x40
[  321.740103]  vfs_write+0xe1/0x1d0
[  321.740110]  ksys_write+0x70/0xf0
[  321.740117]  __x64_sys_write+0x1a/0x20
[  321.740126]  do_syscall_64+0x5f/0x230
[  321.740132]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
[  321.740137] RIP: 0033:0x7f5afeea61e7
[  321.740140] Code: 64 89 02 48 c7 c0 ff ff ff ff eb bb 0f 1f 80 00 00 00 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24
[  321.740143] RSP: 002b:00007ffd3025ded8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[  321.740147] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f5afeea61e7
[  321.740149] RDX: 0000000000000005 RSI: 00007ffd30261f40 RDI: 0000000000000003
[  321.740151] RBP: 00007ffd3025df18 R08: 0000000000000000 R09: 0000000000000000
[  321.740153] R10: 0000000000000001 R11: 0000000000000246 R12: 0000000000000005
[  321.740156] R13: 00007ffd30261f40 R14: 0000000000000003 R15: 0000000000000005
[  321.740172] BUG: sleeping function called from invalid context at mm/slab.h:565
[  321.740273] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 7977, name: nc
[  321.740331] 3 locks held by nc/7977:
[  321.740333]  #0: ffffffff9a4a1360 (rcu_read_lock_bh){....}, at: ip_finish_output2+0xa5/0xa20
[  321.740340]  #1: ffffffff9a4a1360 (rcu_read_lock_bh){....}, at: __dev_queue_xmit+0x72/0xde0
[  321.740346]  #2: ffffffff9a4a13a0 (rcu_read_lock){....}, at: gtp5g_dev_xmit+0x8a/0x4b0 [gtp5g]
[  321.740356] CPU: 3 PID: 7977 Comm: nc Kdump: loaded Tainted: G        W  OE     5.4.157 #1
[  321.740358] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 09/21/2015
[  321.740360] Call Trace:
[  321.740365]  dump_stack+0x98/0xd2
[  321.740371]  ___might_sleep.cold+0xb3/0xc4
[  321.740377]  __might_sleep+0x4b/0x80
[  321.740383]  kmem_cache_alloc_trace+0x292/0x360
[  321.740389]  ? unix_sock_send+0x92/0x1e0 [gtp5g]
[  321.740400]  unix_sock_send+0x92/0x1e0 [gtp5g]
[  321.740417]  gtp5g_dev_xmit+0x38f/0x4b0 [gtp5g]
[  321.740421]  ? __lock_acquire+0x258/0x1990
[  321.740437]  dev_hard_start_xmit+0xa8/0x2e0
[  321.740447]  __dev_queue_xmit+0xac3/0xde0
[  321.740451]  ? ___neigh_create+0x76d/0xb50
[  321.740462]  dev_queue_xmit+0x10/0x20
[  321.740466]  ? dev_queue_xmit+0x10/0x20
[  321.740470]  neigh_direct_output+0x11/0x20
[  321.740474]  ip_finish_output2+0x21e/0xa20
[  321.740477]  ? __cgroup_bpf_run_filter_skb+0x489/0x640
[  321.740486]  __ip_finish_output+0x136/0x3e0
[  321.740490]  ? __ip_finish_output+0x136/0x3e0
[  321.740497]  ip_finish_output+0x2d/0xb0
[  321.740503]  ip_output+0x7c/0x250
[  321.740510]  ? __ip_finish_output+0x3e0/0x3e0
[  321.740517]  ip_local_out+0x41/0x70
[  321.740523]  ip_send_skb+0x19/0x40
[  321.740528]  udp_send_skb.isra.0+0x258/0x3c0
[  321.740536]  udp_sendmsg+0xbd4/0x1040
[  321.740542]  ? ip_reply_glue_bits+0x50/0x50
[  321.740553]  ? __lock_acquire+0x258/0x1990
[  321.740564]  ? __might_sleep+0x4b/0x80
[  321.740569]  ? debug_lockdep_rcu_enabled+0x1d/0x20
[  321.740573]  ? aa_sk_perm+0x7b/0x2b0
[  321.740581]  inet_sendmsg+0x65/0x70
[  321.740585]  ? inet_sendmsg+0x65/0x70
[  321.740590]  sock_sendmsg+0x5e/0x70
[  321.740595]  sock_write_iter+0x96/0xf0
[  321.740607]  new_sync_write+0x128/0x1c0
[  321.740620]  __vfs_write+0x29/0x40
[  321.740624]  vfs_write+0xe1/0x1d0
[  321.740631]  ksys_write+0x70/0xf0
[  321.740638]  __x64_sys_write+0x1a/0x20
[  321.740643]  do_syscall_64+0x5f/0x230
[  321.740648]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
[  321.740651] RIP: 0033:0x7f5afeea61e7
[  321.740654] Code: 64 89 02 48 c7 c0 ff ff ff ff eb bb 0f 1f 80 00 00 00 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24
[  321.740656] RSP: 002b:00007ffd3025ded8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[  321.740660] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f5afeea61e7
[  321.740662] RDX: 0000000000000005 RSI: 00007ffd30261f40 RDI: 0000000000000003
[  321.740664] RBP: 00007ffd3025df18 R08: 0000000000000000 R09: 0000000000000000
[  321.740666] R10: 0000000000000001 R11: 0000000000000246 R12: 0000000000000005
[  321.740668] R13: 00007ffd30261f40 R14: 0000000000000003 R15: 0000000000000005
[  334.951468] upfgtp:[gtp5g] gtp5g_dellink: De-registered 5G GTP interface

Failed at make install due to udp_tunnel - Bringing from the old repo

Currently, I'm try to install modules after already building. When running make install as root (inside a docker - building image process ), I get the following error:

modprobe udp_tunnel
modprobe: FATAL: Module udp_tunnel not found in directory 
/lib/modules/5.4.0-77-generic
make: *** [Makefile:20: install] Error 1

Could you share with me how to fix this error? (install udp_tunnel module)

/lib/modules/5.15.0/build: No such file or directory. Stop.

when I make gtp5g, I meet problems as follow

make -C /lib/modules/5.15.0/build M=/root/gtp5g modules
make[1]: *** /lib/modules/5.15.0/build: No such file or directory.  Stop.
make: *** [Makefile:83: module] Error 2

my system is ubuntu 20.04, the CPU in my pc is phytium D2000. the kernel is 5.10.0 on arm, which is custom made。

Build failure with kernel 5.17 due to mm_segment_t

I'm using kernel 5.17.12 and the build fails.

./gtp5g.c: In Funktion »unix_sock_send«:
./gtp5g.c:362:5: Fehler: unbekannter Typname: »mm_segment_t«
  362 |     mm_segment_t oldfs;
      |     ^~~~~~~~~~~~
./gtp5g.c:436:13: Error [-Werror=implicit-function-declaration]
  436 |     oldfs = force_uaccess_begin();
      |             ^~~~~~~~~~~~~~~~~~~
      |             user_access_begin
./gtp5g.c:446:5: Error [-Werror=implicit-function-declaration]
  446 |     force_uaccess_end(oldfs);
      |     ^~~~~~~~~~~~~~~~~
      |     file_accessed

The implicit-function-declaration bugs are just follow-ups on the first one.

I've found https://lore.kernel.org/lkml/CAMuHMdUCmEeU0G9wkUxZKm5tC9YoB-KXSSCLKwpSia746Myebw@mail.gmail.com/ but am not wise enough to fix this. Do you have a solution?

complier differnt

warning: the compiler differs from the one used to build the kernel
  The kernel was built by: aarch64-linux-gnu-gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
  You are using:           gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
  CC [M]  /root/gtp5g/src/gtp5g.o
/bin/sh: 1: scripts/basic/fixdep: Exec format error

I have this problem. I use Pythiton D2000 as cpu.

Makefile error

Thanks for your help. I find a issue when i execute "make clean && make",the result is following:
:~/gtp5g$ make clean && make
make -C /usr/src/linux-headers-5.11.0-31-generic/ M=/home/gzzx/gtp5g clean
make[1]: access folder “/usr/src/linux-headers-5.11.0-31-generic”
make[1]: exit folder“/usr/src/linux-headers-5.11.0-31-generic”
make -C /usr/src/linux-headers-5.11.0-31-generic/ M=/home/gzzx/gtp5g modules
make[1]: access folder“/usr/src/linux-headers-5.11.0-31-generic”
CC [M] /home/gzzx/gtp5g/gtp5g.o
/home/gzzx/gtp5g/gtp5g.c:1499:27: error: ‘ip_tunnel_get_stats64’ undeclared here (not in a function); did you mean ‘ip_tunnel_get_ttl’?
1499 | .ndo_get_stats64 = ip_tunnel_get_stats64,
| ^~~~~~~~~~~~~~~~~~~~~
| ip_tunnel_get_ttl
make[2]: *** [scripts/Makefile.build:287:/home/gzzx/gtp5g/gtp5g.o] error 1
make[1]: *** [Makefile:1848:/home/gzzx/gtp5g] error 2
make[1]: exit folder“/usr/src/linux-headers-5.11.0-31-generic”
make: *** [Makefile:15:all] error 2

linux version: cat /proc/version
Linux version 5.11.0-31-generic (buildd@lcy01-amd64-009) (gcc (Ubuntu 10.3.0-1ubuntu1) 10.3.0, GNU ld (GNU Binutils for Ubuntu) 2.36.1) #33-Ubuntu SMP Wed Aug 11 13:19:04 UTC 2021

encap.c error

This happens when I try to compile 0.6.6 with gcc 12.2. Sorry, but LC_ALL=C got ignored:

./gtp5g/encap.c: In Funktion »gtp5g_fwd_skb_encap«:
./gtp5g/encap.c:512:22: Fehler: Argument falschen Typs für Inkrementierung
  512 |     stats->rx_packets++;
      |                      ^~
./gtp5g/encap.c:513:21: Fehler: Ungültige Operanden für binäres + (haben »u64_stats_t« und »unsigned int«)
  513 |     stats->rx_bytes += skb->len;
      |     ~~~~~~~~~~~~~~~ ^~ ~~~~~~~~
      |          |                |
      |          u64_stats_t      unsigned int
make[2]: *** [scripts/Makefile.build:249: ./gtp5g/encap.o] Fehler 1

Kernel panic when running 10x ran.sh in parallel

Hi all,

I'm having a kernel panic when running 10x this script in parallel (with 10 UEs, 10 different gNB IPs, 10 differents GTP-U interfaces): https://github.com/free5gc/libgtp5gnl/blob/master/script/ran.sh but using the go binaries from https://github.com/free5gc/go-gtp5gnl (with a tweak here: https://github.com/free5gc/go-gtp5gnl/blob/4f36b49ab7f7f90632b0981aa832121438e5a243/cmd/gogtp5g-link/main.go#L72 so an interface bind only to a single specified IP address instead of binding to all IP addresses).

Adding a small sleep of 20 ms before launching the 2nd, 3rd.. scripts workaround the issue.

According to the kernel panic, issue seems to lie inside gtp5g_genl_add_pdr, you'll find the Kernel panic logs at the end of this post.
If I can be of any help, don't hesitate, thank you!!
Also quick question, is it possible to have multiple gtp5g interface on the same IP address/port? Thanks!

[   57.441597] BUG: kernel NULL pointer dereference, address: 0000000000000080
[   57.442989] #PF: supervisor write access in kernel mode
[   57.443983] #PF: error_code(0x0002) - not-present page
[   57.444965] PGD 802150067 P4D 802150067 PUD 819cfd067 PMD 0
[   57.446041] Oops: 0002 [#1] SMP NOPTI
[   57.446749] CPU: 20 PID: 2009 Comm: app Tainted: G           OE     5.4.0-152-generic #169-Ubuntu
[   57.448424] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020
[   57.450438] RIP: 0010:gtp5g_genl_add_pdr+0x185/0x270 [gtp5g]
[   57.451513] Code: 01 00 00 be 20 0b 00 00 e8 88 0b f9 e3 49 89 c5 48 85 c0 0f 84 e2 00 00 00 49 8b 54 24 10 b8 01 00 00 00 48 8d ba 80 00 00 00 <f0> 0f c1 82 80 00 00 00 85 c0 74 69 78 5b 83 c0 01 78 56 49 8b 44
[   57.455015] RSP: 0018:ffffae83c797ba10 EFLAGS: 00010286
[   57.456013] RAX: 0000000000000001 RBX: ffffae83c797baa8 RCX: 0000000000000000
[   57.457366] RDX: 0000000000000000 RSI: ffffffffc090cc58 RDI: 0000000000000080
[   57.458716] RBP: ffffae83c797ba50 R08: ffff9d421fa35140 R09: ffff9d3a1f406d80
[   57.460064] R10: ffff9d421ab92e00 R11: 0000000000000011 R12: ffff9d3a0360d8c0
[   57.461414] R13: ffff9d421ab92e00 R14: 0000000000000000 R15: ffff9d421ab90c00
[   57.462763] FS:  00007f9d5cff9700(0000) GS:ffff9d421fa00000(0000) knlGS:0000000000000000
[   57.464290] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   57.465381] CR2: 0000000000000080 CR3: 0000000802254005 CR4: 00000000007606e0
[   57.466760] PKRU: 55555554
[   57.467292] Call Trace:
[   57.467779]  genl_family_rcv_msg+0x1b9/0x470
[   57.468601]  genl_rcv_msg+0x4c/0xa0
[   57.469278]  ? _cond_resched+0x19/0x30
[   57.470002]  ? genl_family_rcv_msg+0x470/0x470
[   57.470853]  netlink_rcv_skb+0x50/0x120
[   57.471588]  genl_rcv+0x29/0x40
[   57.472196]  netlink_unicast+0x1a8/0x250
[   57.472949]  netlink_sendmsg+0x240/0x480
[   57.473706]  ? __check_object_size+0x4d/0x150
[   57.474541]  sock_sendmsg+0x65/0x70
[   57.475215]  ____sys_sendmsg+0x212/0x280
[   57.476660]  ___sys_sendmsg+0x88/0xd0
[   57.478060]  ? iput+0x148/0x210
[   57.479356]  ? _cond_resched+0x19/0x30
[   57.480738]  ? get_max_files+0x20/0x20
[   57.482095]  __sys_sendmsg+0x5c/0xa0
[   57.483413]  __x64_sys_sendmsg+0x1f/0x30
[   57.484786]  do_syscall_64+0x57/0x190
[   57.486107]  entry_SYSCALL_64_after_hwframe+0x5c/0xc1
[   57.487677] RIP: 0033:0x40436e
[   57.488858] Code: 48 89 6c 24 38 48 8d 6c 24 38 e8 0d 00 00 00 48 8b 6c 24 38 48 83 c4 40 c3 cc cc cc 49 89 f2 48 89 fa 48 89 ce 48 89 df 0f 05 <48> 3d 01 f0 ff ff 76 15 48 f7 d8 48 89 c1 48 c7 c0 ff ff ff ff 48
[   57.494126] RSP: 002b:000000c000199740 EFLAGS: 00000206 ORIG_RAX: 000000000000002e
[   57.496163] RAX: ffffffffffffffda RBX: 0000000000000078 RCX: 000000000040436e
[   57.498091] RDX: 0000000000000000 RSI: 000000c000199870 RDI: 0000000000000078
[   57.500011] RBP: 000000c000199780 R08: 0000000000000000 R09: 0000000000000000
[   57.501921] R10: 0000000000000000 R11: 0000000000000206 R12: 000000c000199938
[   57.503831] R13: 0000000000000000 R14: 000000c0005816c0 R15: 000000c000067800
[   57.505731] Modules linked in: vrf sctp 8021q garp mrp stp llc vmw_vsock_vmci_transport vsock dm_multipath scsi_dh_rdac scsi_dh_emc scsi_dh_alua binfmt_misc intel_rapl_msr vmw_balloon intel_rapl_common isst_if_mbox_msr isst_if_common joydev input_leds nfit rapl serio_raw vmw_vmci mac_hid sch_fq_codel gtp5g(OE) udp_tunnel msr ramoops reed_solomon efi_pstore ip_tables x_tables autofs4 btrfs zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 multipath linear hid_generic usbhid hid vmwgfx ttm crct10dif_pclmul drm_kms_helper crc32_pclmul ghash_clmulni_intel syscopyarea aesni_intel sysfillrect sysimgblt fb_sys_fops crypto_simd mptspi cryptd mptscsih glue_helper bnxt_en psmouse drm ahci mptbase vmxnet3 i2c_piix4 libahci scsi_transport_spi pata_acpi
[   57.524746] CR2: 0000000000000080
[   57.526104] ---[ end trace d4fa568a26f72f9a ]---
[   57.527702] RIP: 0010:gtp5g_genl_add_pdr+0x185/0x270 [gtp5g]
[   57.529497] Code: 01 00 00 be 20 0b 00 00 e8 88 0b f9 e3 49 89 c5 48 85 c0 0f 84 e2 00 00 00 49 8b 54 24 10 b8 01 00 00 00 48 8d ba 80 00 00 00 <f0> 0f c1 82 80 00 00 00 85 c0 74 69 78 5b 83 c0 01 78 56 49 8b 44
[   57.535267] RSP: 0018:ffffae83c797ba10 EFLAGS: 00010286
[   57.537051] RAX: 0000000000000001 RBX: ffffae83c797baa8 RCX: 0000000000000000
[   57.539202] RDX: 0000000000000000 RSI: ffffffffc090cc58 RDI: 0000000000000080
[   57.541344] RBP: ffffae83c797ba50 R08: ffff9d421fa35140 R09: ffff9d3a1f406d80
[   57.543531] R10: ffff9d421ab92e00 R11: 0000000000000011 R12: ffff9d3a0360d8c0
[   57.545695] R13: ffff9d421ab92e00 R14: 0000000000000000 R15: ffff9d421ab90c00
[   57.547854] FS:  00007f9d5cff9700(0000) GS:ffff9d421fa00000(0000) knlGS:0000000000000000
[   57.550205] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   57.552138] CR2: 0000000000000080 CR3: 0000000802254005 CR4: 00000000007606e0
[   57.554361] PKRU: 55555554

Implicit declaration of »eth_type_trans«

  CC [M]  ./src/gtp5g/genl_far.o
./src/gtp5g/genl_far.c: In Funktion »gtp5g_genl_add_far«:
./src/gtp5g/genl_far.c:105:29: Fehler: Implizite Deklaration der Funktion »eth_type_trans« [-Werror=implicit-function-declaration]
  105 |             skb->protocol = eth_type_trans(skb, gtp->dev);
      |                             ^~~~~~~~~~~~~~
cc1: Einige Warnungen werden als Fehler behandelt

Is your project using custom CFLAGS? Adding "-Wno-implicit-function-declaration" to ArchLinux's makepkg.conf has no effect.

Support for QER QoS

Hi,

I have opened an issue related to "Invalid extension header length" when passing qer definition earlier this year (PrinzOwO/gtp5g#27).

Re-testing with the latest version of gtp5g and libgtp5gnl in free5gc, I do not get this error anymore and ping succeeds for me.

However, I was told that QoS is not supported yet at that time (PrinzOwO/gtp5g#27 (comment)).

I would like to ask whether such a support had been added and if not, when is it planned to be?

I am asking this because we have set up a local free5gc with UERANSIM deployment and would like to create pdu sessions from slices with different QoS.

Thanks.

kernel crash when I generated a lot of traffic

Hello.

I am using gtp5g v0.4.0 with free5gc-compose.

On the performance measurement test, when I generated a lot of traffic, the kernel crash was happened and the host OS was often goes down.

As you can see in the kernel log I attached below, there are some errors related to gtp5g kernel module.
log.txt

I think this could be a gtp5g issue. I suspect the cause is probably in kfree_skb.
Do you have any information about this issue?

The environment which I'm using is below.

  • I'm using the kernel version of 5.0.0-23-generic.
  • I'm using UERANSIM as gNB and UE. These are deployed on virtual machine of KVM on the same machine.

Incidentally, I tried to use gtp5g v0.4.1, but it couldn't work normally. So I use the version of 0.4.0.

Thank you for your help.

fatal error: stdbool.h: No such file or directory

make -C /lib/modules/5.18.13-200.fc36.x86_64/build M=/root/gtp5g modules
make[1]: Entering directory '/usr/src/kernels/5.18.13-200.fc36.x86_64'
CC [M] /root/gtp5g/main.o
CC [M] /root/gtp5g/api_version.o
/root/gtp5g/api_version.c:1:10: fatal error: stdbool.h: No such file or directory
1 | #include <stdbool.h>
| ^~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:289: /root/gtp5g/api_version.o] Error 1
make[1]: *** [Makefile:1842: /root/gtp5g] Error 2
make[1]: Leaving directory '/usr/src/kernels/5.18.13-200.fc36.x86_64'
make: *** [Makefile:50: module] Error 2

gtp5g wont build on ubuntu 20.04.5 kernel 5.4.0-050400-generic with 'pktinfo.c:84:8: error: too many arguments to function ‘rt->dst.ops->update_pmtu’'

Hello:

I'm trying to build and install gtp5g on my 20.04.5 Ubuntu VM with kernel 5.4.0-050400-generic but am hitting the following error. Please help me understand if this is known and if there are any workarounds or fixes.

root@rigel:~# hostnamectl
   Static hostname: rigel
         Icon name: computer-vm
           Chassis: vm
        Machine ID: a8ad6bb1840c4ced8a58115da013d9de
           Boot ID: bf5d204c7f244510ba845dd97f9108f9
    Virtualization: kvm
  Operating System: Ubuntu 20.04.5 LTS
            Kernel: Linux 5.4.0-050400-generic
      Architecture: x86-64
root@rigel:~# cd gtp5g/
root@rigel:~/gtp5g# make clean && make
make -C /lib/modules/5.4.0-050400-generic/build M=/root/gtp5g clean
make[1]: Entering directory '/usr/src/linux-headers-5.4.0-050400-generic'
  CLEAN   /root/gtp5g/Module.symvers
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-050400-generic'
make -C /lib/modules/5.4.0-050400-generic/build M=/root/gtp5g modules
make[1]: Entering directory '/usr/src/linux-headers-5.4.0-050400-generic'
  CC [M]  /root/gtp5g/src/gtp5g.o
  CC [M]  /root/gtp5g/src/log.o
  CC [M]  /root/gtp5g/src/util.o
  CC [M]  /root/gtp5g/src/gtpu/dev.o
  CC [M]  /root/gtp5g/src/gtpu/encap.o
  CC [M]  /root/gtp5g/src/gtpu/hash.o
  CC [M]  /root/gtp5g/src/gtpu/link.o
  CC [M]  /root/gtp5g/src/gtpu/net.o
  CC [M]  /root/gtp5g/src/gtpu/pktinfo.o
/root/gtp5g/src/gtpu/pktinfo.c: In function ‘ip4_find_route’:
/root/gtp5g/src/gtpu/pktinfo.c:84:8: error: too many arguments to function ‘rt->dst.ops->update_pmtu’
   84 |        rt->dst.ops->update_pmtu(&rt->dst, NULL, skb, mtu, false);
      |        ^~
make[2]: *** [scripts/Makefile.build:266: /root/gtp5g/src/gtpu/pktinfo.o] Error 1
make[1]: *** [Makefile:1652: /root/gtp5g] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-050400-generic'
make: *** [Makefile:79: module] Error 2
root@rigel:~/gtp5g#

compilation error In function ‘gtp5g_encap_enable’

Hello, I am trying to compile on my system, but it throws an error.
I cloned the v0.6.2 of the repository:
git clone -b v0.6.2 https://github.com/free5gc/gtp5g.git

Characteristics of the system:
ubuntu@testfree5gcallinone:~/gtp5g$ uname -r
4.15.0-20-generic
ubuntu@testfree5gcallinone:~/gtp5g$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic
ubuntu@testfree5gcallinone:~/gtp5g$ gcc --version
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0

Screenshot 2022-08-03 090112

Thank you for your help

Linux 5.11 API Change

Hi all,

Build fails on Ubuntu 21.04:

make -C /lib/modules/5.11.0-41-generic/build M=/home/merlin/gtp5g  modules
make[1]: Entering directory '/usr/src/linux-headers-5.11.0-41-generic'
  CC [M]  /home/merlin/gtp5g/gtp5g.o
/home/merlin/gtp5g/gtp5g.c:1609:27: error: ‘ip_tunnel_get_stats64’ undeclared here (not in a function); did you mean ‘ip_tunnel_get_ttl’?
 1609 |     .ndo_get_stats64    = ip_tunnel_get_stats64,
      |                           ^~~~~~~~~~~~~~~~~~~~~
      |                           ip_tunnel_get_ttl

I think starting from Linux v5.11, the symbol ip_tunnel_get_stats64 was renamed to dev_get_tstats64. (Kernel patch series here. I don't really know how to find the exact version, so I had a look at the symbol usage statistics for ip_tunnel_get_stats64: still in use in v5.10 and gone in v5.11.)

PR: #20

Note this is UNTESTED so far, just want to document the build issue here.

gtp5g_handle_skb_ipv4 error

i'm getting this error from the kernel messages :
image

i'm installing gtp5g kernel module in order to test free5gc but when UPF pod is up and running i got errors in upfgtp interface and when UE's ping requests througth uesimtun0 interface, it reach the destination but responses cannot reach the UEs.
my host os: ubuntu 20.04
kernel version : 5.4.0-1101-gcp

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.