netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Nguyen, Anthony L" <anthony.l.nguyen@intel.com>
To: "willemdebruijn.kernel@gmail.com" <willemdebruijn.kernel@gmail.com>
Cc: "nhorman@redhat.com" <nhorman@redhat.com>,
	"Loktionov, Aleksandr" <aleksandr.loktionov@intel.com>,
	"sassmann@redhat.com" <sassmann@redhat.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"Kubalewski, Arkadiusz" <arkadiusz.kubalewski@intel.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"andrewx.bowers@intel.com" <andrewx.bowers@intel.com>,
	"davem@davemloft.net" <davem@davemloft.net>
Subject: Re: [net-next 2/3] i40e: Fix MAC address setting for a VF via Host/VM
Date: Mon, 12 Oct 2020 16:27:58 +0000	[thread overview]
Message-ID: <07967f3b63b12a501c83b86befc209769b322c56.camel@intel.com> (raw)
In-Reply-To: <CA+FuTSfX55yiPHZ-Pf051RqMkKbyvHWT86HFB135Tb4kjm6PjQ@mail.gmail.com>

On Fri, 2020-10-09 at 13:46 -0400, Willem de Bruijn wrote:
> On Wed, Oct 7, 2020 at 7:11 PM Tony Nguyen <
> anthony.l.nguyen@intel.com> wrote:
> > 
> > From: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> > 
> > Fix MAC setting flow for the PF driver.
> > 
> > Without this change the MAC address setting was interpreted
> > incorrectly in the following use cases:
> > 1) Print incorrect VF MAC or zero MAC
> > ip link show dev $pf
> > 2) Don't preserve MAC between driver reload
> > rmmod iavf; modprobe iavf
> > 3) Update VF MAC when macvlan was set
> > ip link add link $vf address $mac $vf.1 type macvlan
> > 4) Failed to update mac address when VF was trusted
> > ip link set dev $vf address $mac
> > 
> > This includes all other configurations including above commands.
> > 
> > Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> > Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com
> > >
> > Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
> > Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> 
> If this is a fix, should it target net and/or is there a commit for a
> Fixes tag?

Thanks for the review Willem. I will add a fixes tag and send it to
net.

> > @@ -2740,6 +2744,7 @@ static int i40e_vc_del_mac_addr_msg(struct
> > i40e_vf *vf, u8 *msg)
> >  {
> >         struct virtchnl_ether_addr_list *al =
> >             (struct virtchnl_ether_addr_list *)msg;
> > +       bool was_unimac_deleted = false;
> >         struct i40e_pf *pf = vf->pf;
> >         struct i40e_vsi *vsi = NULL;
> >         i40e_status ret = 0;
> > @@ -2759,6 +2764,8 @@ static int i40e_vc_del_mac_addr_msg(struct
> > i40e_vf *vf, u8 *msg)
> >                         ret = I40E_ERR_INVALID_MAC_ADDR;
> >                         goto error_param;
> >                 }
> > +               if (ether_addr_equal(al->list[i].addr, vf-
> > >default_lan_addr.addr))
> > +                       was_unimac_deleted = true;
> >         }
> >         vsi = pf->vsi[vf->lan_vsi_idx];
> > 
> > @@ -2779,10 +2786,25 @@ static int i40e_vc_del_mac_addr_msg(struct
> > i40e_vf *vf, u8 *msg)
> >                 dev_err(&pf->pdev->dev, "Unable to program VF %d
> > MAC filters, error %d\n",
> >                         vf->vf_id, ret);
> > 
> > +       if (vf->trusted && was_unimac_deleted) {
> > +               struct i40e_mac_filter *f;
> > +               struct hlist_node *h;
> > +               u8 *macaddr = NULL;
> > +               int bkt;
> > +
> > +               /* set last unicast mac address as default */
> > +               spin_lock_bh(&vsi->mac_filter_hash_lock);
> > +               hash_for_each_safe(vsi->mac_filter_hash, bkt, h, f,
> > hlist) {
> > +                       if (is_valid_ether_addr(f->macaddr))
> > +                               macaddr = f->macaddr;
> 
> nit: could break here

Will add the break.

Thanks,
Tony

  reply	other threads:[~2020-10-12 16:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-07 23:10 [net-next 0/3][pull request] 40GbE Intel Wired LAN Driver Updates 2020-10-07 Tony Nguyen
2020-10-07 23:10 ` [net-next 1/3] i40e: Allow changing FEC settings on X722 if supported by FW Tony Nguyen
2020-10-09 17:55   ` Willem de Bruijn
2020-10-09 23:36   ` Jakub Kicinski
2020-10-12 16:31     ` Nguyen, Anthony L
2020-10-07 23:10 ` [net-next 2/3] i40e: Fix MAC address setting for a VF via Host/VM Tony Nguyen
2020-10-09 17:46   ` Willem de Bruijn
2020-10-12 16:27     ` Nguyen, Anthony L [this message]
2020-10-16 10:46     ` Loktionov, Aleksandr
2020-10-16 16:23       ` Willem de Bruijn
2020-10-07 23:10 ` [net-next 3/3] e1000: remove unused and incorrect code Tony Nguyen
2020-10-09 17:44   ` Willem de Bruijn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=07967f3b63b12a501c83b86befc209769b322c56.camel@intel.com \
    --to=anthony.l.nguyen@intel.com \
    --cc=aleksandr.loktionov@intel.com \
    --cc=andrewx.bowers@intel.com \
    --cc=arkadiusz.kubalewski@intel.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=sassmann@redhat.com \
    --cc=willemdebruijn.kernel@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).