diff options
author | Monendra Singh Kushwaha <kmonendra@marvell.com> | 2024-02-06 14:02:43 +0530 |
---|---|---|
committer | Damjan Marion <dmarion@0xa5.net> | 2024-02-27 15:37:20 +0000 |
commit | 4af3fdfdd0a0c2993c80eda6faef6a782111277c (patch) | |
tree | 7d19c7694465da3000efa86f95352fedd1658975 /src/vnet/dev/error.c | |
parent | 4e32bc6b6d4dcbaaca67f4e90d9e0cdfea73e344 (diff) |
dev: add per-port vnet flow
Type: feature
Change-Id: If63f39211288ab2eba8bc1ab50a2a4c7755abc66
Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
Diffstat (limited to 'src/vnet/dev/error.c')
-rw-r--r-- | src/vnet/dev/error.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/vnet/dev/error.c b/src/vnet/dev/error.c index df9c6d364e7..4e057010af0 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 @@ vnet_dev_port_err (vlib_main_t *vm, vnet_dev_port_t *port, vnet_dev_rv_t rv, 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; +} |