From mboxrd@z Thu Jan 1 00:00:00 1970 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) 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:in-reply-to; bh=jTH+IhBsOYaAXbvtn3L0o+hfQViDWkA31S6WXqRNRvo=; b=Qwvmi8zbEDCpE8ueZlL+cf32gi58IKU3G5h6kQtPEDaUpzAnG/j1ZyH9DlJwSlhbJB /DXRastLB1lkS0gv48EdnypLKFy5rvo3E/NOE7XGRXeDrcvuND/lLYBv8RR7NCc9Lu0c N1rOKhHDFPIV8sncKOEpLv9cJp8Eht8LpMrYIC7oR9m8wc5SZwxQ6h2tfKTTtxwfBAeg BU2/6K5A7A17hLljfWSDe1pv/IRAXWTsy4V4/LezFXDo70sSULUZ1MyHe+sC/hwQJJvW gk5YAL+aaQEzN3Kv32KTthRgG8uTcfKi+G/E871eIct6BojCN/+paDWqZnhySHngmdd7 NkDQ== 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:in-reply-to; bh=jTH+IhBsOYaAXbvtn3L0o+hfQViDWkA31S6WXqRNRvo=; b=lpHg60X0xDhZ7MsqBp8HA7l86G9xNTormhBe8ihWGWzdh82SNhGK4iQ8AWRoNIdRyr xG1oEckeHSCYjp8XTibxGIyPrlNCb8JDSe2zz15FzojKLyocrwhkoYMKuTn9KQG/10oP SyUhIVftNPtZZbl8wshz8ZHy3hJN4xyxTCCxjrILPuDFtTWOV4aJqhUqAtS4bqauBIf4 /JZyxvGV5bIlnMqGCFk5esy9dLPsMs0njz0ymtcBjQH0LP+ueJg5ebvQa8TrCVkah1kw e6tz3/bm0OyjpCUxxyeDJVt2CYCK3yKzuFhB4j+v8EyNyHwXhHbDJgTK7vVb9Mmqt3oW rkiA== X-Gm-Message-State: AElRT7G77D+LMKKZBW6fY6vGiELWPptPOzx5shwa94c7oeYsjxtJgxet Z19ayMcniWn5d+4bzX7ytgLOlg== X-Google-Smtp-Source: AIpwx4/UKg9oTInMk3e1dZ5f4A5ux9NhbZUmxBRdBDCNLNsA8cqKPNfwe3CfbxBwQd+2jcVYKdpNTA== X-Received: by 10.223.176.144 with SMTP id i16mr9726074wra.70.1522767458439; Tue, 03 Apr 2018 07:57:38 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id q81sm1161576wmg.8.2018.04.03.07.57.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Apr 2018 07:57:37 -0700 (PDT) Date: Tue, 3 Apr 2018 16:57:24 +0200 From: Adrien Mazarguil To: Olivier Matz Cc: dev@dpdk.org, Thomas Monjalon , Ferruh Yigit , Tomasz Duszynski , Andrew Rybchenko , Ivan Malov 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 Content-Disposition: inline In-Reply-To: <20180403124103.13124-1-olivier.matz@6wind.com> 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 14:57:39 -0000 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