vlib: add description field in plugin registration 24/5824/2
authorDamjan Marion <damarion@cisco.com>
Wed, 22 Mar 2017 10:08:39 +0000 (11:08 +0100)
committerOle Trøan <otroan@employees.org>
Wed, 22 Mar 2017 13:43:14 +0000 (13:43 +0000)
Change-Id: I88b322a5d602f3d6d3310e971479180a89430e0e
Signed-off-by: Damjan Marion <damarion@cisco.com>
12 files changed:
src/examples/sample-plugin/sample/sample.c
src/plugins/acl/acl.c
src/plugins/dpdk/main.c
src/plugins/flowperpkt/flowperpkt.c
src/plugins/ila/ila.c
src/plugins/ioam/encap/ip6_ioam_trace.c
src/plugins/ixge/ixge.c
src/plugins/lb/lb.c
src/plugins/sixrd/sixrd.c
src/plugins/snat/snat.c
src/vlib/unix/plugin.c
src/vlib/unix/plugin.h

index 0185274..2f8ac4c 100644 (file)
@@ -61,6 +61,7 @@ _(SAMPLE_MACSWAP_ENABLE_DISABLE, sample_macswap_enable_disable)
 /* *INDENT-OFF* */
 VLIB_PLUGIN_REGISTER () = {
     .version = SAMPLE_PLUGIN_BUILD_VER,
+    .description = "Sample of VPP Plugin",
 };
 /* *INDENT-ON* */
 
index 476fbc3..4a4dd43 100644 (file)
@@ -80,6 +80,7 @@ _(MACIP_ACL_INTERFACE_GET, macip_acl_interface_get)
 /* *INDENT-OFF* */
 VLIB_PLUGIN_REGISTER () = {
     .version = VPP_BUILD_VER,
+    .description = "Access Control Lists",
 };
 /* *INDENT-ON* */
 
index 8073a50..7ee2a78 100644 (file)
@@ -91,5 +91,6 @@ VLIB_INIT_FUNCTION (dpdk_main_init);
 /* *INDENT-OFF* */
 VLIB_PLUGIN_REGISTER () = {
     .version = VPP_BUILD_VER,
+    .description = "Data Plane Development Kit (DPDK)",
 };
 /* *INDENT-ON* */
index 587972f..3e5fc8b 100644 (file)
@@ -448,6 +448,7 @@ _(FLOWPERPKT_TX_INTERFACE_ADD_DEL, flowperpkt_tx_interface_add_del)
 /* *INDENT-OFF* */
 VLIB_PLUGIN_REGISTER () = {
     .version = VPP_BUILD_VER,
+    .description = "Flow per Packet",
 };
 /* *INDENT-ON* */
 
index 52c7ea5..edbf301 100644 (file)
@@ -825,6 +825,7 @@ ila_interface (u32 sw_if_index, u8 disable)
 /* *INDENT-OFF* */
 VLIB_PLUGIN_REGISTER () = {
     .version = VPP_BUILD_VER,
+    .description = "Identifier-locator addressing for IPv6",
 };
 /* *INDENT-ON* */
 
index 57d3ec5..299ee88 100644 (file)
@@ -411,6 +411,7 @@ VLIB_CLI_COMMAND (ip6_show_ioam_trace_cmd, static) = {
 /* *INDENT-OFF* */
 VLIB_PLUGIN_REGISTER () = {
     .version = VPP_BUILD_VER,
+    .description = "Inbound OAM",
 };
 /* *INDENT-ON* */
 
index 4eebc45..f3c5cc0 100644 (file)
@@ -2935,6 +2935,7 @@ ixge_set_next_node (ixge_rx_next_t next, char *name)
 VLIB_PLUGIN_REGISTER () = {
     .version = VPP_BUILD_VER,
     .default_disabled = 1,
+    .description = "Intel 82599 Family Native Driver (experimental)",
 };
 
 /* *INDENT-ON* */
index dc3f5be..add8123 100644 (file)
@@ -734,6 +734,7 @@ int lb_vip_del(u32 vip_index)
 /* *INDENT-OFF* */
 VLIB_PLUGIN_REGISTER () = {
     .version = VPP_BUILD_VER,
+    .description = "Load Balancer",
 };
 /* *INDENT-ON* */
 
index 67a9a3a..9838752 100644 (file)
@@ -356,8 +356,9 @@ VLIB_CLI_COMMAND(show_sixrd_stats_command, static) = {
 };
 
 /* *INDENT-OFF* */
-VLIB_PLUGIN_REGISTER () = {
+VLIB_PLUGIN_REGISTER () ={
     .version = VPP_BUILD_VER,
+    .description = "IPv6 Rapid Deployment on IPv4 Infrastructure (RFC5969)",
 };
 /* *INDENT-ON* */
 
index d42303f..70b6a6e 100644 (file)
@@ -107,6 +107,7 @@ VNET_FEATURE_INIT (ip4_snat_out2in_fast, static) = {
 /* *INDENT-OFF* */
 VLIB_PLUGIN_REGISTER () = {
     .version = VPP_BUILD_VER,
+    .description = "Network Address Translation",
 };
 /* *INDENT-ON* */
 
index e9846e3..9b341cc 100644 (file)
@@ -105,13 +105,13 @@ load_one_plugin (plugin_main_t * pm, plugin_info_t * pi, int from_early_init)
        }
       if (reg->default_disabled && pc->is_enabled == 0)
        {
-         clib_warning ("Plugin disabled: %s (default)", pi->name);
+         clib_warning ("Plugin disabled (default): %s", pi->name);
          goto error;
        }
     }
   else if (reg->default_disabled)
     {
-      clib_warning ("Plugin disabled: %s (default)", pi->name);
+      clib_warning ("Plugin disabled (default): %s", pi->name);
       goto error;
     }
 
@@ -184,7 +184,10 @@ load_one_plugin (plugin_main_t * pm, plugin_info_t * pi, int from_early_init)
                      (char *) pi->name, reg->early_init);
     }
 
-  clib_warning ("Loaded plugin: %s", pi->name);
+  if (reg->description)
+    clib_warning ("Loaded plugin: %s (%s)", pi->name, reg->description);
+  else
+    clib_warning ("Loaded plugin: %s", pi->name);
 
   return 0;
 error:
@@ -374,7 +377,7 @@ vlib_plugins_show_cmd_fn (vlib_main_t * vm,
   plugin_info_t *pi;
 
   s = format (s, " Plugin path is: %s\n\n", pm->plugin_path);
-  s = format (s, "     %-41s%s\n", "Plugin", "Version");
+  s = format (s, "     %-41s%-33s%s\n", "Plugin", "Version", "Description");
 
   /* *INDENT-OFF* */
   hash_foreach_mem (key, value, pm->plugin_by_name_hash,
@@ -382,7 +385,8 @@ vlib_plugins_show_cmd_fn (vlib_main_t * vm,
       if (key != 0)
         {
           pi = vec_elt_at_index (pm->plugin_info, value);
-          s = format (s, "%3d. %-40s %s\n", index, key, pi->version);
+          s = format (s, "%3d. %-40s %-32s %s\n", index, key, pi->version,
+                     pi->reg->description ? pi->reg->description : "");
          index++;
         }
     });
index 01fec35..d9801ec 100644 (file)
@@ -62,6 +62,7 @@ typedef CLIB_PACKED(struct {
   const char version[32];
   const char version_required[32];
   const char *early_init;
+  const char *description;
 }) vlib_plugin_registration_t;
 /* *INDENT-ON* */