vlib_buffer_t has no ethernet_header_t, *vnet_gso_header_offset_parser* ** will 
failed.
I think if vlib_buffer_t valid l2 header, vnet_gso_header_offset_parser should 
skip *ethernet_header_t* parse.
Below is the VPP crash message:

> 
> 0: /home/dev/code/net-base/build/vpp/src/vnet/ip/ip.h:205
> (ip_calculate_l4_checksum) assertion `ip_header_size' fails
> 
> Program received signal SIGABRT, Aborted.
> 0x00007ffff4a1d337 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);
> (gdb) bt
> #0  0x00007ffff4a1d337 in __GI_raise (sig=sig@entry=6) at
> ../nptl/sysdeps/unix/sysv/linux/raise.c:55
> #1  0x00007ffff4a1ea28 in __GI_abort () at abort.c:90
> #2  0x0000000000407458 in os_panic () at
> /home/dev/code/net-base/build/vpp/src/vpp/vnet/main.c:355
> #3  0x00007ffff5864d1f in debugger () at
> /home/dev/code/net-base/build/vpp/src/vppinfra/error.c:84
> #4  0x00007ffff58650ee in _clib_error (how_to_die=2, function_name=0x0,
> line_number=0, fmt=0x7ffff76abc88 "%s:%d (%s) assertion `%s' fails") at
> /home/dev/code/net-base/build/vpp/src/vppinfra/error.c:143
> #5  0x00007ffff6ed5472 in ip_calculate_l4_checksum (vm=0x7ffff66aa640
> <vlib_global_main>, p0=0x103fdada00, sum0=189151184350281389,
> payload_length=2560, iph=0x103fdadb5e "", ip_header_size=0, l4h=0x0) at
> /home/dev/code/net-base/build/vpp/src/vnet/ip/ip.h:205
> #6  0x00007ffff6edd92f in ip4_tcp_udp_compute_checksum (vm=0x7ffff66aa640
> <vlib_global_main>, p0=0x103fdada00, ip0=0x103fdadb5e) at
> /home/dev/code/net-base/build/vpp/src/vnet/ip/ip4_forward.c:1328
> #7  0x00007ffff6ca5772 in calc_checksums (vm=0x7ffff66aa640
> <vlib_global_main>, b=0x103fdada00) at
> /home/dev/code/net-base/build/vpp/src/vnet/interface_output.c:189
> #8  0x00007ffff6ca64fc in vnet_interface_output_node_inline
> (vm=0x7ffff66aa640 <vlib_global_main>, node=0x7fffd71a3cc0,
> frame=0x7fffd7936b40, vnm=0x7ffff7b6a9c0 <vnet_main>, hi=0x7fffd78848c0,
> do_tx_offloads=1) at
> /home/dev/code/net-base/build/vpp/src/vnet/interface_output.c:450
> #9  0x00007ffff6ca67ff in vnet_interface_output_node (vm=0x7ffff66aa640
> <vlib_global_main>, node=0x7fffd71a3cc0, frame=0x7fffd7936b40) at
> /home/dev/code/net-base/build/vpp/src/vnet/interface_output.c:542
> #10 0x00007ffff6408776 in dispatch_node (vm=0x7ffff66aa640
> <vlib_global_main>, node=0x7fffd71a3cc0, type=VLIB_NODE_TYPE_INTERNAL,
> dispatch_state=VLIB_NODE_STATE_POLLING, frame=0x7fffd7936b40,
> last_time_stamp=64570511102008) at
> /home/dev/code/net-base/build/vpp/src/vlib/main.c:1208
> #11 0x00007ffff6408f37 in dispatch_pending_node (vm=0x7ffff66aa640
> <vlib_global_main>, pending_frame_index=2, last_time_stamp=64570511102008)
> at /home/dev/code/net-base/build/vpp/src/vlib/main.c:1376
> #12 0x00007ffff640ab9a in vlib_main_or_worker_loop (vm=0x7ffff66aa640
> <vlib_global_main>, is_main=1) at
> /home/dev/code/net-base/build/vpp/src/vlib/main.c:1833
> #13 0x00007ffff640b3df in vlib_main_loop (vm=0x7ffff66aa640
> <vlib_global_main>) at
> /home/dev/code/net-base/build/vpp/src/vlib/main.c:1934
> #14 0x00007ffff640c0a7 in vlib_main (vm=0x7ffff66aa640 <vlib_global_main>,
> input=0x7fffd6c8afb0) at
> /home/dev/code/net-base/build/vpp/src/vlib/main.c:2151
> #15 0x00007ffff6471bdc in thread0 (arg=140737327572544) at
> /home/dev/code/net-base/build/vpp/src/vlib/unix/main.c:650
> #16 0x00007ffff5884ef4 in clib_calljmp () at
> /home/dev/code/net-base/build/vpp/src/vppinfra/longjmp.S:123
> #17 0x00007fffffffd070 in ?? ()
> #18 0x00007ffff6472152 in vlib_unix_main (argc=181, argv=0x700fa0) at
> /home/dev/code/net-base/build/vpp/src/vlib/unix/main.c:720
> #19 0x0000000000406dcc in main (argc=181, argv=0x700fa0) at
> /home/dev/code/net-base/build/vpp/src/vpp/vnet/main.c:280
> (gdb) up 7
> (gdb) l
> 194   else if (is_ip6)
> 195     {
> 196       int bogus;
> 197       ip6_header_t *ip6;
> 198
> 199       ip6 =
> 200     (ip6_header_t *) (vlib_buffer_get_current (b) +
> gho.l3_hdr_offset);
> 201       if (b->flags & VNET_BUFFER_F_OFFLOAD_TCP_CKSUM)
> 202     {
> 203       th->checksum = 0;
> (gdb)
> 204       th->checksum =
> 205         ip6_tcp_udp_icmp_compute_checksum (vm, b, ip6, &bogus);
> 206     }
> 207       else if (b->flags & VNET_BUFFER_F_OFFLOAD_UDP_CKSUM)
> 208     {
> 209       uh->checksum = 0;
> 210       uh->checksum =
> 211         ip6_tcp_udp_icmp_compute_checksum (vm, b, ip6, &bogus);
> 212     }
> 213     }
> (gdb)
> 214   b->flags &= ~VNET_BUFFER_F_OFFLOAD_TCP_CKSUM;
> 215   b->flags &= ~VNET_BUFFER_F_OFFLOAD_UDP_CKSUM;
> 216   b->flags &= ~VNET_BUFFER_F_OFFLOAD_IP_CKSUM;
> 217 }
> 218
> 219 static_always_inline uword
> 220 vnet_interface_output_node_inline (vlib_main_t * vm,
> 221                    vlib_node_runtime_t * node,
> 222                    vlib_frame_t * frame,
> 223                    vnet_main_t * vnm,
> (gdb) print b[0]
> $20 = {{cacheline0 = 0x103fdada00 "P", current_data = 80, current_length =
> 60, flags = 23265280, flow_id = 0, ref_count = 1 '\001', buffer_pool_index
> = 0 '\000', error = 0, next_buffer = 0, {current_config_index = 0,
> punt_reason = 0}, opaque = {0, 3, 5242880, 100, 0, 3, 0, 0, 0, 0},
> template_end = 0x103fdada40 "", cacheline1 = 0x103fdada40 "", trace_handle
> = 0, total_length_not_including_first_buffer = 0, opaque2 = {0 <repeats 14
> times>}, cacheline2 = 0x103fdada80 "", pre_data = '\000' <repeats 127
> times>, data = 0x103fdadb00 ""}, as_u8x16 = {{80, 0, 60, 0, 0, 0, 99, 1,
> 0, 0, 0, 0, 1, 0, 0, 0}, {0 <repeats 12 times>, 3, 0, 0, 0}, {0, 0, 80, 0,
> 100, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0}, {0 <repeats 16 times>}}}
> (gdb) x /60xb b->data+80
> 0x103fdadb50:   0x45    0x00    0x00    0x3c    0x00    0x00    0x40   
> 0x00
> 0x103fdadb58:   0xff    0x06    0x00    0x00    0x0a    0x00    0x00   
> 0x02
> 0x103fdadb60:   0x0a    0x00    0x00    0x01    0x68    0x47    0x0f   
> 0xa0
> 0x103fdadb68:   0xff    0xff    0xad    0x5e    0x00    0x00    0x00   
> 0x00
> 0x103fdadb70:   0xa0    0x02    0x10    0x00    0x00    0x00    0x00   
> 0x00
> 0x103fdadb78:   0x02    0x04    0x05    0xb4    0x03    0x03    0x0a   
> 0x04
> 0x103fdadb80:   0x02    0x08    0x0a    0x01    0x34    0xdc    0x83   
> 0x00
> 0x103fdadb88:   0x00    0x00    0x00    0x00
> (gdb) print gho
> $21 = {l2_hdr_offset = 80, l3_hdr_offset = 14, l4_hdr_offset = 14,
> l4_hdr_sz = 0, outer_l2_hdr_offset = 0, outer_l3_hdr_offset = 0,
> outer_l4_hdr_offset = 0}
> (gdb) print b->flags&VNET_BUFFER_F_L2_HDR_OFFSET_VALID
> $22 = 0
> (gdb) print b->flags&VNET_BUFFER_F_L3_HDR_OFFSET_VALID
> $23 = 131072
> (gdb) print b->flags&VNET_BUFFER_F_L4_HDR_OFFSET_VALID
> $24 = 65536
> (gdb) x /20xb ip4
> 0x103fdadb5e:   0x00    0x02    0x0a    0x00    0x00    0x01    0x68   
> 0x47
> 0x103fdadb66:   0x0f    0xa0    0xff    0xff    0xad    0x5e    0x00   
> 0x00
> 0x103fdadb6e:   0x00    0x00    0xa0    0x02
> (gdb) x /20xb th
> 0x103fdadb5e:   0x00    0x02    0x0a    0x00    0x00    0x01    0x68   
> 0x47
> 0x103fdadb66:   0x0f    0xa0    0xff    0xff    0xad    0x5e    0x00   
> 0x00
> 0x103fdadb6e:   0x00    0x00    0xa0    0x02
> (gdb) print ((ip4_header_t *)(b->data+80))[0]
> $25 = {{ip_version_and_header_length = 69 'E', tos = IP_DSCP_CS0, length =
> 15360, fragment_id = 0, flags_and_fragment_offset = 64, ttl = 255 '\377',
> protocol = 6 '\006', checksum = 0, {{src_address = {data =
> "\n\000\000\002", data_u32 = 33554442, as_u8 = "\n\000\000\002", as_u16 =
> {10, 512}, as_u32 = 33554442}, dst_address = {data = "\n\000\000\001",
> data_u32 = 16777226, as_u8 = "\n\000\000\001", as_u16 = {10, 256}, as_u32
> = 16777226}}, address_pair = {src = {data = "\n\000\000\002", data_u32 =
> 33554442, as_u8 = "\n\000\000\002", as_u16 = {10, 512}, as_u32 =
> 33554442}, dst = {data = "\n\000\000\001", data_u32 = 16777226, as_u8 =
> "\n\000\000\001", as_u16 = {10, 256}, as_u32 = 16777226}}}},
> {checksum_data_64 = {18014399516115013, 144115231025530623},
> checksum_data_64_32 = {16777226}}, {checksum_data_32 = {1006633029,
> 4194304, 1791, 33554442, 16777226}}}
> (gdb)
> at /home/dev/code/net-base/build/vpp/src/vlib/unix/main.c:650
> #16 0x00007ffff5884ef4 in clib_calljmp () at
> /home/dev/code/net-base/build/vpp/src/vppinfra/longjmp.S:123
> #17 0x00007fffffffd070 in ?? ()
> #18 0x00007ffff6472152 in vlib_unix_main (argc=181, argv=0x700fa0) at
> /home/dev/code/net-base/build/vpp/src/vlib/unix/main.c:720
> #19 0x0000000000406dcc in main (argc=181, argv=0x700fa0) at
> /home/dev/code/net-base/build/vpp/src/vpp/vnet/main.c:280
> (gdb) l
> 194   else if (is_ip6)
> 195     {
> 196       int bogus;
> 197       ip6_header_t *ip6;
> 198
> 199       ip6 =
> 200     (ip6_header_t *) (vlib_buffer_get_current (b) +
> gho.l3_hdr_offset);
> 201       if (b->flags & VNET_BUFFER_F_OFFLOAD_TCP_CKSUM)
> 202     {
> 203       th->checksum = 0;
> (gdb)
> 204       th->checksum =
> 205         ip6_tcp_udp_icmp_compute_checksum (vm, b, ip6, &bogus);
> 206     }
> 207       else if (b->flags & VNET_BUFFER_F_OFFLOAD_UDP_CKSUM)
> 208     {
> 209       uh->checksum = 0;
> 210       uh->checksum =
> 211         ip6_tcp_udp_icmp_compute_checksum (vm, b, ip6, &bogus);
> 212     }
> 213     }
> (gdb)
> 214   b->flags &= ~VNET_BUFFER_F_OFFLOAD_TCP_CKSUM;
> 215   b->flags &= ~VNET_BUFFER_F_OFFLOAD_UDP_CKSUM;
> 216   b->flags &= ~VNET_BUFFER_F_OFFLOAD_IP_CKSUM;
> 217 }
> 218
> 219 static_always_inline uword
> 220 vnet_interface_output_node_inline (vlib_main_t * vm,
> 221                    vlib_node_runtime_t * node,
> 222                    vlib_frame_t * frame,
> 223                    vnet_main_t * vnm,
> (gdb) print b[0]
> $20 = {{cacheline0 = 0x103fdada00 "P", current_data = 80, current_length =
> 60, flags = 23265280, flow_id = 0, ref_count = 1 '\001', buffer_pool_index
> = 0 '\000', error = 0, next_buffer = 0, {current_config_index = 0,
> punt_reason = 0}, opaque = {0, 3, 5242880, 100, 0, 3, 0, 0, 0, 0},
> template_end = 0x103fdada40 "", cacheline1 = 0x103fdada40 "", trace_handle
> = 0, total_length_not_including_first_buffer = 0, opaque2 = {0 <repeats 14
> times>}, cacheline2 = 0x103fdada80 "", pre_data = '\000' <repeats 127
> times>, data = 0x103fdadb00 ""}, as_u8x16 = {{80, 0, 60, 0, 0, 0, 99, 1,
> 0, 0, 0, 0, 1, 0, 0, 0}, {0 <repeats 12 times>, 3, 0, 0, 0}, {0, 0, 80, 0,
> 100, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0}, {0 <repeats 16 times>}}}
> (gdb) x /140xb b->data
> 0x103fdadb00:   0x00    0x00    0x00    0x00    0x00    0x00    0x00   
> 0x00
> 0x103fdadb08:   0x00    0x00    0x00    0x00    0x00    0x00    0x00   
> 0x00
> 0x103fdadb10:   0x00    0x00    0x00    0x00    0x00    0x00    0x00   
> 0x00
> 0x103fdadb18:   0x00    0x00    0x00    0x00    0x00    0x00    0x00   
> 0x00
> 0x103fdadb20:   0x00    0x00    0x00    0x00    0x00    0x00    0x00   
> 0x00
> 0x103fdadb28:   0x00    0x00    0x00    0x00    0x00    0x00    0x00   
> 0x00
> 0x103fdadb30:   0x00    0x00    0x00    0x00    0x00    0x00    0x00   
> 0x00
> 0x103fdadb38:   0x00    0x00    0x00    0x00    0x00    0x00    0x00   
> 0x00
> 0x103fdadb40:   0x00    0x00    0x00    0x00    0x00    0x00    0x00   
> 0x00
> 0x103fdadb48:   0x00    0x00    0x00    0x00    0x00    0x00    0x00   
> 0x00
> 0x103fdadb50:   0x45    0x00    0x00    0x3c    0x00    0x00    0x40   
> 0x00
> 0x103fdadb58:   0xff    0x06    0x00    0x00    0x0a    0x00    0x00   
> 0x02
> 0x103fdadb60:   0x0a    0x00    0x00    0x01    0x68    0x47    0x0f   
> 0xa0
> 0x103fdadb68:   0xff    0xff    0xad    0x5e    0x00    0x00    0x00   
> 0x00
> 0x103fdadb70:   0xa0    0x02    0x10    0x00    0x00    0x00    0x00   
> 0x00
> 0x103fdadb78:   0x02    0x04    0x05    0xb4    0x03    0x03    0x0a   
> 0x04
> 0x103fdadb80:   0x02    0x08    0x0a    0x01    0x34    0xdc    0x83   
> 0x00
> 0x103fdadb88:   0x00    0x00    0x00    0x00
> (gdb) x /60xb b->data+80
> 0x103fdadb50:   0x45    0x00    0x00    0x3c    0x00    0x00    0x40   
> 0x00
> 0x103fdadb58:   0xff    0x06    0x00    0x00    0x0a    0x00    0x00   
> 0x02
> 0x103fdadb60:   0x0a    0x00    0x00    0x01    0x68    0x47    0x0f   
> 0xa0
> 0x103fdadb68:   0xff    0xff    0xad    0x5e    0x00    0x00    0x00   
> 0x00
> 0x103fdadb70:   0xa0    0x02    0x10    0x00    0x00    0x00    0x00   
> 0x00
> 0x103fdadb78:   0x02    0x04    0x05    0xb4    0x03    0x03    0x0a   
> 0x04
> 0x103fdadb80:   0x02    0x08    0x0a    0x01    0x34    0xdc    0x83   
> 0x00
> 0x103fdadb88:   0x00    0x00    0x00    0x00
> (gdb) print gho
> $21 = {l2_hdr_offset = 80, l3_hdr_offset = 14, l4_hdr_offset = 14,
> l4_hdr_sz = 0, outer_l2_hdr_offset = 0, outer_l3_hdr_offset = 0,
> outer_l4_hdr_offset = 0}
> (gdb) print b->flags&VNET_BUFFER_F_L2_HDR_OFFSET_VALID
> $22 = 0
> (gdb) print b->flags&VNET_BUFFER_F_L3_HDR_OFFSET_VALID
> $23 = 131072
> (gdb) print b->flags&VNET_BUFFER_F_L4_HDR_OFFSET_VALID
> $24 = 65536
> (gdb) x /20xb ip4
> 0x103fdadb5e:   0x00    0x02    0x0a    0x00    0x00    0x01    0x68   
> 0x47
> 0x103fdadb66:   0x0f    0xa0    0xff    0xff    0xad    0x5e    0x00   
> 0x00
> 0x103fdadb6e:   0x00    0x00    0xa0    0x02
> (gdb) x /20xb th
> 0x103fdadb5e:   0x00    0x02    0x0a    0x00    0x00    0x01    0x68   
> 0x47
> 0x103fdadb66:   0x0f    0xa0    0xff    0xff    0xad    0x5e    0x00   
> 0x00
> 0x103fdadb6e:   0x00    0x00    0xa0    0x02
> (gdb) print ((ip4_header_t *)(b->data+80))[0]
> $25 = {{ip_version_and_header_length = 69 'E', tos = IP_DSCP_CS0, length =
> 15360, fragment_id = 0, flags_and_fragment_offset = 64, ttl = 255 '\377',
> protocol = 6 '\006', checksum = 0, {{src_address = {data =
> "\n\000\000\002", data_u32 = 33554442, as_u8 = "\n\000\000\002", as_u16 =
> {10, 512}, as_u32 = 33554442}, dst_address = {data = "\n\000\000\001",
> data_u32 = 16777226, as_u8 = "\n\000\000\001", as_u16 = {10, 256}, as_u32
> = 16777226}}, address_pair = {src = {data = "\n\000\000\002", data_u32 =
> 33554442, as_u8 = "\n\000\000\002", as_u16 = {10, 512}, as_u32 =
> 33554442}, dst = {data = "\n\000\000\001", data_u32 = 16777226, as_u8 =
> "\n\000\000\001", as_u16 = {10, 256}, as_u32 = 16777226}}}},
> {checksum_data_64 = {18014399516115013, 144115231025530623},
> checksum_data_64_32 = {16777226}}, {checksum_data_32 = {1006633029,
> 4194304, 1791, 33554442, 16777226}}}
> (gdb)
> 
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#15175): https://lists.fd.io/g/vpp-dev/message/15175
Mute This Topic: https://lists.fd.io/mt/69709611/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