--- zzzz-none-000/linux-2.6.39.4/net/netfilter/nf_conntrack_core.c 2011-08-03 19:43:28.000000000 +0000 +++ puma6-arm-6490-729/linux-2.6.39.4/net/netfilter/nf_conntrack_core.c 2021-11-10 13:23:11.000000000 +0000 @@ -47,6 +47,8 @@ #include #include +#include + #define NF_CONNTRACK_VERSION "0.5.0" int (*nfnetlink_parse_nat_setup_hook)(struct nf_conn *ct, @@ -284,7 +286,15 @@ { struct nf_conn *ct = (void *)ul_conntrack; struct nf_conn_tstamp *tstamp; - + +#ifdef CONFIG_TI_PACKET_PROCESSOR + /* Generate an event indicating the connection tracking entry is being deleted. */ + ti_hil_pp_event (TI_CT_DEATH_BY_TIMEOUT, (void *)ct); + + /* Did the HIL profile take over or not? */ + if ((ct->ti_pp_status_flag & TI_PP_KILL_CONNTRACK) == 0) + return; /* HIL Profile took over... */ +#endif tstamp = nf_conn_tstamp_find(ct); if (tstamp && tstamp->stop == 0) tstamp->stop = ktime_to_ns(ktime_get_real()); @@ -691,6 +701,15 @@ nf_ct_zone->id = zone; } #endif +#ifdef CONFIG_TI_PACKET_PROCESSOR + /* Initialize the session handle in the ORIGINAL and REPLY Tuple. */ + ct->tuplehash[IP_CT_DIR_ORIGINAL].ti_pp_session_handle = TI_PP_SESSION_CT_IDLE; + ct->tuplehash[IP_CT_DIR_REPLY ].ti_pp_session_handle = TI_PP_SESSION_CT_IDLE; + ct->ti_pp_status_flag = 0; + ct->tuplehash[IP_CT_DIR_ORIGINAL].ti_pp_sessions_count = 0; + ct->tuplehash[IP_CT_DIR_REPLY ].ti_pp_sessions_count = 0; +#endif /* CONFIG_TI_PACKET_PROCESSOR */ + /* * changes to lookup keys must be done before setting refcnt to 1 */ @@ -740,6 +759,9 @@ struct nf_conntrack_tuple repl_tuple; struct nf_conntrack_ecache *ecache; struct nf_conntrack_expect *exp; +#ifdef CONFIG_TI_PACKET_PROCESSOR + struct ct_entry_created_t entry_info; +#endif u16 zone = tmpl ? nf_ct_zone(tmpl) : NF_CT_DEFAULT_ZONE; if (!nf_ct_invert_tuple(&repl_tuple, tuple, l3proto, l4proto)) { @@ -806,7 +828,12 @@ exp->expectfn(ct, exp); nf_ct_expect_put(exp); } - +#ifdef CONFIG_TI_PACKET_PROCESSOR + /* Generate an event indicating that a connection tracking entry has been created. */ + entry_info.skb = skb; + entry_info.ct = ct; + ti_hil_pp_event(TI_CT_ENTRY_CREATED, (void *)(&entry_info)); +#endif //CONFIG_TI_PACKET_PROCESSOR return &ct->tuplehash[IP_CT_DIR_ORIGINAL]; } @@ -940,6 +967,14 @@ goto out; } +#ifdef CONFIG_TI_PACKET_PROCESSOR + /* Check if the packet belongs to a connection which has not been acclerated? + * For all packets matching the connection make sure the BYPASS flag is set. */ + if (ct->ti_pp_status_flag & TI_PP_BYPASS) + { + skb->pp_packet_info.flags |= TI_HIL_PACKET_FLAG_PP_SESSION_BYPASS; + } +#endif NF_CT_ASSERT(skb->nfct); ret = l4proto->packet(ct, skb, dataoff, ctinfo, pf, hooknum);