DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/1] eal: add internal function to get base address
@ 2022-01-17 11:22 Srikanth Yalavarthi
  2022-01-17 13:38 ` [PATCH v3 " Srikanth Yalavarthi
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Srikanth Yalavarthi @ 2022-01-17 11:22 UTC (permalink / raw)
  To: Ray Kinsella; +Cc: dev, jerinj, sshankarnara, Srikanth Yalavarthi

Added an internal helper to get OS-specific EAL mappping base addreess

This helper can be used by the drivers to map host address range with
offload devices and would be need for device specific operations like
firmware load

Change-Id: Ief572468c291c1721699ba7af2bd4fa8054644a0
Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
---
 lib/eal/common/eal_common_config.c | 7 +++++++
 lib/eal/include/rte_eal.h          | 9 +++++++++
 lib/eal/version.map                | 1 +
 3 files changed, 17 insertions(+)

diff --git a/lib/eal/common/eal_common_config.c b/lib/eal/common/eal_common_config.c
index 1c4c4dd585..cec4991d96 100644
--- a/lib/eal/common/eal_common_config.c
+++ b/lib/eal/common/eal_common_config.c
@@ -87,3 +87,10 @@ rte_eal_has_pci(void)
 {
 	return !internal_config.no_pci;
 }
+
+/* Get the EAL base address */
+uint64_t
+rte_eal_get_baseaddr(void)
+{
+	return eal_get_baseaddr();
+}
diff --git a/lib/eal/include/rte_eal.h b/lib/eal/include/rte_eal.h
index 5a34a6acd9..29298c3c83 100644
--- a/lib/eal/include/rte_eal.h
+++ b/lib/eal/include/rte_eal.h
@@ -475,6 +475,15 @@ rte_eal_mbuf_user_pool_ops(void);
 const char *
 rte_eal_get_runtime_dir(void);
 
+/**
+ * Get the OS-specific EAL base address.
+ *
+ * @return
+ *    The base address.
+ */
+__rte_internal
+uint64_t rte_eal_get_baseaddr(void);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/eal/version.map b/lib/eal/version.map
index ab28c22791..b53eeb30d7 100644
--- a/lib/eal/version.map
+++ b/lib/eal/version.map
@@ -425,6 +425,7 @@ EXPERIMENTAL {
 INTERNAL {
 	global:
 
+	rte_eal_get_baseaddr;
 	rte_firmware_read;
 	rte_intr_allow_others;
 	rte_intr_cap_multiple;
-- 
2.17.1


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

* [PATCH v3 1/1] eal: add internal function to get base address
  2022-01-17 11:22 [PATCH 1/1] eal: add internal function to get base address Srikanth Yalavarthi
@ 2022-01-17 13:38 ` Srikanth Yalavarthi
  2022-01-17 13:42 ` [PATCH v4 " Srikanth Yalavarthi
  2022-01-18 13:33 ` [PATCH v5 " Srikanth Yalavarthi
  2 siblings, 0 replies; 11+ messages in thread
From: Srikanth Yalavarthi @ 2022-01-17 13:38 UTC (permalink / raw)
  To: Ray Kinsella; +Cc: dev, jerinj, sshankarnara, Srikanth Yalavarthi

Added an internal helper to get OS-specific EAL mapping base address

This helper can be used by the drivers to map host address range with
offload devices and would be need for device specific operations like
firmware load

Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
Change-Id: I19eec79e46066e3b08896d84ce3f3cb15a59c124
---
 lib/eal/common/eal_common_config.c | 7 +++++++
 lib/eal/include/rte_eal.h          | 9 +++++++++
 lib/eal/version.map                | 1 +
 3 files changed, 17 insertions(+)

diff --git a/lib/eal/common/eal_common_config.c b/lib/eal/common/eal_common_config.c
index 1c4c4dd585..cec4991d96 100644
--- a/lib/eal/common/eal_common_config.c
+++ b/lib/eal/common/eal_common_config.c
@@ -87,3 +87,10 @@ rte_eal_has_pci(void)
 {
 	return !internal_config.no_pci;
 }
+
+/* Get the EAL base address */
+uint64_t
+rte_eal_get_baseaddr(void)
+{
+	return eal_get_baseaddr();
+}
diff --git a/lib/eal/include/rte_eal.h b/lib/eal/include/rte_eal.h
index 5a34a6acd9..29298c3c83 100644
--- a/lib/eal/include/rte_eal.h
+++ b/lib/eal/include/rte_eal.h
@@ -475,6 +475,15 @@ rte_eal_mbuf_user_pool_ops(void);
 const char *
 rte_eal_get_runtime_dir(void);
 
+/**
+ * Get the OS-specific EAL base address.
+ *
+ * @return
+ *    The base address.
+ */
+__rte_internal
+uint64_t rte_eal_get_baseaddr(void);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/eal/version.map b/lib/eal/version.map
index ab28c22791..b53eeb30d7 100644
--- a/lib/eal/version.map
+++ b/lib/eal/version.map
@@ -425,6 +425,7 @@ EXPERIMENTAL {
 INTERNAL {
 	global:
 
+	rte_eal_get_baseaddr;
 	rte_firmware_read;
 	rte_intr_allow_others;
 	rte_intr_cap_multiple;
-- 
2.17.1


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

* [PATCH v4 1/1] eal: add internal function to get base address
  2022-01-17 11:22 [PATCH 1/1] eal: add internal function to get base address Srikanth Yalavarthi
  2022-01-17 13:38 ` [PATCH v3 " Srikanth Yalavarthi
@ 2022-01-17 13:42 ` Srikanth Yalavarthi
  2022-01-17 14:43   ` Dmitry Kozlyuk
  2022-01-18 13:33 ` [PATCH v5 " Srikanth Yalavarthi
  2 siblings, 1 reply; 11+ messages in thread
From: Srikanth Yalavarthi @ 2022-01-17 13:42 UTC (permalink / raw)
  To: Ray Kinsella; +Cc: dev, jerinj, sshankarnara, Srikanth Yalavarthi

Added an internal helper to get OS-specific EAL mapping base address

This helper can be used by the drivers to map host address range with
offload devices and would be need for device specific operations like
firmware load

Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
---
 lib/eal/common/eal_common_config.c | 7 +++++++
 lib/eal/include/rte_eal.h          | 9 +++++++++
 lib/eal/version.map                | 1 +
 3 files changed, 17 insertions(+)

diff --git a/lib/eal/common/eal_common_config.c b/lib/eal/common/eal_common_config.c
index 1c4c4dd585..cec4991d96 100644
--- a/lib/eal/common/eal_common_config.c
+++ b/lib/eal/common/eal_common_config.c
@@ -87,3 +87,10 @@ rte_eal_has_pci(void)
 {
 	return !internal_config.no_pci;
 }
+
+/* Get the EAL base address */
+uint64_t
+rte_eal_get_baseaddr(void)
+{
+	return eal_get_baseaddr();
+}
diff --git a/lib/eal/include/rte_eal.h b/lib/eal/include/rte_eal.h
index 5a34a6acd9..29298c3c83 100644
--- a/lib/eal/include/rte_eal.h
+++ b/lib/eal/include/rte_eal.h
@@ -475,6 +475,15 @@ rte_eal_mbuf_user_pool_ops(void);
 const char *
 rte_eal_get_runtime_dir(void);
 
+/**
+ * Get the OS-specific EAL base address.
+ *
+ * @return
+ *    The base address.
+ */
+__rte_internal
+uint64_t rte_eal_get_baseaddr(void);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/eal/version.map b/lib/eal/version.map
index ab28c22791..b53eeb30d7 100644
--- a/lib/eal/version.map
+++ b/lib/eal/version.map
@@ -425,6 +425,7 @@ EXPERIMENTAL {
 INTERNAL {
 	global:
 
+	rte_eal_get_baseaddr;
 	rte_firmware_read;
 	rte_intr_allow_others;
 	rte_intr_cap_multiple;
-- 
2.17.1


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

* Re: [PATCH v4 1/1] eal: add internal function to get base address
  2022-01-17 13:42 ` [PATCH v4 " Srikanth Yalavarthi
@ 2022-01-17 14:43   ` Dmitry Kozlyuk
  2022-01-18  5:29     ` [EXT] " Srikanth Yalavarthi
  0 siblings, 1 reply; 11+ messages in thread
From: Dmitry Kozlyuk @ 2022-01-17 14:43 UTC (permalink / raw)
  To: Srikanth Yalavarthi; +Cc: Ray Kinsella, dev, jerinj, sshankarnara

2022-01-17 05:42 (UTC-0800), Srikanth Yalavarthi:
> Added an internal helper to get OS-specific EAL mapping base address
> 
> This helper can be used by the drivers to map host address range with
> offload devices and would be need for device specific operations like
> firmware load

Hello Srikanth,

Please elaborate on the intended usage of the new API
and how it will correlate with the EAL usage of the same VA ranges.
Note that on Windows eal_get_baseaddr() returns 0 which does not imply
anything about where EAL mappings will reside.

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

* RE: [EXT] Re: [PATCH v4 1/1] eal: add internal function to get base address
  2022-01-17 14:43   ` Dmitry Kozlyuk
@ 2022-01-18  5:29     ` Srikanth Yalavarthi
  2022-01-18  9:40       ` Dmitry Kozlyuk
  0 siblings, 1 reply; 11+ messages in thread
From: Srikanth Yalavarthi @ 2022-01-18  5:29 UTC (permalink / raw)
  To: Dmitry Kozlyuk
  Cc: Ray Kinsella, dev, Jerin Jacob Kollanukkaran,
	Shivah Shankar Shankar Narayan Rao, Srikanth Yalavarthi

Hi Dmitry,

This is to cater to use cases where chunks of memory are allocated by the host / application, and would like to represent it as an offset from the Linux virtual base address. One use case is for a firmware running on an accelerator, this can be used as reference address to access host memory.

Another situation can be to use the offset as an identifier for the memory using smaller data types

Srikanth

-----Original Message-----
From: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> 
Sent: 17 January 2022 20:14
To: Srikanth Yalavarthi <syalavarthi@marvell.com>
Cc: Ray Kinsella <mdr@ashroe.eu>; dev@dpdk.org; Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Shivah Shankar Shankar Narayan Rao <sshankarnara@marvell.com>
Subject: [EXT] Re: [PATCH v4 1/1] eal: add internal function to get base address

External Email

----------------------------------------------------------------------
2022-01-17 05:42 (UTC-0800), Srikanth Yalavarthi:
> Added an internal helper to get OS-specific EAL mapping base address
> 
> This helper can be used by the drivers to map host address range with 
> offload devices and would be need for device specific operations like 
> firmware load

Hello Srikanth,

Please elaborate on the intended usage of the new API and how it will correlate with the EAL usage of the same VA ranges.
Note that on Windows eal_get_baseaddr() returns 0 which does not imply anything about where EAL mappings will reside.

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

* Re: [EXT] Re: [PATCH v4 1/1] eal: add internal function to get base address
  2022-01-18  5:29     ` [EXT] " Srikanth Yalavarthi
@ 2022-01-18  9:40       ` Dmitry Kozlyuk
  0 siblings, 0 replies; 11+ messages in thread
From: Dmitry Kozlyuk @ 2022-01-18  9:40 UTC (permalink / raw)
  To: Srikanth Yalavarthi
  Cc: Ray Kinsella, dev, Jerin Jacob Kollanukkaran,
	Shivah Shankar Shankar Narayan Rao

2022-01-18 05:29 (UTC+0000), Srikanth Yalavarthi:
> Hi Dmitry,
> 
> This is to cater to use cases where chunks of memory are allocated by the host / application, and would like to represent it as an offset from the Linux virtual base address. One use case is for a firmware running on an accelerator, this can be used as reference address to access host memory.
> 
> Another situation can be to use the offset as an identifier for the memory using smaller data types

Thank you, the intent is clear now. It is worth adding to the commit log.
On the implementation: eal_get_baseaddr() does not respect --base-virtaddr,
you probably want something like what eal_get_virtual_area() uses:

	internal_conf->base_virtaddr != 0 ?
		internal_conf->base_virtaddr : eal_get_baseaddr()

P.S. Please avoid top-posting.


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

* [PATCH v5 1/1] eal: add internal function to get base address
  2022-01-17 11:22 [PATCH 1/1] eal: add internal function to get base address Srikanth Yalavarthi
  2022-01-17 13:38 ` [PATCH v3 " Srikanth Yalavarthi
  2022-01-17 13:42 ` [PATCH v4 " Srikanth Yalavarthi
@ 2022-01-18 13:33 ` Srikanth Yalavarthi
  2022-02-02 14:19   ` Thomas Monjalon
                     ` (2 more replies)
  2 siblings, 3 replies; 11+ messages in thread
From: Srikanth Yalavarthi @ 2022-01-18 13:33 UTC (permalink / raw)
  To: Ray Kinsella
  Cc: dev, jerinj, sshankarnara, dmitry.kozliuk, Srikanth Yalavarthi

Added an internal helper to get OS-specific EAL mapping base address

This helper can be used by the drivers to program offload / accelerator
devices, where the base address can be used as a reference address by
the accelerator to access the host memory

An address can also be represented as an offset relative to the base
address using smaller data types

Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
---
 lib/eal/common/eal_common_config.c | 9 +++++++++
 lib/eal/include/rte_eal.h          | 9 +++++++++
 lib/eal/version.map                | 1 +
 3 files changed, 19 insertions(+)

diff --git a/lib/eal/common/eal_common_config.c b/lib/eal/common/eal_common_config.c
index 1c4c4dd585..19598cb28d 100644
--- a/lib/eal/common/eal_common_config.c
+++ b/lib/eal/common/eal_common_config.c
@@ -87,3 +87,12 @@ rte_eal_has_pci(void)
 {
 	return !internal_config.no_pci;
 }
+
+/* Get the EAL base address */
+uint64_t
+rte_eal_get_baseaddr(void)
+{
+	return (internal_config.base_virtaddr != 0) ?
+		       (uint64_t) internal_config.base_virtaddr :
+		       eal_get_baseaddr();
+}
diff --git a/lib/eal/include/rte_eal.h b/lib/eal/include/rte_eal.h
index 5a34a6acd9..29298c3c83 100644
--- a/lib/eal/include/rte_eal.h
+++ b/lib/eal/include/rte_eal.h
@@ -475,6 +475,15 @@ rte_eal_mbuf_user_pool_ops(void);
 const char *
 rte_eal_get_runtime_dir(void);
 
+/**
+ * Get the OS-specific EAL base address.
+ *
+ * @return
+ *    The base address.
+ */
+__rte_internal
+uint64_t rte_eal_get_baseaddr(void);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/eal/version.map b/lib/eal/version.map
index ab28c22791..b53eeb30d7 100644
--- a/lib/eal/version.map
+++ b/lib/eal/version.map
@@ -425,6 +425,7 @@ EXPERIMENTAL {
 INTERNAL {
 	global:
 
+	rte_eal_get_baseaddr;
 	rte_firmware_read;
 	rte_intr_allow_others;
 	rte_intr_cap_multiple;
-- 
2.17.1


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

* Re: [PATCH v5 1/1] eal: add internal function to get base address
  2022-01-18 13:33 ` [PATCH v5 " Srikanth Yalavarthi
@ 2022-02-02 14:19   ` Thomas Monjalon
  2022-02-04 19:28   ` Dmitry Kozlyuk
  2022-02-08 17:15   ` Burakov, Anatoly
  2 siblings, 0 replies; 11+ messages in thread
From: Thomas Monjalon @ 2022-02-02 14:19 UTC (permalink / raw)
  To: dmitry.kozliuk, anatoly.burakov
  Cc: Ray Kinsella, dev, jerinj, sshankarnara, Srikanth Yalavarthi

Dmitry, Anatoly,
any new comment on this v5?


18/01/2022 14:33, Srikanth Yalavarthi:
> Added an internal helper to get OS-specific EAL mapping base address
> 
> This helper can be used by the drivers to program offload / accelerator
> devices, where the base address can be used as a reference address by
> the accelerator to access the host memory
> 
> An address can also be represented as an offset relative to the base
> address using smaller data types
> 
> Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
> ---
>  lib/eal/common/eal_common_config.c | 9 +++++++++
>  lib/eal/include/rte_eal.h          | 9 +++++++++
>  lib/eal/version.map                | 1 +
>  3 files changed, 19 insertions(+)
> 
> diff --git a/lib/eal/common/eal_common_config.c b/lib/eal/common/eal_common_config.c
> index 1c4c4dd585..19598cb28d 100644
> --- a/lib/eal/common/eal_common_config.c
> +++ b/lib/eal/common/eal_common_config.c
> @@ -87,3 +87,12 @@ rte_eal_has_pci(void)
>  {
>  	return !internal_config.no_pci;
>  }
> +
> +/* Get the EAL base address */
> +uint64_t
> +rte_eal_get_baseaddr(void)
> +{
> +	return (internal_config.base_virtaddr != 0) ?
> +		       (uint64_t) internal_config.base_virtaddr :
> +		       eal_get_baseaddr();
> +}
> diff --git a/lib/eal/include/rte_eal.h b/lib/eal/include/rte_eal.h
> index 5a34a6acd9..29298c3c83 100644
> --- a/lib/eal/include/rte_eal.h
> +++ b/lib/eal/include/rte_eal.h
> @@ -475,6 +475,15 @@ rte_eal_mbuf_user_pool_ops(void);
>  const char *
>  rte_eal_get_runtime_dir(void);
>  
> +/**
> + * Get the OS-specific EAL base address.
> + *
> + * @return
> + *    The base address.
> + */
> +__rte_internal
> +uint64_t rte_eal_get_baseaddr(void);
> +
>  #ifdef __cplusplus
>  }
>  #endif
> diff --git a/lib/eal/version.map b/lib/eal/version.map
> index ab28c22791..b53eeb30d7 100644
> --- a/lib/eal/version.map
> +++ b/lib/eal/version.map
> @@ -425,6 +425,7 @@ EXPERIMENTAL {
>  INTERNAL {
>  	global:
>  
> +	rte_eal_get_baseaddr;
>  	rte_firmware_read;
>  	rte_intr_allow_others;
>  	rte_intr_cap_multiple;
> 






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

* Re: [PATCH v5 1/1] eal: add internal function to get base address
  2022-01-18 13:33 ` [PATCH v5 " Srikanth Yalavarthi
  2022-02-02 14:19   ` Thomas Monjalon
@ 2022-02-04 19:28   ` Dmitry Kozlyuk
  2022-02-08 17:15   ` Burakov, Anatoly
  2 siblings, 0 replies; 11+ messages in thread
From: Dmitry Kozlyuk @ 2022-02-04 19:28 UTC (permalink / raw)
  To: Srikanth Yalavarthi; +Cc: Ray Kinsella, dev, jerinj, sshankarnara

2022-01-18 05:33 (UTC-0800), Srikanth Yalavarthi:
> Added an internal helper to get OS-specific EAL mapping base address
> 
> This helper can be used by the drivers to program offload / accelerator
> devices, where the base address can be used as a reference address by
> the accelerator to access the host memory
> 
> An address can also be represented as an offset relative to the base
> address using smaller data types
> 
> Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
> ---
>  lib/eal/common/eal_common_config.c | 9 +++++++++
>  lib/eal/include/rte_eal.h          | 9 +++++++++
>  lib/eal/version.map                | 1 +
>  3 files changed, 19 insertions(+)

Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>

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

* Re: [PATCH v5 1/1] eal: add internal function to get base address
  2022-01-18 13:33 ` [PATCH v5 " Srikanth Yalavarthi
  2022-02-02 14:19   ` Thomas Monjalon
  2022-02-04 19:28   ` Dmitry Kozlyuk
@ 2022-02-08 17:15   ` Burakov, Anatoly
  2022-02-08 22:58     ` Thomas Monjalon
  2 siblings, 1 reply; 11+ messages in thread
From: Burakov, Anatoly @ 2022-02-08 17:15 UTC (permalink / raw)
  To: Srikanth Yalavarthi, Ray Kinsella
  Cc: dev, jerinj, sshankarnara, dmitry.kozliuk

On 18-Jan-22 1:33 PM, Srikanth Yalavarthi wrote:
> Added an internal helper to get OS-specific EAL mapping base address
> 
> This helper can be used by the drivers to program offload / accelerator
> devices, where the base address can be used as a reference address by
> the accelerator to access the host memory
> 
> An address can also be represented as an offset relative to the base
> address using smaller data types
> 
> Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
> ---

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

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

* Re: [PATCH v5 1/1] eal: add internal function to get base address
  2022-02-08 17:15   ` Burakov, Anatoly
@ 2022-02-08 22:58     ` Thomas Monjalon
  0 siblings, 0 replies; 11+ messages in thread
From: Thomas Monjalon @ 2022-02-08 22:58 UTC (permalink / raw)
  To: Srikanth Yalavarthi
  Cc: Ray Kinsella, dev, jerinj, sshankarnara, dmitry.kozliuk, Burakov,
	Anatoly

08/02/2022 18:15, Burakov, Anatoly:
> On 18-Jan-22 1:33 PM, Srikanth Yalavarthi wrote:
> > Added an internal helper to get OS-specific EAL mapping base address
> > 
> > This helper can be used by the drivers to program offload / accelerator
> > devices, where the base address can be used as a reference address by
> > the accelerator to access the host memory
> > 
> > An address can also be represented as an offset relative to the base
> > address using smaller data types
> > 
> > Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
> Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

Applied, thanks.



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

end of thread, other threads:[~2022-02-08 22:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-17 11:22 [PATCH 1/1] eal: add internal function to get base address Srikanth Yalavarthi
2022-01-17 13:38 ` [PATCH v3 " Srikanth Yalavarthi
2022-01-17 13:42 ` [PATCH v4 " Srikanth Yalavarthi
2022-01-17 14:43   ` Dmitry Kozlyuk
2022-01-18  5:29     ` [EXT] " Srikanth Yalavarthi
2022-01-18  9:40       ` Dmitry Kozlyuk
2022-01-18 13:33 ` [PATCH v5 " Srikanth Yalavarthi
2022-02-02 14:19   ` Thomas Monjalon
2022-02-04 19:28   ` Dmitry Kozlyuk
2022-02-08 17:15   ` Burakov, Anatoly
2022-02-08 22:58     ` Thomas Monjalon

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).