This can all be thrown away once we stop copying the flow table.
Signed-off-by: Stefano Brivio
---
flow.c | 6 +-----
flow_table.h | 5 ++++-
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/flow.c b/flow.c
index a6fe6d1..3b8dd0e 100644
--- a/flow.c
+++ b/flow.c
@@ -109,12 +109,8 @@ unsigned flow_first_free;
union flow flowtab[FLOW_MAX];
static const union flow *flow_new_entry; /* = NULL */
-/* Hash table to index it */
-#define FLOW_HASH_LOAD 70 /* % */
-#define FLOW_HASH_SIZE ((2 * FLOW_MAX * 100 / FLOW_HASH_LOAD))
-
/* Table for lookup from flowside information */
-static flow_sidx_t flow_hashtab[FLOW_HASH_SIZE];
+flow_sidx_t flow_hashtab[FLOW_HASH_SIZE];
static_assert(ARRAY_SIZE(flow_hashtab) >= 2 * FLOW_MAX,
"Safe linear probing requires hash table with more entries than the number of sides in the flow table");
diff --git a/flow_table.h b/flow_table.h
index eeb6f41..be4f841 100644
--- a/flow_table.h
+++ b/flow_table.h
@@ -41,7 +41,10 @@ union flow {
/* Global Flow Table */
extern unsigned flow_first_free;
-extern union flow flowtab[];
+extern union flow flowtab[FLOW_MAX];
+#define FLOW_HASH_LOAD 70 /* % */
+#define FLOW_HASH_SIZE ((2 * FLOW_MAX * 100 / FLOW_HASH_LOAD))
+extern flow_sidx_t flow_hashtab[FLOW_HASH_SIZE];
/**
* flow_foreach_sidei() - 'for' type macro to step through each side of flow
--
2.43.0