DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/bonding: avoid wrong casting on primary_slave_port_id from input param
@ 2018-03-06  9:37 Gowrishankar
  2018-03-06 11:51 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Gowrishankar @ 2018-03-06  9:37 UTC (permalink / raw)
  To: dev; +Cc: Declan Doherty, stable, Gowrishankar Muthukrishnan

From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>

primary_slave_port_id is uint16_t which needs to be correctly stored
with the same data type of input parameter in bond_ethdev_configure.

Fixes: f8244c6399 ("ethdev: increase port id range")
Cc: stable@dpdk.org

Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
---

In powerpc, creating bond pmd results in below error due to wrong
cast on input param. This is reproducible, only when using shared
libraries.

sudo -E LD_LIBRARY_PATH=$PWD/$RTE_TARGET/lib $RTE_TARGET/app/testpmd \
  -l 0,8 --socket-mem=1024,1024 \
  --vdev 'net_tap0,iface=dpdktap0' --vdev 'net_tap1,iface=dpdktap1' \
  --vdev 'net_bonding0,mode=1,slave=0,slave=1,primary=0,socket_id=1' \
  -d $RTE_TARGET/lib/librte_pmd_tap.so \
  -d $RTE_TARGET/lib/librte_mempool_ring.so -- --forward-mode=rxonly

Configuring Port 0 (socket 0)
PMD: net_tap0: 0x70a854070280: TX configured queues number: 1
PMD: net_tap0: 0x70a854070280: RX configured queues number: 1
Port 0: 86:EA:6D:52:3E:DB
Configuring Port 1 (socket 0)
PMD: net_tap1: 0x70a854074300: TX configured queues number: 1
PMD: net_tap1: 0x70a854074300: RX configured queues number: 1
Port 1: 42:9A:B8:49:B6:00
Configuring Port 2 (socket 1)
EAL: Failed to set primary slave port 7424 on bonded device net_bonding0
Fail to configure port 2
EAL: Error - exiting with code: 1
  Cause: Start ports failed

 drivers/net/bonding/rte_eth_bond_args.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bonding/rte_eth_bond_args.c
index 27d3101..e99681e 100644
--- a/drivers/net/bonding/rte_eth_bond_args.c
+++ b/drivers/net/bonding/rte_eth_bond_args.c
@@ -244,7 +244,7 @@
 	if (primary_slave_port_id < 0)
 		return -1;
 
-	*(uint8_t *)extra_args = (uint8_t)primary_slave_port_id;
+	*(uint16_t *)extra_args = (uint16_t)primary_slave_port_id;
 
 	return 0;
 }
-- 
1.9.1

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] net/bonding: avoid wrong casting on primary_slave_port_id from input param
  2018-03-06  9:37 [dpdk-dev] [PATCH] net/bonding: avoid wrong casting on primary_slave_port_id from input param Gowrishankar
@ 2018-03-06 11:51 ` Ferruh Yigit
  2018-03-06 16:12   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2018-03-06 11:51 UTC (permalink / raw)
  To: Gowrishankar, dev; +Cc: Declan Doherty, stable

On 3/6/2018 9:37 AM, Gowrishankar wrote:
> From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
> 
> primary_slave_port_id is uint16_t which needs to be correctly stored
> with the same data type of input parameter in bond_ethdev_configure.
> 
> Fixes: f8244c6399 ("ethdev: increase port id range")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>

Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] net/bonding: avoid wrong casting on primary_slave_port_id from input param
  2018-03-06 11:51 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
@ 2018-03-06 16:12   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2018-03-06 16:12 UTC (permalink / raw)
  To: Gowrishankar, dev; +Cc: Declan Doherty, stable

On 3/6/2018 11:51 AM, Ferruh Yigit wrote:
> On 3/6/2018 9:37 AM, Gowrishankar wrote:
>> From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
>>
>> primary_slave_port_id is uint16_t which needs to be correctly stored
>> with the same data type of input parameter in bond_ethdev_configure.
>>
>> Fixes: f8244c6399 ("ethdev: increase port id range")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
> 
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/master, thanks.

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

end of thread, other threads:[~2018-03-06 16:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-06  9:37 [dpdk-dev] [PATCH] net/bonding: avoid wrong casting on primary_slave_port_id from input param Gowrishankar
2018-03-06 11:51 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2018-03-06 16:12   ` Ferruh Yigit

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