DPDK patches and discussions
 help / color / mirror / Atom feed
From: Shreyansh Jain <shreyansh.jain@nxp.com>
To: Olivier Matz <olivier.matz@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: Thomas Monjalon <thomas@monjalon.net>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	Adrien Mazarguil <adrien.mazarguil@6wind.com>,
	Tomasz Duszynski <tdu@semihalf.com>,
	Andrew Rybchenko <arybchenko@solarflare.com>,
	Ivan Malov <Ivan.Malov@oktetlabs.ru>,
	Ivan Malov <ivan.malov@oktetlabs.ru>
Subject: Re: [dpdk-dev] [PATCH v2] ethdev: return diagnostic when setting MAC	address
Date: Wed, 4 Apr 2018 08:19:43 +0000	[thread overview]
Message-ID: <HE1PR0402MB2780659A60B11632DDBEB4C990A40@HE1PR0402MB2780.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20180403124103.13124-1-olivier.matz@6wind.com>

Hello Olivier,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Olivier Matz
> Sent: Tuesday, April 3, 2018 6:11 PM
> To: dev@dpdk.org
> Cc: Thomas Monjalon <thomas@monjalon.net>; Ferruh Yigit
> <ferruh.yigit@intel.com>; Adrien Mazarguil <adrien.mazarguil@6wind.com>;
> Tomasz Duszynski <tdu@semihalf.com>; Andrew Rybchenko
> <arybchenko@solarflare.com>; Ivan Malov <Ivan.Malov@oktetlabs.ru>; Ivan
> Malov <ivan.malov@oktetlabs.ru>
> Subject: [dpdk-dev] [PATCH v2] ethdev: return diagnostic when setting
> MAC address
> 
> Change the prototype and the behavior of dev_ops->eth_mac_addr_set(): a
> return code is added to notify the caller (librte_ether) if an error
> occurred in the PMD.
> 
> The new default MAC address is now copied in dev->data->mac_addrs[0]
> only if the operation is successful.
> 
> The patch also updates all the PMDs accordingly.
> 
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
> Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
> ---
> 
> v2:
> * add same change for net/cxgbe
> * mrvl was renamed as mvpp2
> * mvpp2: return success if no ppio as suggested by Tomasz
> * mlx5: update comment as suggested by Adrien
> * sfc: replace by Ivan's patch
> 
>  doc/guides/rel_notes/deprecation.rst    |  8 --------
>  drivers/net/ark/ark_ethdev.c            |  9 ++++++---
>  drivers/net/avf/avf_ethdev.c            | 12 +++++++----
>  drivers/net/bnxt/bnxt_ethdev.c          | 10 ++++++----
>  drivers/net/bonding/rte_eth_bond_pmd.c  |  8 ++++++--
>  drivers/net/cxgbe/cxgbe_ethdev.c        |  5 +++--
>  drivers/net/cxgbe/cxgbe_pfvf.h          |  2 +-
>  drivers/net/dpaa/dpaa_ethdev.c          |  4 +++-
>  drivers/net/dpaa2/dpaa2_ethdev.c        |  6 ++++--
>  drivers/net/e1000/igb_ethdev.c          | 12 ++++++-----
>  drivers/net/failsafe/failsafe_ops.c     | 17 +++++++++++++---
>  drivers/net/i40e/i40e_ethdev.c          | 24 +++++++++++++---------
>  drivers/net/i40e/i40e_ethdev_vf.c       | 12 ++++++-----
>  drivers/net/ixgbe/ixgbe_ethdev.c        | 13 +++++++-----
>  drivers/net/mlx4/mlx4.h                 |  2 +-
>  drivers/net/mlx4/mlx4_ethdev.c          |  7 +++++--
>  drivers/net/mlx5/mlx5.h                 |  2 +-
>  drivers/net/mlx5/mlx5_mac.c             |  7 ++++++-
>  drivers/net/mvpp2/mrvl_ethdev.c         | 15 ++++++++++----
>  drivers/net/null/rte_eth_null.c         |  3 ++-
>  drivers/net/octeontx/octeontx_ethdev.c  |  4 +++-
>  drivers/net/qede/qede_ethdev.c          |  7 +++----
>  drivers/net/sfc/sfc_ethdev.c            | 35 ++++++++++++++++++++++----
> -------
>  drivers/net/szedata2/rte_eth_szedata2.c |  3 ++-
>  drivers/net/tap/rte_eth_tap.c           | 34 +++++++++++++++++++++-----
> ------
>  drivers/net/virtio/virtio_ethdev.c      | 15 +++++++++-----
>  drivers/net/vmxnet3/vmxnet3_ethdev.c    |  5 +++--
>  lib/librte_ether/rte_ethdev.c           |  7 +++++--
>  lib/librte_ether/rte_ethdev_core.h      |  2 +-
>  test/test/virtual_pmd.c                 |  3 ++-
>  30 files changed, 188 insertions(+), 105 deletions(-)
> 

