From b7e2f3d312927f2a8f1b2c8030b2e8ffe3288bab Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Tue, 8 Nov 2016 16:47:34 -0500 Subject: Update sample plugin and plugin skeletons: use driver feature arc Change-Id: Ic0a1479e4a0408a4b93f47e50752d07c2bdccdde Signed-off-by: Dave Barach --- build-root/emacs-lisp/plugin-main-skel.el | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'build-root/emacs-lisp/plugin-main-skel.el') diff --git a/build-root/emacs-lisp/plugin-main-skel.el b/build-root/emacs-lisp/plugin-main-skel.el index 0c9cd512e60..196f8653817 100644 --- a/build-root/emacs-lisp/plugin-main-skel.el +++ b/build-root/emacs-lisp/plugin-main-skel.el @@ -127,8 +127,7 @@ int " plugin-name "_enable_disable (" plugin-name "_main_t * sm, u32 sw_if_index int enable_disable) { vnet_sw_interface_t * sw; - int rv; - u32 node_index = enable_disable ? " plugin-name "_node.index : ~0; + int rv = 0; /* Utterly wrong? */ if (pool_is_free_index (sm->vnet_main->interface_main.sw_interfaces, @@ -140,15 +139,9 @@ int " plugin-name "_enable_disable (" plugin-name "_main_t * sm, u32 sw_if_index if (sw->type != VNET_SW_INTERFACE_TYPE_HARDWARE) return VNET_API_ERROR_INVALID_SW_IF_INDEX; - /* - * Redirect pkts from the driver to the macswap node. - * Returns VNET_API_ERROR_UNIMPLEMENTED if the h/w driver - * doesn't implement the API. - * - * Node_index = ~0 => shut off redirection - */ - rv = vnet_hw_interface_rx_redirect_to_node (sm->vnet_main, sw_if_index, - node_index); + vnet_feature_enable_disable (\"device-input\", \"" plugin-name "\", + sw_if_index, enable_disable, 0, 0); + return rv; } @@ -258,5 +251,12 @@ static clib_error_t * " plugin-name "_init (vlib_main_t * vm) } VLIB_INIT_FUNCTION (" plugin-name "_init); + +VNET_FEATURE_INIT (" plugin-name ", static) = +{ + .arc_name = \"device-input\", + .node_name = \"" plugin-name "\", + .runs_before = VNET_FEATURES (\"ethernet-input\"), +}; ") -- cgit 1.2.3-korg