All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] bond: avoid allocating mempool on socket LCORE_ID_ANY
@ 2017-04-26 21:30 Jan Blunck
  2017-04-26 21:30 ` [PATCH 2/2] bond: use rte_eth_dev_socket_id() Jan Blunck
  2017-06-28  9:47 ` [PATCH 1/2] bond: avoid allocating mempool on socket LCORE_ID_ANY Declan Doherty
  0 siblings, 2 replies; 8+ messages in thread
From: Jan Blunck @ 2017-04-26 21:30 UTC (permalink / raw)
  To: dev; +Cc: Eric Kinzie, Eric Kinzie

If the numa node is unknown, use the value from rte_socket_id() to avoid
an allocation failure.

Signed-off-by: Eric Kinzie <ekinzie@brocade.com>
CC: Eric Kinzie <ehkinzie@gmail.com>
---
 drivers/net/bonding/rte_eth_bond_8023ad.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
index 7b863d6..b8df536 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -887,6 +887,8 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id)
 	RTE_ASSERT(port->rx_ring == NULL);
 	RTE_ASSERT(port->tx_ring == NULL);
 	socket_id = rte_eth_devices[slave_id].data->numa_node;
+	if (socket_id == (uint8_t)LCORE_ID_ANY)
+		socket_id = 0;
 
 	element_size = sizeof(struct slow_protocol_frame) +
 				RTE_PKTMBUF_HEADROOM;
-- 
2.7.4

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

* [PATCH 2/2] bond: use rte_eth_dev_socket_id()
  2017-04-26 21:30 [PATCH 1/2] bond: avoid allocating mempool on socket LCORE_ID_ANY Jan Blunck
@ 2017-04-26 21:30 ` Jan Blunck
  2017-06-28  9:49   ` Declan Doherty
  2017-06-28  9:47 ` [PATCH 1/2] bond: avoid allocating mempool on socket LCORE_ID_ANY Declan Doherty
  1 sibling, 1 reply; 8+ messages in thread
From: Jan Blunck @ 2017-04-26 21:30 UTC (permalink / raw)
  To: dev; +Cc: Wen Chiu, Stephen Hemminger

The bonded device does not have to be a PCI device. Use the rte_ethdev
functions instead.

Signed-off-by: Wen Chiu <wchiu@brocade.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Jan Blunck <jblunck@infradead.org>
---
 drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
index b8df536..f84553c 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -886,7 +886,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id)
 
 	RTE_ASSERT(port->rx_ring == NULL);
 	RTE_ASSERT(port->tx_ring == NULL);
-	socket_id = rte_eth_devices[slave_id].data->numa_node;
+	socket_id = rte_eth_dev_socket_id(slave_id);
 	if (socket_id == (uint8_t)LCORE_ID_ANY)
 		socket_id = 0;
 
-- 
2.7.4

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

* Re: [PATCH 1/2] bond: avoid allocating mempool on socket LCORE_ID_ANY
  2017-04-26 21:30 [PATCH 1/2] bond: avoid allocating mempool on socket LCORE_ID_ANY Jan Blunck
  2017-04-26 21:30 ` [PATCH 2/2] bond: use rte_eth_dev_socket_id() Jan Blunck
@ 2017-06-28  9:47 ` Declan Doherty
  2017-06-28 12:00   ` Jan Blunck
  1 sibling, 1 reply; 8+ messages in thread
From: Declan Doherty @ 2017-06-28  9:47 UTC (permalink / raw)
  To: dev; +Cc: Jan Blunck, Eric Kinzie

On 26/04/17 22:30, Jan Blunck wrote:
> If the numa node is unknown, use the value from rte_socket_id() to avoid
> an allocation failure.
> 
> Signed-off-by: Eric Kinzie <ekinzie@brocade.com>
> CC: Eric Kinzie <ehkinzie@gmail.com>
> ---
>   drivers/net/bonding/rte_eth_bond_8023ad.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
> index 7b863d6..b8df536 100644
> --- a/drivers/net/bonding/rte_eth_bond_8023ad.c
> +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
> @@ -887,6 +887,8 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id)
>   	RTE_ASSERT(port->rx_ring == NULL);
>   	RTE_ASSERT(port->tx_ring == NULL);
>   	socket_id = rte_eth_devices[slave_id].data->numa_node;
> +	if (socket_id == (uint8_t)LCORE_ID_ANY)

socket_id is an integer so we shouldn't be casting LCORE_ID_ANY to an 
uint8_t as this condition would never match as LCORE_ID_ANY wouldn't be 
UINT32_MAX after casting

> +		socket_id = 0;

Should this not be socket_id = rte_socket_id(); as we don't know we are 
running on

>   
>   	element_size = sizeof(struct slow_protocol_frame) +
>   				RTE_PKTMBUF_HEADROOM;
> 

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

* Re: [PATCH 2/2] bond: use rte_eth_dev_socket_id()
  2017-04-26 21:30 ` [PATCH 2/2] bond: use rte_eth_dev_socket_id() Jan Blunck
@ 2017-06-28  9:49   ` Declan Doherty
  0 siblings, 0 replies; 8+ messages in thread
From: Declan Doherty @ 2017-06-28  9:49 UTC (permalink / raw)
  To: dev; +Cc: Jan Blunck

On 26/04/17 22:30, Jan Blunck wrote:
> The bonded device does not have to be a PCI device. Use the rte_ethdev
> functions instead.
> 
> Signed-off-by: Wen Chiu <wchiu@brocade.com>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> Signed-off-by: Jan Blunck <jblunck@infradead.org>
> ---
>   drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
> index b8df536..f84553c 100644
> --- a/drivers/net/bonding/rte_eth_bond_8023ad.c
> +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
> @@ -886,7 +886,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id)
>   
>   	RTE_ASSERT(port->rx_ring == NULL);
>   	RTE_ASSERT(port->tx_ring == NULL);
> -	socket_id = rte_eth_devices[slave_id].data->numa_node;
> +	socket_id = rte_eth_dev_socket_id(slave_id);
>   	if (socket_id == (uint8_t)LCORE_ID_ANY)
>   		socket_id = 0;
>   
> 

Acked-by: Declan Doherty <declan.doherty@intel.com>

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

* Re: [PATCH 1/2] bond: avoid allocating mempool on socket LCORE_ID_ANY
  2017-06-28  9:47 ` [PATCH 1/2] bond: avoid allocating mempool on socket LCORE_ID_ANY Declan Doherty
@ 2017-06-28 12:00   ` Jan Blunck
  2017-06-30 14:34     ` [PATCH v2 " Declan Doherty
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Blunck @ 2017-06-28 12:00 UTC (permalink / raw)
  To: Declan Doherty; +Cc: dev, Eric Kinzie

On Wed, Jun 28, 2017 at 11:47 AM, Declan Doherty
<declan.doherty@intel.com> wrote:
> On 26/04/17 22:30, Jan Blunck wrote:
>>
>> If the numa node is unknown, use the value from rte_socket_id() to avoid
>> an allocation failure.
>>
>> Signed-off-by: Eric Kinzie <ekinzie@brocade.com>
>> CC: Eric Kinzie <ehkinzie@gmail.com>
>> ---
>>   drivers/net/bonding/rte_eth_bond_8023ad.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c
>> b/drivers/net/bonding/rte_eth_bond_8023ad.c
>> index 7b863d6..b8df536 100644
>> --- a/drivers/net/bonding/rte_eth_bond_8023ad.c
>> +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
>> @@ -887,6 +887,8 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev
>> *bond_dev, uint8_t slave_id)
>>         RTE_ASSERT(port->rx_ring == NULL);
>>         RTE_ASSERT(port->tx_ring == NULL);
>>         socket_id = rte_eth_devices[slave_id].data->numa_node;
>> +       if (socket_id == (uint8_t)LCORE_ID_ANY)
>
>
> socket_id is an integer so we shouldn't be casting LCORE_ID_ANY to an
> uint8_t as this condition would never match as LCORE_ID_ANY wouldn't be
> UINT32_MAX after casting
>

Ouch ... let me fix this.

>> +               socket_id = 0;
>
>
> Should this not be socket_id = rte_socket_id(); as we don't know we are
> running on
>
>
>>         element_size = sizeof(struct slow_protocol_frame) +
>>                                 RTE_PKTMBUF_HEADROOM;
>>
>

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

* [PATCH v2 1/2] bond: avoid allocating mempool on socket LCORE_ID_ANY
  2017-06-28 12:00   ` Jan Blunck
@ 2017-06-30 14:34     ` Declan Doherty
  2017-06-30 14:34       ` [PATCH v2 2/2] bond: use rte_eth_dev_socket_id() Declan Doherty
  2017-07-03 12:17       ` [PATCH v2 1/2] bond: avoid allocating mempool on socket LCORE_ID_ANY Ferruh Yigit
  0 siblings, 2 replies; 8+ messages in thread
From: Declan Doherty @ 2017-06-30 14:34 UTC (permalink / raw)
  To: dev; +Cc: jblunck, Eric Kinzie, Eric Kinzie, Declan Doherty

From: Jan Blunck <jblunck@infradead.org>

If the numa node is unknown, use the value from rte_socket_id() to avoid
an allocation failure.

Signed-off-by: Eric Kinzie <ekinzie@brocade.com>
CC: Eric Kinzie <ehkinzie@gmail.com>
Signed-off-by: Declan Doherty <declan.doherty@intel.com>
---
 drivers/net/bonding/rte_eth_bond_8023ad.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
index 57b9b32..7826296 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -886,7 +886,10 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id)
 
 	RTE_ASSERT(port->rx_ring == NULL);
 	RTE_ASSERT(port->tx_ring == NULL);
+
 	socket_id = rte_eth_devices[slave_id].data->numa_node;
+	if (socket_id == (int)LCORE_ID_ANY)
+		socket_id = rte_socket_id();
 
 	element_size = sizeof(struct slow_protocol_frame) +
 				RTE_PKTMBUF_HEADROOM;
-- 
2.9.4

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

* [PATCH v2 2/2] bond: use rte_eth_dev_socket_id()
  2017-06-30 14:34     ` [PATCH v2 " Declan Doherty
@ 2017-06-30 14:34       ` Declan Doherty
  2017-07-03 12:17       ` [PATCH v2 1/2] bond: avoid allocating mempool on socket LCORE_ID_ANY Ferruh Yigit
  1 sibling, 0 replies; 8+ messages in thread
From: Declan Doherty @ 2017-06-30 14:34 UTC (permalink / raw)
  To: dev; +Cc: jblunck, Wen Chiu, Stephen Hemminger, Declan Doherty

From: Jan Blunck <jblunck@infradead.org>

The bonded device does not have to be a PCI device. Use the rte_ethdev
functions instead.

Signed-off-by: Wen Chiu <wchiu@brocade.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Signed-off-by: Declan Doherty <declan.doherty@intel.com>
---
 drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
index 7826296..65dc75b 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -887,7 +887,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id)
 	RTE_ASSERT(port->rx_ring == NULL);
 	RTE_ASSERT(port->tx_ring == NULL);
 
-	socket_id = rte_eth_devices[slave_id].data->numa_node;
+	socket_id = rte_eth_dev_socket_id(slave_id);
 	if (socket_id == (int)LCORE_ID_ANY)
 		socket_id = rte_socket_id();
 
-- 
2.9.4

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

* Re: [PATCH v2 1/2] bond: avoid allocating mempool on socket LCORE_ID_ANY
  2017-06-30 14:34     ` [PATCH v2 " Declan Doherty
  2017-06-30 14:34       ` [PATCH v2 2/2] bond: use rte_eth_dev_socket_id() Declan Doherty
@ 2017-07-03 12:17       ` Ferruh Yigit
  1 sibling, 0 replies; 8+ messages in thread
From: Ferruh Yigit @ 2017-07-03 12:17 UTC (permalink / raw)
  To: Declan Doherty, dev; +Cc: jblunck, Eric Kinzie, Eric Kinzie

On 6/30/2017 3:34 PM, Declan Doherty wrote:
> From: Jan Blunck <jblunck@infradead.org>
> 
> If the numa node is unknown, use the value from rte_socket_id() to avoid
> an allocation failure.
> 
> Signed-off-by: Eric Kinzie <ekinzie@brocade.com>

> Signed-off-by: Declan Doherty <declan.doherty@intel.com>

Series applied to dpdk-next-net/master, thanks.

(patch subjects updated slightly)

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

end of thread, other threads:[~2017-07-03 12:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-26 21:30 [PATCH 1/2] bond: avoid allocating mempool on socket LCORE_ID_ANY Jan Blunck
2017-04-26 21:30 ` [PATCH 2/2] bond: use rte_eth_dev_socket_id() Jan Blunck
2017-06-28  9:49   ` Declan Doherty
2017-06-28  9:47 ` [PATCH 1/2] bond: avoid allocating mempool on socket LCORE_ID_ANY Declan Doherty
2017-06-28 12:00   ` Jan Blunck
2017-06-30 14:34     ` [PATCH v2 " Declan Doherty
2017-06-30 14:34       ` [PATCH v2 2/2] bond: use rte_eth_dev_socket_id() Declan Doherty
2017-07-03 12:17       ` [PATCH v2 1/2] bond: avoid allocating mempool on socket LCORE_ID_ANY Ferruh Yigit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.