All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guillaume Hetier <Guillaume.Hetier@microsoft.com>
To: Johannes Berg <johannes@sipsolutions.net>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: "kvalo@codeaurora.org" <kvalo@codeaurora.org>,
	"schuffelen@google.com" <schuffelen@google.com>,
	Shwetha Bhat <shwbhat@microsoft.com>,
	Andrew Beltrano <anbeltra@microsoft.com>,
	Brian Perkins <Brian.Perkins@microsoft.com>,
	KY Srinivasan <kys@microsoft.com>,
	Matteo Croce <mcroce@microsoft.com>
Subject: RE: [EXTERNAL] Re: [RFC PATCH 1/1] Add control path virtualization in virt_wifi
Date: Thu, 23 Sep 2021 19:01:24 +0000	[thread overview]
Message-ID: <CY4PR21MB15401F95BAED44381746C11F8FA39@CY4PR21MB1540.namprd21.prod.outlook.com> (raw)
In-Reply-To: <254b35a0eb1e0c68cdc87fa54470c7c079d5dd6e.camel@sipsolutions.net>

Hi,

> From: Johannes Berg <johannes@sipsolutions.net> 
> Sent: Tuesday, September 21, 2021 1:27
>> On Mon, 2021-09-13 at 21:03 +0000, Guillaume Hetier wrote:
>> Today, there is no solution for Wi-Fi control path virtualization in a 
>> Linux virtual machine.
>> 
> 
> True :)
> 
> I guess I knew this was eventually inevitable, but it's also really
> difficult, depending on what you're trying to do?
> 
> But then, how exactly are you trying (or going to try) to use this? In
> lieu of assigning the entire NIC to the VM, replacing PCI passthrough?
> Or perhaps somehow in addition to the host system (I guess in Hyper-V
> lingo that'd be the root partition?) using the WiFi as well?
 
Our target is to give the guest VM a similar level of control over WiFi as
other applications on the host.  The host OS keeps control of the NIC. Requests
from the guest are executed through calls to public host wlan APIs and the
result is returned to the guest driver.
 
> I suppose the guest doesn't really need to care, but on the host having
> multiple things try to use WiFi would be difficult - e.g. if the host
> supports only a single client interface, what should happen?
 
Since the host keeps control of the NIC, it handles multiple things trying to
use WiFi the same way it handles different host applications trying to use Wi-Fi.
This means the host OS can reject a command from the guest, or that the guest
VM could get disconnected if another program on the host initiates a connection
to a different Wi-Fi network.
 
> IOW, I think I'm more concerned about the *host* implementation than the
> *guest* implementation.
> 
> From the guest side, we could basically treat it like any other
> "fullMAC" device, not use mac80211, and poke the cfg80211 APIs more or
> less directly out into the hypervisor.
> 
> Of course, you could argue that I don't need to care, but it feels odd
> to be adding something here where we don't know how to implement the
> other side.
 
Agreed, only one half doesn’t make a lot of sense.  We are in the process of
making our Windows host proxy implementation open source. It should be a matter
of days now.  I will send an update with a link when it is available.
 
[snip]
 
>> Are there existing recommendations or a standard way to solve this in the
>> kernel?
> 
> Netlink? Though I'm probably the only one to have ever transported
> netlink over virtio (in hwsim).
 
> I'm almost joking, but it's not really a bad format, and it has a lot of
> helper code already to format and parse messages, both in the kernel and
> in userspace, should one want to implement the device side (on the
> host/hypervisor).
> 
> Might even be feasible to just pass nl80211 through somehow? Hmm.
> Perhaps not? Haven't thought hard about it, but in a way it'd be nice,
> then we wouldn't need any new code in the driver for new features, we'd
> have all the bits in nl80211 already ...
 
Using netlink seems a great idea, thanks for the suggestion! :)
 
We also considered forwarding nl80211 messages directly, since it could avoid
the need for a specialized guest driver.  However, we wondered about
compatibility issues (what if the host and guest versions of nl80211 don’t
match?), and it seemed much more complex to implement, with significant changes
to cfg80211 and likely other parts of the wireless subsystem.  Overall, the
nl80211 forwarding option appears architecturally sound, but given the much
larger scope and impact, we focused on a more targeted solution in which the
guest driver doesn’t own the host NIC.  We feel this solution provides a middle
ground where the host can decide which parts of its wireless stack to proxy to
the guest.
 
Guillaume

  reply	other threads:[~2021-09-23 19:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13 21:03 [RFC PATCH 1/1] Add control path virtualization in virt_wifi Guillaume Hetier
2021-09-21  8:27 ` Johannes Berg
2021-09-23 19:01   ` Guillaume Hetier [this message]
2021-09-23 19:19     ` [EXTERNAL] " Johannes Berg
2021-09-27 16:31       ` Guillaume Hetier
2021-09-27 17:17         ` Johannes Berg

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=CY4PR21MB15401F95BAED44381746C11F8FA39@CY4PR21MB1540.namprd21.prod.outlook.com \
    --to=guillaume.hetier@microsoft.com \
    --cc=Brian.Perkins@microsoft.com \
    --cc=anbeltra@microsoft.com \
    --cc=johannes@sipsolutions.net \
    --cc=kvalo@codeaurora.org \
    --cc=kys@microsoft.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mcroce@microsoft.com \
    --cc=schuffelen@google.com \
    --cc=shwbhat@microsoft.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 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.