On 3/27/20 10:53 AM, pbhagavat...@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavat...@marvell.com>
> 
> Add device arguments to lock Rx/Tx contexts.
> Application can either choose to lock Rx or Tx contexts by using
> 'lock_rx_ctx' or 'lock_tx_ctx' respectively per each port.
> 
> Example:
>       -w 0002:02:00.0,lock_rx_ctx=1 -w 0002:03:00.0,lock_tx_ctx=1
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavat...@marvell.com>
> Reviewed-by: Andrzej Ostruszka <aostrus...@marvell.com>
> ---
>  Depends on http://patches.dpdk.org/patch/67178/
>  v4 Changes:
>  - Fix return path using unnecessary goto.(Andrzej)
>  - Fix datatype of values passed to devargs parser.(Andrzej)
> 
>  v3 Changes:
>  - Split series into individual patches as targets are different.
> 
>  doc/guides/nics/octeontx2.rst               |  16 ++
>  drivers/net/octeontx2/otx2_ethdev.c         | 187 +++++++++++++++++++-
>  drivers/net/octeontx2/otx2_ethdev.h         |   2 +
>  drivers/net/octeontx2/otx2_ethdev_devargs.c |  16 +-
>  drivers/net/octeontx2/otx2_rss.c            |  23 +++
>  5 files changed, 241 insertions(+), 3 deletions(-)
[...]
> diff --git a/drivers/net/octeontx2/otx2_ethdev.c 
> b/drivers/net/octeontx2/otx2_ethdev.c
> index e60f4901c..a6f2c0f42 100644
> --- a/drivers/net/octeontx2/otx2_ethdev.c
> +++ b/drivers/net/octeontx2/otx2_ethdev.c
> @@ -381,6 +381,40 @@ nix_cq_rq_init(struct rte_eth_dev *eth_dev, struct 
> otx2_eth_dev *dev,
>               goto fail;
>       }
> 
> +     if (dev->lock_rx_ctx) {
> +             aq = otx2_mbox_alloc_msg_nix_aq_enq(mbox);
> +             aq->qidx = qid;
> +             aq->ctype = NIX_AQ_CTYPE_CQ;
> +             aq->op = NIX_AQ_INSTOP_LOCK;
> +
> +             aq = otx2_mbox_alloc_msg_nix_aq_enq(mbox);
> +             if (!aq) {
> +                     /* The shared memory buffer can be full.
> +                      * Flush it and retry
> +                      */
> +                     otx2_mbox_msg_send(mbox, 0);
> +                     rc = otx2_mbox_wait_for_rsp(mbox, 0);
> +                     if (rc < 0) {
> +                             otx2_err("Failed to LOCK cq context");
> +                             return rc;
> +                     }
> +
> +                     aq = otx2_mbox_alloc_msg_nix_aq_enq(mbox);
> +                     if (!aq) {
> +                             otx2_err("Failed to LOCK rq context");
> +                             return -ENOMEM;
> +                     }
> +             }
> +             aq->qidx = qid;
> +             aq->ctype = NIX_AQ_CTYPE_RQ;
> +             aq->op = NIX_AQ_INSTOP_LOCK;
> +             rc = otx2_mbox_process(mbox);
> +             if (rc < 0) {
> +                     otx2_err("Failed to LOCK rq context");
> +                     return rc;
> +             }
> +     }
> +
>       return 0;
>  fail:
>       return rc;

Pavan - sorry for being so ... finicky :)
I've said 'replace all "goto fail" with "return rc"' and I meant that.
So not only the "goto fail" in you changes but all "goto fail" in that
function.

Apart from that:
Reviewed-by: Andrzej Ostruszka <aostrus...@marvell.com>

With regards
Andrzej

PS. Thanks for the patience ;)

Reply via email to