Thread (28 messages) 28 messages, 4 authors, 2021-05-21

Re: [PATCH bpf-next 09/11] bpfilter: Add struct table

From: Song Liu <hidden>
Date: 2021-05-20 18:07:24
Also in: netdev

On May 17, 2021, at 3:53 PM, Dmitrii Banshchikov [off-list ref] wrote:

A table keeps iptables' blob and an array of struct rule for this blob.
The array of rules provides more convenient way to interact with blob's
entries.

All tables are stored in table_ops_map map which is used for lookups.
Also all tables are linked into a list that is used for freeing them.

Signed-off-by: Dmitrii Banshchikov <redacted>
[...]

quoted hunk ↗ jump to hunk
diff --git a/net/bpfilter/context.h b/net/bpfilter/context.h
index c62c1ba4781c..2d9e3fafb0f8 100644
--- a/net/bpfilter/context.h
+++ b/net/bpfilter/context.h
@@ -10,12 +10,15 @@
#include "match-ops-map.h"
#include "target-ops-map.h"
+#include "table-map.h"

struct context {
	FILE *log_file;
	int log_level;
	struct match_ops_map match_ops_map;
	struct target_ops_map target_ops_map;
+	struct table_map table_map;
+	struct list_head table_list;
How about we add table_list to struct table_map (and maybe rename it)?
I suspect that will make the code a little cleaner. 

Thanks,
Song

[...]

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help