--- zzzz-none-000/linux-5.15.111/net/ipv6/ip6_output.c 2023-05-11 14:00:40.000000000 +0000 +++ puma7-atom-6670-761/linux-5.15.111/net/ipv6/ip6_output.c 2024-02-07 10:23:30.000000000 +0000 @@ -21,6 +21,12 @@ * : add ip6_append_data and related functions * for datagram xmit */ +/* + Includes MaxLinear's changes dated: 2022. + Changed portions - Copyright 2020-2022, MaxLinear, Inc. + Includes Intel Corporation's changes dated: 2018,2020. + Changed portions - Copyright 2018-2020, Intel Corporation. +*/ #include #include @@ -56,6 +62,19 @@ #include #include +#include + +#ifdef CONFIG_TI_DOCSIS_INPUT_DEV +# define DBRIDGE_IFINDEX_CHK(__ifindex, format, args...) \ +{ \ + if (((__ifindex) < 0) || ((__ifindex) >= TI_MAX_DEVICE_INDEX)) \ + { \ + printk("\n===>>> %s - %d: Currupt " #__ifindex " - %d\n" format, __func__, __LINE__, __ifindex, ##args); \ + BUG(); \ + } \ +} +#endif + static int ip6_finish_output2(struct net *net, struct sock *sk, struct sk_buff *skb) { struct dst_entry *dst = skb_dst(skb); @@ -66,6 +85,11 @@ struct ipv6hdr *hdr; struct neighbour *neigh; int ret; +#ifdef CONFIG_TI_PACKET_PROCESSOR +#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) + const struct nf_conn *ct; +#endif +#endif /* Be paranoid, rather than too clever. */ if (unlikely(hh_len > skb_headroom(skb)) && dev->header_ops) { @@ -108,6 +132,15 @@ return 0; } } +#ifdef CONFIG_TI_PACKET_PROCESSOR +#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) + ct = (struct nf_conn *)skb_nfct(skb); + if (ct != NULL) + { + ti_hil_pp_event( TI_CT_NETFILTER_CANCEL_DISCARD_ACCELERATION, skb->nfct); + } +#endif +#endif if (lwtunnel_xmit_redirect(dst->lwtstate)) { int res = lwtunnel_xmit(skb); @@ -318,6 +351,10 @@ if (unlikely(!skb)) return 0; + /* For UDP, ICMPv6 and XFRM, see __ip6_local_out() */ + if (avm_pa_dev_local_out(AVM_PA_NET_IP6_DEVINFO(net), skb) == AVM_PA_RX_STOLEN) + return 0; + /* hooks should never assume socket lock is held. * we promote our socket to non const */ @@ -441,6 +478,9 @@ #endif skb->tstamp = 0; + + avm_pa_mark_routed(skb); + return dst_output(net, sk, skb); } @@ -651,7 +691,28 @@ #ifdef CONFIG_NET_SCHED to->tc_index = from->tc_index; #endif +#ifdef CONFIG_AVM_PA + memcpy(AVM_PKT_INFO(to), AVM_PKT_INFO(from), sizeof(*AVM_PKT_INFO(to))); +#endif nf_copy(to, from); + +#ifdef CONFIG_TI_DOCSIS_INPUT_DEV + to->ti_docsis_input_dev = from->ti_docsis_input_dev; + if (to->ti_docsis_input_dev) + { + DBRIDGE_IFINDEX_CHK(to->ti_docsis_input_dev->ifindex, "dev %p, devname %s, ti_docsis_input_dev %p, ti_docsis_input_dev->name %s", to->dev, to->dev ? to->dev->name : NULL, to->ti_docsis_input_dev, to->ti_docsis_input_dev->name); + } +#endif /* CONFIG_TI_DOCSIS_INPUT_DEV */ +#ifdef CONFIG_INTEL_DOCSIS_ICMP_IIF + to->docsis_icmp_iif = from->docsis_icmp_iif; +#endif /* CONFIG_INTEL_DOCSIS_ICMP_IIF */ +#ifdef CONFIG_TI_L2_SELECTIVE_FORWARDER + to->ti_selective_fwd_dev_info = from->ti_selective_fwd_dev_info; +#endif /* CONFIG_TI_L2_SELECTIVE_FORWARDER */ +#ifdef CONFIG_TI_PACKET_PROCESSOR + memcpy((void *)SKB_GET_PP_INFO_P(to), (void *)SKB_GET_PP_INFO_P(from), sizeof(*SKB_GET_PP_INFO_P(from))); +#endif + skb_ext_copy(to, from); skb_copy_secmark(to, from); } @@ -1006,6 +1067,7 @@ kfree_skb(skb); return err; } +EXPORT_SYMBOL(ip6_fragment); static inline int ip6_rt_check(const struct rt6key *rt_key, const struct in6_addr *fl_addr,