diff options
author | Damjan Marion <damarion@cisco.com> | 2018-04-26 22:45:40 +0200 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2018-04-27 11:20:58 +0000 |
commit | aa682a39b76ee043f65313f23e134bf18fe7a47e (patch) | |
tree | 5cd74943911f0a7a9a886e0c309cb18ca1841eb3 /src/vlib/error.h | |
parent | 582caa3bb67a1380c12790ba6f98450b92835761 (diff) |
A bit of buffer metadata reshuffling to accommodate flow_id
Change-Id: I2794384557c6272fe217269b14a9db09eda19220
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/error.h')
-rw-r--r-- | src/vlib/error.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/vlib/error.h b/src/vlib/error.h index df2075c306d..58352519be2 100644 --- a/src/vlib/error.h +++ b/src/vlib/error.h @@ -41,33 +41,33 @@ #define included_vlib_error_h /* Combined 16 bit node & 16 bit code as 32 bit number. */ -typedef u32 vlib_error_t; +typedef u16 vlib_error_t; always_inline u32 vlib_error_get_node (vlib_error_t e) { - return e >> 12; + return e >> 6; } always_inline u32 vlib_error_get_code (vlib_error_t e) { - return e & 0xfff; + return e & 0x3f; } always_inline vlib_error_t vlib_error_set (u32 node_index, u32 code) { - ASSERT (node_index < (1 << 20)); - ASSERT (code < (1 << 12)); - return (node_index << 12) | code; + ASSERT (node_index < (1 << 10)); + ASSERT (code < (1 << 6)); + return (node_index << 6) | code; } always_inline vlib_error_t vlib_error_set_code (vlib_error_t e, u32 code) { ASSERT (vlib_error_get_code (e) == 0); - ASSERT (code < (1 << 12)); + ASSERT (code < (1 << 6)); e |= code; return e; } |