R&D/DPDK

vpp plugin

sunshout 2017. 7. 5. 21:49

cp -r sample ../../plugins/elb

cp sample.am  ../../plugins/elb.am


add at src/configuration.ac


...

PLUGIN_ENABLED(snat)

PLUGIN_ENABLED(elb)

...



add at src/plugins/Makefile.am


if ENABLE_ELB_PLUGIN
include elb.am
endif



edit at src/plugins/elb.am


# Build

make wipe

make build



# You can see plugins (command: show plugins)


 Plugin path is: /root/dev/vpp/build-root/install-vpp_debug-native/vpp/lib64/vpp_plugins

     Plugin                                   Version                          Description
  1. ioam_plugin.so                           17.10-rc0~24-g99a0e60            Inbound OAM
  2. memif_plugin.so                          17.10-rc0~24-g99a0e60            Packet Memory Interface (experimetal)
  3. sample_plugin.so                         1.0                              ELB of VPP Plugin




name                                next

-------------------------------------------------

flow-report-process      

flowprobe-ip4                   error-drop [0]     
                                         ip4-lookup [1]     

flowprobe-ip6                   error-drop [0]     
                                         ip4-lookup [1]     

flowprobe-l2                    error-drop [0]     
                                        ip4-lookup [1]     

flowprobe-timer-process  


flowprobe-walker


"next" is defined by ".next_nodes"


#define FLOWPROBE_NEXT_NODES {          \
    [FLOWPROBE_NEXT_DROP] = "error-drop",     \
    [FLOWPROBE_NEXT_IP4_LOOKUP] = "ip4-lookup",   \
}


VLIB_REGISTER_NODE (flowprobe_ip4_node) = {
  .function = flowprobe_ip4_node_fn,
  .name = "flowprobe-ip4",
  .vector_size = sizeof (u32),
  .format_trace = format_flowprobe_trace,
  .type = VLIB_NODE_TYPE_INTERNAL,
  .n_errors = ARRAY_LEN(flowprobe_error_strings),
  .error_strings = flowprobe_error_strings,
  .n_next_nodes = FLOWPROBE_N_NEXT,
  .next_nodes = FLOWPROBE_NEXT_NODES,
};




#show feature


interface-output:
  span-output
  interface-tx
  flowprobe-l2



VNET_FEATURE_INIT (flow_perpacket_ip4, static) =
{
  .arc_name = "ip4-output",
  .node_name = "flowprobe-ip4",
  .runs_before = VNET_FEATURES ("interface-output"),
};





loopback create
set int l2 bridge loop0 1 bvi
set int ip address loop0 192.168.2.1/24
set int state loop0 up

tap connect lstack address 192.168.2.2/24 set int l2 bridge tap-0 1 set int state tap-0 up