patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 19.11] crypto/octeontx2: fix for multi process
@ 2020-10-22  5:57 Ankur Dwivedi
  2020-10-27 15:17 ` Luca Boccassi
  0 siblings, 1 reply; 6+ messages in thread
From: Ankur Dwivedi @ 2020-10-22  5:57 UTC (permalink / raw)
  To: stable; +Cc: Ankur Dwivedi, Narayana Prasad Raju Athreya, Anoob Joseph

During crypto device probe few functions should be called only
for the primary process. This patch fixes this issue.

Fixes: 818d138bcce9 ("crypto/octeontx2: add init sequence in probe")

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Reviewed-by: Narayana Prasad Raju Athreya <pathreya@marvell.com>
Reviewed-by: Anoob Joseph <anoobj@marvell.com>
---
 drivers/crypto/octeontx2/otx2_cryptodev.c     | 46 +++++++++++--------
 drivers/crypto/octeontx2/otx2_cryptodev.h     |  2 +
 drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 13 ++++--
 3 files changed, 38 insertions(+), 23 deletions(-)

diff --git a/drivers/crypto/octeontx2/otx2_cryptodev.c b/drivers/crypto/octeontx2/otx2_cryptodev.c
index 417eda6de..4626e754e 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev.c
@@ -70,31 +70,34 @@ otx2_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 
 	otx2_dev = &vf->otx2_dev;
 
-	/* Initialize the base otx2_dev object */
-	ret = otx2_dev_init(pci_dev, otx2_dev);
-	if (ret) {
-		CPT_LOG_ERR("Could not initialize otx2_dev");
-		goto pmd_destroy;
-	}
+	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+		/* Initialize the base otx2_dev object */
+		ret = otx2_dev_init(pci_dev, otx2_dev);
+		if (ret) {
+			CPT_LOG_ERR("Could not initialize otx2_dev");
+			goto pmd_destroy;
+		}
 
-	/* Get number of queues available on the device */
-	ret = otx2_cpt_available_queues_get(dev, &nb_queues);
-	if (ret) {
-		CPT_LOG_ERR("Could not determine the number of queues available");
-		goto otx2_dev_fini;
-	}
+		/* Get number of queues available on the device */
+		ret = otx2_cpt_available_queues_get(dev, &nb_queues);
+		if (ret) {
+			CPT_LOG_ERR("Could not determine the number of queues available");
+			goto otx2_dev_fini;
+		}
 
-	/* Don't exceed the limits set per VF */
-	nb_queues = RTE_MIN(nb_queues, OTX2_CPT_MAX_QUEUES_PER_VF);
+		/* Don't exceed the limits set per VF */
+		nb_queues = RTE_MIN(nb_queues, OTX2_CPT_MAX_QUEUES_PER_VF);
 
-	if (nb_queues == 0) {
-		CPT_LOG_ERR("No free queues available on the device");
-		goto otx2_dev_fini;
-	}
+		if (nb_queues == 0) {
+			CPT_LOG_ERR("No free queues available on the device");
+			goto otx2_dev_fini;
+		}
 
-	vf->max_queues = nb_queues;
+		vf->max_queues = nb_queues;
 
-	CPT_LOG_INFO("Max queues supported by device: %d", vf->max_queues);
+		CPT_LOG_INFO("Max queues supported by device: %d",
+				vf->max_queues);
+	}
 
 	dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO |
 			     RTE_CRYPTODEV_FF_HW_ACCELERATED |
@@ -105,6 +108,9 @@ otx2_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 			     RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO |
 			     RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT;
 
+	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
+		otx2_cpt_set_enqdeq_fns(dev);
+
 	return 0;
 
 otx2_dev_fini:
diff --git a/drivers/crypto/octeontx2/otx2_cryptodev.h b/drivers/crypto/octeontx2/otx2_cryptodev.h
index c0aa661b3..17c0bee66 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev.h
+++ b/drivers/crypto/octeontx2/otx2_cryptodev.h
@@ -40,4 +40,6 @@ extern int otx2_cpt_logtype;
  */
 extern uint8_t otx2_cryptodev_driver_id;
 
+void otx2_cpt_set_enqdeq_fns(struct rte_cryptodev *dev);
+
 #endif /* _OTX2_CRYPTODEV_H_ */
diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
index 65101b0d2..b87a16f30 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
@@ -808,6 +808,15 @@ otx2_cpt_dequeue_burst(void *qptr, struct rte_crypto_op **ops, uint16_t nb_ops)
 	return nb_completed;
 }
 
+void
+otx2_cpt_set_enqdeq_fns(struct rte_cryptodev *dev)
+{
+	dev->enqueue_burst = otx2_cpt_enqueue_burst;
+	dev->dequeue_burst = otx2_cpt_dequeue_burst;
+
+	rte_mb();
+}
+
 /* PMD ops */
 
 static int
@@ -857,10 +866,8 @@ otx2_cpt_dev_config(struct rte_cryptodev *dev,
 		goto queues_detach;
 	}
 
-	dev->enqueue_burst = otx2_cpt_enqueue_burst;
-	dev->dequeue_burst = otx2_cpt_dequeue_burst;
+	otx2_cpt_set_enqdeq_fns(dev);
 
-	rte_mb();
 	return 0;
 
 queues_detach:
-- 
2.28.0


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

* Re: [dpdk-stable] [PATCH 19.11] crypto/octeontx2: fix for multi process
  2020-10-22  5:57 [dpdk-stable] [PATCH 19.11] crypto/octeontx2: fix for multi process Ankur Dwivedi
@ 2020-10-27 15:17 ` Luca Boccassi
  2020-10-28  6:52   ` [dpdk-stable] [EXT] " Ankur Dwivedi
  0 siblings, 1 reply; 6+ messages in thread
From: Luca Boccassi @ 2020-10-27 15:17 UTC (permalink / raw)
  To: Ankur Dwivedi, stable; +Cc: Narayana Prasad Raju Athreya, Anoob Joseph

On Thu, 2020-10-22 at 11:27 +0530, Ankur Dwivedi wrote:
> During crypto device probe few functions should be called only
> for the primary process. This patch fixes this issue.
> 
> Fixes: 818d138bcce9 ("crypto/octeontx2: add init sequence in probe")
> 
> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> Reviewed-by: Narayana Prasad Raju Athreya <pathreya@marvell.com>
> Reviewed-by: Anoob Joseph <anoobj@marvell.com>
> ---
>  drivers/crypto/octeontx2/otx2_cryptodev.c     | 46 +++++++++++--------
>  drivers/crypto/octeontx2/otx2_cryptodev.h     |  2 +
>  drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 13 ++++--
>  3 files changed, 38 insertions(+), 23 deletions(-)

Hi,

I do not see this patch on main. Does it only apply to 19.11?

-- 
Kind regards,
Luca Boccassi

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

* Re: [dpdk-stable] [EXT] Re: [PATCH 19.11] crypto/octeontx2: fix for multi process
  2020-10-27 15:17 ` Luca Boccassi
