Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Broadcom
bcmlinux
Commits
d79515d2
Commit
d79515d2
authored
Oct 20, 2021
by
Anas Sayed
Committed by
Roman Azarenko
Oct 21, 2021
Browse files
Add flowtable flows de-acceleration procfs option
parent
1d9616c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
net/netfilter/xt_FLOWOFFLOAD.c
View file @
d79515d2
...
...
@@ -14,6 +14,7 @@
#include <net/netfilter/nf_conntrack_extend.h>
#include <net/netfilter/nf_conntrack_helper.h>
#include <net/netfilter/nf_flow_table.h>
#include <linux/proc_fs.h>
static
struct
nf_flowtable
nf_flowtable
;
static
HLIST_HEAD
(
hooks
);
...
...
@@ -392,10 +393,40 @@ static struct notifier_block flow_offload_netdev_notifier = {
.
notifier_call
=
flow_offload_netdev_event
,
};
static
struct
proc_dir_entry
*
procfs_subdir_entry
;
static
ssize_t
procfs_callback
(
struct
file
*
f
,
const
char
__user
*
u
,
size_t
count
,
loff_t
*
p
)
{
nf_flow_table_cleanup
(
NULL
,
NULL
);
return
count
;
}
#define PROC_SUBDIR "nf-flow-table-control"
#define PROC_ACTION "clear"
static
void
register_flow_table_ctrl
(
void
)
{
static
struct
file_operations
ops
=
{
.
owner
=
THIS_MODULE
,
.
write
=
procfs_callback
};
procfs_subdir_entry
=
proc_mkdir
(
PROC_SUBDIR
,
NULL
);
proc_create
(
PROC_ACTION
,
0220
,
procfs_subdir_entry
,
&
ops
);
}
static
void
unregister_flow_table_ctrl
(
void
)
{
remove_proc_entry
(
PROC_ACTION
,
procfs_subdir_entry
);
remove_proc_entry
(
PROC_SUBDIR
,
NULL
);
}
static
int
__init
xt_flowoffload_tg_init
(
void
)
{
int
ret
;
register_flow_table_ctrl
();
register_netdevice_notifier
(
&
flow_offload_netdev_notifier
);
INIT_DELAYED_WORK
(
&
hook_work
,
xt_flowoffload_hook_work
);
...
...
@@ -415,6 +446,7 @@ static void __exit xt_flowoffload_tg_exit(void)
{
xt_unregister_target
(
&
offload_tg_reg
);
xt_flowoffload_table_cleanup
(
&
nf_flowtable
);
unregister_flow_table_ctrl
();
unregister_netdevice_notifier
(
&
flow_offload_netdev_notifier
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment