From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk0-f45.google.com (mail-vk0-f45.google.com [209.85.213.45]) by dpdk.org (Postfix) with ESMTP id AF381FA72 for ; Thu, 19 Jan 2017 23:39:55 +0100 (CET) Received: by mail-vk0-f45.google.com with SMTP id t8so40604164vke.3 for ; Thu, 19 Jan 2017 14:39:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nfware-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=sgQmkT9SwlOiXXheKKKIAHYh9Bcfq26mxnX4ob6QVKo=; b=psHe+lA5TwcQRuB97eEuStbqzr+b9hjn0qKrEYC1KEMGwrBzzaq9MFpAhfEsomU/6w J+Wq0FY9NhjYNsusDBdEjoAukShJzqKNRJ5yG/cQrV0Jl46efw/pKrkw677pwYKfcz8V MWO0aam8SPlDsoBgNDFMHWv9ZgSm+IF2ziMZwcd0cWMXGpZqM7EBAxgzHytcPv5Z8qBi dvuC5J7iIYHrOu7rEo1fYMv6AJxGUduoL1KGC0W/toOyqRJU7o617VMv/Hwm+HasbBOD 5Ok0PXG4U5Gsxo1WF/iOXHMFYm9fvi/OEZ4N848U95I2rpdjoBA2hXHenpbhcpAox9vl 3PCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=sgQmkT9SwlOiXXheKKKIAHYh9Bcfq26mxnX4ob6QVKo=; b=aaEd3JuhKIrdriGevxlrgF6x5/wqOoB6LWw4QdSuUHKhu/jPKDVyBSlYmujVzCkPwY 9ywH8ISEURbtDgw94yqz6HwHxXnjalOATdTBRZW4A5uPIlkSise/zGhMRafiBOMto1xA NOFzEKYDXr6T8/X75xDzDZD3+X5I5i3k2Z/stFZZua4PORAuP1Hz3o2Zysy0SpFDy+5h OgaLYPwcxSoIkjlLql8xv2Z5B5q/OLoZuSeXf3k8FJHHT53AHd+W54JpezIvs3ZN6gW0 bjRF9B7ZN2/Srdx0c9KK7atcQpBxsyXWNeo7/kLXfj744/hzUETqc3oktQkt/TkOmR9B x1BQ== X-Gm-Message-State: AIkVDXI9FGzhyoMKYNDj77ZtwnDxNmLVEELsUUceGQXr8KXEaPLhZK7//kPMJXhSmZsMlAHH3+MDqp2iSjCUoQ== X-Received: by 10.31.242.11 with SMTP id q11mr5843717vkh.54.1484865594669; Thu, 19 Jan 2017 14:39:54 -0800 (PST) MIME-Version: 1.0 Received: by 10.159.35.80 with HTTP; Thu, 19 Jan 2017 14:39:54 -0800 (PST) X-Originating-IP: [77.105.154.150] In-Reply-To: References: <20170119184721.22348-1-jonshin@cisco.com> From: Igor Ryzhov Date: Fri, 20 Jan 2017 01:39:54 +0300 Message-ID: To: "Steve Shin (jonshin)" Cc: "dev@dpdk.org" , "ferruh.yigit@intel.com" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] lib/librte_ether: error handling on MAC address replay 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: Thu, 19 Jan 2017 22:39:55 -0000 Hello Steve, Thank you for the patch. I think a couple of improvements can be done: 1. Function existence check =E2=80=93 if (*dev->dev_ops->mac_addr_add) =E2= =80=93 can be taken out of the loop. We don't need to check it on each iteration. 2. I'm not completely sure, but I think loop can be started from 1, not from 0, because mac_pool_sel[0] is always zero. Am I right? Best regards, Igor On Thu, Jan 19, 2017 at 10:35 PM, Steve Shin (jonshin) wrote: > Dear maintainer, > > Sorry that I forgot to add =E2=80=9CFixes:=E2=80=9D line as follows: > > Fixes: 4bdefaade6d1 ("ethdev: VMDQ enhancements") > > Can you please add the above line as part of comment? > > Thanks, > Steve > > On 1/19/17, 10:47 AM, "Steve Shin (jonshin)" wrote: > > This patch fixes a bug in replaying MAC address to the hardware > in rte_eth_dev_config_restore() routine. > > Signed-off-by: Steve Shin > --- > lib/librte_ether/rte_ethdev.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/lib/librte_ether/rte_ethdev.c > b/lib/librte_ether/rte_ethdev.c > index 4790faf..7e01f10 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -951,10 +951,12 @@ rte_eth_dev_config_restore(uint8_t port_id) > continue; > > /* add address to the hardware */ > - if (*dev->dev_ops->mac_addr_add && > - (dev->data->mac_pool_sel[i] & (1ULL << pool))) > - (*dev->dev_ops->mac_addr_add)(dev, &addr, i, > pool); > - else { > + if (*dev->dev_ops->mac_addr_add) { > + if (dev->data->mac_pool_sel[i] & (1ULL << pool)) > + (*dev->dev_ops->mac_addr_add)(dev, &addr, > i, pool); > + else > + continue; > + } else { > RTE_PMD_DEBUG_TRACE("port %d: MAC address array > not supported\n", > port_id); > /* exit the loop but not return an error */ > -- > 2.9.3 > > > >