--- zzzz-none-000/linux-4.1.52/net/ipv4/ah4.c 2018-05-28 02:26:45.000000000 +0000 +++ bcm63-7530ax-731/linux-4.1.52/net/ipv4/ah4.c 2022-03-02 11:37:13.000000000 +0000 @@ -13,6 +13,10 @@ #include #include +#if defined(CONFIG_BCM_KF_BLOG) && defined(CONFIG_BLOG) +#include +#endif + struct ah_skb_cb { struct xfrm_skb_cb xfrm; void *tmp; @@ -160,6 +164,10 @@ int sglists = 0; struct scatterlist *seqhisg; +#if defined(CONFIG_BCM_KF_BLOG) && defined(CONFIG_BLOG) + blog_skip(skb, blog_skip_reason_unknown_proto_ah4); +#endif + ahp = x->data; ahash = ahp->ahash; @@ -220,7 +228,14 @@ ah->seq_no = htonl(XFRM_SKB_CB(skb)->seq.output.low); sg_init_table(sg, nfrags + sglists); +#if defined(CONFIG_BCM_KF_MISC_BACKPORTS) + err = +#endif skb_to_sgvec_nomark(skb, sg, 0, skb->len); +#if defined(CONFIG_BCM_KF_MISC_BACKPORTS) + if (unlikely(err) < 0) + goto out_free; +#endif if (x->props.flags & XFRM_STATE_ESN) { /* Attach seqhi sg right after packet payload */ @@ -232,6 +247,22 @@ AH_SKB_CB(skb)->tmp = iph; +#if defined(CONFIG_BCM_KF_SPU) && (defined(CONFIG_BCM_SPU) || defined(CONFIG_BCM_SPU_MODULE)) && !(defined(CONFIG_BCM_RDPA) || defined(CONFIG_BCM_RDPA_MODULE)) + /* ensure there is enough headroom and tailroom for HW info */ + if((skb_headroom(skb) < 12) || + (skb_tailroom(skb) < 20)) + { + req->alloc_buff_spu = 1; + } + else + { + req->alloc_buff_spu = 0; + } + + /* not used for output */ + req->headerLen = 0; +#endif + err = crypto_ahash_digest(req); if (err) { if (err == -EINPROGRESS) @@ -317,6 +348,10 @@ int sglists = 0; struct scatterlist *seqhisg; +#if defined(CONFIG_BCM_KF_BLOG) && defined(CONFIG_BLOG) + blog_skip(skb, blog_skip_reason_unknown_proto_ah4); +#endif + if (!pskb_may_pull(skb, sizeof(*ah))) goto out; @@ -391,7 +426,14 @@ skb_push(skb, ihl); sg_init_table(sg, nfrags + sglists); +#if defined(CONFIG_BCM_KF_MISC_BACKPORTS) + err = +#endif skb_to_sgvec_nomark(skb, sg, 0, skb->len); +#if defined(CONFIG_BCM_KF_MISC_BACKPORTS) + if (unlikely(err) < 0) + goto out_free; +#endif if (x->props.flags & XFRM_STATE_ESN) { /* Attach seqhi sg right after packet payload */ @@ -403,6 +445,22 @@ AH_SKB_CB(skb)->tmp = work_iph; +#if defined(CONFIG_BCM_KF_SPU) && (defined(CONFIG_BCM_SPU) || defined(CONFIG_BCM_SPU_MODULE)) && !(defined(CONFIG_BCM_RDPA) || defined(CONFIG_BCM_RDPA_MODULE)) + /* ensure there is enough headroom and tailroom for HW info */ + if((skb_headroom(skb) < 12) || + (skb_tailroom(skb) < 20)) + { + req->alloc_buff_spu = 1; + } + else + { + req->alloc_buff_spu = 0; + } + + /* offset to icv */ + req->headerLen = &ah->auth_data[0] - skb->data; +#endif + err = crypto_ahash_digest(req); if (err) { if (err == -EINPROGRESS)