DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/bonding: check return value in bond_ethdev_configure
@ 2018-11-16 14:54 Lee Daly
  2018-11-16 15:43 ` Ferruh Yigit
  2018-11-16 16:48 ` [dpdk-dev] [PATCH v2] net/bonding: fix possible silent failure in configuration Lee Daly
  0 siblings, 2 replies; 4+ messages in thread
From: Lee Daly @ 2018-11-16 14:54 UTC (permalink / raw)
  To: declan.doherty, chas3; +Cc: dev, Lee Daly

This patch checks the return value of function
rte_eth_bond_8023ad_agg_selection_set() in bond_ethdev_configure
for error return value.

Signed-off-by: Lee Daly <lee.daly@intel.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 156f31c..a7612ae 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -3420,9 +3420,14 @@ bond_ethdev_configure(struct rte_eth_dev *dev)
 				     "Failed to parse agg selection mode for bonded device %s",
 				     name);
 		}
-		if (internals->mode == BONDING_MODE_8023AD)
-			rte_eth_bond_8023ad_agg_selection_set(port_id,
-							      agg_mode);
+		if (internals->mode == BONDING_MODE_8023AD) {
+			if (rte_eth_bond_8023ad_agg_selection_set(port_id,
+							      agg_mode) < 0) {
+				RTE_BOND_LOG(ERR, "Invalid args for agg selection"
+					     " set for bonded device %s", name);
+				return -1;
+			}
+		}
 	}
 
 	/* Parse/add slave ports to bonded device */
-- 
2.7.4

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

* Re: [dpdk-dev] [PATCH] net/bonding: check return value in bond_ethdev_configure
  2018-11-16 14:54 [dpdk-dev] [PATCH] net/bonding: check return value in bond_ethdev_configure Lee Daly
@ 2018-11-16 15:43 ` Ferruh Yigit
  2018-11-16 16:48 ` [dpdk-dev] [PATCH v2] net/bonding: fix possible silent failure in configuration Lee Daly
  1 sibling, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2018-11-16 15:43 UTC (permalink / raw)
  To: Lee Daly, declan.doherty, chas3; +Cc: dev

On 11/16/2018 2:54 PM, Lee Daly wrote:
> This patch checks the return value of function
> rte_eth_bond_8023ad_agg_selection_set() in bond_ethdev_configure
> for error return value.

Thanks Lee, just a few minor syntax comment below.

> 
> Signed-off-by: Lee Daly <lee.daly@intel.com>
> ---
>  drivers/net/bonding/rte_eth_bond_pmd.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
> index 156f31c..a7612ae 100644
> --- a/drivers/net/bonding/rte_eth_bond_pmd.c
> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c
> @@ -3420,9 +3420,14 @@ bond_ethdev_configure(struct rte_eth_dev *dev)
>  				     "Failed to parse agg selection mode for bonded device %s",
>  				     name);
>  		}
> -		if (internals->mode == BONDING_MODE_8023AD)
> -			rte_eth_bond_8023ad_agg_selection_set(port_id,
> -							      agg_mode);
> +		if (internals->mode == BONDING_MODE_8023AD) {
> +			if (rte_eth_bond_8023ad_agg_selection_set(port_id,
> +							      agg_mode) < 0) {

It it clear if you extract the function out of if() and check return type in if()

> +				RTE_BOND_LOG(ERR, "Invalid args for agg selection"
> +					     " set for bonded device %s", name);

You can merge the error msg, it is accepted to go beyond 80 chars for msgs.

> +				return -1;
> +			}
> +		}
>  	}
>  
>  	/* Parse/add slave ports to bonded device */
> 

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

* [dpdk-dev] [PATCH v2] net/bonding: fix possible silent failure in configuration
  2018-11-16 14:54 [dpdk-dev] [PATCH] net/bonding: check return value in bond_ethdev_configure Lee Daly
  2018-11-16 15:43 ` Ferruh Yigit
@ 2018-11-16 16:48 ` Lee Daly
  2018-11-16 17:37   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
  1 sibling, 1 reply; 4+ messages in thread
From: Lee Daly @ 2018-11-16 16:48 UTC (permalink / raw)
  To: declan.doherty, chas3; +Cc: dev, Lee Daly, stable

This patch checks the return value of function
rte_eth_bond_8023ad_agg_selection_set() in bond_ethdev_configure
for error return value.

Fixes: 6d72657ce379 ("net/bonding: add other aggregator modes")
Cc: stable@dpdk.org

V2:
syntax changes.
commit message update.

Signed-off-by: Lee Daly <lee.daly@intel.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 156f31c..953cee5 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -3420,9 +3420,16 @@ bond_ethdev_configure(struct rte_eth_dev *dev)
 				     "Failed to parse agg selection mode for bonded device %s",
 				     name);
 		}
-		if (internals->mode == BONDING_MODE_8023AD)
-			rte_eth_bond_8023ad_agg_selection_set(port_id,
-							      agg_mode);
+		if (internals->mode == BONDING_MODE_8023AD) {
+			int ret = rte_eth_bond_8023ad_agg_selection_set(port_id,
+					agg_mode);
+			if (ret < 0) {
+				RTE_BOND_LOG(ERR,
+					"Invalid args for agg selection set for bonded device %s",
+					name);
+				return -1;
+			}
+		}
 	}
 
 	/* Parse/add slave ports to bonded device */
-- 
2.7.4

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH v2] net/bonding: fix possible silent failure in configuration
  2018-11-16 16:48 ` [dpdk-dev] [PATCH v2] net/bonding: fix possible silent failure in configuration Lee Daly
@ 2018-11-16 17:37   ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2018-11-16 17:37 UTC (permalink / raw)
  To: Lee Daly, declan.doherty, chas3; +Cc: dev, stable

On 11/16/2018 4:48 PM, Lee Daly wrote:
> This patch checks the return value of function
> rte_eth_bond_8023ad_agg_selection_set() in bond_ethdev_configure
> for error return value.
> 
> Fixes: 6d72657ce379 ("net/bonding: add other aggregator modes")
> Cc: stable@dpdk.org
> 
> V2:
> syntax changes.
> commit message update.
> 
> Signed-off-by: Lee Daly <lee.daly@intel.com>

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

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

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

end of thread, other threads:[~2018-11-16 17:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-16 14:54 [dpdk-dev] [PATCH] net/bonding: check return value in bond_ethdev_configure Lee Daly
2018-11-16 15:43 ` Ferruh Yigit
2018-11-16 16:48 ` [dpdk-dev] [PATCH v2] net/bonding: fix possible silent failure in configuration Lee Daly
2018-11-16 17:37   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git