PCIE VNET driver kernel panic

[ 99.305563] BUG: unable to handle kernel paging request at ffffa0b602400007
[ 99.305564] PGD 2762bc067 P4D 2762bc067 PUD 0
[ 99.305569] Oops: 0002 [#1] PREEMPT SMP NOPTI
[ 99.305572] CPU: 3 PID: 583 Comm: NetworkManager Not tainted 4.19.72-rt25-hongjingdrive-adcu-B0 #6
[ 99.305579] RIP: 0010:tvnet_open+0x153/0x2e0
[ 99.305581] Code: ea 01 00 00 48 c7 c6 a0 ec ef b3 48 c7 c7 24 eb 1d b4 e8 13 bf 80 ff ba ec 01 00 00 48 c7 c6 a0 ec ef b3 48 c7 c7 24 eb 1d b4 <41> c7 47 08 00 00 00 00 e8 f3 be 80 ff ba ee 01 00 00 48 c7 c6 a0
[ 99.305582] RSP: 0018:ffffa0b500c0f3c0 EFLAGS: 00010282
[ 99.305584] RAX: 0000000000000021 RBX: ffff8b5cf3831000 RCX: 0000000000000000
[ 99.305586] RDX: 00000000000001ec RSI: ffffffffb3efeca0 RDI: ffffffffb41deb24
[ 99.305587] RBP: ffffa0b500c0f410 R08: 0000000000000001 R09: 0000000000000000
[ 99.305588] R10: ffffa0b500c0f3b8 R11: 0000000000000000 R12: ffff8b5cf3831bc0
[ 99.305589] R13: ffff8b5cf3831980 R14: ffffa0b6023fffff R15: ffffa0b6023fffff
[ 99.305591] FS: 00007f13f4229940(0000) GS:ffff8b5cf7ac0000(0000) knlGS:0000000000000000
[ 99.305592] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 99.305593] CR2: ffffa0b602400007 CR3: 000000027269c000 CR4: 00000000003406e0
[ 99.305594] Call Trace:
[ 99.305602] __dev_open+0xd7/0x160
[ 99.305606] __dev_change_flags+0x186/0x1d0
[ 99.305609] dev_change_flags+0x29/0x70
[ 99.305613] do_setlink+0x338/0xca0
[ 99.305617] ? tracing_record_taskinfo_skip+0x41/0x60
[ 99.305621] ? nla_parse+0xa7/0x120
[ 99.305625] ? inet6_validate_link_af+0x4f/0x70
[ 99.305628] ? nla_parse+0x36/0x120
[ 99.305630] rtnl_newlink+0x561/0x840
[ 99.305634] ? update_group_capacity+0x28/0x2a0
[ 99.305638] ? cpumask_next+0x1a/0x20
[ 99.305640] ? __snmp6_fill_stats64.isra.51+0xd4/0x100
[ 99.305645] ? debug_smp_processor_id+0x17/0x20
[ 99.305648] ? unpin_current_cpu+0x5e/0x90
[ 99.305651] ? migrate_enable+0x2e3/0x410
[ 99.305654] ? debug_smp_processor_id+0x17/0x20
[ 99.305656] ? unpin_current_cpu+0x5e/0x90
[ 99.305658] ? migrate_enable+0x2e3/0x410
[ 99.305661] ? _raw_spin_unlock_irqrestore+0x18/0x50
[ 99.305664] ? rt_spin_unlock+0x27/0x40
[ 99.305667] ? sock_def_readable+0x75/0x80
[ 99.305671] ? __netlink_sendskb+0x42/0x50
[ 99.305673] ? netlink_unicast+0x1f7/0x240
[ 99.305681] ? security_capset+0x20/0x80
[ 99.305684] ? ns_capable_common+0x68/0x80
[ 99.305686] ? ns_capable+0x13/0x20
[ 99.305689] rtnetlink_rcv_msg+0x12e/0x360
[ 99.305691] ? rt_spin_unlock+0x27/0x40
[ 99.305694] ? rtnl_calcit.isra.31+0x130/0x130
[ 99.305696] netlink_rcv_skb+0xd9/0x110
[ 99.305699] rtnetlink_rcv+0x15/0x20
[ 99.305701] netlink_unicast+0x192/0x240
[ 99.305704] netlink_sendmsg+0x2bd/0x3b0
[ 99.305707] ___sys_sendmsg+0x2fa/0x310
[ 99.305709] ? _raw_spin_unlock_irqrestore+0x18/0x50
[ 99.305712] ? unpin_current_cpu+0x5e/0x90
[ 99.305715] ? debug_smp_processor_id+0x17/0x20
[ 99.305718] ? __fget+0x7b/0xb0
[ 99.305721] __sys_sendmsg+0x66/0xa0
[ 99.305723] ? __sys_sendmsg+0x66/0xa0
[ 99.305726] __x64_sys_sendmsg+0x1f/0x30
[ 99.305729] do_syscall_64+0x4d/0x110
[ 99.305731] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 99.305734] RIP: 0033:0x7f13f2091a6d
[ 99.305735] Code: b9 20 00 00 75 10 b8 2e 00 00 00 0f 05 48 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 fe f6 ff ff 48 89 04 24 b8 2e 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 47 f7 ff ff 48 89 d0 48 83 c4 08 48 3d 01
[ 99.305736] RSP: 002b:00007ffdd59d4960 EFLAGS: 00000293 ORIG_RAX: 000000000000002e
[ 99.305739] RAX: ffffffffffffffda RBX: 0000000000cab490 RCX: 00007f13f2091a6d
[ 99.305740] RDX: 0000000000000000 RSI: 00007ffdd59d49f0 RDI: 000000000000000d
[ 99.305741] RBP: 0000000000cab580 R08: 0000000000000020 R09: 0000000000d65020
[ 99.305742] R10: 0000000000001000 R11: 0000000000000293 R12: 0000000000d5f6d0
[ 99.305743] R13: 00007ffdd59d49f0 R14: 00007ffdd59d4b64 R15: 0000000000d5f6d0
[ 99.305745] Modules linked in: intel_powerclamp coretemp intel_th_gth intel_th_pci intel_th i2c_ismt parport_pc lp parport
[ 99.305755] CR2: ffffa0b602400007
[ 99.591437] —[ end trace 0000000000000002 ]—
[ 99.591441] RIP: 0010:tvnet_open+0x153/0x2e0
[ 99.591442] Code: ea 01 00 00 48 c7 c6 a0 ec ef b3 48 c7 c7 24 eb 1d b4 e8 13 bf 80 ff ba ec 01 00 00 48 c7 c6 a0 ec ef b3 48 c7 c7 24 eb 1d b4 <41> c7 47 08 00 00 00 00 e8 f3 be 80 ff ba ee 01 00 00 48 c7 c6 a0
[ 99.591444] RSP: 0018:ffffa0b500c0f3c0 EFLAGS: 00010282
[ 99.591445] RAX: 0000000000000021 RBX: ffff8b5cf3831000 RCX: 0000000000000000
[ 99.591446] RDX: 00000000000001ec RSI: ffffffffb3efeca0 RDI: ffffffffb41deb24
[ 99.591447] RBP: ffffa0b500c0f410 R08: 0000000000000001 R09: 0000000000000000
[ 99.591449] R10: ffffa0b500c0f3b8 R11: 0000000000000000 R12: ffff8b5cf3831bc0
[ 99.591450] R13: ffff8b5cf3831980 R14: ffffa0b6023fffff R15: ffffa0b6023fffff
[ 99.591451] FS: 00007f13f4229940(0000) GS:ffff8b5cf7ac0000(0000) knlGS:0000000000000000
[ 99.591453] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 99.591454] CR2: ffffa0b602400007 CR3: 000000027269c000 CR4: 00000000003406e0

What is the host in this case? Is it another AGX or x86 or any other host?

x86.

I think you are using older Jetpack version. Please update to Latest Jetpack 4.3 release.
at x86 host side use attached driver. tvnet.zip (9.7 KB)

1.First,i pull down reset pin of pcie. then i pull up reset pin of pcie.
2.echo 1 >/sys/bus/pci/devices/0000:00:0e/rescan
3.Then i get the following:


I have replaced the tegra_vnet.c on x86. Errors still exist.

We have recently tested tegra vnet with x86 host. We are not getting any such crash.
as mentioned earlier, Please install Jetpack version 4.3

If you use rescan pcie , you will get the same mistake with me .I have show you my steps as before:
First,i enter x86 host filesystem,and pcie reset pin change from 0 to 1.
Now,xavier use dmesg,find log: EP init done.
Then, on x86 host, i rescan pci bus by execute sudo echo 1 >/sys/bus/pci/devices/0000:00:0e/rescan.
then,i get the kernel panic crash…

We have not explored rescan option.
currently in order to use tegra vnet do the following

  1. first boot Xavier AGX in EP mode
  2. start EP function
  3. Boot X86 host
  4. insmod tegra_vnet.ko