All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: David Laight <David.Laight@aculab.com>
Cc: 'Koba Ko' <koba.ko@canonical.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] r8169: introduce polling method for link change
Date: Mon, 7 Jun 2021 14:49:46 +0200	[thread overview]
Message-ID: <YL4V6jak3TYxDPg8@lunn.ch> (raw)
In-Reply-To: <16f24c21776a4772ac41e6d3e0a9150c@AcuMS.aculab.com>

On Mon, Jun 07, 2021 at 12:32:29PM +0000, David Laight wrote:
> From: Koba Ko
> > Sent: 07 June 2021 05:35
> ...
> > After consulting with REALTEK, I can identify RTL8106e by PCI_VENDOR
> > REALTEK, DEVICE 0x8136, Revision 0x7.
> > I would like to make PHY_POLL as default for RTL8106E on V2.
> > because there's no side effects besides the cpu usage rate would be a
> > little higher,
> > How do you think?
> 
> If reading the PHY registers involves a software bit-bang
> of an MII register (rather than, say, a sleep for interrupt
> while the MAC unit does the bit-bang) then you can clobber
> interrupt latency because of all the time spent spinning.

That is not what PHY IRQ/POLL means in the PHY subsystem.

Many PHYs don't actually have there interrupt output connected to a
GPIO. This is partially because 803.2 C22 and C45 standards don't
define interrupts. Each vendor which supports interrupts uses
proprietary registers. So by default, the PHY subsystem will poll the
status of the PHY once per second to see if the link has changed
state. If the combination of PHY hardware, board hardware and PHY
driver does have interrupts, the PHY subsystem will not poll, but wait
for an interrupt, and then check the status of the link.

As for MII bus masters, i only know of one which is interrupt driven,
rather than polled IO, for completion. The hardware is clocking out 64
bits at 2.5MHz. So it is done rather quickly. I profiled that one
using interrupts, and the overhead of dealing with the interrupt is
bigger than polling.

    Andrew

  reply	other threads:[~2021-06-07 12:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-03  2:54 [PATCH] r8169: introduce polling method for link change Koba Ko
2021-06-03  9:59 ` Heiner Kallweit
2021-06-04  7:22   ` Koba Ko
2021-06-04  8:23     ` Heiner Kallweit
2021-06-04  9:08       ` Koba Ko
2021-06-04 11:59         ` Heiner Kallweit
2021-06-07  4:34           ` Koba Ko
2021-06-07 10:43             ` Heiner Kallweit
2021-06-07 11:09               ` Koba Ko
2021-06-07 12:32             ` David Laight
2021-06-07 12:49               ` Andrew Lunn [this message]
2021-06-07 13:17                 ` David Laight
2021-06-03 21:33 ` kernel test robot
2021-06-03 21:33   ` kernel test robot

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=YL4V6jak3TYxDPg8@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=David.Laight@aculab.com \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=koba.ko@canonical.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.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.