[dpdk-dev] [PATCH 03/15] crypto/octeontx2: configure for inline IPsec

Jerin Jacob jerinjacobk at gmail.com
Mon Dec 9 08:46:30 CET 2019


On Sun, Dec 8, 2019 at 5:26 PM Anoob Joseph <anoobj at marvell.com> wrote:
>
> From: Tejasree Kondoj <ktejasree at marvell.com>
>
> For enabling outbound inline IPsec, a CPT queue needs to be tied
> to a NIX PF_FUNC. Distribute CPT queues fairly among all availble
> otx2 eth ports.
>
> For inbound, one CPT LF will be assigned and initialized by kernel.
>
> Signed-off-by: Ankur Dwivedi <adwivedi at marvell.com>
> Signed-off-by: Anoob Joseph <anoobj at marvell.com>
> Signed-off-by: Archana Muniganti <marchana at marvell.com>
> Signed-off-by: Tejasree Kondoj <ktejasree at marvell.com>
> Signed-off-by: Vamsi Attunuru <vattunuru at marvell.com>

>
> +static int
> +otx2_cpt_qp_inline_cfg(const struct rte_cryptodev *dev, struct otx2_cpt_qp *qp)
> +{
> +       static rte_atomic16_t port_offset = RTE_ATOMIC16_INIT(-1);
> +       uint16_t port_id, nb_ethport = rte_eth_dev_count_avail();
> +       int i, ret;
> +
> +       for (i = 0; i < nb_ethport; i++) {
> +               port_id = rte_atomic16_add_return(&port_offset, 1) % nb_ethport;
> +               if (otx2_is_ethdev(&rte_eth_devices[port_id]))
> +                       break;
> +       }
> +
> +       if (i >= nb_ethport)
> +               return 0;
> +
> +       ret = otx2_cpt_qp_ethdev_bind(dev, qp, port_id);
> +       if (ret)
> +               return ret;
> +
> +       return 0;

Last five lines can be replaced with "return
otx2_cpt_qp_ethdev_bind(dev, qp, port_id)"

Across the patch series, the above pattern is common, Please fix in
all relevant instances.


More information about the dev mailing list