diff mbox series

crypto/dpaa2_sec: remove iova conversion for fle address

Message ID 20180509092642.9092-1-shreyansh.jain@nxp.com
State New
Headers show
Series crypto/dpaa2_sec: remove iova conversion for fle address | expand

Commit Message

Shreyansh Jain May 9, 2018, 9:26 a.m. UTC
From: Hemant Agrawal <hemant.agrawal@nxp.com>


fle is already in virtual addressing mode - no need to perform
address conversion for it.

Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation")
Cc: akhil.goyal@nxp.com

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

---
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

-- 
2.17.0

Comments

Akhil Goyal May 9, 2018, 9:14 a.m. UTC | #1
On 5/9/2018 2:56 PM, Shreyansh Jain wrote:
> From: Hemant Agrawal <hemant.agrawal@nxp.com>

>

> fle is already in virtual addressing mode - no need to perform

> address conversion for it.

>

> Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation")

> Cc: akhil.goyal@nxp.com

>

> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

> ---

>  drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 3 +--

>  1 file changed, 1 insertion(+), 2 deletions(-)

>

> diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c

> index 58cbce868..56fa969d3 100644

> --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c

> +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c

> @@ -1261,8 +1261,7 @@ sec_fd_to_mbuf(const struct qbman_fd *fd, uint8_t driver_id)

>  		DPAA2_SEC_ERR("error: non inline buffer");

>  		return NULL;

>  	}

> -	op = (struct rte_crypto_op *)DPAA2_IOVA_TO_VADDR(

> -			DPAA2_GET_FLE_ADDR((fle - 1)));

> +	op = (struct rte_crypto_op *)DPAA2_GET_FLE_ADDR((fle - 1));

>

>  	/* Prefeth op */

>  	src = op->sym->m_src;

>

Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
De Lara Guarch, Pablo May 9, 2018, 10:24 a.m. UTC | #2
> -----Original Message-----

> From: Akhil Goyal [mailto:akhil.goyal@nxp.com]

> Sent: Wednesday, May 9, 2018 10:14 AM

> To: Shreyansh Jain <shreyansh.jain@nxp.com>; De Lara Guarch, Pablo

> <pablo.de.lara.guarch@intel.com>

> Cc: akhil.goyal@nxp.com; dev@dpdk.org; Hemant Agrawal

> <hemant.agrawal@nxp.com>

> Subject: Re: [dpdk-dev] [PATCH] crypto/dpaa2_sec: remove iova conversion for

> fle address

> 

> On 5/9/2018 2:56 PM, Shreyansh Jain wrote:

> > From: Hemant Agrawal <hemant.agrawal@nxp.com>

> >

> > fle is already in virtual addressing mode - no need to perform address

> > conversion for it.

> >

> > Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation")

> > Cc: akhil.goyal@nxp.com

> >

> > Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>


...

> >

> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>


Added Cc: stable@dpdk.org (try remembering this for next time, please).

Applied to dpdk-next-crypto.
Thanks,

Pablo
De Lara Guarch, Pablo May 9, 2018, 11:30 a.m. UTC | #3
Hi,

> -----Original Message-----

> From: Shreyansh Jain [mailto:shreyansh.jain@nxp.com]

> Sent: Wednesday, May 9, 2018 12:40 PM

> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>

> Cc: Akhil Goyal <akhil.goyal@nxp.com>; dev@dpdk.org; Hemant Agrawal

> <hemant.agrawal@nxp.com>

> Subject: Re: [dpdk-dev] [PATCH] crypto/dpaa2_sec: remove iova conversion for

> fle address

> 

> On Wednesday 09 May 2018 03:54 PM, De Lara Guarch, Pablo wrote:

> >

> >

> >> -----Original Message-----

> >> From: Akhil Goyal [mailto:akhil.goyal@nxp.com]

> >> Sent: Wednesday, May 9, 2018 10:14 AM

> >> To: Shreyansh Jain <shreyansh.jain@nxp.com>; De Lara Guarch, Pablo

> >> <pablo.de.lara.guarch@intel.com>

> >> Cc: akhil.goyal@nxp.com; dev@dpdk.org; Hemant Agrawal

> >> <hemant.agrawal@nxp.com>

> >> Subject: Re: [dpdk-dev] [PATCH] crypto/dpaa2_sec: remove iova

> >> conversion for fle address

> >>

> >> On 5/9/2018 2:56 PM, Shreyansh Jain wrote:

> >>> From: Hemant Agrawal <hemant.agrawal@nxp.com>

> >>>

