DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerinjacobk@gmail.com>
To: Volodymyr Fialko <vfialko@marvell.com>
Cc: dpdk-dev <dev@dpdk.org>, Jerin Jacob <jerinj@marvell.com>,
	Anoob Joseph <anoobj@marvell.com>
Subject: Re: [PATCH v2 1/2] app/eventdev: add null checks for cop allocations
Date: Tue, 21 Jun 2022 00:59:57 +0530	[thread overview]
Message-ID: <CALBAE1PrmG3F-_Ug9Y+X_Jt895ZHbmDi6sES02vp0Ey=VkTxCg@mail.gmail.com> (raw)
In-Reply-To: <20220617123818.3359117-2-vfialko@marvell.com>

On Fri, Jun 17, 2022 at 6:09 PM Volodymyr Fialko <vfialko@marvell.com> wrote:
>
> Crypto operation allocation may fail in case when total size of queue
> pairs are bigger then the pool size.

then -> than

>
> Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>

Series-Acked-by: Jerin Jacob <jerinj@marvell.com>
Series applied to dpdk-next-net-eventdev/for-main. Thanks


> ---
>  app/test-eventdev/test_perf_common.c | 40 ++++++++++++++++++++++++++--
>  1 file changed, 38 insertions(+), 2 deletions(-)
>
> diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
> index b41785492e..a5e031873d 100644
> --- a/app/test-eventdev/test_perf_common.c
> +++ b/app/test-eventdev/test_perf_common.c
> @@ -367,6 +367,7 @@ crypto_adapter_enq_op_new(struct prod_data *p)
>         struct evt_options *opt = t->opt;
>         uint16_t qp_id = p->ca.cdev_qp_id;
>         uint8_t cdev_id = p->ca.cdev_id;
> +       uint64_t alloc_failures = 0;
>         uint32_t flow_counter = 0;
>         struct rte_crypto_op *op;
>         struct rte_mbuf *m;
> @@ -386,9 +387,17 @@ crypto_adapter_enq_op_new(struct prod_data *p)
>
>                         op = rte_crypto_op_alloc(t->ca_op_pool,
>                                          RTE_CRYPTO_OP_TYPE_SYMMETRIC);
> +                       if (unlikely(op == NULL)) {
> +                               alloc_failures++;
> +                               continue;
> +                       }
> +
>                         m = rte_pktmbuf_alloc(pool);
> -                       if (m == NULL)
> +                       if (unlikely(m == NULL)) {
> +                               alloc_failures++;
> +                               rte_crypto_op_free(op);
>                                 continue;
> +                       }
>
>                         rte_pktmbuf_append(m, len);
>                         sym_op = op->sym;
> @@ -404,6 +413,11 @@ crypto_adapter_enq_op_new(struct prod_data *p)
>
>                         op = rte_crypto_op_alloc(t->ca_op_pool,
>                                          RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
> +                       if (unlikely(op == NULL)) {
> +                               alloc_failures++;
> +                               continue;
> +                       }
> +
>                         asym_op = op->asym;
>                         asym_op->modex.base.data = modex_test_case.base.data;
>                         asym_op->modex.base.length = modex_test_case.base.len;
> @@ -418,6 +432,10 @@ crypto_adapter_enq_op_new(struct prod_data *p)
>
>                 count++;
>         }
> +
> +       if (opt->verbose_level > 1 && alloc_failures)
> +               printf("%s(): lcore %d allocation failures: %"PRIu64"\n",
> +                      __func__, rte_lcore_id(), alloc_failures);
>  }
>
>  static inline void
> @@ -430,6 +448,7 @@ crypto_adapter_enq_op_fwd(struct prod_data *p)
>         const uint64_t nb_pkts = t->nb_pkts;
>         struct rte_mempool *pool = t->pool;
>         struct evt_options *opt = t->opt;
> +       uint64_t alloc_failures = 0;
>         uint32_t flow_counter = 0;
>         struct rte_crypto_op *op;
>         struct rte_event ev;
> @@ -455,9 +474,17 @@ crypto_adapter_enq_op_fwd(struct prod_data *p)
>
>                         op = rte_crypto_op_alloc(t->ca_op_pool,
>                                          RTE_CRYPTO_OP_TYPE_SYMMETRIC);
> +                       if (unlikely(op == NULL)) {
> +                               alloc_failures++;
> +                               continue;
> +                       }
> +
>                         m = rte_pktmbuf_alloc(pool);
> -                       if (m == NULL)
> +                       if (unlikely(m == NULL)) {
> +                               alloc_failures++;
> +                               rte_crypto_op_free(op);
>                                 continue;
> +                       }
>
>                         rte_pktmbuf_append(m, len);
>                         sym_op = op->sym;
> @@ -473,6 +500,11 @@ crypto_adapter_enq_op_fwd(struct prod_data *p)
>
>                         op = rte_crypto_op_alloc(t->ca_op_pool,
>                                          RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
> +                       if (unlikely(op == NULL)) {
> +                               alloc_failures++;
> +                               continue;
> +                       }
> +
>                         asym_op = op->asym;
>                         asym_op->modex.base.data = modex_test_case.base.data;
>                         asym_op->modex.base.length = modex_test_case.base.len;
> @@ -489,6 +521,10 @@ crypto_adapter_enq_op_fwd(struct prod_data *p)
>
>                 count++;
>         }
> +
> +       if (opt->verbose_level > 1 && alloc_failures)
> +               printf("%s(): lcore %d allocation failures: %"PRIu64"\n",
> +                      __func__, rte_lcore_id(), alloc_failures);
>  }
>
>  static inline int
> --
> 2.25.1
>

  reply	other threads:[~2022-06-20 19:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-17 12:38 [PATCH v2 0/2] app/eventdev: fix issues with cop alloc and qp size Volodymyr Fialko
2022-06-17 12:38 ` [PATCH v2 1/2] app/eventdev: add null checks for cop allocations Volodymyr Fialko
2022-06-20 19:29   ` Jerin Jacob [this message]
2022-06-17 12:38 ` [PATCH v2 2/2] app/eventdev: increase number of qp descriptors Volodymyr Fialko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALBAE1PrmG3F-_Ug9Y+X_Jt895ZHbmDi6sES02vp0Ey=VkTxCg@mail.gmail.com' \
    --to=jerinjacobk@gmail.com \
    --cc=anoobj@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=vfialko@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).