* limitations under the License.
*/
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <linux/vfio.h>
+#include <sys/ioctl.h>
+
#include <vnet/vnet.h>
#include <vnet/plugin/plugin.h>
#include <dpdk/device/dpdk.h>
* Return 1 if to skip the delay loop because we are suspending
* the calling vlib process instead.
*/
-int
+static int
rte_delay_us_override (unsigned us)
{
vlib_main_t *vm;
* thread then do not intercept. (Must not be called from an
* independent pthread).
*/
- if (os_get_cpu_number () == 0)
+ if (vlib_get_thread_index () == 0)
{
/*
* We're in the vlib main thread or a vlib process. Make sure
/* Only suspend for the admin_down_process */
vlib_process_t *proc = vlib_get_current_process (vm);
if (!(proc->flags & VLIB_PROCESS_IS_RUNNING) ||
- (proc->node_runtime.function != admin_up_down_process))
+ (proc->node_runtime.node_index !=
+ admin_up_down_process_node.index))
return 0;
f64 delay = 1e-6 * us;
static clib_error_t * dpdk_main_init (vlib_main_t * vm)
{
- dpdk_main_t * dm = &dpdk_main;
clib_error_t * error = 0;
- dm->vlib_main = vm;
- dm->vnet_main = vnet_get_main ();
-
- if ((error = vlib_call_init_function (vm, dpdk_init)))
- return error;
-
/* register custom delay function */
rte_delay_us_callback_register (rte_delay_us_override_cb);
return error;
}
-VLIB_INIT_FUNCTION (dpdk_main_init);
-
/* *INDENT-OFF* */
+VLIB_INIT_FUNCTION (dpdk_main_init) =
+{
+ .runs_after = VLIB_INITS("dpdk_init"),
+};
+
VLIB_PLUGIN_REGISTER () = {
.version = VPP_BUILD_VER,
+ .description = "Data Plane Development Kit (DPDK)",
};
/* *INDENT-ON* */