DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/bonding: fix check slaves link properties
@ 2017-10-20 15:49 Tomasz Kulasek
  2017-10-25 22:01 ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Tomasz Kulasek @ 2017-10-20 15:49 UTC (permalink / raw)
  To: dev; +Cc: declan.doherty

Result of slaves link properties validation is not used when new slave
is added.

This patch uses the value of link_properties_valid() to determinate if
slave can be used in the bonding. If function fails, error is returned
preventing to add slave with invalid link properties.

Coverity issue: 158661
Fixes: deba8a2f8b0b ("net/bonding: fix link properties management")
Cc: declan.doherty@intel.com

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
---
 drivers/net/bonding/rte_eth_bond_api.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index de1d9e0..ecda494 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -302,8 +302,13 @@
 		internals->tx_offload_capa &= dev_info.tx_offload_capa;
 		internals->flow_type_rss_offloads &= dev_info.flow_type_rss_offloads;
 
-		link_properties_valid(bonded_eth_dev,
-				&slave_eth_dev->data->dev_link);
+		if (link_properties_valid(bonded_eth_dev,
+				&slave_eth_dev->data->dev_link) != 0) {
+			RTE_BOND_LOG(ERR, "Invalid link properties for slave %d"
+					" in bonding mode %d", slave_port_id,
+					internals->mode);
+			return -1;
+		}
 
 		/* RETA size is GCD of all slaves RETA sizes, so, if all sizes will be
 		 * the power of 2, the lower one is GCD
-- 
1.9.1

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

* Re: [dpdk-dev] [PATCH] net/bonding: fix check slaves link properties
  2017-10-20 15:49 [dpdk-dev] [PATCH] net/bonding: fix check slaves link properties Tomasz Kulasek
@ 2017-10-25 22:01 ` Ferruh Yigit
  2017-10-25 22:02   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2017-10-25 22:01 UTC (permalink / raw)
  To: Tomasz Kulasek, dev; +Cc: declan.doherty

On 10/20/2017 8:49 AM, Tomasz Kulasek wrote:
> Result of slaves link properties validation is not used when new slave
> is added.
> 
> This patch uses the value of link_properties_valid() to determinate if
> slave can be used in the bonding. If function fails, error is returned
> preventing to add slave with invalid link properties.
> 
> Coverity issue: 158661
> Fixes: deba8a2f8b0b ("net/bonding: fix link properties management")
Cc: stable@dpdk.org

> Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>

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

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

* Re: [dpdk-dev] [PATCH] net/bonding: fix check slaves link properties
  2017-10-25 22:01 ` Ferruh Yigit
@ 2017-10-25 22:02   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2017-10-25 22:02 UTC (permalink / raw)
  To: Tomasz Kulasek, dev; +Cc: declan.doherty

On 10/25/2017 3:01 PM, Ferruh Yigit wrote:
> On 10/20/2017 8:49 AM, Tomasz Kulasek wrote:
>> Result of slaves link properties validation is not used when new slave
>> is added.
>>
>> This patch uses the value of link_properties_valid() to determinate if
>> slave can be used in the bonding. If function fails, error is returned
>> preventing to add slave with invalid link properties.
>>
>> Coverity issue: 158661
>> Fixes: deba8a2f8b0b ("net/bonding: fix link properties management")
> Cc: stable@dpdk.org
> 
>> Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
> 
> Reviewed-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:[~2017-10-25 22:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-20 15:49 [dpdk-dev] [PATCH] net/bonding: fix check slaves link properties Tomasz Kulasek
2017-10-25 22:01 ` Ferruh Yigit
2017-10-25 22:02   ` 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).