Netdev List
 help / color / mirror / Atom feed
From: "Tobias Waldekranz" <tobias@waldekranz.com>
To: "Vladimir Oltean" <olteanv@gmail.com>
Cc: <netdev@vger.kernel.org>, <andrew@lunn.ch>,
	<f.fainelli@gmail.com>, <hkallweit1@gmail.com>
Subject: Re: MDIO Debug Interface
Date: Fri, 10 Jul 2020 09:51:44 +0200	[thread overview]
Message-ID: <C42S3ZZ1E08V.CJ83S0R5R8CY@wkz-x280> (raw)
In-Reply-To: <20200709221800.yqnvepm3p57gfxym@skbuf>

On Fri Jul 10, 2020 at 3:18 AM CEST, Vladimir Oltean wrote:
> I will let the PHY library maintainers comment about implementation
> design choices made by mdio-netlink. However, I want to add a big "+1"
> from my side for identifying the correct issues in the existing PHY
> ioctls and doing something about it. I think the mainline kernel needs
> this.
> Please be aware that, if your mdio-netlink module, or something
> equivalent to it, lands in mainline, QEMU/KVM is going to be one of its
> users (for virtualizing an MDIO bus). So this is going to be more than
> just for debugging.
> And, while we're at it: context switches from a VM to a host are
> expensive. And the PHY library polls around 5 MDIO registers per PHY
> every second. It would be nice if your mdio-netlink module had some sort
> of concept of "poll offload": just do the polling in the kernel side and
> notify the user space only of a change.

The current flow is:

1. User: Send program to kernel.
2. Kernel: Verify program.
3. Kernel: Lock bus.
4. Kernel: Execute program.
5. Kernel: Unlock bus.
6. User: Read back status, including the output buffer.

(3, 5) is what allows for doing complex operations in a race free
manner. (4) is capped with a timeout to make sure that userspace can't
monopolize the bus. A "poll offload" would have to yield (i.e. unlock)
the bus in between poll cycles. Certainly doable, but it complicates
the model a bit.

> Thanks,
> -Vladimir


  parent reply	other threads:[~2020-07-10  8:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-09 20:47 MDIO Debug Interface Tobias Waldekranz
2020-07-09 22:18 ` Vladimir Oltean
2020-07-09 22:48   ` Andrew Lunn
2020-07-10  7:51   ` Tobias Waldekranz [this message]
2020-07-09 22:36 ` Florian Fainelli
2020-07-10  8:29   ` Tobias Waldekranz
2020-07-09 22:39 ` Andrew Lunn
2020-07-09 22:57   ` Vladimir Oltean
2020-07-09 23:20     ` Andrew Lunn
2020-07-09 23:33       ` Vladimir Oltean
2020-07-10  9:30         ` Tobias Waldekranz
2020-07-10  9:45           ` Vladimir Oltean
2020-07-10 13:35             ` Andrew Lunn
2020-07-10 15:47               ` Ioana Ciornei
2020-07-10  8:51   ` Tobias Waldekranz

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=C42S3ZZ1E08V.CJ83S0R5R8CY@wkz-x280 \
    --to=tobias@waldekranz.com \
    --cc=andrew@lunn.ch \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@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