dev: add per-port vnet flow

Type: feature

Change-Id: If63f39211288ab2eba8bc1ab50a2a4c7755abc66
Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
diff --git a/src/vnet/dev/error.c b/src/vnet/dev/error.c
index df9c6d3..4e05701 100644
--- a/src/vnet/dev/error.c
+++ b/src/vnet/dev/error.c
@@ -6,6 +6,7 @@
 #include <vnet/ethernet/ethernet.h>
 #include <vnet/dev/dev.h>
 #include <vnet/dev/counters.h>
+#include <vnet/flow/flow.h>
 
 clib_error_t *
 vnet_dev_port_err (vlib_main_t *vm, vnet_dev_port_t *port, vnet_dev_rv_t rv,
@@ -27,3 +28,27 @@
   vec_free (s);
   return err;
 }
+
+int
+vnet_dev_flow_err (vlib_main_t *vm, vnet_dev_rv_t rv)
+{
+  if (rv == VNET_DEV_OK)
+    return 0;
+
+  switch (rv)
+    {
+      /* clang-format off */
+#define _(n, e, s)                                            \
+    case VNET_DEV_ERR_##e:                                    \
+      return VNET_FLOW_ERROR_##e;
+    foreach_flow_error;
+#undef _
+      /* clang-format on */
+    default:
+      ASSERT (0);
+    }
+
+  ASSERT (0);
+
+  return 0;
+}