From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id F3AED1B837 for ; Tue, 3 Apr 2018 18:26:20 +0200 (CEST) Received: from lfbn-lil-1-702-109.w81-254.abo.wanadoo.fr ([81.254.39.109] helo=droids-corp.org) by mail.droids-corp.org with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1f3Olr-0005zS-DW; Tue, 03 Apr 2018 18:26:58 +0200 Received: by droids-corp.org (sSMTP sendmail emulation); Tue, 03 Apr 2018 18:26:16 +0200 Date: Tue, 3 Apr 2018 18:26:16 +0200 From: Olivier Matz To: Adrien Mazarguil Cc: dev@dpdk.org, Thomas Monjalon , Ferruh Yigit , Tomasz Duszynski , Andrew Rybchenko , Ivan Malov Message-ID: <20180403162616.2xyosoulzcw7s24p@platinum> References: <20180227151129.30387-1-olivier.matz@6wind.com> <20180403124103.13124-1-olivier.matz@6wind.com> <20180403145724.GD4957@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180403145724.GD4957@6wind.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v2] ethdev: return diagnostic when setting MAC address X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2018 16:26:21 -0000 On Tue, Apr 03, 2018 at 04:57:24PM +0200, Adrien Mazarguil wrote: > 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). Will fix in next version, thanks. Olivier