> >>> fle is already in virtual addressing mode - no need to perform

> >>> address conversion for it.

> >>>

> >>> Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation")

> >>> Cc: akhil.goyal@nxp.com

> >>>

> >>> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

> >

> > ...

> >

> >>>

> >> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>

> >

> > Added Cc: stable@dpdk.org (try remembering this for next time, please).

> 

> Thanks for doing it this time. I'll take care of this next time.


No worries. Actually, gcc 32 bits is broken:

drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c:1264:7:
error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  op = (struct rte_crypto_op *)DPAA2_GET_FLE_ADDR((fle - 1));

Is this PMD supposed to be compatible for 32-bit targets?

Thanks,
Pablo

> 

> >

> > Applied to dpdk-next-crypto.

> > Thanks,

> >

> > Pablo

> >
Shreyansh Jain May 9, 2018, 11:39 a.m. UTC | #4
On Wednesday 09 May 2018 03:54 PM, De Lara Guarch, Pablo wrote:
> 

> 

>> -----Original Message-----

>> From: Akhil Goyal [mailto:akhil.goyal@nxp.com]

>> Sent: Wednesday, May 9, 2018 10:14 AM

>> To: Shreyansh Jain <shreyansh.jain@nxp.com>; De Lara Guarch, Pablo

>> <pablo.de.lara.guarch@intel.com>

>> Cc: akhil.goyal@nxp.com; dev@dpdk.org; Hemant Agrawal

>> <hemant.agrawal@nxp.com>

>> Subject: Re: [dpdk-dev] [PATCH] crypto/dpaa2_sec: remove iova conversion for

>> fle address

>>

>> On 5/9/2018 2:56 PM, Shreyansh Jain wrote:

>>> From: Hemant Agrawal <hemant.agrawal@nxp.com>

>>>

>>> fle is already in virtual addressing mode - no need to perform address

>>> conversion for it.

>>>

>>> Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation")

>>> Cc: akhil.goyal@nxp.com

>>>

>>> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

> 

> ...

> 

>>>

>> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>

> 

> Added Cc: stable@dpdk.org (try remembering this for next time, please).


Thanks for doing it this time. I'll take care of this next time.

> 

> Applied to dpdk-next-crypto.

> Thanks,

> 

> Pablo

>
Shreyansh Jain May 9, 2018, 12:29 p.m. UTC | #5
On Wednesday 09 May 2018 05:00 PM, De Lara Guarch, Pablo wrote:
> Hi,

> 

>> -----Original Message-----

>> From: Shreyansh Jain [mailto:shreyansh.jain@nxp.com]

>> Sent: Wednesday, May 9, 2018 12:40 PM

>> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>

>> Cc: Akhil Goyal <akhil.goyal@nxp.com>; dev@dpdk.org; Hemant Agrawal

>> <hemant.agrawal@nxp.com>

>> Subject: Re: [dpdk-dev] [PATCH] crypto/dpaa2_sec: remove iova conversion for

>> fle address

>>

>> On Wednesday 09 May 2018 03:54 PM, De Lara Guarch, Pablo wrote:

>>>

>>>

>>>> -----Original Message-----

>>>> From: Akhil Goyal [mailto:akhil.goyal@nxp.com]

>>>> Sent: Wednesday, May 9, 2018 10:14 AM

>>>> To: Shreyansh Jain <shreyansh.jain@nxp.com>; De Lara Guarch, Pablo

>>>> <pablo.de.lara.guarch@intel.com>

>>>> Cc: akhil.goyal@nxp.com; dev@dpdk.org; Hemant Agrawal

>>>> <hemant.agrawal@nxp.com>

>>>> Subject: Re: [dpdk-dev] [PATCH] crypto/dpaa2_sec: remove iova

>>>> conversion for fle address

>>>>

>>>> On 5/9/2018 2:56 PM, Shreyansh Jain wrote:

>>>>> From: Hemant Agrawal <hemant.agrawal@nxp.com>

>>>>>

>>>>> fle is already in virtual addressing mode - no need to perform

>>>>> address conversion for it.

>>>>>

>>>>> Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation")

>>>>> Cc: akhil.goyal@nxp.com

>>>>>

>>>>> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

>>>

>>> ...

>>>

>>>>>

>>>> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>

>>>

>>> Added Cc: stable@dpdk.org (try remembering this for next time, please).

>>

>> Thanks for doing it this time. I'll take care of this next time.

> 

> No worries. Actually, gcc 32 bits is broken:

> 

> drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c:1264:7:

> error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

