From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by passt.top (Postfix, from userid 1000) id D4F305A063D; Fri, 31 Jan 2025 20:39:53 +0100 (CET) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH v3 15/20] flow, flow_table: Export declaration of hash table Date: Fri, 31 Jan 2025 20:39:48 +0100 Message-ID: <20250131193953.3034031-16-sbrivio@redhat.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250131193953.3034031-1-sbrivio@redhat.com> References: <20250131193953.3034031-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: IJHFIMT76Y3CCJLUXYTWHWCIJEDIPJMO X-Message-ID-Hash: IJHFIMT76Y3CCJLUXYTWHWCIJEDIPJMO X-MailFrom: sbrivio@passt.top X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Laurent Vivier , David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: We need this to transfer it, so we can throw away this change soon, I guess. Signed-off-by: Stefano Brivio --- flow.c | 6 +----- flow_table.h | 3 +++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/flow.c b/flow.c index e7148b2..5638ff1 100644 --- a/flow.c +++ b/flow.c @@ -110,12 +110,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 a85cab5..633805d 100644 --- a/flow_table.h +++ b/flow_table.h @@ -49,6 +49,9 @@ static_assert(sizeof(union flow) == 128, "union flow should be 128-byte wide"); /* Global Flow Table */ extern unsigned flow_first_free; 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