diff options
author | Chenmin Sun <chenmin.sun@intel.com> | 2019-07-17 22:29:44 +0800 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2019-09-21 08:25:35 +0000 |
commit | 5564db85327fc1778152d00b159efd57784d357b (patch) | |
tree | 5e7570760d69e166d3b50c7fb616cf655887f9b4 /src/plugins/dpdk/device/device.c | |
parent | f5d6c80acc5e1fbdaf3a891e010a7e653733c851 (diff) |
dpdk: add TSO support in dpdk plugin.
Type: feature
You can enable tso in starup.conf like this:
dev 0000:86:00.0{
tso on
}
TSO is disabled by default.
Change-Id: Ifdbaf5322f768c384aa54e532d7bf45e810ca01c
Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
(cherry picked from commit de5ed58fdb72536ed928e12990a08104e1f89f51)
Diffstat (limited to 'src/plugins/dpdk/device/device.c')
-rw-r--r-- | src/plugins/dpdk/device/device.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/plugins/dpdk/device/device.c b/src/plugins/dpdk/device/device.c index 8778d71cd7a..cb0448fa503 100644 --- a/src/plugins/dpdk/device/device.c +++ b/src/plugins/dpdk/device/device.c @@ -226,10 +226,11 @@ dpdk_buffer_tx_offload (dpdk_device_t * xd, vlib_buffer_t * b, u32 tcp_cksum = b->flags & VNET_BUFFER_F_OFFLOAD_TCP_CKSUM; u32 udp_cksum = b->flags & VNET_BUFFER_F_OFFLOAD_UDP_CKSUM; int is_ip4 = b->flags & VNET_BUFFER_F_IS_IP4; + u32 tso = b->flags & VNET_BUFFER_F_GSO; u64 ol_flags; /* Is there any work for us? */ - if (PREDICT_TRUE ((ip_cksum | tcp_cksum | udp_cksum) == 0)) + if (PREDICT_TRUE ((ip_cksum | tcp_cksum | udp_cksum | tso) == 0)) return; mb->l2_len = vnet_buffer (b)->l3_hdr_offset - b->current_data; @@ -241,6 +242,14 @@ dpdk_buffer_tx_offload (dpdk_device_t * xd, vlib_buffer_t * b, ol_flags |= ip_cksum ? PKT_TX_IP_CKSUM : 0; ol_flags |= tcp_cksum ? PKT_TX_TCP_CKSUM : 0; ol_flags |= udp_cksum ? PKT_TX_UDP_CKSUM : 0; + ol_flags |= tso ? (tcp_cksum ? PKT_TX_TCP_SEG : PKT_TX_UDP_SEG) : 0; + + if (tso) + { + mb->l4_len = vnet_buffer2 (b)->gso_l4_hdr_sz; + mb->tso_segsz = vnet_buffer2 (b)->gso_size; + } + mb->ol_flags |= ol_flags; /* we are trying to help compiler here by using local ol_flags with known |