patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] [PATCH] drivers/crypto/dpaa_sec: update DPAA iova table in dpaa_mem_vtop
@ 2019-09-11 16:06 Thierry Herbelot
  2019-09-12  5:24 ` Hemant Agrawal
  2019-09-12  8:38 ` Thierry Herbelot
  0 siblings, 2 replies; 4+ messages in thread
From: Thierry Herbelot @ 2019-09-11 16:06 UTC (permalink / raw)
  To: dev; +Cc: Thomas Monjalon, stable, akhil.goyal, hemant.agrawal

dpaa_sec needs translations between physical and virtual addresses.
V to P translation is relatively fast, as memory is managed in
contiguous segments.

The result of each V to P translation is used to update the DPAA iova
table, which should be updated by a Mem event callback, but is not.
Then the DPAA iova table has entries for all needed memory ranges.

With this patch, dpaa_mem_ptov will always use dpaax_iova_table_get_va,
which ensures optimal performance.

Fixes: 5a7dbb934d75 ('dpaa: enable dpaax library')
Cc: stable@dpdk.org
Cc: akhil.goyal@nxp.com
Cc: hemant.agrawal@nxp.com

Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
---
 drivers/crypto/dpaa_sec/dpaa_sec.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 122c80a072ff..22b8b1d63ce0 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -38,6 +38,7 @@
 #include <rte_dpaa_bus.h>
 #include <dpaa_sec.h>
 #include <dpaa_sec_log.h>
+#include <dpaax_iova_table.h>
 
 enum rta_sec_era rta_sec_era;
 
@@ -100,8 +101,10 @@ dpaa_mem_vtop(void *vaddr)
 	const struct rte_memseg *ms;
 
 	ms = rte_mem_virt2memseg(vaddr, NULL);
-	if (ms)
+	if (ms) {
+		dpaax_iova_table_update(ms->iova, (void *)ms->addr_64, ms->len);
 		return ms->iova + RTE_PTR_DIFF(vaddr, ms->addr);
+	}
 	return (size_t)NULL;
 }
 
-- 
2.20.1


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

* Re: [dpdk-stable] [PATCH] drivers/crypto/dpaa_sec: update DPAA iova table in dpaa_mem_vtop
  2019-09-11 16:06 [dpdk-stable] [PATCH] drivers/crypto/dpaa_sec: update DPAA iova table in dpaa_mem_vtop Thierry Herbelot
@ 2019-09-12  5:24 ` Hemant Agrawal
  2019-09-12  8:38 ` Thierry Herbelot
  1 sibling, 0 replies; 4+ messages in thread
From: Hemant Agrawal @ 2019-09-12  5:24 UTC (permalink / raw)
  To: Thierry Herbelot, dev; +Cc: Thomas Monjalon, stable, Akhil Goyal

Hi Thierry,

> -----Original Message-----
> From: Thierry Herbelot <thierry.herbelot@6wind.com>
> Sent: Wednesday, September 11, 2019 9:37 PM
> To: dev@dpdk.org
> Cc: Thomas Monjalon <thomas@monjalon.net>; stable@dpdk.org; Akhil
> Goyal <akhil.goyal@nxp.com>; Hemant Agrawal
> <hemant.agrawal@nxp.com>
> Subject: [PATCH] drivers/crypto/dpaa_sec: update DPAA iova table in
> dpaa_mem_vtop
> Importance: High
> 
> dpaa_sec needs translations between physical and virtual addresses.
> V to P translation is relatively fast, as memory is managed in contiguous
> segments.
> 
> The result of each V to P translation is used to update the DPAA iova table,
> which should be updated by a Mem event callback, but is not.
> Then the DPAA iova table has entries for all needed memory ranges.
> 
> With this patch, dpaa_mem_ptov will always use dpaax_iova_table_get_va,
> which ensures optimal performance.
> 
> Fixes: 5a7dbb934d75 ('dpaa: enable dpaax library')
> Cc: stable@dpdk.org
> Cc: akhil.goyal@nxp.com
> Cc: hemant.agrawal@nxp.com
> 
> Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
> ---
>  drivers/crypto/dpaa_sec/dpaa_sec.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c
> b/drivers/crypto/dpaa_sec/dpaa_sec.c
> index 122c80a072ff..22b8b1d63ce0 100644
> --- a/drivers/crypto/dpaa_sec/dpaa_sec.c
> +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
> @@ -38,6 +38,7 @@
>  #include <rte_dpaa_bus.h>
>  #include <dpaa_sec.h>
>  #include <dpaa_sec_log.h>
> +#include <dpaax_iova_table.h>
> 
>  enum rta_sec_era rta_sec_era;
> 
> @@ -100,8 +101,10 @@ dpaa_mem_vtop(void *vaddr)
>  	const struct rte_memseg *ms;
> 
>  	ms = rte_mem_virt2memseg(vaddr, NULL);
> -	if (ms)
> +	if (ms) {
> +		dpaax_iova_table_update(ms->iova, (void *)ms->addr_64,
> ms->len);
[Hemant] This fails 32bit (i686) compilation 
You can use "ms->addr" instead of  "(void *)ms->addr_64"

>  		return ms->iova + RTE_PTR_DIFF(vaddr, ms->addr);
> +	}
>  	return (size_t)NULL;
>  }
> 
> --
> 2.20.1


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

