aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/error.h
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2019-11-20 11:20:08 -0800
committerDave Barach <openvpp@barachs.net>2019-11-25 15:05:51 +0000
commit70449b9b9bf8dbe3b4aa4d9af35c759789b03fe1 (patch)
tree13faf049d3007a5a3314e69680bb6f652cb84529 /src/vlib/error.h
parentac0e98a67553747b823d8398896559bb07cafe3d (diff)
vlib: address vlib_error_t scaling issuestable/1901
Encoding the vpp node index into the vlib_error_t as a 10-bit quantity limits us to 1K graph nodes. Unfortunately, a few nodes need 6 bit per-node error codes. Only a very few nodes have so many counters. It turns out that there are about 2K total error counters in the system, which is (approximately) the maximum error heap index. The current (index,code) encoding limits the number of interfaces to around 250, since each interface has two associated graph nodes and we have about 500 "normal, interior" graph node This patch adds an error-index to node-index map, so we can store error heap indices directly in the vlib_buffer_t. Type: refactor Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: Ic2e91a5b344c9df3b98b264cacda246e06092a94
Diffstat (limited to 'src/vlib/error.h')
-rw-r--r--src/vlib/error.h30
1 files changed, 0 insertions, 30 deletions
diff --git a/src/vlib/error.h b/src/vlib/error.h
index 58352519be2..0da3a18d85d 100644
--- a/src/vlib/error.h
+++ b/src/vlib/error.h
@@ -40,38 +40,8 @@
#ifndef included_vlib_error_h
#define included_vlib_error_h
-/* Combined 16 bit node & 16 bit code as 32 bit number. */
typedef u16 vlib_error_t;
-always_inline u32
-vlib_error_get_node (vlib_error_t e)
-{
- return e >> 6;
-}
-
-always_inline u32
-vlib_error_get_code (vlib_error_t e)
-{
- return e & 0x3f;
-}
-
-always_inline vlib_error_t
-vlib_error_set (u32 node_index, u32 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 << 6));
- e |= code;
- return e;
-}
-
typedef struct
{
/* Error counters. */