[...]

> diff --git a/drivers/net/dpaa/dpaa_ethdev.c
> b/drivers/net/dpaa/dpaa_ethdev.c
> index db493648a..2e4cb8267 100644
> --- a/drivers/net/dpaa/dpaa_ethdev.c
> +++ b/drivers/net/dpaa/dpaa_ethdev.c
> @@ -813,7 +813,7 @@ dpaa_dev_remove_mac_addr(struct rte_eth_dev *dev,
>  	fman_if_clear_mac_addr(dpaa_intf->fif, index);
>  }
> 
> -static void
> +static int
>  dpaa_dev_set_mac_addr(struct rte_eth_dev *dev,
>  		       struct ether_addr *addr)
>  {
> @@ -825,6 +825,8 @@ dpaa_dev_set_mac_addr(struct rte_eth_dev *dev,
>  	ret = fman_if_add_mac_addr(dpaa_intf->fif, addr->addr_bytes, 0);
>  	if (ret)
>  		RTE_LOG(ERR, PMD, "error: Setting the MAC ADDR failed %d",
> ret);
> +
> +	return 0;

This should be 'return ret' as just above this line there is an error condition.

>  }
> 
>  static struct eth_dev_ops dpaa_devops = {
> diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c
> b/drivers/net/dpaa2/dpaa2_ethdev.c
> index 281483dfd..07d45a11e 100644
> --- a/drivers/net/dpaa2/dpaa2_ethdev.c
> +++ b/drivers/net/dpaa2/dpaa2_ethdev.c
> @@ -1019,7 +1019,7 @@ dpaa2_dev_remove_mac_addr(struct rte_eth_dev *dev,
>  			"error: Removing the MAC ADDR failed: err = %d", ret);
>  }
> 
> -static void
> +static int
>  dpaa2_dev_set_mac_addr(struct rte_eth_dev *dev,
>  		       struct ether_addr *addr)
>  {
> @@ -1031,7 +1031,7 @@ dpaa2_dev_set_mac_addr(struct rte_eth_dev *dev,
> 
>  	if (dpni == NULL) {
>  		DPAA2_PMD_ERR("dpni is NULL");
> -		return;
> +		return -EINVAL;
>  	}
> 
>  	ret = dpni_set_primary_mac_addr(dpni, CMD_PRI_LOW,
> @@ -1040,6 +1040,8 @@ dpaa2_dev_set_mac_addr(struct rte_eth_dev *dev,
>  	if (ret)
>  		DPAA2_PMD_ERR(
>  			"error: Setting the MAC ADDR failed %d", ret);
> +
> +	return 0;

Same is the case here - It should be 'return ret' as there is an error reported just above this line.

>  }
> 
>  static

[...]

For the v3 with the changes above, for dpaa/dpaa2 and generic part:

Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>


-
Shreyansh

  parent reply	other threads:[~2018-04-04  8:19 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-27 15:11 [dpdk-dev] [PATCH] " Olivier Matz
2018-03-05 10:29 ` Adrien Mazarguil
2018-03-06  9:37 ` Tomasz Duszynski
2018-03-16 15:41 ` Andrew Rybchenko
2018-03-26 18:39 ` Ferruh Yigit
2018-03-28  8:24   ` Olivier Matz
2018-04-03 12:41 ` [dpdk-dev] [PATCH v2] " Olivier Matz
2018-04-03 13:02   ` Andrew Rybchenko
2018-04-03 14:57   ` Adrien Mazarguil
2018-04-03 16:26     ` Olivier Matz
2018-04-03 16:19   ` Ferruh Yigit
2018-04-03 16:25     ` Olivier Matz
2018-04-04  8:19   ` Shreyansh Jain [this message]
2018-04-06 15:21   ` [dpdk-dev] [PATCH] " Olivier Matz
2018-04-06 15:34     ` Olivier Matz
2018-04-09  8:57     ` Nélio Laranjeiro
2018-04-06 15:34   ` [dpdk-dev] [PATCH v3] " Olivier Matz
2018-04-06 16:03     ` Ferruh Yigit
2018-04-10 13:19       ` Thomas Monjalon
2018-04-11 16:32     ` [dpdk-dev] [PATCH v4] " Olivier Matz
2018-04-11 19:30       ` 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=HE1PR0402MB2780659A60B11632DDBEB4C990A40@HE1PR0402MB2780.eurprd04.prod.outlook.com \
    --to=shreyansh.jain@nxp.com \
    --cc=Ivan.Malov@oktetlabs.ru \
    --cc=adrien.mazarguil@6wind.com \
    --cc=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=olivier.matz@6wind.com \
    --cc=tdu@semihalf.com \
    --cc=thomas@monjalon.net \
    /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).