vpp will crash when add more then 256 ip to an interface, and then delete the 
interface ip.
Below is the crash stack. The reason is that the ip enabled counter 
*ip_enabled_by_sw_if_index* is type u8, and oly support less then 255 ips.
But in my vpn scenario, I simulate more then 256 vpn tunnel on one interface 
and each tunnel with one ip.
When user close one tunnel, vpp will crash.
I think it's necessory to change ip_enabled_by_sw_if_index type form u8 to u32. 
Here is my Patch: https://gerrit.fd.io/r/c/vpp/+/23805
> 
> 
> dpdk_ipsec_process:1014: not enough DPDK crypto resources, default to
> OpenSSL DBGvpp# /home/dev/net-base/build/vpp/src/vnet/ip/ip4_forward.c:653
> (ip4_sw_interface_enable_disable) assertion
> `im->ip_enabled_by_sw_if_index[sw_if_index] > 0' fails Program received
> signal SIGABRT, Aborted. 0x00007ffff4a93337 in __GI_raise (sig=sig@entry=6)
> at ../nptl/sysdeps/unix/sysv/linux/raise.c:55 55        return
> INLINE_SYSCALL (tgkill, 3, pid, selftid, sig); Missing separate debuginfos,
> use: debuginfo-install libgcc-4.8.5-39.el7.x86_64
> libuuid-2.23.2-61.el7.x86_64 mbedtls-2.7.12-1.el7.x86_64
> numactl-libs-2.0.12-3.el7.x86_64 (gdb) bt #0  0x00007ffff4a93337 in
> __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:55
> #1  0x00007ffff4a94a28 in __GI_abort () at abort.c:90 #2 
> 0x0000000000407458 in os_panic () at
> /home/dev/net-base/build/vpp/src/vpp/vnet/main.c:355 #3  0x00007ffff58dac5a
> in debugger () at /home/dev/net-base/build/vpp/src/vppinfra/error.c:84 #4 
> 0x00007ffff58db029 in _clib_error (how_to_die=2, function_name=0x0,
> line_number=0, fmt=0x7ffff76c08c0 "%s:%d (%s) assertion `%s' fails") at
> /home/dev/net-base/build/vpp/src/vppinfra/error.c:143 #5 
> 0x00007ffff6f2d639 in ip4_sw_interface_enable_disable (sw_if_index=1,
> is_enable=0) at /home/dev/net-base/build/vpp/src/vnet/ip/ip4_forward.c:653
> #6  0x00007ffff6f2e13e in ip4_add_del_interface_address_internal ( 
> vm=0x7ffff671f600
> <vlib_global_main>, sw_if_index=1, address=0x7fffb63747d0, address_length=24,
> is_del=1) at /home/dev/net-base/build/vpp/src/vnet/ip/ip4_forward.c:762 #7 
> 0x00007ffff6f2e402 in ip4_add_del_interface_address (vm=0x7ffff671f600
> <vlib_global_main>, sw_if_index=1, address=0x7fffb63747d0,
> address_length=24, is_del=1) at
> /home/dev/net-base/build/vpp/src/vnet/ip/ip4_forward.c:798 #8 
> 0x00007ffff6f16dad in add_del_ip_address (vm=0x7ffff671f600
> <vlib_global_main>, input=0x7fffb6374f00, cmd=0x7fffb5fd40f8) at
> /home/dev/net-base/build/vpp/src/vnet/ip/ip46_cli.c:171 #9 
> 0x00007ffff643cac3 in vlib_cli_dispatch_sub_commands (vm=0x7ffff671f600
> <vlib_global_main>, cm=0x7ffff671f830 <vlib_global_main+560>,
> input=0x7fffb6374f00, parent_command_index=299) at
> /home/dev/net-base/build/vpp/src/vlib/cli.c:649 #10 0x00007ffff643c948 in
> vlib_cli_dispatch_sub_commands (vm=0x7ffff671f600 <vlib_global_main>, 
> cm=0x7ffff671f830
> <vlib_global_main+560>, input=0x7fffb6374f00, parent_command_index=63) at
> /home/dev/net-base/build/vpp/src/vlib/cli.c:609 #11 0x00007ffff643c948 in
> vlib_cli_dispatch_sub_commands (vm=0x7ffff671f600 <vlib_global_main>, 
> cm=0x7ffff671f830
> <vlib_global_main+560>, input=0x7fffb6374f00, parent_command_index=33) at
> /home/dev/net-base/build/vpp/src/vlib/cli.c:609 #12 0x00007ffff643c948 in
> vlib_cli_dispatch_sub_commands (vm=0x7ffff671f600 <vlib_global_main>, 
> cm=0x7ffff671f830
> <vlib_global_main+560>, input=0x7fffb6374f00, parent_command_index=0) at
> /home/dev/net-base/build/vpp/src/vlib/cli.c:609
BIN=/home/dev/net-base/build/vpp/build-root/install-vpp_debug-native/vpp/bin/vppctl

sudo su - <<EOF
    ip link del veth0 >/dev/null 2>&1;
    ip link add veth0 type veth peer name veth1
EOF

$BIN create host-interface name veth0

$BIN set interface state host-veth0 up


for i in `seq 0 1`; do
	for j in `seq 1 128`; do
		$BIN set interface ip address host-veth0 10.0.$i.$j/24
	done
done

$BIN sh interface addr host-veth0 | wc -l

# will crash
$BIN set interface ip address del host-veth0 10.0.0.1/24
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#14839): https://lists.fd.io/g/vpp-dev/message/14839
Mute This Topic: https://lists.fd.io/mt/67738937/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to