netfilter: flowtable: consolidate unsupported hardware offload check
Subsystems (2)
Pablo Neira Ayuso
maintainerPATCH 1/1 netfilter: flowtable: consolidate unsupported hardware offload check
Move this check to the function that allocates and enqueues the hardware offload work. If hardware does not support it, then turn this into noop.
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- net/netfilter/nf_flow_table_offload.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
net/netfilter/nf_flow_table_offload.c +12 -9
@@ -1079,12 +1079,24 @@ static void flow_offload_queue_work(struct flow_offload_work *offload) } } +static bool nf_flow_offload_unsupported (struct flow_offload *flow) +{ +if (flow->tuplehash[FLOW_OFFLOAD_DIR_ORIGINAL ].tuple.tun_num || + flow->tuplehash[FLOW_OFFLOAD_DIR_REPLY ].tuple.tun_num) +return true; + +return false; +} +static struct flow_offload_work *nf_flow_offload_work_alloc (struct nf_flowtable *flowtable,struct flow_offload *flow,unsigned int cmd) {struct flow_offload_work *offload; +if (nf_flow_offload_unsupported (flow)) +return NULL ; +if (test_and_set_bit (NF_FLOW_PENDING , &flow->flags))return NULL ;
@@ -1102,15 +1114,6 @@ nf_flow_offload_work_alloc(struct nf_flowtable *flowtable,return offload; } -static bool nf_flow_offload_unsupported (struct flow_offload *flow) -{ -if (flow->tuplehash[FLOW_OFFLOAD_DIR_ORIGINAL ].tuple.tun_num || - flow->tuplehash[FLOW_OFFLOAD_DIR_REPLY ].tuple.tun_num) -return true; - -return false; -} -void nf_flow_offload_refresh (struct nf_flowtable *flowtable,struct flow_offload *flow) {
Signature · 1 line
2.47.3