bonding: add bond_create2 API to include gso option
[vpp.git] / src / vat / api_format.c
index c3441eb..f1935de 100644 (file)
@@ -2,7 +2,7 @@
  *------------------------------------------------------------------
  * api_format.c
  *
- * Copyright (c) 2014-2016 Cisco and/or its affiliates.
+ * Copyright (c) 2014-2020 Cisco and/or its affiliates.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at:
@@ -43,7 +43,6 @@
 #include <vnet/mpls/mpls.h>
 #include <vnet/ipsec/ipsec.h>
 #include <inttypes.h>
-#include <vnet/cop/cop.h>
 #include <vnet/ip/ip6_hop_by_hop.h>
 #include <vnet/ip/ip_source_and_port_range_check.h>
 #include <vnet/policer/xlate.h>
@@ -1165,7 +1164,7 @@ vl_api_cli_inband_reply_t_handler (vl_api_cli_inband_reply_t * mp)
 
   vam->retval = retval;
   if (retval == 0)
-    vam->cmd_reply = vl_api_from_api_to_new_vec (&mp->reply);
+    vam->cmd_reply = vl_api_from_api_to_new_vec (mp, &mp->reply);
   vam->result_ready = 1;
 }
 
@@ -1176,7 +1175,7 @@ vl_api_cli_inband_reply_t_handler_json (vl_api_cli_inband_reply_t * mp)
   vat_json_node_t node;
   u8 *reply = 0;               /* reply vector */
 
-  reply = vl_api_from_api_to_new_vec (&mp->reply);
+  reply = vl_api_from_api_to_new_vec (mp, &mp->reply);
   vec_reset_length (vam->cmd_reply);
 
   vat_json_init_object (&node);
@@ -1829,6 +1828,41 @@ static void vl_api_virtio_pci_create_reply_t_handler_json
 
 }
 
+static void
+  vl_api_virtio_pci_create_v2_reply_t_handler
+  (vl_api_virtio_pci_create_v2_reply_t * mp)
+{
+  vat_main_t *vam = &vat_main;
+  i32 retval = ntohl (mp->retval);
+  if (vam->async_mode)
+    {
+      vam->async_errors += (retval < 0);
+    }
+  else
+    {
+      vam->retval = retval;
+      vam->sw_if_index = ntohl (mp->sw_if_index);
+      vam->result_ready = 1;
+    }
+}
+
+static void vl_api_virtio_pci_create_v2_reply_t_handler_json
+  (vl_api_virtio_pci_create_v2_reply_t * mp)
+{
+  vat_main_t *vam = &vat_main;
+  vat_json_node_t node;
+
+  vat_json_init_object (&node);
+  vat_json_object_add_int (&node, "retval", ntohl (mp->retval));
+  vat_json_object_add_uint (&node, "sw_if_index", ntohl (mp->sw_if_index));
+
+  vat_json_print (vam->ofp, &node);
+  vat_json_free (&node);
+
+  vam->retval = ntohl (mp->retval);
+  vam->result_ready = 1;
+}
+
 static void
 vl_api_virtio_pci_delete_reply_t_handler (vl_api_virtio_pci_delete_reply_t *
                                          mp)
@@ -1897,6 +1931,41 @@ static void vl_api_bond_create_reply_t_handler_json
   vam->result_ready = 1;
 }
 
+static void
+vl_api_bond_create2_reply_t_handler (vl_api_bond_create2_reply_t * mp)
+{
+  vat_main_t *vam = &vat_main;
+  i32 retval = ntohl (mp->retval);
+
+  if (vam->async_mode)
+    {
+      vam->async_errors += (retval < 0);
+    }
+  else
+    {
+      vam->retval = retval;
+      vam->sw_if_index = ntohl (mp->sw_if_index);
+      vam->result_ready = 1;
+    }
+}
+
+static void vl_api_bond_create2_reply_t_handler_json
+  (vl_api_bond_create2_reply_t * mp)
+{
+  vat_main_t *vam = &vat_main;
+  vat_json_node_t node;
+
+  vat_json_init_object (&node);
+  vat_json_object_add_int (&node, "retval", ntohl (mp->retval));
+  vat_json_object_add_uint (&node, "sw_if_index", ntohl (mp->sw_if_index));
+
+  vat_json_print (vam->ofp, &node);
+  vat_json_free (&node);
+
+  vam->retval = ntohl (mp->retval);
+  vam->result_ready = 1;
+}
+
 static void
 vl_api_bond_delete_reply_t_handler (vl_api_bond_delete_reply_t * mp)
 {
@@ -1931,7 +2000,7 @@ static void vl_api_bond_delete_reply_t_handler_json
 }
 
 static void
