[PATCH v6 06/21] pdcp: add pre and post process for UL
Thomas Monjalon
thomas at monjalon.net
Sun Jun 11 00:50:35 CEST 2023
Hello,
I'm sorry to inform you that I see a compilation failure
when cross-compiling for PPC64:
err_mb is seen as potentially unitialized when calling rte_memcpy().
30/05/2023 12:01, Anoob Joseph:
> +static uint16_t
> +pdcp_post_process_ul(const struct rte_pdcp_entity *entity,
> + struct rte_mbuf *in_mb[], struct rte_mbuf *out_mb[],
> + uint16_t num, uint16_t *nb_err_ret)
> +{
> + struct entity_priv *en_priv = entity_priv_get(entity);
> + const uint32_t hdr_trim_sz = en_priv->aad_sz;
> + int i, nb_success = 0, nb_err = 0;
> + struct rte_mbuf *mb, *err_mb[num];
> +
I need to add a workaround here to make GCC happy:
#ifdef RTE_ARCH_PPC_64
err_mb[0] = NULL; /* workaround PPC-GCC bug */
#endif
> + for (i = 0; i < num; i++) {
> + mb = in_mb[i];
> + if (unlikely(mb->ol_flags & RTE_MBUF_F_RX_SEC_OFFLOAD_FAILED)) {
> + err_mb[nb_err++] = mb;
> + continue;
> + }
> +
> + if (hdr_trim_sz)
> + rte_pktmbuf_adj(mb, hdr_trim_sz);
> +
> + out_mb[nb_success++] = mb;
> + }
> +
> + if (unlikely(nb_err != 0))
> + rte_memcpy(&out_mb[nb_success], err_mb, nb_err * sizeof(struct rte_mbuf *));
> +
> + *nb_err_ret = nb_err;
> + return nb_success;
> +}
I've added the workaround in 3 places while pulling next-crypto tree.
Feel free to improve it with a new patch, thanks.
More information about the dev
mailing list