Message ID | 1607670251-31733-1-git-send-email-hemantk@codeaurora.org |
---|---|
Headers | show |
Series | userspace MHI client interface driver | expand |
On Thu, Dec 10, 2020 at 11:04:11PM -0800, Hemant Kumar wrote: > This MHI client driver allows userspace clients to transfer > raw data between MHI device and host using standard file operations. > Driver instantiates UCI device object which is associated to device > file node. UCI device object instantiates UCI channel object when device > file node is opened. UCI channel object is used to manage MHI channels > by calling MHI core APIs for read and write operations. MHI channels > are started as part of device open(). MHI channels remain in start > state until last release() is called on UCI device file node. Device > file node is created with format > > /dev/<mhi_device_name> > > Currently it supports QMI channel. libqmi is userspace MHI client which > communicates to a QMI service using QMI channel. libqmi is a glib-based > library for talking to WWAN modems and devices which speaks QMI protocol. > For more information about libqmi please refer > https://www.freedesktop.org/wiki/Software/libqmi/ This says _what_ this is doing, but not _why_. Why do you want to circumvent the normal user/kernel apis for this type of device and move the normal network handling logic out to userspace? What does that help with? What does the current in-kernel api lack that this userspace interface is going to solve, and why can't the in-kernel api solve it instead? You are pushing a common user/kernel api out of the kernel here, to become very device-specific, with no apparent justification as to why this is happening. Also, because you are going around the existing network api, I will need the networking maintainers to ack this type of patch. thanks, greg k-h
Hi Greg, On Fri, Dec 11, 2020 at 08:44:29AM +0100, Greg KH wrote: > On Thu, Dec 10, 2020 at 11:04:11PM -0800, Hemant Kumar wrote: > > This MHI client driver allows userspace clients to transfer > > raw data between MHI device and host using standard file operations. > > Driver instantiates UCI device object which is associated to device > > file node. UCI device object instantiates UCI channel object when device > > file node is opened. UCI channel object is used to manage MHI channels > > by calling MHI core APIs for read and write operations. MHI channels > > are started as part of device open(). MHI channels remain in start > > state until last release() is called on UCI device file node. Device > > file node is created with format > > > > /dev/<mhi_device_name> > > > > Currently it supports QMI channel. libqmi is userspace MHI client which > > communicates to a QMI service using QMI channel. libqmi is a glib-based > > library for talking to WWAN modems and devices which speaks QMI protocol. > > For more information about libqmi please refer > > https://www.freedesktop.org/wiki/Software/libqmi/ > > This says _what_ this is doing, but not _why_. > > Why do you want to circumvent the normal user/kernel apis for this type > of device and move the normal network handling logic out to userspace? > What does that help with? What does the current in-kernel api lack that > this userspace interface is going to solve, and why can't the in-kernel > api solve it instead? > Well, this driver is not moving the network handling logic out. Instead this driver just exposes a channel which can be used to configure the modem using the existing userspace library like libqmi. Then the networking logic is handled by a separate in kernel driver called mhi-net which is queued for v5.11. This is same for most of the Qualcomm USB modems as well. They expose a chardev node like /dev/cdc_wdm0 for configuration and once configured the networking logic is handled by usual network interface wwan0. The difference here is that the underlying physical layer is PCIe and there is this MHI bus which sits on top of it. > You are pushing a common user/kernel api out of the kernel here, to > become very device-specific, with no apparent justification as to why > this is happening. > > Also, because you are going around the existing network api, I will need > the networking maintainers to ack this type of patch. > No, this driver is not at all touching the networking part. As said, the networking logic is all handled by mhi-net driver. Thanks, Mani > thanks, > > greg k-h
On Fri, 11 Dec 2020 11:37:34 -0600 Dan Williams wrote: > Just to re-iterate: QMI ~= AT commands ~= MBIM (not quite, but same > level) > > We already do QMI-over-USB, or AT-over-CDC-ACM. This is QMI-over-MHI. Why do we need a different QMI-over-X for every X? If you say there are already chardev interfaces to configure WWAN why not provide one of those? > It's not networking data plane. It's WWAN device configuration. Ack. Not that network config doesn't fall under networking, but eh. I wonder - did DaveM ever ack this, or was it just out of his sight enough, behind the cdev, to never trigger a nack? > There are no current kernel APIs for this, and I really don't think we > want there to be. The API surface is *huge* and we definitely don't > want that in-kernel. It is what it is today for WWAN. I don't think anyone in the development community or among users is particularly happy about the situation. Which makes it rather self evident why there is so much apprehension about this patch set. It's going to be a user space channel for everything Qualcomm - AI accelerator etc. Widening the WWAN status quo to more device types.
On Fri, Dec 11, 2020 at 08:08:16PM -0800, Jakub Kicinski wrote: > On Fri, 11 Dec 2020 11:37:34 -0600 Dan Williams wrote: > > Just to re-iterate: QMI ~= AT commands ~= MBIM (not quite, but same > > level) > > > > We already do QMI-over-USB, or AT-over-CDC-ACM. This is QMI-over-MHI. > > Why do we need a different QMI-over-X for every X? If you say there > are already chardev interfaces to configure WWAN why not provide one > of those? > Just because the underlying PHY is different and it offers more services than just configuring the modem (downloading crash dump, firmware download etc...) The existing chardev nodes are closely tied to the physical interfaces. For instance, /dev/cdc_wdm is used by the USB based WWAN devices. So we really can't reuse it for MHI/PCIe. > > It's not networking data plane. It's WWAN device configuration. > > Ack. Not that network config doesn't fall under networking, but eh. > I wonder - did DaveM ever ack this, or was it just out of his sight > enough, behind the cdev, to never trigger a nack? > > > There are no current kernel APIs for this, and I really don't think we > > want there to be. The API surface is *huge* and we definitely don't > > want that in-kernel. > > It is what it is today for WWAN. I don't think anyone in the > development community or among users is particularly happy about > the situation. Which makes it rather self evident why there is > so much apprehension about this patch set. It's going to be > a user space channel for everything Qualcomm - AI accelerator etc. > Widening the WWAN status quo to more device types. Well not everything Qualcomm but for just the subsystems where there is no standardization right now. I think we went too far ahead for standardizing the modems. Thanks, Mani
Hello, Il giorno dom 13 dic 2020 alle ore 15:22 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> ha scritto: > > On Fri, Dec 11, 2020 at 08:08:16PM -0800, Jakub Kicinski wrote: > > On Fri, 11 Dec 2020 11:37:34 -0600 Dan Williams wrote: > > > Just to re-iterate: QMI ~= AT commands ~= MBIM (not quite, but same > > > level) > > > > > > We already do QMI-over-USB, or AT-over-CDC-ACM. This is QMI-over-MHI. > > > > Why do we need a different QMI-over-X for every X? If you say there > > are already chardev interfaces to configure WWAN why not provide one > > of those? > > > > Just because the underlying PHY is different and it offers more services than > just configuring the modem (downloading crash dump, firmware download etc...) > > The existing chardev nodes are closely tied to the physical interfaces. For > instance, /dev/cdc_wdm is used by the USB based WWAN devices. So we really can't > reuse it for MHI/PCIe. > let me also add that the current MHI UCI approach makes sense because it makes the switch USB -> PCIe smooth, since all the current open-source userspace tools (e.g. libqmi and qmicli), according to my testing until now, properly works without any need for a change, behaving the UCI QMI char device like cdc-wdm. While a different solution (which one?) would maybe cause to re-think the userspace side for having the same high-level behavior. Thanks, Daniele > > > It's not networking data plane. It's WWAN device configuration. > > > > Ack. Not that network config doesn't fall under networking, but eh. > > I wonder - did DaveM ever ack this, or was it just out of his sight > > enough, behind the cdev, to never trigger a nack? > > > > > There are no current kernel APIs for this, and I really don't think we > > > want there to be. The API surface is *huge* and we definitely don't > > > want that in-kernel. > > > > It is what it is today for WWAN. I don't think anyone in the > > development community or among users is particularly happy about > > the situation. Which makes it rather self evident why there is > > so much apprehension about this patch set. It's going to be > > a user space channel for everything Qualcomm - AI accelerator etc. > > Widening the WWAN status quo to more device types. > > Well not everything Qualcomm but for just the subsystems where there is no > standardization right now. I think we went too far ahead for standardizing > the modems. > > Thanks, > Mani >