-vl_api_bond_enslave_reply_t_handler (vl_api_bond_enslave_reply_t * mp)
+vl_api_bond_add_member_reply_t_handler (vl_api_bond_add_member_reply_t * mp)
 {
   vat_main_t *vam = &vat_main;
   i32 retval = ntohl (mp->retval);
@@ -1947,8 +2016,8 @@ vl_api_bond_enslave_reply_t_handler (vl_api_bond_enslave_reply_t * mp)
     }
 }
 
-static void vl_api_bond_enslave_reply_t_handler_json
-  (vl_api_bond_enslave_reply_t * mp)
+static void vl_api_bond_add_member_reply_t_handler_json
+  (vl_api_bond_add_member_reply_t * mp)
 {
   vat_main_t *vam = &vat_main;
   vat_json_node_t node;
@@ -1964,8 +2033,8 @@ static void vl_api_bond_enslave_reply_t_handler_json
 }
 
 static void
-vl_api_bond_detach_slave_reply_t_handler (vl_api_bond_detach_slave_reply_t *
-                                         mp)
+vl_api_bond_detach_member_reply_t_handler (vl_api_bond_detach_member_reply_t *
+                                          mp)
 {
   vat_main_t *vam = &vat_main;
   i32 retval = ntohl (mp->retval);
@@ -1981,8 +2050,8 @@ vl_api_bond_detach_slave_reply_t_handler (vl_api_bond_detach_slave_reply_t *
     }
 }
 
-static void vl_api_bond_detach_slave_reply_t_handler_json
-  (vl_api_bond_detach_slave_reply_t * mp)
+static void vl_api_bond_detach_member_reply_t_handler_json
+  (vl_api_bond_detach_member_reply_t * mp)
 {
   vat_main_t *vam = &vat_main;
   vat_json_node_t node;
@@ -2040,8 +2109,8 @@ api_sw_interface_set_bond_weight (vat_main_t * vam)
   return ret;
 }
 
-static void vl_api_sw_interface_bond_details_t_handler
-  (vl_api_sw_interface_bond_details_t * mp)
+static void vl_api_sw_bond_interface_details_t_handler
+  (vl_api_sw_bond_interface_details_t * mp)
 {
   vat_main_t *vam = &vat_main;
 
@@ -2049,11 +2118,11 @@ static void vl_api_sw_interface_bond_details_t_handler
         "%-16s %-12d %-12U %-13U %-14u %-14u",
         mp->interface_name, ntohl (mp->sw_if_index),
         format_bond_mode, ntohl (mp->mode), format_bond_load_balance,
-        ntohl (mp->lb), ntohl (mp->active_slaves), ntohl (mp->slaves));
+        ntohl (mp->lb), ntohl (mp->active_members), ntohl (mp->members));
 }
 
-static void vl_api_sw_interface_bond_details_t_handler_json
-  (vl_api_sw_interface_bond_details_t * mp)
+static void vl_api_sw_bond_interface_details_t_handler_json
+  (vl_api_sw_bond_interface_details_t * mp)
 {
   vat_main_t *vam = &vat_main;
   vat_json_node_t *node = NULL;
@@ -2071,24 +2140,38 @@ static void vl_api_sw_interface_bond_details_t_handler_json
                                   mp->interface_name);
   vat_json_object_add_uint (node, "mode", ntohl (mp->mode));
   vat_json_object_add_uint (node, "load_balance", ntohl (mp->lb));
-  vat_json_object_add_uint (node, "active_slaves", ntohl (mp->active_slaves));
-  vat_json_object_add_uint (node, "slaves", ntohl (mp->slaves));
+  vat_json_object_add_uint (node, "active_members",
+                           ntohl (mp->active_members));
+  vat_json_object_add_uint (node, "members", ntohl (mp->members));
 }
 
 static int