@ 2020-10-28  6:52   ` Ankur Dwivedi
  2020-10-28  9:52     ` Luca Boccassi
  0 siblings, 1 reply; 6+ messages in thread
From: Ankur Dwivedi @ 2020-10-28  6:52 UTC (permalink / raw)
  To: Luca Boccassi, stable; +Cc: Narayana Prasad Raju Athreya, Anoob Joseph

Hi Luca,

Please see my reply inline.

Regards,
Ankur

>-----Original Message-----
>From: Luca Boccassi <bluca@debian.org>
>Sent: Tuesday, October 27, 2020 8:47 PM
>To: Ankur Dwivedi <adwivedi@marvell.com>; stable@dpdk.org
>Cc: Narayana Prasad Raju Athreya <pathreya@marvell.com>; Anoob Joseph
><anoobj@marvell.com>
>Subject: [EXT] Re: [dpdk-stable] [PATCH 19.11] crypto/octeontx2: fix for multi
>process
>
>External Email
>
>----------------------------------------------------------------------
>On Thu, 2020-10-22 at 11:27 +0530, Ankur Dwivedi wrote:
>> During crypto device probe few functions should be called only for the
>> primary process. This patch fixes this issue.
>>
>> Fixes: 818d138bcce9 ("crypto/octeontx2: add init sequence in probe")
>>
>> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
>> Reviewed-by: Narayana Prasad Raju Athreya <pathreya@marvell.com>
>> Reviewed-by: Anoob Joseph <anoobj@marvell.com>
>> ---
>>  drivers/crypto/octeontx2/otx2_cryptodev.c     | 46 +++++++++++--------
>>  drivers/crypto/octeontx2/otx2_cryptodev.h     |  2 +
>>  drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 13 ++++--
>>  3 files changed, 38 insertions(+), 23 deletions(-)
>
>Hi,
>
>I do not see this patch on main. Does it only apply to 19.11?
>
Yes this patch applies only to 19.11. 
For 20.11 I have submitted a separate patch. It is Under Review. 
The following is the link to patch on 20.11:
http://patches.dpdk.org/patch/81737/

