Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
gso: fix the udp checksum in test
[vpp.git]
/
src
/
vnet
/
pg
/
input.c
diff --git
a/src/vnet/pg/input.c
b/src/vnet/pg/input.c
index
483add0
..
6968cce
100644
(file)
--- a/
src/vnet/pg/input.c
+++ b/
src/vnet/pg/input.c
@@
-1537,7
+1537,6
@@
fill_buffer_offload_flags (vlib_main_t * vm, u32 * buffers, u32 n_buffers,
{
vlib_buffer_t *b0 = vlib_get_buffer (vm, buffers[i]);
u8 l4_proto = 0;
{
vlib_buffer_t *b0 = vlib_get_buffer (vm, buffers[i]);
u8 l4_proto = 0;
- u8 l4_hdr_sz = 0;
ethernet_header_t *eh =
(ethernet_header_t *) vlib_buffer_get_current (b0);
ethernet_header_t *eh =
(ethernet_header_t *) vlib_buffer_get_current (b0);
@@
-1589,25
+1588,21
@@
fill_buffer_offload_flags (vlib_main_t * vm, u32 * buffers, u32 n_buffers,
if (l4_proto == IP_PROTOCOL_TCP)
{
b0->flags |= VNET_BUFFER_F_OFFLOAD_TCP_CKSUM;
if (l4_proto == IP_PROTOCOL_TCP)
{
b0->flags |= VNET_BUFFER_F_OFFLOAD_TCP_CKSUM;
- tcp_header_t *tcp = (tcp_header_t *) (vlib_buffer_get_current (b0) +
- vnet_buffer
- (b0)->l4_hdr_offset);
- tcp->checksum = 0;
- if (gso_enabled)
+
+ /* only set GSO flag for chained buffers */
+ if (gso_enabled && (b0->flags & VLIB_BUFFER_NEXT_PRESENT))
{
b0->flags |= VNET_BUFFER_F_GSO;
{
b0->flags |= VNET_BUFFER_F_GSO;
- l4_hdr_sz = tcp_header_bytes (tcp);
- vnet_buffer2 (b0)->gso_l4_hdr_sz = l4_hdr_sz;
+ tcp_header_t *tcp =
+ (tcp_header_t *) (vlib_buffer_get_current (b0) +
+ vnet_buffer (b0)->l4_hdr_offset);
+ vnet_buffer2 (b0)->gso_l4_hdr_sz = tcp_header_bytes (tcp);
vnet_buffer2 (b0)->gso_size = gso_size;
}
}
else if (l4_proto == IP_PROTOCOL_UDP)
{
b0->flags |= VNET_BUFFER_F_OFFLOAD_UDP_CKSUM;
vnet_buffer2 (b0)->gso_size = gso_size;
}
}
else if (l4_proto == IP_PROTOCOL_UDP)
{
b0->flags |= VNET_BUFFER_F_OFFLOAD_UDP_CKSUM;
- udp_header_t *udp = (udp_header_t *) (vlib_buffer_get_current (b0) +
- vnet_buffer
- (b0)->l4_hdr_offset);
- udp->checksum = 0;
}
}
}
}
}
}