Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bcmlinux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Broadcom
bcmlinux
Commits
d79515d2
Commit
d79515d2
authored
3 years ago
by
Anas Sayed
Committed by
Roman Azarenko
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add flowtable flows de-acceleration procfs option
parent
1d9616c1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
net/netfilter/xt_FLOWOFFLOAD.c
+32
-0
32 additions, 0 deletions
net/netfilter/xt_FLOWOFFLOAD.c
with
32 additions
and
0 deletions
net/netfilter/xt_FLOWOFFLOAD.c
+
32
−
0
View file @
d79515d2
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
#include
<net/netfilter/nf_conntrack_extend.h>
#include
<net/netfilter/nf_conntrack_extend.h>
#include
<net/netfilter/nf_conntrack_helper.h>
#include
<net/netfilter/nf_conntrack_helper.h>
#include
<net/netfilter/nf_flow_table.h>
#include
<net/netfilter/nf_flow_table.h>
#include
<linux/proc_fs.h>
static
struct
nf_flowtable
nf_flowtable
;
static
struct
nf_flowtable
nf_flowtable
;
static
HLIST_HEAD
(
hooks
);
static
HLIST_HEAD
(
hooks
);
...
@@ -392,10 +393,40 @@ static struct notifier_block flow_offload_netdev_notifier = {
...
@@ -392,10 +393,40 @@ static struct notifier_block flow_offload_netdev_notifier = {
.
notifier_call
=
flow_offload_netdev_event
,
.
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
)
static
int
__init
xt_flowoffload_tg_init
(
void
)
{
{
int
ret
;
int
ret
;
register_flow_table_ctrl
();
register_netdevice_notifier
(
&
flow_offload_netdev_notifier
);
register_netdevice_notifier
(
&
flow_offload_netdev_notifier
);
INIT_DELAYED_WORK
(
&
hook_work
,
xt_flowoffload_hook_work
);
INIT_DELAYED_WORK
(
&
hook_work
,
xt_flowoffload_hook_work
);
...
@@ -415,6 +446,7 @@ static void __exit xt_flowoffload_tg_exit(void)
...
@@ -415,6 +446,7 @@ static void __exit xt_flowoffload_tg_exit(void)
{
{
xt_unregister_target
(
&
offload_tg_reg
);
xt_unregister_target
(
&
offload_tg_reg
);
xt_flowoffload_table_cleanup
(
&
nf_flowtable
);
xt_flowoffload_table_cleanup
(
&
nf_flowtable
);
unregister_flow_table_ctrl
();
unregister_netdevice_notifier
(
&
flow_offload_netdev_notifier
);
unregister_netdevice_notifier
(
&
flow_offload_netdev_notifier
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment