[dpdk-dev,1/2] enic: fix allocation when not using first numa node

Message ID 1441958551-29313-1-git-send-email-david.marchand@6wind.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

David Marchand Sept. 11, 2015, 8:02 a.m. UTC
  Seen by code review.

If dpdk is run with memory only available on socket != 0, then enic pmd
refuses to initialize ports as this pmd requires some memory on socket 0.
Fix this by setting socket to SOCKET_ID_ANY, so that allocations happen on
the caller socket.

Signed-off-by: David Marchand <david.marchand@6wind.com>
---
 drivers/net/enic/enic_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Sujith Sankar Sept. 11, 2015, 8:28 a.m. UTC | #1
On 11/09/15 1:32 pm, "David Marchand" <david.marchand@6wind.com> wrote:

>Seen by code review.
>
>If dpdk is run with memory only available on socket != 0, then enic pmd
>refuses to initialize ports as this pmd requires some memory on socket 0.
>Fix this by setting socket to SOCKET_ID_ANY, so that allocations happen on
>the caller socket.
>
>Signed-off-by: David Marchand <david.marchand@6wind.com>
>---
> drivers/net/enic/enic_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
>index 3b8719f..46a90bd 100644
>--- a/drivers/net/enic/enic_main.c
>+++ b/drivers/net/enic/enic_main.c
>@@ -539,7 +539,7 @@ enic_alloc_consistent(__rte_unused void *priv, size_t
>size,
> 	*dma_handle = 0;
> 
> 	rz = rte_memzone_reserve_aligned((const char *)name,
>-		size, 0, 0, ENIC_ALIGN);
>+					 size, SOCKET_ID_ANY, 0, ENIC_ALIGN);
> 	if (!rz) {
> 		pr_err("%s : Failed to allocate memory requested for %s",
> 			__func__, name);
>--

Acked by: Sujith Sankar <ssujith@cisco.com>

> 
>1.9.1
>
  

Patch

diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 3b8719f..46a90bd 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -539,7 +539,7 @@  enic_alloc_consistent(__rte_unused void *priv, size_t size,
 	*dma_handle = 0;
 
 	rz = rte_memzone_reserve_aligned((const char *)name,
-		size, 0, 0, ENIC_ALIGN);
+					 size, SOCKET_ID_ANY, 0, ENIC_ALIGN);
 	if (!rz) {
 		pr_err("%s : Failed to allocate memory requested for %s",
 			__func__, name);