linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Neftin, Sasha" <sasha.neftin@intel.com>
To: Aaron Ma <aaron.ma@canonical.com>,
	jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com,
	davem@davemloft.net, kuba@kernel.org,
	intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, "Edri,
	Michael" <michael.edri@intel.com>,
	"Ruinskiy, Dima" <dima.ruinskiy@intel.com>,
	"Shalev, Avi" <avi.shalev@intel.com>,
	"Ruinskiy, Dima" <dima.ruinskiy@intel.com>,
	"Neftin, Sasha" <sasha.neftin@intel.com>
Subject: Re: [Intel-wired-lan] [PATCH 2/2] igc: wait for the MAC copy when enabled MAC passthrough
Date: Mon, 5 Jul 2021 14:54:39 +0300	[thread overview]
Message-ID: <f9f9408e-9ba3-7ed9-acc2-1c71913b04f0@intel.com> (raw)
In-Reply-To: <ad3d2d01-1d0a-8887-b057-e6a9531a05f4@canonical.com>

On 7/5/2021 10:38, Aaron Ma wrote:
> 
> 
> On 7/4/21 1:36 PM, Neftin, Sasha wrote:
>> On 7/2/2021 07:51, Aaron Ma wrote:
>>> Such as dock hot plug event when runtime, for hardware implementation,
>>> the MAC copy takes less than one second when BIOS enabled MAC 
>>> passthrough.
>>> After test on Lenovo TBT4 dock, 600ms is enough to update the
>>> MAC address.
>>> Otherwise ethernet fails to work.
>>>
>>> Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
>>> ---
>>>   drivers/net/ethernet/intel/igc/igc_main.c | 3 +++
>>>   1 file changed, 3 insertions(+)
>>>
>>> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c 
>>> b/drivers/net/ethernet/intel/igc/igc_main.c
>>> index 606b72cb6193..c8bc5f089255 100644
>>> --- a/drivers/net/ethernet/intel/igc/igc_main.c
>>> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
>>> @@ -5468,6 +5468,9 @@ static int igc_probe(struct pci_dev *pdev,
>>>       memcpy(&hw->mac.ops, ei->mac_ops, sizeof(hw->mac.ops));
>>>       memcpy(&hw->phy.ops, ei->phy_ops, sizeof(hw->phy.ops));
>>> +    if (pci_is_thunderbolt_attached(pdev) > +        msleep(600);
>> I believe it is a bit fragile. I would recommend here look for another 
>> indication instead of delay. Can we poll for a 'pci_channel_io_normal' 
>> state? (igc->pdev->error_state == pci_channel_io_normal)
> 
> Hi sasha,
> In this situation, the error_state is always pci_channel_io_normal.
Ok.
> The delay is necessary.
> 
> Refer to "627239-Intel® Ethernet Controller 
> I225-MAC-Address-Passthrough-rev1.2"
> section "3.5
>   Timing Considerations":
Hello Aaron, Thanks to point me on this document. I see... This is 
recommendation for Windows driver. Anyway, "delay" approach is 
error-prone. We need rather ask for MNG FW confirmation (message) that 
MAC address is copied.
Can we call (in case we know that MNG FW copied MAC address):
igc_rar_set (method from igc_mac.c), update the mac.addr and then 
perform": memcpy(netdev->dev_addr, hw->mac.addr, netdev->addr_len);?

> "For hardware implementation,
> 
> when the operating system is already running, the MAC copy must happen 
> not more than one
> 
> second after TBT link is established.
> the I225 Windows driver prevents the operating
> 
> system from detecting the I225 for one second. This allows enough time 
> for hardware to update the
> 
> MAC address."
> 
> Thanks sasha,
> Aaron
> 
>>> +
>>>       /* Initialize skew-specific constants */
>>>       err = ei->get_invariants(hw);
>>>       if (err)
>>>
>> Thanks Aaron,
>> sasha
Sasha

  reply	other threads:[~2021-07-05 11:54 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-02  4:51 [PATCH 1/2] igc: don't rd/wr iomem when PCI is removed Aaron Ma
2021-07-02  4:51 ` [PATCH 2/2] igc: wait for the MAC copy when enabled MAC passthrough Aaron Ma
2021-07-04  5:36   ` [Intel-wired-lan] " Neftin, Sasha
2021-07-05  7:38     ` Aaron Ma
2021-07-05 11:54       ` Neftin, Sasha [this message]
2021-07-06  6:46         ` Aaron Ma
2021-07-08  4:24           ` Neftin, Sasha
2021-07-13 13:45             ` Aaron Ma
2021-07-14  9:13               ` Ruinskiy, Dima
2021-07-04 14:28 ` [PATCH 1/2] igc: don't rd/wr iomem when PCI is removed Pali Rohár
2021-07-05  7:23   ` Aaron Ma
2021-07-05 23:02   ` Krzysztof Wilczyński
2021-07-06 14:23     ` Pali Rohár
2021-07-05  7:47 ` Dave Airlie
2021-07-06  6:42   ` Aaron Ma
2021-07-06 20:12 ` Bjorn Helgaas
2021-07-07 21:53   ` Pali Rohár
2021-07-07 22:10     ` Bjorn Helgaas
2021-07-08  2:04       ` Oliver O'Halloran
2021-07-08 15:45         ` Bjorn Helgaas
2021-07-18 16:31           ` Oliver O'Halloran
2021-07-18 22:50             ` Pali Rohár
2021-07-19  2:49               ` Oliver O'Halloran
2021-07-19  8:13                 ` Pali Rohár
2021-07-20  0:17                 ` Bjorn Helgaas
2021-07-13 13:00 ` [PATCH v2] igc: fix page fault when thunderbolt is unplugged Aaron Ma
2021-08-04 12:06   ` [Intel-wired-lan] " Fuxbrumer, Dvora

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=f9f9408e-9ba3-7ed9-acc2-1c71913b04f0@intel.com \
    --to=sasha.neftin@intel.com \
    --cc=aaron.ma@canonical.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=avi.shalev@intel.com \
    --cc=davem@davemloft.net \
    --cc=dima.ruinskiy@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jesse.brandeburg@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.edri@intel.com \
    --cc=netdev@vger.kernel.org \
    --subject='Re: [Intel-wired-lan] [PATCH 2/2] igc: wait for the MAC copy when enabled MAC passthrough' \
    /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

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).