From: Long Li <[email protected]>
Microsoft Azure Blob storage service exposes a REST API to applications
for data access. While it's flexible and works on most platforms, it's
not as efficient as native network stack.
This patchset implements a VSC that communicates with a VSP on the host
to execute blob storage access via native network stack on the host.
Reference:
https://azure.microsoft.com/en-us/services/storage/blobs/#overview
Long Li (3):
Drivers: hv: vmbus: add support to ignore certain PCIE devices
Drivers: hv: add Azure Blob driver
Drivers: hv: add to maintainer
Changes:
v2:
Refactored the code in vmbus to scan devices
Reworked Azure Blob driver and moved user-mode interfaces to uapi
Documentation/userspace-api/ioctl/ioctl-number.rst | 2 +
MAINTAINERS | 1 +
drivers/hv/Kconfig | 10 +
drivers/hv/Makefile | 1 +
drivers/hv/azure_blob.c | 621 +++++++++++++++++++++
drivers/hv/channel_mgmt.c | 55 +-
include/linux/hyperv.h | 9 +
include/uapi/misc/azure_blob.h | 31 +
8 files changed, 724 insertions(+), 6 deletions(-)
create mode 100644 drivers/hv/azure_blob.c
create mode 100644 include/uapi/misc/azure_blob.h
--
1.8.3.1
From: Long Li <[email protected]>
Under certain configurations when Hyper-v presents a device to VMBUS, it
may have a VMBUS channel and a PCIe channel. The PCIe channel is not used
in Linux and does not have a backing PCIE device on Hyper-v. For such
devices, ignore those PCIe channels so they are not getting probed by the
PCI subsystem.
Cc: K. Y. Srinivasan <[email protected]>
Cc: Haiyang Zhang <[email protected]>
Cc: Stephen Hemminger <[email protected]>
Cc: Wei Liu <[email protected]>
Cc: Dexuan Cui <[email protected]>
Signed-off-by: Long Li <[email protected]>
---
drivers/hv/channel_mgmt.c | 48 +++++++++++++++++++++++++++++++++++++++++------
1 file changed, 42 insertions(+), 6 deletions(-)
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index caf6d0c..0c75662 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -26,6 +26,21 @@
static void init_vp_index(struct vmbus_channel *channel);
+/*
+ * For some VMBUS devices, Hyper-v also presents certain PCIE devices as
+ * part of the host device implementation. Those devices have no real
+ * PCI implementation in Hyper-V, and should be ignored and not presented
+ * to the PCI layer.
+ */
+static const guid_t vpci_ignore_instances[] = {
+ /*
+ * Azure Blob instance ID in VPCI
+ * {d4573da2-2caa-4711-a8f9-bbabf4ee9685}
+ */
+ GUID_INIT(0xd4573da2, 0x2caa, 0x4711, 0xa8, 0xf9,
+ 0xbb, 0xab, 0xf4, 0xee, 0x96, 0x85),
+};
+
const struct vmbus_device vmbus_devs[] = {
/* IDE */
{ .dev_type = HV_IDE,
@@ -187,20 +202,19 @@ static bool is_unsupported_vmbus_devs(const guid_t *guid)
return false;
}
-static u16 hv_get_dev_type(const struct vmbus_channel *channel)
+static u16 hv_get_dev_type(const guid_t *guid)
{
- const guid_t *guid = &channel->offermsg.offer.if_type;
u16 i;
- if (is_hvsock_channel(channel) || is_unsupported_vmbus_devs(guid))
+ if (is_unsupported_vmbus_devs(guid))
return HV_UNKNOWN;
for (i = HV_IDE; i < HV_UNKNOWN; i++) {
if (guid_equal(guid, &vmbus_devs[i].guid))
- return i;
+ return vmbus_devs[i].dev_type;
}
pr_info("Unknown GUID: %pUl\n", guid);
- return i;
+ return HV_UNKNOWN;
}
/**
@@ -487,6 +501,16 @@ void vmbus_free_channels(void)
}
}
+static bool ignore_pcie_device(guid_t *if_instance)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(vpci_ignore_instances); i++)
+ if (guid_equal(&vpci_ignore_instances[i], if_instance))
+ return true;
+ return false;
+}
+
/* Note: the function can run concurrently for primary/sub channels. */
static void vmbus_add_channel_work(struct work_struct *work)
{
@@ -910,7 +934,11 @@ static void vmbus_setup_channel_state(struct vmbus_channel *channel,
sizeof(struct vmbus_channel_offer_channel));
channel->monitor_grp = (u8)offer->monitorid / 32;
channel->monitor_bit = (u8)offer->monitorid % 32;
- channel->device_id = hv_get_dev_type(channel);
+ if (is_hvsock_channel(channel))
+ channel->device_id = HV_UNKNOWN;
+ else
+ channel->device_id =
+ hv_get_dev_type(&channel->offermsg.offer.if_type);
}
/*
@@ -972,6 +1000,14 @@ static void vmbus_onoffer(struct vmbus_channel_message_header *hdr)
trace_vmbus_onoffer(offer);
+ /* Check to see if we should ignore this PCIe channel */
+ if (hv_get_dev_type(&offer->offer.if_type) == HV_PCIE &&
+ ignore_pcie_device(&offer->offer.if_instance)) {
+ pr_debug("Ignore instance %pUl over VPCI\n",
+ &offer->offer.if_instance);
+ return;
+ }
+
if (!vmbus_is_valid_device(&offer->offer.if_type)) {
pr_err_ratelimited("Invalid offer %d from the host supporting isolation\n",
offer->child_relid);
--
1.8.3.1
From: [email protected] <[email protected]> Sent: Friday, June 25, 2021 11:30 PM
>
> Under certain configurations when Hyper-v presents a device to VMBUS, it
> may have a VMBUS channel and a PCIe channel. The PCIe channel is not used
> in Linux and does not have a backing PCIE device on Hyper-v. For such
> devices, ignore those PCIe channels so they are not getting probed by the
> PCI subsystem.
>
> Cc: K. Y. Srinivasan <[email protected]>
> Cc: Haiyang Zhang <[email protected]>
> Cc: Stephen Hemminger <[email protected]>
> Cc: Wei Liu <[email protected]>
> Cc: Dexuan Cui <[email protected]>
> Signed-off-by: Long Li <[email protected]>
> ---
> drivers/hv/channel_mgmt.c | 48 +++++++++++++++++++++++++++++++++++++++++------
> 1 file changed, 42 insertions(+), 6 deletions(-)
>
Reviewed-by: Michael Kelley <[email protected]>