-api_sw_interface_bond_dump (vat_main_t * vam)
+api_sw_bond_interface_dump (vat_main_t * vam)
 {
-  vl_api_sw_interface_bond_dump_t *mp;
+  unformat_input_t *i = vam->input;
+  vl_api_sw_bond_interface_dump_t *mp;
   vl_api_control_ping_t *mp_ping;
   int ret;
+  u32 sw_if_index = ~0;
+
+  while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (i, "%U", api_unformat_sw_if_index, vam, &sw_if_index))
+       ;
+      else if (unformat (i, "sw_if_index %d", &sw_if_index))
+       ;
+      else
+       break;
+    }
 
   print (vam->ofp,
         "\n%-16s %-12s %-12s %-13s %-14s %-14s",
         "interface name", "sw_if_index", "mode", "load balance",
-        "active slaves", "slaves");
+        "active members", "members");
 
   /* Get list of bond interfaces */
-  M (SW_INTERFACE_BOND_DUMP, mp);
+  M (SW_BOND_INTERFACE_DUMP, mp);
+  mp->sw_if_index = ntohl (sw_if_index);
   S (mp);
 
   /* Use a control ping for synchronization */
@@ -2099,8 +2182,8 @@ api_sw_interface_bond_dump (vat_main_t * vam)
   return ret;
 }
 
-static void vl_api_sw_interface_slave_details_t_handler
-  (vl_api_sw_interface_slave_details_t * mp)
+static void vl_api_sw_member_interface_details_t_handler
+  (vl_api_sw_member_interface_details_t * mp)
 {
   vat_main_t *vam = &vat_main;
 
@@ -2110,8 +2193,8 @@ static void vl_api_sw_interface_slave_details_t_handler
         ntohl (mp->weight), mp->is_local_numa);
 }
 
-static void vl_api_sw_interface_slave_details_t_handler_json
-  (vl_api_sw_interface_slave_details_t * mp)
+static void vl_api_sw_member_interface_details_t_handler_json
+  (vl_api_sw_member_interface_details_t * mp)
 {
   vat_main_t *vam = &vat_main;
   vat_json_node_t *node = NULL;
@@ -2134,10 +2217,10 @@ static void vl_api_sw_interface_slave_details_t_handler_json
 }
 
 static int
-api_sw_interface_slave_dump (vat_main_t * vam)
+api_sw_member_interface_dump (vat_main_t * vam)
 {
   unformat_input_t *i = vam->input;
-  vl_api_sw_interface_slave_dump_t *mp;
+  vl_api_sw_member_interface_dump_t *mp;
   vl_api_control_ping_t *mp_ping;
   u32 sw_if_index = ~0;
   u8 sw_if_index_set = 0;
@@ -2162,11 +2245,11 @@ api_sw_interface_slave_dump (vat_main_t * vam)
 
   print (vam->ofp,
         "\n%-25s %-12s %-7s %-12s %-10s %-10s",
-        "slave interface name", "sw_if_index", "passive", "long_timeout",
+        "member interface name", "sw_if_index", "passive", "long_timeout",
         "weight", "local numa");
 
   /* Get list of bond interfaces */
-  M (SW_INTERFACE_SLAVE_DUMP, mp);
+  M (SW_MEMBER_INTERFACE_DUMP, mp);
   mp->sw_if_index = ntohl (sw_if_index);
   S (mp);
 
@@ -2901,7 +2984,7 @@ unformat_nsh_address (unformat_input_t * input, va_list * args)
   return unformat (input, "SPI:%d SI:%d", &nsh->spi, &nsh->si);
 }
 
