From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrien Mazarguil Subject: Re: [PATCH v2] ethdev: return diagnostic when setting MAC address Date: Tue, 3 Apr 2018 16:57:24 +0200 Message-ID: <20180403145724.GD4957@6wind.com> References: <20180227151129.30387-1-olivier.matz@6wind.com> <20180403124103.13124-1-olivier.matz@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, Thomas Monjalon , Ferruh Yigit , Tomasz Duszynski , Andrew Rybchenko , Ivan Malov To: Olivier Matz Return-path: Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by dpdk.org (Postfix) with ESMTP id B925D1B777 for ; Tue, 3 Apr 2018 16:57:38 +0200 (CEST) Received: by mail-wr0-f196.google.com with SMTP id d17so3640043wre.1 for ; Tue, 03 Apr 2018 07:57:38 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20180403124103.13124-1-olivier.matz@6wind.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Apr 03, 2018 at 02:41:03PM +0200, Olivier Matz wrote: > 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 > Signed-off-by: Ivan Malov > --- > > 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 Just one remaining nit regarding mlx5, please see below. Otherwise for both mlx4 and mlx5: Acked-by: Adrien Mazarguil > diff --git a/drivers/net/mlx5/mlx5_mac.c b/drivers/net/mlx5/mlx5_mac.c > index 01c7ba17a..3bf76e38c 100644 > --- a/drivers/net/mlx5/mlx5_mac.c > +++ b/drivers/net/mlx5/mlx5_mac.c > @@ -124,8 +124,11 @@ mlx5_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac, > * Pointer to Ethernet device structure. > * @param mac_addr > * MAC address to register. > + * > + * @return > + * 0 on success, a negative errno value otherwise and rte_errno is set. > */ > -void > +int > mlx5_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr) > { > int ret; > @@ -137,4 +140,6 @@ mlx5_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr) > if (ret) > DRV_LOG(ERR, "port %u cannot set mac address: %s", > dev->data->port_id, strerror(rte_errno)); > + This empty line is unnecessary (this follows the work done to remove non-mandatory empty lines sprinkled everywhere in these PMDs for coding style consistency). > + return ret; -- Adrien Mazarguil 6WIND