>--
>Kind regards,
>Luca Boccassi

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

* Re: [dpdk-stable] [EXT] Re: [PATCH 19.11] crypto/octeontx2: fix for multi process
  2020-10-28  6:52   ` [dpdk-stable] [EXT] " Ankur Dwivedi
@ 2020-10-28  9:52     ` Luca Boccassi
  2020-11-06  5:21       ` Ankur Dwivedi
  0 siblings, 1 reply; 6+ messages in thread
From: Luca Boccassi @ 2020-10-28  9:52 UTC (permalink / raw)
  To: Ankur Dwivedi, stable; +Cc: Narayana Prasad Raju Athreya, Anoob Joseph

On Wed, 2020-10-28 at 06:52 +0000, Ankur Dwivedi wrote:
> Hi Luca,
> 
> Please see my reply inline.
> 
> Regards,
> Ankur
> 
> > -----Original Message-----
> > From: Luca Boccassi <bluca@debian.org>
> > Sent: Tuesday, October 27, 2020 8:47 PM
> > To: Ankur Dwivedi <adwivedi@marvell.com>; stable@dpdk.org
> > Cc: Narayana Prasad Raju Athreya <pathreya@marvell.com>; Anoob Joseph
> > <anoobj@marvell.com>
> > Subject: [EXT] Re: [dpdk-stable] [PATCH 19.11] crypto/octeontx2: fix for multi
> > process
> > 
> > External Email
> > 
> > ----------------------------------------------------------------------
> > On Thu, 2020-10-22 at 11:27 +0530, Ankur Dwivedi wrote:
> > > During crypto device probe few functions should be called only for the
> > > primary process. This patch fixes this issue.
> > > 
> > > Fixes: 818d138bcce9 ("crypto/octeontx2: add init sequence in probe")
> > > 
> > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> > > Reviewed-by: Narayana Prasad Raju Athreya <pathreya@marvell.com>
> > > Reviewed-by: Anoob Joseph <anoobj@marvell.com>
> > > ---
> > >  drivers/crypto/octeontx2/otx2_cryptodev.c     | 46 +++++++++++--------
> > >  drivers/crypto/octeontx2/otx2_cryptodev.h     |  2 +
> > >  drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 13 ++++--
> > >  3 files changed, 38 insertions(+), 23 deletions(-)
> > 
> > Hi,
> > 
> > I do not see this patch on main. Does it only apply to 19.11?
> > 
> Yes this patch applies only to 19.11. 
> For 20.11 I have submitted a separate patch. It is Under Review. 
> The following is the link to patch on 20.11:
> http://patches.dpdk.org/patch/81737/

Once the mainline patch has been reviewed and merged, please send a
reminder and I'll merge this.

-- 
Kind regards,
Luca Boccassi

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

* Re: [dpdk-stable] [EXT] Re: [PATCH 19.11] crypto/octeontx2: fix for multi process
  2020-10-28  9:52     ` Luca Boccassi
@ 2020-11-06  5:21       ` Ankur Dwivedi
  2020-11-09 18:53         ` Luca Boccassi
  0 siblings, 1 reply; 6+ messages in thread
