From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it1-f195.google.com (mail-it1-f195.google.com [209.85.166.195]) by dpdk.org (Postfix) with ESMTP id AE567A3 for ; Sun, 10 Mar 2019 12:42:20 +0100 (CET) Received: by mail-it1-f195.google.com with SMTP id z131so2940225itf.5 for ; Sun, 10 Mar 2019 04:42:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=x4BwkAEoGk8Fr9ptcwYu0iFRWB4x3AF7zdEna+5vEYU=; b=pG64ZI+m4Yox4Qh/6bWNFUBdLVO/J1Vs7GWo8pFUTpyRjtqDwJjkpWJAJVQlHsFGKH Z0nNg7PFo+o4odQnsmSQjbW1W7tME3BNhy5Q3xZNJgqzFPBgMmDb1gIPcUc1DxGvdOQl mRgLALlpmqRBQP9pAquaM77EuJeZx2qsKM0CM4A8BsNrAMm/U8FQ0navZttcP4xaKpnN G9ihShh/qnHZ6Gz+Ux7BuvRLorF69VWEzVJ6Y0A6suL3mq8aoOHNt1cv/nBzX+dkWI43 /9GqnTwoy9cHdMPFlLn/RLxMJN0P+cBS/+2e7VEZyehvpyrJEZg0A83KZdzhOivW0uGu 5aJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=x4BwkAEoGk8Fr9ptcwYu0iFRWB4x3AF7zdEna+5vEYU=; b=fZ2tslyNTyvarINIhA9TRdYIJZrNe/zUXQLuVOw89Fol0lmcUkoLv6VbYHcDeIAhrZ N3ryOzhWj7txfSSyf6l9bBm67WSf3iMnNBSaGK7VAmPZRdM6KGRouwkNXh0fp8LYAu8S 6KG8KRGvRqyyAv8LijqstCnDRAJe5Co/W4BQ1wACgv8MCm2+LTC6OBfbmIVwwxcKJ/8x r672boKLAFDADXL74YZUdwxPFfXgJmrwbg+hkosUoMUyXFJGZwf7k2wlnVCn6VsXUFCr RO2t9VnMO9vRSyFV/FBIPomOHc4Y4fP4KRaJjfM/G4aEqadfRbM4tq/unwXvR4wGcAhu roeQ== X-Gm-Message-State: APjAAAV8fHe6uROkP/MO3CX2Rd1/eWru6FA/z7ab7BiBdBfI2KdjN7a+ cCssOOpLQIXWZXSONuU2ULTUxpyfuDzkHHKELBZvNA== X-Google-Smtp-Source: APXvYqw+gaKHrWqR7L8n8XhlHqjU/nn9J/o9PAnM/JI86CQgBDWEMqIBYV7aRQV+z26yOJ3TWa042nOF6c+pJKRFj7o= X-Received: by 2002:a05:660c:fc5:: with SMTP id m5mr1976792itn.13.1552218140034; Sun, 10 Mar 2019 04:42:20 -0700 (PDT) MIME-Version: 1.0 References: <1552059647-2725-1-git-send-email-pablo.cascon@netronome.com> In-Reply-To: <1552059647-2725-1-git-send-email-pablo.cascon@netronome.com> From: Alejandro Lucero Date: Sun, 10 Mar 2019 11:42:08 +0000 Message-ID: To: =?UTF-8?Q?Pablo_Casc=C3=B3n?= Cc: dev , dpdk stable 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 1/1] net/nfp: fix set_mac_addr 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: Sun, 10 Mar 2019 11:42:20 -0000 On Fri, Mar 8, 2019 at 3:41 PM Pablo Casc=C3=B3n wrote: > Some firmwares, mostly for VFs, do not advertise the feature / > capability of changing the MAC address while the interface is up. With > such firmware a request to change the MAC address that at the same > time also tries to enable the not available feature will be denied by > the firmware resulting in an error message like: > > nfp_net_reconfig(): Error nfp_net reconfig for ctrl: 80000000 update: 800 > > Fix set_mac_addr by not trying to enable a feature if it is not > advertised by the firmware. > > Fixes: 2fe669f4bcd2 ("net/nfp: support MAC address change") > > Signed-off-by: Pablo Casc=C3=B3n > --- > drivers/net/nfp/nfp_net.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c > index 54c6da9..278e154 100644 > --- a/drivers/net/nfp/nfp_net.c > +++ b/drivers/net/nfp/nfp_net.c > @@ -566,7 +566,10 @@ nfp_set_mac_addr(struct rte_eth_dev *dev, struct > ether_addr *mac_addr) > > /* Signal the NIC about the change */ > update =3D NFP_NET_CFG_UPDATE_MACADDR; > - ctrl =3D hw->ctrl | NFP_NET_CFG_CTRL_LIVE_ADDR; > + ctrl =3D hw->ctrl; > + if ((hw->ctrl & NFP_NET_CFG_CTRL_ENABLE) && > + (hw->cap & NFP_NET_CFG_CTRL_LIVE_ADDR)) > + ctrl |=3D NFP_NET_CFG_CTRL_LIVE_ADDR; > if (nfp_net_reconfig(hw, ctrl, update) < 0) { > PMD_INIT_LOG(INFO, "MAC address update failed"); > return -EIO; > -- > 2.7.4 > > Acked-by: Alejandro Lucero