>    op = (struct rte_crypto_op *)DPAA2_GET_FLE_ADDR((fle - 1));

> 

> Is this PMD supposed to be compatible for 32-bit targets?


Oh! This is bad. I will send you an update on this in a few minutes.
Ideally, the code was written for 64bit in mind - though, it should 
still be able to work (at least compile) for 32 bit.

> 

> Thanks,

> Pablo

> 

>>

>>>

>>> Applied to dpdk-next-crypto.

>>> Thanks,

>>>

>>> Pablo

>>>

>
Shreyansh Jain May 9, 2018, 12:46 p.m. UTC | #6
On Wednesday 09 May 2018 05:59 PM, Shreyansh Jain wrote:
> On Wednesday 09 May 2018 05:00 PM, De Lara Guarch, Pablo wrote:

>> Hi,

>>

>>> -----Original Message-----

>>> From: Shreyansh Jain [mailto:shreyansh.jain@nxp.com]

>>> Sent: Wednesday, May 9, 2018 12:40 PM

>>> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>

>>> Cc: Akhil Goyal <akhil.goyal@nxp.com>; dev@dpdk.org; Hemant Agrawal

>>> <hemant.agrawal@nxp.com>

>>> Subject: Re: [dpdk-dev] [PATCH] crypto/dpaa2_sec: remove iova 

>>> conversion for

>>> fle address

>>>

>>> On Wednesday 09 May 2018 03:54 PM, De Lara Guarch, Pablo wrote:

>>>>

>>>>

>>>>> -----Original Message-----

>>>>> From: Akhil Goyal [mailto:akhil.goyal@nxp.com]

>>>>> Sent: Wednesday, May 9, 2018 10:14 AM

>>>>> To: Shreyansh Jain <shreyansh.jain@nxp.com>; De Lara Guarch, Pablo

>>>>> <pablo.de.lara.guarch@intel.com>

>>>>> Cc: akhil.goyal@nxp.com; dev@dpdk.org; Hemant Agrawal

>>>>> <hemant.agrawal@nxp.com>

>>>>> Subject: Re: [dpdk-dev] [PATCH] crypto/dpaa2_sec: remove iova

>>>>> conversion for fle address

>>>>>

>>>>> On 5/9/2018 2:56 PM, Shreyansh Jain wrote:

>>>>>> From: Hemant Agrawal <hemant.agrawal@nxp.com>

>>>>>>

>>>>>> fle is already in virtual addressing mode - no need to perform

>>>>>> address conversion for it.

>>>>>>

>>>>>> Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation")

>>>>>> Cc: akhil.goyal@nxp.com

>>>>>>

>>>>>> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

>>>>

>>>> ...

>>>>

>>>>>>

>>>>> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>

>>>>

>>>> Added Cc: stable@dpdk.org (try remembering this for next time, please).

>>>

>>> Thanks for doing it this time. I'll take care of this next time.

>>

>> No worries. Actually, gcc 32 bits is broken:

>>

>> drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c:1264:7:

>> error: cast to pointer from integer of different size 

>> [-Werror=int-to-pointer-cast]

>>    op = (struct rte_crypto_op *)DPAA2_GET_FLE_ADDR((fle - 1));

>>

>> Is this PMD supposed to be compatible for 32-bit targets?

> 

> Oh! This is bad. I will send you an update on this in a few minutes.

> Ideally, the code was written for 64bit in mind - though, it should 

> still be able to work (at least compile) for 32 bit.


I have sent the v2 but I observe that the patchwork for v1 states 
'accepted' - not sure if I can change that back to 'superseded'.

If you have already applied and issued the pull request for next (and 
you won't be changing it), I will send a fix against that.

> 

>>

>> Thanks,

>> Pablo

>>

>>>

>>>>

>>>> Applied to dpdk-next-crypto.

>>>> Thanks,

>>>>

>>>> Pablo

>>>>

>>

>
diff mbox series

Patch

diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 58cbce868..56fa969d3 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -1261,8 +1261,7 @@  sec_fd_to_mbuf(const struct qbman_fd *fd, uint8_t driver_id)
 		DPAA2_SEC_ERR("error: non inline buffer");
 		return NULL;
 	}
-	op = (struct rte_crypto_op *)DPAA2_IOVA_TO_VADDR(
-			DPAA2_GET_FLE_ADDR((fle - 1)));
+	op = (struct rte_crypto_op *)DPAA2_GET_FLE_ADDR((fle - 1));
 
 	/* Prefeth op */
 	src = op->sym->m_src;