--- zzzz-none-000/linux-5.15.111/net/netfilter/nf_conntrack_proto_tcp.c 2023-05-11 14:00:40.000000000 +0000 +++ puma7-arm-6670-761/linux-5.15.111/net/netfilter/nf_conntrack_proto_tcp.c 2024-02-07 09:28:10.000000000 +0000 @@ -4,6 +4,12 @@ * (C) 2002-2013 Jozsef Kadlecsik * (C) 2006-2012 Patrick McHardy */ +/* +* Includes MaxLinear's changes dated: 2021, 2022. +* Changed portions - Copyright 2020-2022, MaxLinear, Inc. +* Includes Intel Corporation's changes dated: 2014, 2018, 2020. +* Changed portions - Copyright 2014-2020, IntelCorporation. +*/ #include #include @@ -15,6 +21,7 @@ #include #include #include +#include #include @@ -935,6 +942,10 @@ & IP_CT_TCP_FLAG_CLOSE_INIT) || (ct->proto.tcp.last_dir == dir && ct->proto.tcp.last_index == TCP_RST_SET)) { +#ifdef CONFIG_TI_PACKET_PROCESSOR + /* There is no point in accelerating this CONNTRACK since it will be deleted. */ + ti_hil_pp_event(TI_CT_NETFILTER_DELETE_CONNTRACK_SESSIONS, (void *)ct); +#endif /* CONFIG_TI_PACKET_PROCESSOR */ /* Attempt to reopen a closed/aborted connection. * Delete this connection and look up again. */ spin_unlock_bh(&ct->lock); @@ -1156,11 +1167,33 @@ break; } +#ifdef CONFIG_TI_PACKET_PROCESSOR + /* TCP Window tracking does not make sense if the sessions are being accelerated. Thus + * we added this check... Maybe a better way is to make the window tracking more resilient. + * Check here to see if both of the sessions are not accelerated and if so be the case do the + * window checking else skip it! */ + + if ((list_empty(&ct->tuplehash[IP_CT_DIR_ORIGINAL].pp_session_list_head)) && + (list_empty(&ct->tuplehash[IP_CT_DIR_REPLY].pp_session_list_head))) +#endif + { if (!tcp_in_window(ct, dir, index, skb, dataoff, th, state)) { spin_unlock_bh(&ct->lock); return -NF_ACCEPT; } + } +#ifdef CONFIG_TI_PACKET_PROCESSOR + else + { + if (ct->tuplehash[dir].rst_tcp_win) + { + ct->tuplehash[dir].rst_tcp_win = 0; + ct->proto.tcp.seen[dir].td_maxwin = 0; + tcp_in_window(ct, dir, index, skb, dataoff, th, state); + } + } +#endif in_window: /* From now on we have got in-window packets */ ct->proto.tcp.last_index = index;