From 35b3e74a184b709b8ddfaaa094919a656a6ec059 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 5 Apr 2018 14:44:40 +0200 Subject: [PATCH] defaults: add support for setting --hw on the xt_FLOWOFFLOAD rule Enables hardware offload support where supported Signed-off-by: Felix Fietkau --- defaults.c | 3 +++ options.h | 1 + 2 files changed, 4 insertions(+) diff --git a/defaults.c b/defaults.c index 81f439e..11fbf0d 100644 --- a/defaults.c +++ b/defaults.c @@ -58,6 +58,7 @@ const struct fw3_option fw3_flag_opts[] = { FW3_OPT("custom_chains", bool, defaults, custom_chains), FW3_OPT("disable_ipv6", bool, defaults, disable_ipv6), FW3_OPT("flow_offloading", bool, defaults, flow_offloading), + FW3_OPT("flow_offloading_hw", bool, defaults, flow_offloading_hw), FW3_OPT("__flags_v4", int, defaults, flags[0]), FW3_OPT("__flags_v6", int, defaults, flags[1]), @@ -236,6 +237,8 @@ fw3_print_default_head_rules(struct fw3_ipt_handle *handle, fw3_ipt_rule_comment(r, "Traffic offloading"); fw3_ipt_rule_extra(r, "-m conntrack --ctstate RELATED,ESTABLISHED"); fw3_ipt_rule_target(r, "FLOWOFFLOAD"); + if (defs->flow_offloading_hw) + fw3_ipt_rule_addarg(r, false, "--hw", NULL); fw3_ipt_rule_append(r, "FORWARD"); } diff --git a/options.h b/options.h index dcce644..15cd504 100644 --- a/options.h +++ b/options.h @@ -290,6 +290,7 @@ struct fw3_defaults bool custom_chains; bool auto_helper; bool flow_offloading; + bool flow_offloading_hw; bool disable_ipv6; -- 2.25.1