aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/vmxnet3/output.c
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2019-02-25 12:10:53 -0800
committerDamjan Marion <dmarion@me.com>2019-02-26 11:30:42 +0000
commitdd3737284d5021e2e3bd0413b61aab14797e365c (patch)
tree4c538ed6e44118102b9f2af9a2de5697e4d2a3d9 /src/plugins/vmxnet3/output.c
parent5ecd5a5d159332a964dd840fcdabe5f8d3111b0e (diff)
vmxnet3: lro/tso and rx checksum
Add lro/tso and rx checksum support. lro/tso is configured via startup.conf vmxnet3 { lro } It is disable by default due to not all versions of ESXi supports it. Change-Id: Icf224ff528884ecd9e655b4fcf4481194e8c5a63 Signed-off-by: Steven Luong <sluong@cisco.com>
Diffstat (limited to 'src/plugins/vmxnet3/output.c')
-rw-r--r--src/plugins/vmxnet3/output.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/plugins/vmxnet3/output.c b/src/plugins/vmxnet3/output.c
index 5c48549e60d..5de41cdba07 100644
--- a/src/plugins/vmxnet3/output.c
+++ b/src/plugins/vmxnet3/output.c
@@ -127,7 +127,9 @@ VNET_DEVICE_CLASS_TX_FN (vmxnet3_device_class) (vlib_main_t * vm,
while (PREDICT_TRUE (n_left))
{
u16 space_needed = 1, i;
+ u32 gso_size = 0;
vlib_buffer_t *b;
+ u32 hdr_len = 0;
bi0 = buffers[0];
b0 = vlib_get_buffer (vm, bi0);
@@ -178,17 +180,33 @@ VNET_DEVICE_CLASS_TX_FN (vmxnet3_device_class) (vlib_main_t * vm,
txq->tx_ring.bufs[desc_idx] = bi0;
txd = &txq->tx_desc[desc_idx];
+
txd->address = vlib_buffer_get_current_pa (vm, b0);
txd->flags[0] = generation | b0->current_length;
+ txd->flags[1] = 0;
+ if (PREDICT_FALSE (b0->flags & VNET_BUFFER_F_GSO))
+ {
+ /*
+ * We should not be getting GSO outbound traffic unless it is
+ * lro is enable
+ */
+ ASSERT (vd->lro_enable == 1);
+ gso_size = vnet_buffer2 (b0)->gso_size;
+ hdr_len = vnet_buffer (b0)->l4_hdr_offset +
+ sizeof (ethernet_header_t);
+ }
generation = txq->tx_ring.gen;
-
- txd->flags[1] = 0;
bi0 = b0->next_buffer;
}
-
- txd->flags[1] = VMXNET3_TXF_CQ | VMXNET3_TXF_EOP;
+ if (PREDICT_FALSE (gso_size != 0))
+ {
+ txd->flags[1] = hdr_len;
+ txd->flags[1] |= VMXNET3_TXF_OM (VMXNET3_OM_TSO);
+ txd->flags[0] |= VMXNET3_TXF_MSSCOF (gso_size);
+ }
+ txd->flags[1] |= VMXNET3_TXF_CQ | VMXNET3_TXF_EOP;
asm volatile ("":::"memory");
/*
* Now toggle back the generation bit for the first segment.