Message ID | 20230201163100.1001180-3-vladbu@nvidia.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 0eb5acb16418898c3d813e2c2d59a7ea7763a824 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Allow offloading of UDP NEW connections via act_ct | expand |
diff --git a/net/netfilter/nf_flow_table_core.c b/net/netfilter/nf_flow_table_core.c index 81c26a96c30b..04bd0ed4d2ae 100644 --- a/net/netfilter/nf_flow_table_core.c +++ b/net/netfilter/nf_flow_table_core.c @@ -193,8 +193,11 @@ static void flow_offload_fixup_ct(struct nf_conn *ct) timeout -= tn->offload_timeout; } else if (l4num == IPPROTO_UDP) { struct nf_udp_net *tn = nf_udp_pernet(net); + enum udp_conntrack state = + test_bit(IPS_SEEN_REPLY_BIT, &ct->status) ? + UDP_CT_REPLIED : UDP_CT_UNREPLIED; - timeout = tn->timeouts[UDP_CT_REPLIED]; + timeout = tn->timeouts[state]; timeout -= tn->offload_timeout; } else { return;
Currently flow_offload_fixup_ct() function assumes that only replied UDP connections can be offloaded and hardcodes UDP_CT_REPLIED timeout value. To enable UDP NEW connection offload in following patches extract the actual connections state from ct->status and set the timeout according to it. Signed-off-by: Vlad Buslov <vladbu@nvidia.com> --- Notes: Changes V5 -> V6: - Revert the patch to V2 version. Pablo is going to fix the issue of netfilter's flow table not updating ct->status flags. Changes V3 -> V4: - Rework the patch to decouple netfilter and act_ct timeout fixup algorithms. net/netfilter/nf_flow_table_core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)