aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2019-05-16 09:25:46 -0700
committerDamjan Marion <dmarion@me.com>2019-05-21 14:17:40 +0000
commit5a5c036c023ab88b9630f67055db19a1a1c6cf34 (patch)
treec6dcf4ce202b099e8c72e88e70444d5fb3dc41a2 /src/plugins
parentd3ebc83af33be72409032e7969dc2dcfc07a9783 (diff)
vmxnet3: gso_l4_hdr_sz is not set correctly
vnet_buffer2 -> gso_l4_hdr_sz is not set correctly because vnet_buffer->l4_hdr_offset is not set yet at the top. Move the code to set vnet_buffer->gso_l4_hdr_sz further down. Change-Id: I0110e4687572bb93cb593d7d4d14a3d5083af13a Signed-off-by: Steven Luong <sluong@cisco.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/vmxnet3/input.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/src/plugins/vmxnet3/input.c b/src/plugins/vmxnet3/input.c
index 87aa29cb49a..7928bc35fd9 100644
--- a/src/plugins/vmxnet3/input.c
+++ b/src/plugins/vmxnet3/input.c
@@ -80,22 +80,6 @@ vmxnet3_handle_offload (vmxnet3_rx_comp * rx_comp, vlib_buffer_t * hb,
{
u8 l4_hdr_sz = 0;
- if (gso_size)
- {
- if (rx_comp->flags & VMXNET3_RXCF_TCP)
- {
- tcp_header_t *tcp =
- (tcp_header_t *) (hb->data + vnet_buffer (hb)->l4_hdr_offset);
- l4_hdr_sz = tcp_header_bytes (tcp);
- }
- else if (rx_comp->flags & VMXNET3_RXCF_UDP)
- {
- udp_header_t *udp =
- (udp_header_t *) (hb->data + vnet_buffer (hb)->l4_hdr_offset);
- l4_hdr_sz = sizeof (*udp);
- }
- }
-
if (rx_comp->flags & VMXNET3_RXCF_IP4)
{
ip4_header_t *ip4 = (ip4_header_t *) (hb->data +
@@ -141,6 +125,18 @@ vmxnet3_handle_offload (vmxnet3_rx_comp * rx_comp, vlib_buffer_t * hb,
if (gso_size)
{
+ if (rx_comp->flags & VMXNET3_RXCF_TCP)
+ {
+ tcp_header_t *tcp =
+ (tcp_header_t *) (hb->data + vnet_buffer (hb)->l4_hdr_offset);
+ l4_hdr_sz = tcp_header_bytes (tcp);
+ }
+ else if (rx_comp->flags & VMXNET3_RXCF_UDP)
+ {
+ udp_header_t *udp =
+ (udp_header_t *) (hb->data + vnet_buffer (hb)->l4_hdr_offset);
+ l4_hdr_sz = sizeof (*udp);
+ }
vnet_buffer2 (hb)->gso_size = gso_size;
vnet_buffer2 (hb)->gso_l4_hdr_sz = l4_hdr_sz;
hb->flags |= VNET_BUFFER_F_GSO;
@@ -184,6 +180,18 @@ vmxnet3_handle_offload (vmxnet3_rx_comp * rx_comp, vlib_buffer_t * hb,
if (gso_size)
{
+ if (rx_comp->flags & VMXNET3_RXCF_TCP)
+ {
+ tcp_header_t *tcp =
+ (tcp_header_t *) (hb->data + vnet_buffer (hb)->l4_hdr_offset);
+ l4_hdr_sz = tcp_header_bytes (tcp);
+ }
+ else if (rx_comp->flags & VMXNET3_RXCF_UDP)
+ {
+ udp_header_t *udp =
+ (udp_header_t *) (hb->data + vnet_buffer (hb)->l4_hdr_offset);
+ l4_hdr_sz = sizeof (*udp);
+ }
vnet_buffer2 (hb)->gso_size = gso_size;
vnet_buffer2 (hb)->gso_l4_hdr_sz = l4_hdr_sz;
hb->flags |= VNET_BUFFER_F_GSO;