All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH v3 net] i40e: Look up MAC address in Open Firmware or IDPROM
Date: Sun, 1 Nov 2015 11:24:07 -0500	[thread overview]
Message-ID: <20151101162407.GA26373@oracle.com> (raw)
In-Reply-To: <20151030231301.GA14974@oracle.com>

On (10/30/15 19:13), Sowmini Varadhan wrote:
> > In looking at a couple other drivers, I see the difference being that
> > they typically are writing the primary mac filter on probe (and any
> > other reset), whereas the i40e "knows" that the default mac address is
> > already set up as the filter and doesn't bother with a redundant write.
> > If you want to add this Open Filter code, you'll need to arrange for
> > this write to happen.  You can't call i40e_set_mac() to do it, but you
> > can see the i40e_aq_mac_address_write() code there that is involved in
> > updating the mac address as an example.  You probably will want to look
> > at section 4.2.1.5.3 of the XL710 data sheet in order to know how to
> > use i40e_aq_mac_address_write() for your situation.
>
> ok. I'll look into it (and also why this did not show up in my testing).

So I figured out why it all "seemed to work" - my test env had another
obscure init process that was marking the link promiscuous.  I guess
that was having the side-effect of somehow setting the filters above.

But looks like there's more to getting this right than just calling
i40e_aq_mac_address_write() - I think it also needs a i40e_aq_add_macvlan().  

I was able to get this to work by calling a the core part of
i40e_set_mac just before register_netdev. In my patch (RFC patch 
in a separate thread - please review) I now have this sequence in
i40e_probe

	err = i40e_get_platform_mac_addr(pdev, hw->mac.addr);
	if (err)
		i40e_get_mac_addr(hw, hw->mac.addr);
	 : 
	i40e_setup_pf_switch(..);

And the resulting i40e_vsi_setup() from i40e_setup_pf_switch()
will end up doing the right thing by invoking the guts of 
i40e_set_mac(), which is basically the  sequence:
	i40e_aq_mac_address_write()
	i40e_aq_add_macvlan()	

I dont know if it is necessary/possible/important to set up the
filters sooner in the sequence- the add_macvlan needs an "seid",
and I could not tell when (in the ":" code above) the right seid 
can be found.  

Please review the RFC patch I'll be sending shortly.

--Sowmini


WARNING: multiple messages have this Message-ID (diff)
From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
To: "Nelson, Shannon" <shannon.nelson@intel.com>
Cc: "intel-wired-lan@lists.osuosl.org"
	<intel-wired-lan@lists.osuosl.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel.com>,
	"Brandeburg, Jesse" <jesse.brandeburg@intel.com>,
	"Wyborny, Carolyn" <carolyn.wyborny@intel.com>,
	"Skidmore, Donald C" <donald.c.skidmore@intel.com>,
	"Vick, Matthew" <matthew.vick@intel.com>,
	"Ronciak, John" <john.ronciak@intel.com>,
	"Williams, Mitch A" <mitch.a.williams@intel.com>,
	"andy.shevchenko@gmail.com" <andy.shevchenko@gmail.com>
Subject: Re: [PATCH v3 net] i40e: Look up MAC address in Open Firmware or IDPROM
Date: Sun, 1 Nov 2015 11:24:07 -0500	[thread overview]
Message-ID: <20151101162407.GA26373@oracle.com> (raw)
In-Reply-To: <20151030231301.GA14974@oracle.com>

On (10/30/15 19:13), Sowmini Varadhan wrote:
> > In looking at a couple other drivers, I see the difference being that
> > they typically are writing the primary mac filter on probe (and any
> > other reset), whereas the i40e "knows" that the default mac address is
> > already set up as the filter and doesn't bother with a redundant write.
> > If you want to add this Open Filter code, you'll need to arrange for
> > this write to happen.  You can't call i40e_set_mac() to do it, but you
> > can see the i40e_aq_mac_address_write() code there that is involved in
> > updating the mac address as an example.  You probably will want to look
> > at section 4.2.1.5.3 of the XL710 data sheet in order to know how to
> > use i40e_aq_mac_address_write() for your situation.
>
> ok. I'll look into it (and also why this did not show up in my testing).

So I figured out why it all "seemed to work" - my test env had another
obscure init process that was marking the link promiscuous.  I guess
that was having the side-effect of somehow setting the filters above.

But looks like there's more to getting this right than just calling
i40e_aq_mac_address_write() - I think it also needs a i40e_aq_add_macvlan().  

I was able to get this to work by calling a the core part of
i40e_set_mac just before register_netdev. In my patch (RFC patch 
in a separate thread - please review) I now have this sequence in
i40e_probe

	err = i40e_get_platform_mac_addr(pdev, hw->mac.addr);
	if (err)
		i40e_get_mac_addr(hw, hw->mac.addr);
	 : 
	i40e_setup_pf_switch(..);

And the resulting i40e_vsi_setup() from i40e_setup_pf_switch()
will end up doing the right thing by invoking the guts of 
i40e_set_mac(), which is basically the  sequence:
	i40e_aq_mac_address_write()
	i40e_aq_add_macvlan()	

I dont know if it is necessary/possible/important to set up the
filters sooner in the sequence- the add_macvlan needs an "seid",
and I could not tell when (in the ":" code above) the right seid 
can be found.  

Please review the RFC patch I'll be sending shortly.

--Sowmini


  reply	other threads:[~2015-11-01 16:24 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-30 15:03 [Intel-wired-lan] [PATCH v3 net] i40e: Look up MAC address in Open Firmware or IDPROM Sowmini Varadhan
2015-10-30 15:03 ` Sowmini Varadhan
2015-10-30 18:06 ` [Intel-wired-lan] " Andy Shevchenko
2015-10-30 18:06   ` Andy Shevchenko
2015-10-30 18:12   ` [Intel-wired-lan] " Sowmini Varadhan
2015-10-30 18:12     ` Sowmini Varadhan
2015-10-30 18:20     ` [Intel-wired-lan] " Andy Shevchenko
2015-10-30 18:20       ` Andy Shevchenko
2015-10-30 18:28 ` [Intel-wired-lan] " Nelson, Shannon
2015-10-30 18:28   ` Nelson, Shannon
2015-10-30 18:36   ` [Intel-wired-lan] " Sowmini Varadhan
2015-10-30 18:36     ` Sowmini Varadhan
2015-10-30 18:57     ` [Intel-wired-lan] " Nelson, Shannon
2015-10-30 18:57       ` Nelson, Shannon
2015-10-30 19:24       ` [Intel-wired-lan] " Sowmini Varadhan
2015-10-30 19:24         ` Sowmini Varadhan
2015-10-30 22:03         ` [Intel-wired-lan] " Nelson, Shannon
2015-10-30 22:03           ` Nelson, Shannon
2015-10-30 23:13           ` [Intel-wired-lan] " Sowmini Varadhan
2015-10-30 23:13             ` Sowmini Varadhan
2015-11-01 16:24             ` Sowmini Varadhan [this message]
2015-11-01 16:24               ` Sowmini Varadhan
2015-11-01 21:03               ` [Intel-wired-lan] " Nelson, Shannon
2015-11-01 21:03                 ` Nelson, Shannon
2015-11-02  0:07                 ` Sowmini Varadhan
2015-11-02 17:26                   ` Nelson, Shannon
2015-11-02 19:57                     ` Sowmini Varadhan
2015-11-04 19:26                       ` Sowmini Varadhan

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=20151101162407.GA26373@oracle.com \
    --to=sowmini.varadhan@oracle.com \
    --cc=intel-wired-lan@osuosl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.