Update API description
[vpp.git] / src / vnet / interface_api.c
index 4cd2ec9..58035fb 100644 (file)
@@ -239,38 +239,38 @@ send_sw_interface_details (vpe_api_main_t * am,
       mp->sub_default = sub->eth.flags.default_sub;
       mp->sub_outer_vlan_id_any = sub->eth.flags.outer_vlan_id_any;
       mp->sub_inner_vlan_id_any = sub->eth.flags.inner_vlan_id_any;
+    }
 
-      /* vlan tag rewrite data */
-      u32 vtr_op = L2_VTR_DISABLED;
-      u32 vtr_push_dot1q = 0, vtr_tag1 = 0, vtr_tag2 = 0;
+  /* vlan tag rewrite data */
+  u32 vtr_op = L2_VTR_DISABLED;
+  u32 vtr_push_dot1q = 0, vtr_tag1 = 0, vtr_tag2 = 0;
 
-      if (l2vtr_get (am->vlib_main, am->vnet_main, swif->sw_if_index,
-                    &vtr_op, &vtr_push_dot1q, &vtr_tag1, &vtr_tag2) != 0)
-       {
-         // error - default to disabled
-         mp->vtr_op = ntohl (L2_VTR_DISABLED);
-         clib_warning ("cannot get vlan tag rewrite for sw_if_index %d",
-                       swif->sw_if_index);
-       }
-      else
-       {
-         mp->vtr_op = ntohl (vtr_op);
-         mp->vtr_push_dot1q = ntohl (vtr_push_dot1q);
-         mp->vtr_tag1 = ntohl (vtr_tag1);
-         mp->vtr_tag2 = ntohl (vtr_tag2);
-       }
+  if (l2vtr_get (am->vlib_main, am->vnet_main, swif->sw_if_index,
+                &vtr_op, &vtr_push_dot1q, &vtr_tag1, &vtr_tag2) != 0)
+    {
+      // error - default to disabled
+      mp->vtr_op = ntohl (L2_VTR_DISABLED);
+      clib_warning ("cannot get vlan tag rewrite for sw_if_index %d",
+                   swif->sw_if_index);
+    }
+  else
+    {
+      mp->vtr_op = ntohl (vtr_op);
+      mp->vtr_push_dot1q = ntohl (vtr_push_dot1q);
+      mp->vtr_tag1 = ntohl (vtr_tag1);
+      mp->vtr_tag2 = ntohl (vtr_tag2);
     }
 
   /* pbb tag rewrite data */
   ethernet_header_t eth_hdr;
-  u32 vtr_op = L2_VTR_DISABLED;
+  u32 pbb_vtr_op = L2_VTR_DISABLED;
   u16 outer_tag = 0;
   u16 b_vlanid = 0;
   u32 i_sid = 0;
   clib_memset (&eth_hdr, 0, sizeof (eth_hdr));
 
   if (!l2pbb_get (am->vlib_main, am->vnet_main, swif->sw_if_index,
-                 &vtr_op, &outer_tag, &eth_hdr, &b_vlanid, &i_sid))
+                 &pbb_vtr_op, &outer_tag, &eth_hdr, &b_vlanid, &i_sid))
     {
       mp->sub_dot1ah = 1;
       clib_memcpy (mp->b_dmac, eth_hdr.dst_address,
@@ -1414,6 +1414,11 @@ interface_api_hookup (vlib_main_t * vm)
   foreach_vpe_api_msg;
 #undef _
 
+  /* Mark these APIs as mp safe */
+  am->is_mp_safe[VL_API_SW_INTERFACE_DUMP] = 1;
+  am->is_mp_safe[VL_API_SW_INTERFACE_DETAILS] = 1;
+  am->is_mp_safe[VL_API_SW_INTERFACE_TAG_ADD_DEL] = 1;
+
   /*
    * Set up the (msg_name, crc, message-id) table
    */