-u8 *
+static u8 *
 format_nsh_address_vat (u8 * s, va_list * args)
 {
   nsh_t *a = va_arg (*args, nsh_t *);
@@ -2958,7 +3041,7 @@ vl_api_one_eid_table_details_t_handler (vl_api_one_eid_table_details_t * mp)
     s = format (0, "%d", clib_net_to_host_u32 (mp->locator_set_index));
 
   eid = format (0, "%U", format_lisp_eid_vat,
-               mp->deid, mp->seid, mp->is_src_dst);
+               &mp->deid, &mp->seid, mp->is_src_dst);
   vec_add1 (eid, 0);
 
   print (vam->ofp, "[%d] %-35s%-20s%-30s%-20d%-20d%-10d%-20s",
@@ -3007,7 +3090,7 @@ vl_api_one_eid_table_details_t_handler_json (vl_api_one_eid_table_details_t
   else
     {
       eid = format (0, "%U", format_lisp_eid_vat,
-                   mp->deid, mp->seid, mp->is_src_dst);
+                   &mp->deid, &mp->seid, mp->is_src_dst);
       vec_add1 (eid, 0);
       vat_json_object_add_string_copy (node, "eid", eid);
       vec_free (eid);
@@ -3031,9 +3114,9 @@ vl_api_one_stats_details_t_handler (vl_api_one_stats_details_t * mp)
   u8 *seid = 0, *deid = 0;
   ip46_address_t lloc, rloc;
 
-  deid = format (0, "%U", format_lisp_eid_vat, mp->deid, 0);
+  deid = format (0, "%U", format_lisp_eid_vat, &mp->deid, 0, 0);
 
-  seid = format (0, "%U", format_lisp_eid_vat, mp->seid, 0);
+  seid = format (0, "%U", format_lisp_eid_vat, &mp->seid, 0, 0);
 
   vec_add1 (deid, 0);
   vec_add1 (seid, 0);
@@ -3079,9 +3162,9 @@ vl_api_one_stats_details_t_handler_json (vl_api_one_stats_details_t * mp)
   node = vat_json_array_add (&vam->json_tree);
 
   vat_json_init_object (node);
-  deid = format (0, "%U", format_lisp_eid_vat, mp->deid, 0);
+  deid = format (0, "%U", format_lisp_eid_vat, &mp->deid, 0, 0);
 
-  seid = format (0, "%U", format_lisp_eid_vat, mp->seid, 0);
+  seid = format (0, "%U", format_lisp_eid_vat, &mp->seid, 0, 0);
 
   vec_add1 (deid, 0);
   vec_add1 (seid, 0);
@@ -5136,6 +5219,7 @@ _(flow_classify_set_interface_reply)                    \
 _(sw_interface_span_enable_disable_reply)               \
 _(pg_capture_reply)                                     \
 _(pg_enable_disable_reply)                              \
+_(pg_interface_enable_disable_coalesce_reply)           \
 _(ip_source_and_port_range_check_add_del_reply)         \
 _(ip_source_and_port_range_check_interface_add_del_reply)\
 _(delete_subif_reply)                                   \
@@ -5154,7 +5238,8 @@ _(tcp_configure_src_addresses_reply)                      \
 _(session_rule_add_del_reply)                          \
 _(ip_container_proxy_add_del_reply)                     \
 _(output_acl_set_interface_reply)                       \
-_(qos_record_enable_disable_reply)
+_(qos_record_enable_disable_reply)                     \
+_(flow_add_reply)
 
 #define _(n)                                    \
     static void vl_api_##n##_t_handler          \
@@ -5227,15 +5312,17 @@ _(TAP_CREATE_V2_REPLY, tap_create_v2_reply)                             \
 _(TAP_DELETE_V2_REPLY, tap_delete_v2_reply)                            \
 _(SW_INTERFACE_TAP_V2_DETAILS, sw_interface_tap_v2_details)             \
 _(VIRTIO_PCI_CREATE_REPLY, virtio_pci_create_reply)                    \
+_(VIRTIO_PCI_CREATE_V2_REPLY, virtio_pci_create_v2_reply)              \
 _(VIRTIO_PCI_DELETE_REPLY, virtio_pci_delete_reply)                    \
 _(SW_INTERFACE_VIRTIO_PCI_DETAILS, sw_interface_virtio_pci_details)     \
 _(BOND_CREATE_REPLY, bond_create_reply)                                        \
+_(BOND_CREATE2_REPLY, bond_create2_reply)                              \
 _(BOND_DELETE_REPLY, bond_delete_reply)                                        \
-_(BOND_ENSLAVE_REPLY, bond_enslave_reply)                              \
-_(BOND_DETACH_SLAVE_REPLY, bond_detach_slave_reply)                    \
+_(BOND_ADD_MEMBER_REPLY, bond_add_member_reply)                                \
+_(BOND_DETACH_MEMBER_REPLY, bond_detach_member_reply)                  \
 _(SW_INTERFACE_SET_BOND_WEIGHT_REPLY, sw_interface_set_bond_weight_reply) \
-_(SW_INTERFACE_BOND_DETAILS, sw_interface_bond_details)                 \
-_(SW_INTERFACE_SLAVE_DETAILS, sw_interface_slave_details)               \
+_(SW_BOND_INTERFACE_DETAILS, sw_bond_interface_details)                 \
+_(SW_MEMBER_INTERFACE_DETAILS, sw_member_interface_details)               \
 _(IP_ROUTE_ADD_DEL_REPLY, ip_route_add_del_reply)                      \
 _(IP_TABLE_ADD_DEL_REPLY, ip_table_add_del_reply)                      \
 _(IP_TABLE_REPLACE_BEGIN_REPLY, ip_table_replace_begin_reply)           \
@@ -5425,6 +5512,7 @@ _(GET_NEXT_INDEX_REPLY, get_next_index_reply)                           \
 _(PG_CREATE_INTERFACE_REPLY, pg_create_interface_reply)                 \
 _(PG_CAPTURE_REPLY, pg_capture_reply)                                   \
 _(PG_ENABLE_DISABLE_REPLY, pg_enable_disable_reply)                     \
+_(PG_INTERFACE_ENABLE_DISABLE_COALESCE_REPLY, pg_interface_enable_disable_coalesce_reply) \
 _(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL_REPLY,                         \
  ip_source_and_port_range_check_add_del_reply)                          \
 _(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL_REPLY,               \
@@ -5451,7 +5539,8 @@ _(SESSION_RULE_ADD_DEL_REPLY, session_rule_add_del_reply)         \
 _(SESSION_RULES_DETAILS, session_rules_details)                                \
 _(IP_CONTAINER_PROXY_ADD_DEL_REPLY, ip_container_proxy_add_del_reply)  \
 _(OUTPUT_ACL_SET_INTERFACE_REPLY, output_acl_set_interface_reply)       \
-_(QOS_RECORD_ENABLE_DISABLE_REPLY, qos_record_enable_disable_reply)
+_(QOS_RECORD_ENABLE_DISABLE_REPLY, qos_record_enable_disable_reply)            \
+_(FLOW_ADD_REPLY, flow_add_reply)   \
 
 #define foreach_standalone_reply_msg                                   \
 _(SW_INTERFACE_EVENT, sw_interface_event)
@@ -7360,15 +7449,23 @@ api_tap_create_v2 (vat_main_t * vam)
       else if (unformat (i, "host-mtu-size %u", &host_mtu_size))
        host_mtu_set = 1;
       else if (unformat (i, "no-gso"))
-       tap_flags &= ~TAP_FLAG_GSO;
+       tap_flags &= ~TAP_API_FLAG_GSO;
       else if (unformat (i, "gso"))
-       tap_flags |= TAP_FLAG_GSO;
+       tap_flags |= TAP_API_FLAG_GSO;
       else if (unformat (i, "csum-offload"))
-       tap_flags |= TAP_FLAG_CSUM_OFFLOAD;
+       tap_flags |= TAP_API_FLAG_CSUM_OFFLOAD;
       else if (unformat (i, "persist"))
-       tap_flags |= TAP_FLAG_PERSIST;
+       tap_flags |= TAP_API_FLAG_PERSIST;
       else if (unformat (i, "attach"))
-       tap_flags |= TAP_FLAG_ATTACH;
+       tap_flags |= TAP_API_FLAG_ATTACH;
+      else if (unformat (i, "tun"))
+       tap_flags |= TAP_API_FLAG_TUN;
+      else if (unformat (i, "gro-coalesce"))
+       tap_flags |= TAP_API_FLAG_GRO_COALESCE;
+      else if (unformat (i, "packed"))
+       tap_flags |= TAP_API_FLAG_PACKED;
+      else if (unformat (i, "in-order"))
+       tap_flags |= TAP_API_FLAG_IN_ORDER;
       else
        break;
     }
@@ -7538,16 +7635,15 @@ unformat_vlib_pci_addr (unformat_input_t * input, va_list * args)
 }
 
 static int
-api_virtio_pci_create (vat_main_t * vam)
+api_virtio_pci_create_v2 (vat_main_t * vam)
 {
   unformat_input_t *i = vam->input;
-  vl_api_virtio_pci_create_t *mp;
+  vl_api_virtio_pci_create_v2_t *mp;
   u8 mac_address[6];
   u8 random_mac = 1;
-  u8 gso_enabled = 0;
-  u8 checksum_offload_enabled = 0;
   u32 pci_addr = 0;
   u64 features = (u64) ~ (0ULL);
+  u32 virtio_flags = 0;
   int ret;
 
   clib_memset (mac_address, 0, sizeof (mac_address));
@@ -7564,9 +7660,15 @@ api_virtio_pci_create (vat_main_t * vam)
       else if (unformat (i, "features 0x%llx", &features))
        ;
       else if (unformat (i, "gso-enabled"))
-       gso_enabled = 1;
+       virtio_flags |= VIRTIO_API_FLAG_GSO;
       else if (unformat (i, "csum-offload-enabled"))
-       checksum_offload_enabled = 1;
+       virtio_flags |= VIRTIO_API_FLAG_CSUM_OFFLOAD;
+      else if (unformat (i, "gro-coalesce"))
+       virtio_flags |= VIRTIO_API_FLAG_GRO_COALESCE;
+      else if (unformat (i, "packed"))
+       virtio_flags |= VIRTIO_API_FLAG_PACKED;
+      else if (unformat (i, "in-order"))
+       virtio_flags |= VIRTIO_API_FLAG_IN_ORDER;
       else
        break;
     }
@@ -7578,7 +7680,7 @@ api_virtio_pci_create (vat_main_t * vam)
     }
 
   /* Construct the API message */
