dpdk: bump DPDK version to 19.08
[vpp.git] / src / plugins / dpdk / device / device.c
index 8778d71..806749c 100644 (file)
@@ -50,8 +50,7 @@ dpdk_set_mac_address (vnet_hw_interface_t * hi,
   dpdk_main_t *dm = &dpdk_main;
   dpdk_device_t *xd = vec_elt_at_index (dm->devices, hi->dev_instance);
 
-  error = rte_eth_dev_default_mac_addr_set (xd->port_id,
-                                           (struct ether_addr *) address);
+  error = rte_eth_dev_default_mac_addr_set (xd->port_id, (void *) address);
 
   if (error)
     {
@@ -226,10 +225,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 +241,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