From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id 8A3401B739 for ; Mon, 9 Apr 2018 10:57:44 +0200 (CEST) Received: by mail-wr0-f195.google.com with SMTP id y55so8594653wry.3 for ; Mon, 09 Apr 2018 01:57:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=BBH6cC6eeUurLrlbnFuQGXDzasjMbEI8NfPtOiDjx9o=; b=jMfdrn+ggEYXmk8jvHnx9k0mqpqy6ah53WAGwEVszm2oj06/9euWbIV0l+rmZ4aiTC H9H2wo06v1PGk73TWGFIPETIAL13JPR5c8btInVE2NwToBRLeJiBYa2qSV6Ow9BV/quG plNuoUnBvfrMMKR2F554DsMcYd8yfz1vWHn8h9gJgmAWq1V1n9fGLaZ5i3ys6NMotHuo wjempEDmooJWPX5VLZd/quNQRRuNai/godUmYpW5b77OuprRQD3RUkbi5rvuox/z34Vy tmz5MeHA18wIDu42+ohhmOZsx30I4YmyKm/M+g0eN4apgEF6fVHWKaAmRyMWXLZt6xbm 5Fuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=BBH6cC6eeUurLrlbnFuQGXDzasjMbEI8NfPtOiDjx9o=; b=RPuyPmF/WTbKfGYmzbQxp01Y2M0A8JTcGQ2mg1/FyXc1fdjUiB9nHcu21JtjMKmv5q 3kajizJxC2y2aApGeghSmMzPW0UECYaImfSejeqaJ6ODb8mHgaitJTIua2r/xv4epy5U wqdgCzmYKy0F+DK7jRCY/Y89lVRKbBi5PB9S3jBfbH6kWxDSBYMq0jIOJdtcapPs1MHK yyTtJQCFmazPqHP8jpZgFnjG+/6dDbdO+Tf/KkjHlFGG+VMuZ8y4KYGXFUB1f3ugyAPa 28ay/tlKSMBbrPgNpQqzpYTxIlYC6B7YxbCAVOnaavxj8AtXS2AdJtq5JMGv2t+rl96f Z6OQ== X-Gm-Message-State: AElRT7F7L7Jk5YKQ6NUspcKcORsVkU0ZehBMrhBPLfmeDOpK29LljSwF 3agCpSMZ59rqxUcpFLjB+oXk X-Google-Smtp-Source: AIpwx4+BxwbI4BzkEzbZ6bvkKPSuSdRX3elwBMjEY076wfZWMzjvsJarD2stVBptmF7koTVVS0WV+g== X-Received: by 10.223.172.35 with SMTP id v32mr24729885wrc.19.1523264264246; Mon, 09 Apr 2018 01:57:44 -0700 (PDT) Received: from laranjeiro-vm.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id c130sm221941wmh.33.2018.04.09.01.57.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Apr 2018 01:57:43 -0700 (PDT) Date: Mon, 9 Apr 2018 10:57:58 +0200 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Olivier Matz Cc: dev@dpdk.org, Thomas Monjalon , Ferruh Yigit , Tomasz Duszynski , Andrew Rybchenko , Adrien Mazarguil , Shreyansh Jain , Ivan Malov Message-ID: <20180409085758.y5key7wqansvfqwb@laranjeiro-vm.dev.6wind.com> References: <20180403124103.13124-1-olivier.matz@6wind.com> <20180406152148.23270-1-olivier.matz@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180406152148.23270-1-olivier.matz@6wind.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH] 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: Mon, 09 Apr 2018 08:57:44 -0000 On Fri, Apr 06, 2018 at 05:21:48PM +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 > Acked-by: Andrew Rybchenko > Acked-by: Adrien Mazarguil > Acked-by: Shreyansh Jain > --- > > v3: > * mlx5: remove empty line as suggested by Adrien > * mvpp2: remove wrong changes in mrvl_mac_addr_remove() as suggested > by Ferruh > * dpaa/dpaa2: fix return value as suggested by Shreyansh > > 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 | 6 +++++- > drivers/net/mvpp2/mrvl_ethdev.c | 11 ++++++++--- > 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, 184 insertions(+), 104 deletions(-) > > diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h > index faacfd9d6..738709854 100644 > --- a/drivers/net/mlx5/mlx5.h > +++ b/drivers/net/mlx5/mlx5.h > @@ -195,7 +195,7 @@ int mlx5_get_mac(struct rte_eth_dev *dev, uint8_t (*mac)[ETHER_ADDR_LEN]); > void mlx5_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index); > int mlx5_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac, > uint32_t index, uint32_t vmdq); > -void mlx5_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr); > +int mlx5_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr); > > /* mlx5_rss.c */ > > diff --git a/drivers/net/mlx5/mlx5_mac.c b/drivers/net/mlx5/mlx5_mac.c > index 01c7ba17a..6ca1cc4a1 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,5 @@ 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)); > + return ret; > } You should also remove the DRV_LOG which become useless, it has been added as the function did not return anything, now has it returns an error, the application can fully handle it. Unless that, for MLX5 Acked-by: Nelio Laranjeiro -- Nélio Laranjeiro 6WIND