-  M (VIRTIO_PCI_CREATE, mp);
+  M (VIRTIO_PCI_CREATE_V2, mp);
 
   mp->use_random_mac = random_mac;
 
@@ -7588,8 +7690,7 @@ api_virtio_pci_create (vat_main_t * vam)
   mp->pci_addr.function = ((vlib_pci_addr_t) pci_addr).function;
 
   mp->features = clib_host_to_net_u64 (features);
-  mp->gso_enabled = gso_enabled;
-  mp->checksum_offload_enabled = checksum_offload_enabled;
+  mp->virtio_flags = clib_host_to_net_u32 (virtio_flags);
 
   if (random_mac == 0)
     clib_memcpy (mp->mac_address, mac_address, 6);
@@ -7704,6 +7805,73 @@ api_bond_create (vat_main_t * vam)
   return ret;
 }
 
+static int
+api_bond_create2 (vat_main_t * vam)
+{
+  unformat_input_t *i = vam->input;
+  vl_api_bond_create2_t *mp;
+  u8 mac_address[6];
+  u8 custom_mac = 0;
+  int ret;
+  u8 mode;
+  u8 lb;
+  u8 mode_is_set = 0;
+  u32 id = ~0;
+  u8 numa_only = 0;
+  u8 gso = 0;
+
+  clib_memset (mac_address, 0, sizeof (mac_address));
+  lb = BOND_LB_L2;
+
+  /* Parse args required to build the message */
+  while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (i, "mode %U", unformat_bond_mode, &mode))
+       mode_is_set = 1;
+      else if (((mode == BOND_MODE_LACP) || (mode == BOND_MODE_XOR))
+              && unformat (i, "lb %U", unformat_bond_load_balance, &lb))
+       ;
+      else if (unformat (i, "hw-addr %U", unformat_ethernet_address,
+                        mac_address))
+       custom_mac = 1;
+      else if (unformat (i, "numa-only"))
+       numa_only = 1;
+      else if (unformat (i, "gso"))
+       gso = 1;
+      else if (unformat (i, "id %u", &id))
+       ;
+      else
+       break;
+    }
+
+  if (mode_is_set == 0)
+    {
+      errmsg ("Missing bond mode. ");
+      return -99;
+    }
+
+  /* Construct the API message */
+  M (BOND_CREATE2, mp);
+
+  mp->use_custom_mac = custom_mac;
+
+  mp->mode = htonl (mode);
+  mp->lb = htonl (lb);
+  mp->id = htonl (id);
+  mp->numa_only = numa_only;
+  mp->enable_gso = gso;
+
+  if (custom_mac)
+    clib_memcpy (mp->mac_address, mac_address, 6);
+
+  /* send it... */
+  S (mp);
+
+  /* Wait for a reply... */
+  W (ret);
+  return ret;
+}
+
 static int
 api_bond_delete (vat_main_t * vam)
 {
@@ -7744,10 +7912,10 @@ api_bond_delete (vat_main_t * vam)
 }
 
 static int
