DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Lee Daly <lee.daly@intel.com>, declan.doherty@intel.com, chas3@att.com
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] net/bonding: check return value in bond_ethdev_configure
Date: Fri, 16 Nov 2018 15:43:05 +0000	[thread overview]
Message-ID: <5303e90d-7116-88cc-5875-76de8254bf3d@intel.com> (raw)
In-Reply-To: <1542380067-140320-1-git-send-email-lee.daly@intel.com>

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 */
> 

  reply	other threads:[~2018-11-16 15:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-16 14:54 Lee Daly
2018-11-16 15:43 ` Ferruh Yigit [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5303e90d-7116-88cc-5875-76de8254bf3d@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=chas3@att.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=lee.daly@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).