diff options
author | Steven Luong <sluong@cisco.com> | 2020-09-15 09:48:38 -0700 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2020-09-16 16:54:20 +0000 |
commit | 007abe751f2ee86528d0ccc005a3da1c90850868 (patch) | |
tree | 2c95fa65ff7ae47f0d1f56905873a4df7a445f89 /src/plugins/vmxnet3/input.c | |
parent | cc7c88e529eb3a2ca0934f27eb048c8ca3788f95 (diff) |
vmxnet3: gso fixes
outbound:
wrong header len computation
gso size and header length need to be set in the first segment of the
chain
inbound:
EOP may have zero length descriptor to terminate the chain
missing endian conversion for ethertype
Type: fix
Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Iaa003c0e9af3ead4df6c6c0d5772a179d2ff15c4
Diffstat (limited to 'src/plugins/vmxnet3/input.c')
-rw-r--r-- | src/plugins/vmxnet3/input.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/plugins/vmxnet3/input.c b/src/plugins/vmxnet3/input.c index 173ab915b2b..f182409ac59 100644 --- a/src/plugins/vmxnet3/input.c +++ b/src/plugins/vmxnet3/input.c @@ -269,7 +269,6 @@ vmxnet3_device_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node, b0->flags = 0; b0->error = 0; b0->current_config_index = 0; - ASSERT (b0->current_length != 0); if (PREDICT_FALSE ((rx_comp->index & VMXNET3_RXCI_EOP) && (rx_comp->len & VMXNET3_RXCL_ERROR))) @@ -317,12 +316,19 @@ vmxnet3_device_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node, else if (rx_comp->index & VMXNET3_RXCI_EOP) { /* end of segment */ - if (prev_b0) + if (PREDICT_TRUE (prev_b0 != 0)) { - prev_b0->flags |= VLIB_BUFFER_NEXT_PRESENT; - prev_b0->next_buffer = bi0; - hb->total_length_not_including_first_buffer += - b0->current_length; + if (PREDICT_TRUE (b0->current_length != 0)) + { + prev_b0->flags |= VLIB_BUFFER_NEXT_PRESENT; + prev_b0->next_buffer = bi0; + hb->total_length_not_including_first_buffer += + b0->current_length; + } + else + { + vlib_buffer_free_one (vm, bi0); + } prev_b0 = 0; got_packet = 1; } @@ -387,7 +393,7 @@ vmxnet3_device_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node, ethernet_header_t *e = (ethernet_header_t *) hb->data; next[0] = VNET_DEVICE_INPUT_NEXT_ETHERNET_INPUT; - if (!ethernet_frame_is_tagged (e->type)) + if (!ethernet_frame_is_tagged (ntohs (e->type))) vmxnet3_handle_offload (rx_comp, hb, gso_size); } |