-api_bond_enslave (vat_main_t * vam)
+api_bond_add_member (vat_main_t * vam)
 {
   unformat_input_t *i = vam->input;
-  vl_api_bond_enslave_t *mp;
+  vl_api_bond_add_member_t *mp;
   u32 bond_sw_if_index;
   int ret;
   u8 is_passive;
@@ -7778,12 +7946,12 @@ api_bond_enslave (vat_main_t * vam)
     }
   if (sw_if_index_is_set == 0)
     {
-      errmsg ("Missing slave sw_if_index. ");
+      errmsg ("Missing member sw_if_index. ");
       return -99;
     }
 
   /* Construct the API message */
-  M (BOND_ENSLAVE, mp);
+  M (BOND_ADD_MEMBER, mp);
 
   mp->bond_sw_if_index = ntohl (bond_sw_if_index);
   mp->sw_if_index = ntohl (sw_if_index);
@@ -7799,10 +7967,10 @@ api_bond_enslave (vat_main_t * vam)
 }
 
 static int
-api_bond_detach_slave (vat_main_t * vam)
+api_bond_detach_member (vat_main_t * vam)
 {
   unformat_input_t *i = vam->input;
-  vl_api_bond_detach_slave_t *mp;
+  vl_api_bond_detach_member_t *mp;
   u32 sw_if_index = ~0;
   u8 sw_if_index_set = 0;
   int ret;
@@ -7825,7 +7993,7 @@ api_bond_detach_slave (vat_main_t * vam)
     }
 
   /* Construct the API message */
