patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Zhang, Helin" <helin.zhang@intel.com>
To: Igor Ryzhov <iryzhov@nfware.com>,
	Olivier Matz <olivier.matz@6wind.com>,
	"Xing, Beilei" <beilei.xing@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"Wu, Jingjing" <jingjing.wu@intel.com>,
	"stable@dpdk.org" <stable@dpdk.org>,
	Laurent Hardy <laurent.hardy@6wind.com>
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] net/i40e: fix VSI MAC filter on primary address change
Date: Mon, 8 Jan 2018 06:36:26 +0000	[thread overview]
Message-ID: <F35DEAC7BCE34641BA9FAC6BCA4A12E71ACE6F3C@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <CAF+s_FweTX94J4SBidNhjTgTM93fSz55sfjpzpxmzFXK_YkYJA@mail.gmail.com>

Hi Developers and maintainers

Could you help to address the comments from Igor?

Regards,
Helin

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Igor Ryzhov
> Sent: Friday, January 5, 2018 8:35 PM
> To: Olivier Matz
> Cc: dev@dpdk.org; Wu, Jingjing; Xing, Beilei; stable@dpdk.org; Laurent Hardy
> Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix VSI MAC filter on primary address
> change
> 
> Thank you for the patch! Comments inline.
> 
> On Wed, Jan 3, 2018 at 5:29 PM, Olivier Matz <olivier.matz@6wind.com>
> wrote:
> >
> >  drivers/net/i40e/i40e_ethdev.c | 29 +++++++++++++++++++++++++++++
> >  1 file changed, 29 insertions(+)
> >
> > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_
> > ethdev.c index 811cc9ffe..e7d070879 100644
> > --- a/drivers/net/i40e/i40e_ethdev.c
> > +++ b/drivers/net/i40e/i40e_ethdev.c
> > @@ -10818,12 +10818,41 @@ static void i40e_set_default_mac_addr(struct
> > rte_eth_dev *dev,
> >                                       struct ether_addr *mac_addr)  {
> >         struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->
> > data->dev_private);
> > +       struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->
> > data->dev_private);
> > +       struct i40e_vsi *vsi = pf->main_vsi;
> > +       struct i40e_mac_filter_info mac_filter;
> > +       struct i40e_mac_filter *f;
> > +       int ret;
> >
> >         if (!is_valid_assigned_ether_addr(mac_addr)) {
> >                 PMD_DRV_LOG(ERR, "Tried to set invalid MAC address.");
> >                 return;
> >         }
> >
> >
> Is following check really necessary here?
> i40e_vsi_delete_mac(vsi, &pf->dev_addr) will do absolutely the same.
> 
> +       TAILQ_FOREACH(f, &vsi->mac_list, next) {
> > +               if (is_same_ether_addr(&pf->dev_addr,
> > &f->mac_info.mac_addr))
> > +                       break;
> > +       }
> > +
> > +       if (f == NULL) {
> > +               PMD_DRV_LOG(ERR, "Failed to find filter for default mac");
> > +               return;
> > +       }
> > +
> > +       mac_filter = f->mac_info;
> > +       ret = i40e_vsi_delete_mac(vsi, &mac_filter.mac_addr);
> > +       if (ret != I40E_SUCCESS) {
> > +               PMD_DRV_LOG(ERR, "Failed to delete mac filter");
> > +               return;
> > +       }
> > +       memcpy(&mac_filter.mac_addr, mac_addr, ETH_ADDR_LEN);
> >
> 
> Shouldn't mac_filter.filter_type be set to RTE_MACVLAN_PERFECT_MATCH?
> 
> 
> > +       ret = i40e_vsi_add_mac(vsi, &mac_filter);
> > +       if (ret != I40E_SUCCESS) {
> > +               PMD_DRV_LOG(ERR, "Failed to add mac filter");
> > +               return;
> > +       }
> > +       memcpy(&pf->dev_addr, mac_addr, ETH_ADDR_LEN);
> > +
> >         /* Flags: 0x3 updates port address */
> >
> 
> In Linux driver I40E_AQC_WRITE_TYPE_LAA_WOL is used as a flag instead of
> 0x3.
> Shouldn't we use the same flag?
> 
> 
> >         i40e_aq_mac_address_write(hw, 0x3, mac_addr->addr_bytes,
> > NULL);  }
> > --
> > 2.11.0
> >
> >
> Best regards,
> Igor

      reply	other threads:[~2018-01-08  6:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-03 14:29 [dpdk-stable] " Olivier Matz
2018-01-04  5:39 ` Xing, Beilei
2018-01-10 13:57   ` [dpdk-stable] [dpdk-dev] " Zhang, Helin
2018-01-10 22:46     ` Igor Ryzhov
2018-01-11  8:21       ` Xing, Beilei
2018-01-11 10:08         ` Igor Ryzhov
2018-01-05 12:34 ` Igor Ryzhov
2018-01-08  6:36   ` Zhang, Helin [this message]

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=F35DEAC7BCE34641BA9FAC6BCA4A12E71ACE6F3C@SHSMSX103.ccr.corp.intel.com \
    --to=helin.zhang@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=iryzhov@nfware.com \
    --cc=jingjing.wu@intel.com \
    --cc=laurent.hardy@6wind.com \
    --cc=olivier.matz@6wind.com \
    --cc=stable@dpdk.org \
    /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).