patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [19.11 PATCH] crypto/dpaa_sec: affine the thread portal affinity
@ 2021-06-03 12:17 Hemant Agrawal
  2021-06-04  5:09 ` Christian Ehrhardt
  0 siblings, 1 reply; 2+ messages in thread
From: Hemant Agrawal @ 2021-06-03 12:17 UTC (permalink / raw)
  To: christian.ehrhardt; +Cc: Hemant Agrawal, stable

DPAA requires the I/O shall be done in a HW portal context only.
The portal affinity is currently only being done in session create
and config APIs with the assumption that same thread will be used
for IO. This is causing issue.
This patch add support during I/O to check the HW portal affinity
and affine portal- if not affined already.

Fixes: 9a984458f755 ("crypto/dpaa_sec: rewrite Rx/Tx path")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/crypto/dpaa_sec/dpaa_sec.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index a650313cdb..6e454273ee 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -1690,6 +1690,13 @@ dpaa_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops,
 	uint32_t index, flags[DPAA_SEC_BURST] = {0};
 	struct qman_fq *inq[DPAA_SEC_BURST];
 
+	if (unlikely(!RTE_PER_LCORE(dpaa_io))) {
+		if (rte_dpaa_portal_init((void *)0)) {
+			DPAA_SEC_ERR("Failure in affining portal");
+			return 0;
+		}
+	}
+
 	while (nb_ops) {
 		frames_to_send = (nb_ops > DPAA_SEC_BURST) ?
 				DPAA_SEC_BURST : nb_ops;
@@ -1890,6 +1897,13 @@ dpaa_sec_dequeue_burst(void *qp, struct rte_crypto_op **ops,
 	uint16_t num_rx;
 	struct dpaa_sec_qp *dpaa_qp = (struct dpaa_sec_qp *)qp;
 
+	if (unlikely(!RTE_PER_LCORE(dpaa_io))) {
+		if (rte_dpaa_portal_init((void *)0)) {
+			DPAA_SEC_ERR("Failure in affining portal");
+			return 0;
+		}
+	}
+
 	num_rx = dpaa_sec_deq(dpaa_qp, ops, nb_ops);
 
 	dpaa_qp->rx_pkts += num_rx;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [19.11 PATCH] crypto/dpaa_sec: affine the thread portal affinity
  2021-06-03 12:17 [dpdk-stable] [19.11 PATCH] crypto/dpaa_sec: affine the thread portal affinity Hemant Agrawal
@ 2021-06-04  5:09 ` Christian Ehrhardt
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Ehrhardt @ 2021-06-04  5:09 UTC (permalink / raw)
  To: Hemant Agrawal; +Cc: dpdk stable

On Thu, Jun 3, 2021 at 2:19 PM Hemant Agrawal <hemant.agrawal@nxp.com> wrote:
>
> DPAA requires the I/O shall be done in a HW portal context only.
> The portal affinity is currently only being done in session create
> and config APIs with the assumption that same thread will be used
> for IO. This is causing issue.
> This patch add support during I/O to check the HW portal affinity
> and affine portal- if not affined already.
>
> Fixes: 9a984458f755 ("crypto/dpaa_sec: rewrite Rx/Tx path")
> Cc: stable@dpdk.org
>
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

Applied to 19.11.x - thanks!

> ---
>  drivers/crypto/dpaa_sec/dpaa_sec.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
> index a650313cdb..6e454273ee 100644
> --- a/drivers/crypto/dpaa_sec/dpaa_sec.c
> +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
> @@ -1690,6 +1690,13 @@ dpaa_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops,
>         uint32_t index, flags[DPAA_SEC_BURST] = {0};
>         struct qman_fq *inq[DPAA_SEC_BURST];
>
> +       if (unlikely(!RTE_PER_LCORE(dpaa_io))) {
> +               if (rte_dpaa_portal_init((void *)0)) {
> +                       DPAA_SEC_ERR("Failure in affining portal");
> +                       return 0;
> +               }
> +       }
> +
>         while (nb_ops) {
>                 frames_to_send = (nb_ops > DPAA_SEC_BURST) ?
>                                 DPAA_SEC_BURST : nb_ops;
> @@ -1890,6 +1897,13 @@ dpaa_sec_dequeue_burst(void *qp, struct rte_crypto_op **ops,
>         uint16_t num_rx;
>         struct dpaa_sec_qp *dpaa_qp = (struct dpaa_sec_qp *)qp;
>
> +       if (unlikely(!RTE_PER_LCORE(dpaa_io))) {
> +               if (rte_dpaa_portal_init((void *)0)) {
> +                       DPAA_SEC_ERR("Failure in affining portal");
> +                       return 0;
> +               }
> +       }
> +
>         num_rx = dpaa_sec_deq(dpaa_qp, ops, nb_ops);
>
>         dpaa_qp->rx_pkts += num_rx;
> --
> 2.17.1
>


-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-04  5:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-03 12:17 [dpdk-stable] [19.11 PATCH] crypto/dpaa_sec: affine the thread portal affinity Hemant Agrawal
2021-06-04  5:09 ` Christian Ehrhardt

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git