* [dpdk-stable] [PATCH] drivers/crypto/dpaa_sec: update DPAA iova table in dpaa_mem_vtop
  2019-09-11 16:06 [dpdk-stable] [PATCH] drivers/crypto/dpaa_sec: update DPAA iova table in dpaa_mem_vtop Thierry Herbelot
  2019-09-12  5:24 ` Hemant Agrawal
@ 2019-09-12  8:38 ` Thierry Herbelot
  2019-09-12  8:39   ` Hemant Agrawal
  1 sibling, 1 reply; 4+ messages in thread
From: Thierry Herbelot @ 2019-09-12  8:38 UTC (permalink / raw)
  To: dev; +Cc: Thomas Monjalon, stable, akhil.goyal, hemant.agrawal

dpaa_sec needs translations between physical and virtual addresses.
V to P translation is relatively fast, as memory is managed in
contiguous segments.

The result of each V to P translation is used to update the DPAA iova
table, which should be updated by a Mem event callback, but is not.
Then the DPAA iova table has entries for all needed memory ranges.

With this patch, dpaa_mem_ptov will always use dpaax_iova_table_get_va,
which ensures optimal performance.

Fixes: 5a7dbb934d75 ('dpaa: enable dpaax library')
Cc: stable@dpdk.org
Cc: akhil.goyal@nxp.com
Cc: hemant.agrawal@nxp.com

V2: use "ms->addr" instead of  "(void *)ms->addr_64" to fix
    compilation on 32bit (i686)

Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
---
 drivers/crypto/dpaa_sec/dpaa_sec.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 122c80a072ff..b8d142107d2a 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -38,6 +38,7 @@
 #include <rte_dpaa_bus.h>
 #include <dpaa_sec.h>
 #include <dpaa_sec_log.h>
+#include <dpaax_iova_table.h>
 
 enum rta_sec_era rta_sec_era;
 
@@ -100,8 +101,10 @@ dpaa_mem_vtop(void *vaddr)
 	const struct rte_memseg *ms;
 
 	ms = rte_mem_virt2memseg(vaddr, NULL);
-	if (ms)
+	if (ms) {
+		dpaax_iova_table_update(ms->iova, ms->addr, ms->len);
 		return ms->iova + RTE_PTR_DIFF(vaddr, ms->addr);
+	}
 	return (size_t)NULL;
 }
 
-- 
2.20.1


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

* Re: [dpdk-stable] [PATCH] drivers/crypto/dpaa_sec: update DPAA iova table in dpaa_mem_vtop
  2019-09-12  8:38 ` Thierry Herbelot
@ 2019-09-12  8:39   ` Hemant Agrawal
  0 siblings, 0 replies; 4+ messages in thread
From: Hemant Agrawal @ 2019-09-12  8:39 UTC (permalink / raw)
  To: Thierry Herbelot, dev; +Cc: Thomas Monjalon, stable, Akhil Goyal

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

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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-11 16:06 [dpdk-stable] [PATCH] drivers/crypto/dpaa_sec: update DPAA iova table in dpaa_mem_vtop Thierry Herbelot
2019-09-12  5:24 ` Hemant Agrawal
2019-09-12  8:38 ` Thierry Herbelot
2019-09-12  8:39   ` Hemant Agrawal

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://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/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


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