-  M (BOND_DETACH_SLAVE, mp);
+  M (BOND_DETACH_MEMBER, mp);
 
   mp->sw_if_index = ntohl (sw_if_index);
 
@@ -12671,15 +12839,28 @@ static void vl_api_sw_interface_vhost_user_details_t_handler_json
 static int
 api_sw_interface_vhost_user_dump (vat_main_t * vam)
 {
+  unformat_input_t *i = vam->input;
   vl_api_sw_interface_vhost_user_dump_t *mp;
   vl_api_control_ping_t *mp_ping;
   int ret;
+  u32 sw_if_index = ~0;
+
+  while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (i, "%U", api_unformat_sw_if_index, vam, &sw_if_index))
+       ;
+      else if (unformat (i, "sw_if_index %d", &sw_if_index))
+       ;
+      else
+       break;
+    }
+
   print (vam->ofp,
         "Interface name            idx hdr_sz features server regions filename");
 
   /* Get list of vhost-user interfaces */
   M (SW_INTERFACE_VHOST_USER_DUMP, mp);
-  mp->sw_if_index = ntohl (~0);
+  mp->sw_if_index = ntohl (sw_if_index);
   S (mp);
 
   /* Use a control ping for synchronization */
@@ -18590,6 +18771,44 @@ api_pg_enable_disable (vat_main_t * vam)
   return ret;
 }
 
