From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BD940A04E7; Wed, 11 Nov 2020 01:09:01 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 938352B93; Wed, 11 Nov 2020 01:09:00 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by dpdk.org (Postfix) with ESMTP id 16DF1DED for ; Wed, 11 Nov 2020 01:08:59 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1059) id 70D7C20C27FD; Tue, 10 Nov 2020 16:08:57 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 70D7C20C27FD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1605053337; bh=EUxGgXLWXfn7F2y0XPZ6+2jRI8Zws0mgyF9Ef1IfN0k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JG0uMj/DN/iVC3v4ybE5bHP9EQIOKC/aG9NahEKolMmH43pkSAGvtlQrlYFQMfHkr wx4iLkGI0zaUDXiG/5BqYaLO3G9R+SzWVLXdroIexsXV8BxzBxz5PVGpGqqzCWUyD0 WvnehJ96eYc1SpUkf5k0eBPBgUNmS33Dd7ygHdZg= Date: Tue, 10 Nov 2020 16:08:57 -0800 From: Narcisa Ana Maria Vasile To: Ophir Munk Cc: dev@dpdk.org, Raslan Darawsheh , Matan Azrad , Tal Shnaiderman , Thomas Monjalon Message-ID: <20201111000857.GF9449@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20201027232335.31427-1-ophirmu@nvidia.com> <20201027232335.31427-35-ophirmu@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201027232335.31427-35-ophirmu@nvidia.com> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [dpdk-dev] [PATCH v1 34/72] net/mlx5/windows: implement mlx5 mac addr add 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Oct 27, 2020 at 11:22:57PM +0000, Ophir Munk wrote: > From: Tal Shnaiderman > > Get the list of MAC addresses and verify if the input mac parameter > already exists. If not - return -ENOTSUP (as Windows does not support > adding new MAC addresses). If the MAC address exists (EEXIST) return 0 > (the equivalent of Linux implementation of this API). > > Signed-off-by: Tal Shnaiderman > --- > drivers/net/mlx5/windows/mlx5_os.c | 36 ++++++++++++++++++++++++++++++++++++ > 1 file changed, 36 insertions(+) > > diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c > index b0cc9f3..6e27474 100644 > --- a/drivers/net/mlx5/windows/mlx5_os.c > +++ b/drivers/net/mlx5/windows/mlx5_os.c > @@ -183,6 +183,42 @@ mlx5_os_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index) > } > > + * > + * @return > + * 0 on success, a negative errno value otherwise > + */ > +int > +mlx5_os_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac, > + uint32_t index) > +{ > + (void)index; > + struct rte_ether_addr lmac; > + > + if (mlx5_get_mac(dev, &lmac.addr_bytes)) { > + DRV_LOG(ERR, > + "port %u cannot get MAC address, is mlx5_en" > + " loaded? (errno: %s)", > + dev->data->port_id, strerror(rte_errno)); > + return rte_errno; Should it be "return -rte_errno" here? > + } > + if (memcmp(&lmac, mac, sizeof(struct rte_ether_addr))) { > + DRV_LOG(ERR, > + "adding new mac address to device is unsupported"); > + return -ENOTSUP; > + } > + return 0; > +} > + > +/** > * Modify a VF MAC address > * Currently it has no support under Windows. > * > -- > 2.8.4