From: Ankur Dwivedi @ 2020-11-06  5:21 UTC (permalink / raw)
  To: Luca Boccassi, stable; +Cc: Narayana Prasad Raju Athreya, Anoob Joseph

Hi Luca,

Please see my reply inline.

Regards,
Ankur

>-----Original Message-----
>From: Luca Boccassi <bluca@debian.org>
>Sent: Wednesday, October 28, 2020 3:23 PM
>To: Ankur Dwivedi <adwivedi@marvell.com>; stable@dpdk.org
>Cc: Narayana Prasad Raju Athreya <pathreya@marvell.com>; Anoob Joseph
><anoobj@marvell.com>
>Subject: Re: [dpdk-stable] [EXT] Re: [PATCH 19.11] crypto/octeontx2: fix for
>multi process
>
>On Wed, 2020-10-28 at 06:52 +0000, Ankur Dwivedi wrote:
>> Hi Luca,
>>
>> Please see my reply inline.
>>
>> Regards,
>> Ankur
>>
>> > -----Original Message-----
>> > From: Luca Boccassi <bluca@debian.org>
>> > Sent: Tuesday, October 27, 2020 8:47 PM
>> > To: Ankur Dwivedi <adwivedi@marvell.com>; stable@dpdk.org
>> > Cc: Narayana Prasad Raju Athreya <pathreya@marvell.com>; Anoob
>> > Joseph <anoobj@marvell.com>
>> > Subject: [EXT] Re: [dpdk-stable] [PATCH 19.11] crypto/octeontx2: fix
>> > for multi process
>> >
>> > External Email
>> >
>> > --------------------------------------------------------------------
>> > -- On Thu, 2020-10-22 at 11:27 +0530, Ankur Dwivedi wrote:
>> > > During crypto device probe few functions should be called only for
>> > > the primary process. This patch fixes this issue.
>> > >
>> > > Fixes: 818d138bcce9 ("crypto/octeontx2: add init sequence in
>> > > probe")
>> > >
>> > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
>> > > Reviewed-by: Narayana Prasad Raju Athreya <pathreya@marvell.com>
>> > > Reviewed-by: Anoob Joseph <anoobj@marvell.com>
>> > > ---
>> > >  drivers/crypto/octeontx2/otx2_cryptodev.c     | 46 +++++++++++--------
>> > >  drivers/crypto/octeontx2/otx2_cryptodev.h     |  2 +
>> > >  drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 13 ++++--
>> > >  3 files changed, 38 insertions(+), 23 deletions(-)
>> >
>> > Hi,
>> >
>> > I do not see this patch on main. Does it only apply to 19.11?
>> >
>> Yes this patch applies only to 19.11.
>> For 20.11 I have submitted a separate patch. It is Under Review.
>> The following is the link to patch on 20.11:
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__patches.dpdk.org_p
>>
>atch_81737_&d=DwIFaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=ILjiNF3GF25y6QdH
>ZUxMl6
>>
>JrStU0MIuCtO5dMzn3Ybk&m=YpflGj702BpD9wCrqk6P7WEMgJzHOt_SeOKPeF
>9-P_A&s=
>> j7X0RRQvX5Pqqgn9I91Im6TVmoOH9J5Vj38_WBpEZHU&e=
>
>Once the mainline patch has been reviewed and merged, please send a
>reminder and I'll merge this.
The mainline patch for dpdk 20.11 has been merged. Can you please merge this patch in 19.11?
>
>--
>Kind regards,
>Luca Boccassi

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

* Re: [dpdk-stable] [EXT] Re: [PATCH 19.11] crypto/octeontx2: fix for multi process
  2020-11-06  5:21       ` Ankur Dwivedi
@ 2020-11-09 18:53         ` Luca Boccassi
  0 siblings, 0 replies; 6+ messages in thread
From: Luca Boccassi @ 2020-11-09 18:53 UTC (permalink / raw)
  To: Ankur Dwivedi, stable; +Cc: Narayana Prasad Raju Athreya, Anoob Joseph

On Fri, 2020-11-06 at 05:21 +0000, Ankur Dwivedi wrote:
> Hi Luca,
> 
> Please see my reply inline.
> 
> Regards,
> Ankur
> 
> > -----Original Message-----
> > From: Luca Boccassi <bluca@debian.org>
> > Sent: Wednesday, October 28, 2020 3:23 PM
> > To: Ankur Dwivedi <adwivedi@marvell.com>; stable@dpdk.org
> > Cc: Narayana Prasad Raju Athreya <pathreya@marvell.com>; Anoob Joseph
> > <anoobj@marvell.com>
> > Subject: Re: [dpdk-stable] [EXT] Re: [PATCH 19.11] crypto/octeontx2: fix for
> > multi process
> > 
> > On Wed, 2020-10-28 at 06:52 +0000, Ankur Dwivedi wrote:
> > > Hi Luca,
> > > 
> > > Please see my reply inline.
> > > 
> > > Regards,
> > > Ankur
> > > 
> > > > -----Original Message-----
> > > > From: Luca Boccassi <bluca@debian.org>
> > > > Sent: Tuesday, October 27, 2020 8:47 PM
> > > > To: Ankur Dwivedi <adwivedi@marvell.com>; stable@dpdk.org
> > > > Cc: Narayana Prasad Raju Athreya <pathreya@marvell.com>; Anoob
> > > > Joseph <anoobj@marvell.com>
> > > > Subject: [EXT] Re: [dpdk-stable] [PATCH 19.11] crypto/octeontx2: fix
> > > > for multi process
> > > > 
> > > > External Email
> > > > 
> > > > --------------------------------------------------------------------
> > > > -- On Thu, 2020-10-22 at 11:27 +0530, Ankur Dwivedi wrote:
> > > > > During crypto device probe few functions should be called only for
> > > > > the primary process. This patch fixes this issue.
> > > > > 
> > > > > Fixes: 818d138bcce9 ("crypto/octeontx2: add init sequence in
> > > > > probe")
> > > > > 
> > > > > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> > > > > Reviewed-by: Narayana Prasad Raju Athreya <pathreya@marvell.com>
> > > > > Reviewed-by: Anoob Joseph <anoobj@marvell.com>
> > > > > ---
> > > > >  drivers/crypto/octeontx2/otx2_cryptodev.c     | 46 +++++++++++--------
> > > > >  drivers/crypto/octeontx2/otx2_cryptodev.h     |  2 +
> > > > >  drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 13 ++++--
> > > > >  3 files changed, 38 insertions(+), 23 deletions(-)
> > > > 
> > > > Hi,
> > > > 
> > > > I do not see this patch on main. Does it only apply to 19.11?
> > > > 
> > > Yes this patch applies only to 19.11.
> > > For 20.11 I have submitted a separate patch. It is Under Review.
> > > The following is the link to patch on 20.11:
> > > https://urldefense.proofpoint.com/v2/url?u=http-3A__patches.dpdk.org_p
> > > 
> > atch_81737_&d=DwIFaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=ILjiNF3GF25y6QdH
> > ZUxMl6
> > JrStU0MIuCtO5dMzn3Ybk&m=YpflGj702BpD9wCrqk6P7WEMgJzHOt_SeOKPeF
> > 9-P_A&s=
> > > j7X0RRQvX5Pqqgn9I91Im6TVmoOH9J5Vj38_WBpEZHU&e=
> > 
> > Once the mainline patch has been reviewed and merged, please send a
> > reminder and I'll merge this.
> The mainline patch for dpdk 20.11 has been merged. Can you please merge this patch in 19.11?

Hi,

I can confirm the patch has been picked up and it's queued.

-- 
Kind regards,
Luca Boccassi

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

end of thread, other threads:[~2020-11-09 18:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-22  5:57 [dpdk-stable] [PATCH 19.11] crypto/octeontx2: fix for multi process Ankur Dwivedi
2020-10-27 15:17 ` Luca Boccassi
2020-10-28  6:52   ` [dpdk-stable] [EXT] " Ankur Dwivedi
2020-10-28  9:52     ` Luca Boccassi
2020-11-06  5:21       ` Ankur Dwivedi
2020-11-09 18:53         ` Luca Boccassi

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