+int
+api_pg_interface_enable_disable_coalesce (vat_main_t * vam)
+{
+  unformat_input_t *input = vam->input;
+  vl_api_pg_interface_enable_disable_coalesce_t *mp;
+
+  u32 sw_if_index = ~0;
+  u8 enable = 1;
+  int ret;
+  while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (input, "%U", api_unformat_sw_if_index, vam, &sw_if_index))
+       ;
+      else if (unformat (input, "sw_if_index %d", &sw_if_index))
+       ;
+      else if (unformat (input, "disable"))
+       enable = 0;
+      else
+       break;
+    }
+
+  if (sw_if_index == ~0)
+    {
+      errmsg ("Interface required but not specified");
+      return -99;
+    }
+
+  /* Construct the API message */
+  M (PG_INTERFACE_ENABLE_DISABLE_COALESCE, mp);
+  mp->context = 0;
+  mp->coalesce_enabled = enable;
+  mp->sw_if_index = htonl (sw_if_index);
+
+  S (mp);
+  W (ret);
+  return ret;
+}
+
 int
 api_ip_source_and_port_range_check_add_del (vat_main_t * vam)
 {
@@ -20587,12 +20806,12 @@ _(l2_flags,                                                             \
 _(bridge_flags,                                                         \
   "bd_id <bridge-domain-id> [learn] [forward] [uu-flood] [flood] [arp-term] [disable]\n") \
 _(tap_create_v2,                                                        \
-  "id <num> [hw-addr <mac-addr>] [host-if-name <name>] [host-ns <name>] [num-rx-queues <num>] [rx-ring-size <num>] [tx-ring-size <num>] [host-bridge <name>] [host-mac-addr <mac-addr>] [host-ip4-addr <ip4addr/mask>] [host-ip6-addr <ip6addr/mask>] [host-mtu-size <mtu>] [gso | no-gso | csum-offload] [persist] [attach]") \
+  "id <num> [hw-addr <mac-addr>] [host-if-name <name>] [host-ns <name>] [num-rx-queues <num>] [rx-ring-size <num>] [tx-ring-size <num>] [host-bridge <name>] [host-mac-addr <mac-addr>] [host-ip4-addr <ip4addr/mask>] [host-ip6-addr <ip6addr/mask>] [host-mtu-size <mtu>] [gso | no-gso | csum-offload | gro-coalesce] [persist] [attach] [tun] [packed] [in-order]") \
 _(tap_delete_v2,                                                        \
   "<vpp-if-name> | sw_if_index <id>")                                   \
 _(sw_interface_tap_v2_dump, "")                                         \
-_(virtio_pci_create,                                                    \
-  "pci-addr <pci-address> [use_random_mac | hw-addr <mac-addr>] [features <hex-value>] [gso-enabled | csum-offload-enabled]") \
+_(virtio_pci_create_v2,                                                    \
+  "pci-addr <pci-address> [use_random_mac | hw-addr <mac-addr>] [features <hex-value>] [gso-enabled [gro-coalesce] | csum-offload-enabled] [packed] [in-order]") \
 _(virtio_pci_delete,                                                    \
   "<vpp-if-name> | sw_if_index <id>")                                   \
 _(sw_interface_virtio_pci_dump, "")                                     \
@@ -20600,15 +20819,19 @@ _(bond_create,                                                          \
   "[hw-addr <mac-addr>] {round-robin | active-backup | "                \
   "broadcast | {lacp | xor} [load-balance { l2 | l23 | l34 }]} "        \
   "[id <if-id>]")                                                      \
+_(bond_create2,                                                         \
+  "[hw-addr <mac-addr>] {mode round-robin | active-backup | "           \
+  "broadcast | {lacp | xor} [load-balance { l2 | l23 | l34 }]} "        \
+  "[id <if-id>] [gso]")                                                        \
 _(bond_delete,                                                          \
   "<vpp-if-name> | sw_if_index <id>")                                   \
-_(bond_enslave,                                                         \
+_(bond_add_member,                                                      \
   "sw_if_index <n> bond <sw_if_index> [is_passive] [is_long_timeout]")  \
-_(bond_detach_slave,                                                    \
+_(bond_detach_member,                                                   \
   "sw_if_index <n>")                                                   \
  _(sw_interface_set_bond_weight, "<intfc> | sw_if_index <nn> weight <value>") \
-_(sw_interface_bond_dump, "")                                           \
-_(sw_interface_slave_dump,                                              \
+ _(sw_bond_interface_dump, "<intfc> | sw_if_index <nn>")               \
+ _(sw_member_interface_dump,                                           \
   "<vpp-if-name> | sw_if_index <id>")                                   \
 _(ip_table_add_del,                                                     \
   "table <n> [ipv6] [add | del]\n")                                     \
@@ -20725,7 +20948,7 @@ _(modify_vhost_user_if,                                                 \
         "<intfc> | sw_if_index <nn> socket <filename>\n"                \
         "[server] [renumber <dev_instance>] [gso] [packed]")            \
 _(delete_vhost_user_if, "<intfc> | sw_if_index <nn>")                   \
-_(sw_interface_vhost_user_dump, "")                                     \
+_(sw_interface_vhost_user_dump, "<intfc> | sw_if_index <nn>")           \
 _(show_version, "")                                                     \
 _(show_threads, "")                                                     \
 _(vxlan_gpe_add_del_tunnel,                                             \
@@ -20925,6 +21148,7 @@ _(get_next_index, "node-name <node-name> next-node-name <node-name>")   \
 _(pg_create_interface, "if_id <nn> [gso-enabled gso-size <size>]")      \
 _(pg_capture, "if_id <nnn> pcap <file_name> count <nnn> [disable]")     \
 _(pg_enable_disable, "[stream <id>] disable")                           \
+_(pg_interface_enable_disable_coalesce, "<intf> | sw_if_index <nn> enable | disable")  \
 _(ip_source_and_port_range_check_add_del,                               \
   "<ip-addr>/<mask> range <nn>-<nn> vrf <id>")                          \
 _(ip_source_and_port_range_check_interface_add_del,                     \