Linux-HyperV List
 help / color / mirror / Atom feed
* Re: [PATCH v5 2/8] arm64: hyperv: Add hypercall and register access functions
From: Boqun Feng @ 2019-11-04  4:36 UTC (permalink / raw)
  To: Michael Kelley
  Cc: will@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com,
	maz@kernel.org, linux-arm-kernel@lists.infradead.org,
	gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	linux-hyperv@vger.kernel.org, devel@linuxdriverproject.org,
	olaf@aepfle.de, apw@canonical.com, vkuznets, jasowang@redhat.com,
	marcelo.cerri@canonical.com, KY Srinivasan, Sunil Muthuswamy
In-Reply-To: <1570129355-16005-3-git-send-email-mikelley@microsoft.com>

Hi Michael,

On Thu, Oct 03, 2019 at 07:03:19PM +0000, Michael Kelley wrote:
> Add ARM64-specific code to make Hyper-V hypercalls and to
> access virtual processor synthetic registers via hypercalls.
> Hypercalls use a Hyper-V specific calling sequence with a non-zero
> immediate value per Section 2.9 of the SMC Calling Convention
> spec.
> 
> This code is architecture dependent and is mostly driven by
> architecture independent code in the VMbus driver and the
> Hyper-V timer clocksource driver.
> 
> This code is built only when CONFIG_HYPERV is enabled.
> 
> Signed-off-by: Michael Kelley <mikelley@microsoft.com>
> ---
>  MAINTAINERS                 |   1 +
>  arch/arm64/Kbuild           |   1 +
>  arch/arm64/hyperv/Makefile  |   2 +
>  arch/arm64/hyperv/hv_hvc.S  |  44 +++++++++++++++
>  arch/arm64/hyperv/hv_init.c | 133 ++++++++++++++++++++++++++++++++++++++++++++
>  5 files changed, 181 insertions(+)
>  create mode 100644 arch/arm64/hyperv/Makefile
>  create mode 100644 arch/arm64/hyperv/hv_hvc.S
>  create mode 100644 arch/arm64/hyperv/hv_init.c
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index d464067..84f76f9 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -7566,6 +7566,7 @@ F:	arch/x86/kernel/cpu/mshyperv.c
>  F:	arch/x86/hyperv
>  F:	arch/arm64/include/asm/hyperv-tlfs.h
>  F:	arch/arm64/include/asm/mshyperv.h
> +F:	arch/arm64/hyperv
>  F:	drivers/clocksource/hyperv_timer.c
>  F:	drivers/hid/hid-hyperv.c
>  F:	drivers/hv/
> diff --git a/arch/arm64/Kbuild b/arch/arm64/Kbuild
> index d646582..2469421 100644
> --- a/arch/arm64/Kbuild
> +++ b/arch/arm64/Kbuild
> @@ -3,4 +3,5 @@ obj-y			+= kernel/ mm/
>  obj-$(CONFIG_NET)	+= net/
>  obj-$(CONFIG_KVM)	+= kvm/
>  obj-$(CONFIG_XEN)	+= xen/
> +obj-$(CONFIG_HYPERV)	+= hyperv/

I did a kernel built with CONFIG_HYPERV=m today, and found out this line
should be (similar to x86):

	+obj-$(subst m,y,$(CONFIG_HYPERV))      += hyperv/

, otherwise, when CONFIG_HYPERV=m, files in arch/arm64/hyperv/ will be
compiled as obj-m, and symbols defined in those files cannot be
used by kernel builtin, e.g. hyperv_timer (since CONFIG_HYPERV_TIMER=y
in this case).

A compile/link error I hit today is:

| /home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:98: undefined reference to `hv_set_vpreg'
| aarch64-linux-gnu-ld: /home/boqun/linux-arm64/drivers/clocksource/hyperv_timer.c:98: undefined reference to `hv_set_vpreg'

[...]

Besides, another problem I hit when compiled with CONFIG_HYPERV=m is:

| ERROR: "screen_info" [drivers/hv/hv_vmbus.ko] undefined!

, which can be fixed by the following change.

Regards,
Boqun

---------------->8
diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c
index d0cf596db82c..8ff557ae5cc6 100644
--- a/arch/arm64/kernel/efi.c
+++ b/arch/arm64/kernel/efi.c

@@ -55,6 +55,7 @@ static __init pteval_t create_mapping_protection(efi_memory_desc_t *md)

 /* we will fill this structure from the stub, so don't put it in .bss */
 struct screen_info screen_info __section(.data);
+EXPORT_SYMBOL(screen_info);

 int __init efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md)
 {

^ permalink raw reply

* RE: [PATCH] video: hyperv: hyperv_fb: Use physical memory for fb on HyperV Gen 1 VMs.
From: Dexuan Cui @ 2019-11-02  6:17 UTC (permalink / raw)
  To: Wei Hu, b.zolnierkie@samsung.com, KY Srinivasan, Haiyang Zhang,
	Stephen Hemminger, sashal@kernel.org, hch@lst.de,
	m.szyprowski@samsung.com, robin.murphy@arm.com,
	mchehab+samsung@kernel.org, sam@ravnborg.org,
	gregkh@linuxfoundation.org, alexandre.belloni@bootlin.com,
	info@metux.net, arnd@arndb.de, dri-devel@lists.freedesktop.org,
	linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-hyperv@vger.kernel.org, iommu@lists.linux-foundation.org,
	dcui@microsoft.com, Michael Kelley
In-Reply-To: <20191022110905.4032-1-weh@microsoft.com>

> From: linux-hyperv-owner@vger.kernel.org
> <linux-hyperv-owner@vger.kernel.org> On Behalf Of Wei Hu
> Sent: Tuesday, October 22, 2019 4:11 AM
> ... 
> +	/* Allocate from CMA */
> +	// request_pages = (request_size >> PAGE_SHIFT) + 1;

"//" seems rare in Linux kernel code.
IMO "/* */" is more common.

> +			pr_info("Unable to allocate enough contiguous physical memory
> on Gen 1 VM. Use MMIO instead.\n");

The line exceeds 80 chars.
 
> @@ -1060,6 +1168,7 @@ static int hvfb_probe(struct hv_device *hdev,
>  	par = info->par;
>  	par->info = info;
>  	par->fb_ready = false;
> +	par->need_docopy = false;

Maybe it's better if we set the default value to true? This way we can save
the "	par->need_docopy = true;" in hvfb_getmem().

Thanks,
-- Dexuan

^ permalink raw reply

* Re: [PATCH v1] tools/hv: async name resolution in kvp_daemon
From: Sasha Levin @ 2019-11-02  4:18 UTC (permalink / raw)
  To: Olaf Hering
  Cc: K. Y. Srinivasan, Haiyang Zhang, Stephen Hemminger,
	open list:Hyper-V CORE AND DRIVERS, open list
In-Reply-To: <20191028184955.24dbb7d4.olaf@aepfle.de>

On Mon, Oct 28, 2019 at 06:49:55PM +0100, Olaf Hering wrote:
>Am Mon, 28 Oct 2019 12:17:54 -0400
>schrieb Sasha Levin <sashal@kernel.org>:
>
>> undefined reference to `pthread_create'
>
>Does "make V=1 -C tools/hv" work for you?
>This is what I use.

It works before I apply this patch, but breaks after:

$ make V=1 -C tools/hv
make: Entering directory '/home/sasha/linux/tools/hv'
make -f /home/sasha/linux/tools/build/Makefile.build dir=. obj=hv_kvp_daemon
make[1]: Entering directory '/home/sasha/linux/tools/hv'
  gcc -Wp,-MD,./.hv_kvp_daemon.o.d -Wp,-MT,hv_kvp_daemon.o -O2 -Wall -g -D_GNU_SOURCE -Iinclude -D"BUILD_STR(s)=#s" -c -o hv_kvp_daemon.o hv_kvp_daemon.c
   ld -r -o hv_kvp_daemon-in.o  hv_kvp_daemon.o
make[1]: Leaving directory '/home/sasha/linux/tools/hv'
gcc -O2 -Wall -g -D_GNU_SOURCE -Iinclude  hv_kvp_daemon-in.o -o hv_kvp_daemon
make -f /home/sasha/linux/tools/build/Makefile.build dir=. obj=hv_vss_daemon
make[1]: Entering directory '/home/sasha/linux/tools/hv'
  gcc -Wp,-MD,./.hv_vss_daemon.o.d -Wp,-MT,hv_vss_daemon.o -O2 -Wall -g -D_GNU_SOURCE -Iinclude -D"BUILD_STR(s)=#s" -c -o hv_vss_daemon.o hv_vss_daemon.c
   ld -r -o hv_vss_daemon-in.o  hv_vss_daemon.o
make[1]: Leaving directory '/home/sasha/linux/tools/hv'
gcc -O2 -Wall -g -D_GNU_SOURCE -Iinclude  hv_vss_daemon-in.o -o hv_vss_daemon
make -f /home/sasha/linux/tools/build/Makefile.build dir=. obj=hv_fcopy_daemon
make[1]: Entering directory '/home/sasha/linux/tools/hv'
  gcc -Wp,-MD,./.hv_fcopy_daemon.o.d -Wp,-MT,hv_fcopy_daemon.o -O2 -Wall -g -D_GNU_SOURCE -Iinclude -D"BUILD_STR(s)=#s" -c -o hv_fcopy_daemon.o hv_fcopy_daemon.c
   ld -r -o hv_fcopy_daemon-in.o  hv_fcopy_daemon.o
make[1]: Leaving directory '/home/sasha/linux/tools/hv'
gcc -O2 -Wall -g -D_GNU_SOURCE -Iinclude  hv_fcopy_daemon-in.o -o hv_fcopy_daemon
make: Leaving directory '/home/sasha/linux/tools/hv'
$ git am ~/incoming/_PATCH_v1_tools-hv_async_name_resolution_in_kvp_daemon.patch
Applying: tools/hv: async name resolution in kvp_daemon
$ make V=1 -C tools/hv
make: Entering directory '/home/sasha/linux/tools/hv'
make -f /home/sasha/linux/tools/build/Makefile.build dir=. obj=hv_kvp_daemon
make[1]: Entering directory '/home/sasha/linux/tools/hv'
  gcc -Wp,-MD,./.hv_kvp_daemon.o.d -Wp,-MT,hv_kvp_daemon.o -O2 -Wall -g -D_GNU_SOURCE -Iinclude -D"BUILD_STR(s)=#s" -c -o hv_kvp_daemon.o hv_kvp_daemon.c
   ld -r -o hv_kvp_daemon-in.o  hv_kvp_daemon.o
make[1]: Leaving directory '/home/sasha/linux/tools/hv'
gcc -O2 -Wall -g -D_GNU_SOURCE -Iinclude -lpthread hv_kvp_daemon-in.o -o hv_kvp_daemon
/usr/bin/ld: hv_kvp_daemon-in.o: in function `kvp_obtain_domain_name':
/home/sasha/linux/tools/hv/hv_kvp_daemon.c:1372: undefined reference to `pthread_create'
/usr/bin/ld: /home/sasha/linux/tools/hv/hv_kvp_daemon.c:1377: undefined reference to `pthread_detach'
collect2: error: ld returned 1 exit status
make: *** [Makefile:36: hv_kvp_daemon] Error 1
make: Leaving directory '/home/sasha/linux/tools/hv'

-- 
Thanks,
Sasha

^ permalink raw reply

* RE: [PATCH] video: hyperv: hyperv_fb: Use physical memory for fb on HyperV Gen 1 VMs.
From: Michael Kelley @ 2019-11-02  0:28 UTC (permalink / raw)
  To: Wei Hu, b.zolnierkie@samsung.com, KY Srinivasan, Haiyang Zhang,
	Stephen Hemminger, sashal@kernel.org, hch@lst.de,
	m.szyprowski@samsung.com, robin.murphy@arm.com,
	mchehab+samsung@kernel.org, sam@ravnborg.org,
	gregkh@linuxfoundation.org, alexandre.belloni@bootlin.com,
	info@metux.net, arnd@arndb.de, dri-devel@lists.freedesktop.org,
	linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-hyperv@vger.kernel.org, iommu@lists.linux-foundation.org,
	dcui@microsoft.com
In-Reply-To: <20191022110905.4032-1-weh@microsoft.com>

From: Wei Hu <weh@microsoft.com> Sent: Tuesday, October 22, 2019 4:11 AM
> 
> On Hyper-V, Generation 1 VMs can directly use VM's physical memory for
> their framebuffers. This can improve the efficiency of framebuffer and
> overall performence for VM. The physical memory assigned to framebuffer
> must be contiguous. We use CMA allocator to get contiguouse physicial
> memory when the framebuffer size is greater than 4MB. For size under
> 4MB, we use alloc_pages to achieve this.
> 
> To enable framebuffer memory allocation from CMA, supply a kernel
> parameter to give enough space to CMA allocator at boot time. For
> example:
>     cma=130m
> This gives 130MB memory to CAM allocator that can be allocated to
> framebuffer. If this fails, we fall back to the old way of using
> mmio for framebuffer.
> 
> Signed-off-by: Wei Hu <weh@microsoft.com>
> ---

[snip]

> +/*
> + * Allocate enough contiguous physical memory.
> + * Return physical address if succeeded or -1 if failed.
> + */
> +static unsigned long hvfb_get_phymem(unsigned int request_size)
> +{
> +	struct page *page = NULL;
> +	unsigned int request_pages;
> +	unsigned long paddr = 0;

Using 'unsigned long' for physical addresses is problematic on 32-bit
systems with Physical Address Extension (PAE) enabled. Linux has
phys_addr_t that handles 32-bit PAE correctly and that probably
should be used here.   This whole driver needs to be carefully
checked for the correct type for physical addresses.

> +	unsigned int order = get_order(request_size);
> +
> +	if (request_size == 0)
> +		return -1;
> +
> +	/* Try call alloc_pages if the size is less than 2^MAX_ORDER */
> +	if (order < MAX_ORDER) {
> +		page = alloc_pages(GFP_KERNEL | __GFP_ZERO, order);
> +		if (!page)
> +			return -1;
> +
> +		request_pages = (1 << order);
> +		goto get_phymem1;
> +	}
> +
> +	/* Allocate from CMA */
> +	// request_pages = (request_size >> PAGE_SHIFT) + 1;
> +	request_pages = (round_up(request_size, PAGE_SIZE) >> PAGE_SHIFT);
> +	page = dma_alloc_from_contiguous(NULL, request_pages, 0, false);
> +
> +	if (page == NULL)
> +		return -1;
> +
> +get_phymem1:
> +	paddr = (page_to_pfn(page) << PAGE_SHIFT);
> +
> +	pr_info("Allocated %d pages starts at physical addr 0x%lx\n",
> +		request_pages, paddr);
> +
> +	return paddr;
> +}
> +
> +/* Release contiguous physical memory */
> +static void hvfb_release_phymem(unsigned long paddr, unsigned int size)

Same issue here with 'unsigned long paddr'.

> +{
> +	unsigned int order = get_order(size);
> +
> +	if (order < MAX_ORDER)
> +		__free_pages(pfn_to_page(paddr >> PAGE_SHIFT), order);
> +	else
> +		dma_release_from_contiguous(NULL,
> +					    pfn_to_page(paddr >> PAGE_SHIFT),
> +					    (round_up(size, PAGE_SIZE) >>
> +					     PAGE_SHIFT));
> +					    // (size >> PAGE_SHIFT) + 1);
> +}
> +
> 
>  /* Get framebuffer memory from Hyper-V video pci space */
>  static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info)
> @@ -947,8 +1017,58 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info
> *info)
>  	void __iomem *fb_virt;
>  	int gen2vm = efi_enabled(EFI_BOOT);
>  	resource_size_t pot_start, pot_end;
> +	unsigned long paddr;

Same issue with 'unsigned long'.

>  	int ret;
> 
> +	if (!gen2vm) {
> +		pdev = pci_get_device(PCI_VENDOR_ID_MICROSOFT,
> +			PCI_DEVICE_ID_HYPERV_VIDEO, NULL);
> +		if (!pdev) {
> +			pr_err("Unable to find PCI Hyper-V video\n");
> +			return -ENODEV;
> +		}
> +	}
> +
> +	info->apertures = alloc_apertures(1);
> +	if (!info->apertures)
> +		goto err1;
> +
> +	if (gen2vm) {
> +		info->apertures->ranges[0].base = screen_info.lfb_base;
> +		info->apertures->ranges[0].size = screen_info.lfb_size;
> +	} else {
> +		info->apertures->ranges[0].base = pci_resource_start(pdev, 0);
> +		info->apertures->ranges[0].size = pci_resource_len(pdev, 0);
> +	}
> +
> +	/*
> +	 * For Gen 1 VM, we can directly use the contiguous memory
> +	 * from VM. If we success, deferred IO happens directly
> +	 * on this allocated framebuffer memory, avoiding extra
> +	 * memory copy.
> +	 */
> +	if (!gen2vm) {
> +		paddr = hvfb_get_phymem(screen_fb_size);
> +		if (paddr != (unsigned long) -1) {

phys_addr_t

> +			par->mmio_pp = paddr;

I'm not really sure what to do about the above, because mmio_pp is
declared as 'unsigned long' when it really should be phys_addr_t.
But maybe a MMIO address will always be less than 4 Gb and therefore
will fit in 32 bits?

> +			par->mmio_vp = par->dio_vp = __va(paddr);
> +
> +			info->fix.smem_start = paddr;

smem_start is also declared as 'unsigned long', which seems
problematic with 32-bit PAE.  There are a lot of drivers that cast values
as 'unsigned long' before storing into smem_start

> +			info->fix.smem_len = screen_fb_size;
> +			info->screen_base = par->mmio_vp;
> +			info->screen_size = screen_fb_size;
> +
> +			par->need_docopy = false;
> +			goto getmem1;
> +		} else {
> +			pr_info("Unable to allocate enough contiguous physical memory on
> Gen 1 VM. Use MMIO instead.\n");
> +		}
> +	}
> +
> +	/*
> +	 * Cannot use the contiguous physical memory.
> +	 * Allocate mmio space for framebuffer.
> +	 */
>  	dio_fb_size =
>  		screen_width * screen_height * screen_depth / 8;
> 
> @@ -956,13 +1076,6 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info
> *info)
>  		pot_start = 0;
>  		pot_end = -1;
>  	} else {
> -		pdev = pci_get_device(PCI_VENDOR_ID_MICROSOFT,
> -			      PCI_DEVICE_ID_HYPERV_VIDEO, NULL);
> -		if (!pdev) {
> -			pr_err("Unable to find PCI Hyper-V video\n");
> -			return -ENODEV;
> -		}
> -
>  		if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM) ||
>  		    pci_resource_len(pdev, 0) < screen_fb_size) {
>  			pr_err("Resource not available or (0x%lx < 0x%lx)\n",
> @@ -991,20 +1104,6 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info
> *info)
>  	if (par->dio_vp == NULL)
>  		goto err3;
> 
> -	info->apertures = alloc_apertures(1);
> -	if (!info->apertures)
> -		goto err4;
> -
> -	if (gen2vm) {
> -		info->apertures->ranges[0].base = screen_info.lfb_base;
> -		info->apertures->ranges[0].size = screen_info.lfb_size;
> -		remove_conflicting_framebuffers(info->apertures,
> -						KBUILD_MODNAME, false);
> -	} else {
> -		info->apertures->ranges[0].base = pci_resource_start(pdev, 0);
> -		info->apertures->ranges[0].size = pci_resource_len(pdev, 0);
> -	}
> -
>  	/* Physical address of FB device */
>  	par->mmio_pp = par->mem->start;

32-bit PAE problem could also occur here, even though the above line isn't
part of your patch.

Ideally, we would build the kernel in 32-bit mode with PAE enabled, and
test in an environment where the frame buffer gets allocated above the
4 Gbyte line.  There may be some similar bugs in other parts of this
driver that aren't touched by the patch.

Michael

^ permalink raw reply

* [PATCH net-next 2/2] hv_netvsc: record hardware hash in skb
From: Stephen Hemminger @ 2019-11-01 23:42 UTC (permalink / raw)
  To: davem, haiyangz, kys, sashal; +Cc: netdev, linux-hyperv, Stephen Hemminger
In-Reply-To: <20191101234238.23921-1-stephen@networkplumber.org>

From: Stephen Hemminger <sthemmin@microsoft.com>

Since RSS hash is available from the host, record it in
the skb.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 drivers/net/hyperv/hyperv_net.h   | 1 +
 drivers/net/hyperv/netvsc_drv.c   | 4 ++++
 drivers/net/hyperv/rndis_filter.c | 8 +++++++-
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
index 670ef682f268..4209d1cf57f6 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
@@ -853,6 +853,7 @@ struct multi_recv_comp {
 struct nvsc_rsc {
 	const struct ndis_pkt_8021q_info *vlan;
 	const struct ndis_tcp_ip_checksum_info *csum_info;
+	const u32 *hash_info;
 	u8 is_last; /* last RNDIS msg in a vmtransfer_page */
 	u32 cnt; /* #fragments in an RSC packet */
 	u32 pktlen; /* Full packet length */
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index fa56fcde9f8b..01b0d15ac681 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -766,6 +766,7 @@ static struct sk_buff *netvsc_alloc_recv_skb(struct net_device *net,
 	const struct ndis_pkt_8021q_info *vlan = nvchan->rsc.vlan;
 	const struct ndis_tcp_ip_checksum_info *csum_info =
 						nvchan->rsc.csum_info;
+	const u32 *hash_info = nvchan->rsc.hash_info;
 	struct sk_buff *skb;
 	int i;
 
@@ -802,6 +803,9 @@ static struct sk_buff *netvsc_alloc_recv_skb(struct net_device *net,
 			skb->ip_summed = CHECKSUM_UNNECESSARY;
 	}
 
+	if (hash_info)
+		skb_set_hash(skb, *hash_info, PKT_HASH_TYPE_L4);
+
 	if (vlan) {
 		u16 vlan_tci = vlan->vlanid | (vlan->pri << VLAN_PRIO_SHIFT) |
 			(vlan->cfi ? VLAN_CFI_MASK : 0);
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
index abaf8156d19d..c06178380ac8 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -358,6 +358,7 @@ static inline
 void rsc_add_data(struct netvsc_channel *nvchan,
 		  const struct ndis_pkt_8021q_info *vlan,
 		  const struct ndis_tcp_ip_checksum_info *csum_info,
+		  const u32 *hash_info,
 		  void *data, u32 len)
 {
 	u32 cnt = nvchan->rsc.cnt;
@@ -368,6 +369,7 @@ void rsc_add_data(struct netvsc_channel *nvchan,
 		nvchan->rsc.vlan = vlan;
 		nvchan->rsc.csum_info = csum_info;
 		nvchan->rsc.pktlen = len;
+		nvchan->rsc.hash_info = hash_info;
 	}
 
 	nvchan->rsc.data[cnt] = data;
@@ -385,6 +387,7 @@ static int rndis_filter_receive_data(struct net_device *ndev,
 	const struct ndis_tcp_ip_checksum_info *csum_info;
 	const struct ndis_pkt_8021q_info *vlan;
 	const struct rndis_pktinfo_id *pktinfo_id;
+	const u32 *hash_info;
 	u32 data_offset;
 	void *data;
 	bool rsc_more = false;
@@ -411,6 +414,8 @@ static int rndis_filter_receive_data(struct net_device *ndev,
 
 	csum_info = rndis_get_ppi(rndis_pkt, TCPIP_CHKSUM_PKTINFO, 0);
 
+	hash_info = rndis_get_ppi(rndis_pkt, NBL_HASH_VALUE, 0);
+
 	pktinfo_id = rndis_get_ppi(rndis_pkt, RNDIS_PKTINFO_ID, 1);
 
 	data = (void *)msg + data_offset;
@@ -441,7 +446,8 @@ static int rndis_filter_receive_data(struct net_device *ndev,
 	 * rndis_pkt->data_len tell us the real data length, we only copy
 	 * the data packet to the stack, without the rndis trailer padding
 	 */
-	rsc_add_data(nvchan, vlan, csum_info, data, rndis_pkt->data_len);
+	rsc_add_data(nvchan, vlan, csum_info, hash_info,
+		     data, rndis_pkt->data_len);
 
 	if (rsc_more)
 		return NVSP_STAT_SUCCESS;
-- 
2.20.1


^ permalink raw reply related

* [PATCH net-next 1/2] hv_netvsc: flag software created hash value
From: Stephen Hemminger @ 2019-11-01 23:42 UTC (permalink / raw)
  To: davem, haiyangz, kys, sashal; +Cc: netdev, linux-hyperv, Stephen Hemminger
In-Reply-To: <20191101234238.23921-1-stephen@networkplumber.org>

From: Stephen Hemminger <sthemmin@microsoft.com>

When the driver needs to create a hash value because it
was not done at higher level, then the hash should be marked
as a software not hardware hash.

Fixes: f72860afa2e3 ("hv_netvsc: Exclude non-TCP port numbers from vRSS hashing")
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 drivers/net/hyperv/netvsc_drv.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 39dddcd8b3cb..fa56fcde9f8b 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -285,9 +285,9 @@ static inline u32 netvsc_get_hash(
 		else if (flow.basic.n_proto == htons(ETH_P_IPV6))
 			hash = jhash2((u32 *)&flow.addrs.v6addrs, 8, hashrnd);
 		else
-			hash = 0;
+			return 0;
 
-		skb_set_hash(skb, hash, PKT_HASH_TYPE_L3);
+		__skb_set_sw_hash(skb, hash, false);
 	}
 
 	return hash;
@@ -795,8 +795,7 @@ static struct sk_buff *netvsc_alloc_recv_skb(struct net_device *net,
 	    skb->protocol == htons(ETH_P_IP))
 		netvsc_comp_ipcsum(skb);
 
-	/* Do L4 checksum offload if enabled and present.
-	 */
+	/* Do L4 checksum offload if enabled and present. */
 	if (csum_info && (net->features & NETIF_F_RXCSUM)) {
 		if (csum_info->receive.tcp_checksum_succeeded ||
 		    csum_info->receive.udp_checksum_succeeded)
-- 
2.20.1


^ permalink raw reply related

* [PATCH net-next 0/2] netvsc: RSS related patches
From: Stephen Hemminger @ 2019-11-01 23:42 UTC (permalink / raw)
  To: davem, haiyangz, kys, sashal; +Cc: netdev, linux-hyperv, Stephen Hemminger

Address a couple of issues related to recording RSS hash
value in skb. These were found by reviewing RSS support.

Stephen Hemminger (2):
  hv_netvsc: flag software created hash value
  hv_netvsc: record hardware hash in skb

 drivers/net/hyperv/hyperv_net.h   |  1 +
 drivers/net/hyperv/netvsc_drv.c   | 11 +++++++----
 drivers/net/hyperv/rndis_filter.c |  8 +++++++-
 3 files changed, 15 insertions(+), 5 deletions(-)

-- 
2.20.1


^ permalink raw reply

* Re: [PATCH net-next, 2/4] hv_netvsc: Fix error handling in netvsc_attach()
From: Markus Elfring @ 2019-11-01 20:42 UTC (permalink / raw)
  To: Haiyang Zhang, linux-hyperv, netdev
  Cc: kernel-janitors, linux-kernel, David S. Miller, K. Y. Srinivasan,
	Olaf Hering, Sasha Levin, Stephen Hemminger, Vitaly Kuznetsov
In-Reply-To: <1572296801-4789-3-git-send-email-haiyangz@microsoft.com>

> If rndis_filter_open() fails, we need to remove the rndis device created
> in earlier steps, before returning an error code. Otherwise, the retry of
> netvsc_attach() from its callers will fail and hang.

How do you think about to choose a more “imperative mood” for your
change description?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=0dbe6cb8f7e05bc9611602ef45980a6c57b245a3#n151> +++ b/drivers/net/hyperv/netvsc_drv.c
> @@ -982,7 +982,7 @@ static int netvsc_attach(struct net_device *ndev,
>  	if (netif_running(ndev)) {
>  		ret = rndis_filter_open(nvdev);
>  		if (ret)
> -			return ret;
> +			goto err;
>
>  		rdev = nvdev->extension;
>  		if (!rdev->link_state)
…

I would prefer to specify the completed exception handling
(addition of two function calls) by a compound statement in
the shown if branch directly.

If you would insist to use a goto statement, I find an other label
more appropriate according to the Linux coding style.

Regards,
Markus

^ permalink raw reply

* Re: [PATCH v1] tools/hv: async name resolution in kvp_daemon
From: Olaf Hering @ 2019-11-01 20:17 UTC (permalink / raw)
  To: Sasha Levin
  Cc: K. Y. Srinivasan, Haiyang Zhang, Stephen Hemminger,
	open list:Hyper-V CORE AND DRIVERS, open list
In-Reply-To: <20191028184955.24dbb7d4.olaf@aepfle.de>

[-- Attachment #1: Type: text/plain, Size: 324 bytes --]

Am Mon, 28 Oct 2019 18:49:55 +0100
schrieb Olaf Hering <olaf@aepfle.de>:

> Am Mon, 28 Oct 2019 12:17:54 -0400
> schrieb Sasha Levin <sashal@kernel.org>:
> > undefined reference to `pthread_create'  
> Does "make V=1 -C tools/hv" work for you?

Did you have a chance to check why the patch fails for you?


Olaf

[-- Attachment #2: Digitale Signatur von OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply

* Re: [PATCH net, 2/2] hv_netvsc: Fix error handling in netvsc_attach()
From: Markus Elfring @ 2019-11-01 20:14 UTC (permalink / raw)
  To: Haiyang Zhang, linux-hyperv, netdev
  Cc: kernel-janitors, linux-kernel, David S. Miller, K. Y. Srinivasan,
	Olaf Hering, Sasha Levin, Stephen Hemminger, Vitaly Kuznetsov
In-Reply-To: <1572449471-5219-3-git-send-email-haiyangz@microsoft.com>

…
> +++ b/drivers/net/hyperv/netvsc_drv.c
> @@ -982,7 +982,7 @@ static int netvsc_attach(struct net_device *ndev,
>  	if (netif_running(ndev)) {
>  		ret = rndis_filter_open(nvdev);
>  		if (ret)
> -			return ret;
> +			goto err;
>
>  		rdev = nvdev->extension;
>  		if (!rdev->link_state)
…

I would prefer to specify the completed exception handling
(addition of two function calls) by a compound statement in
the shown if branch directly.

If you would insist to use a goto statement, I find an other label
more appropriate according to the Linux coding style.

Regards,
Markus

^ permalink raw reply

* [PATCH] drivers/hv: Replace binary semaphore with mutex
From: Davidlohr Bueso @ 2019-11-01 20:00 UTC (permalink / raw)
  To: kys, haiyangz, sthemmin, sashal
  Cc: linux-kernel, linux-hyperv, dave, Davidlohr Bueso

At a slight footprint cost (24 vs 32 bytes), mutexes are more optimal
than semaphores; it's also a nicer interface for mutual exclusion,
which is why they are encouraged over binary semaphores, when possible.

Replace the hyperv_mmio_lock, its semantics implies traditional lock
ownership; that is, the lock owner is the same for both lock/unlock
operations. Therefore it is safe to convert.

Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
---
This is part of reducing the amount of semaphore users in the kernel.
Compile-tested only.

 drivers/hv/vmbus_drv.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 391f0b225c9a..5c606dc4a3f7 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -79,7 +79,7 @@ static struct notifier_block hyperv_panic_block = {
 static const char *fb_mmio_name = "fb_range";
 static struct resource *fb_mmio;
 static struct resource *hyperv_mmio;
-static DEFINE_SEMAPHORE(hyperv_mmio_lock);
+static DEFINE_MUTEX(hyperv_mmio_lock);
 
 static int vmbus_exists(void)
 {
@@ -2011,7 +2011,7 @@ int vmbus_allocate_mmio(struct resource **new, struct hv_device *device_obj,
 	int retval;
 
 	retval = -ENXIO;
-	down(&hyperv_mmio_lock);
+	mutex_lock(&hyperv_mmio_lock);
 
 	/*
 	 * If overlaps with frame buffers are allowed, then first attempt to
@@ -2058,7 +2058,7 @@ int vmbus_allocate_mmio(struct resource **new, struct hv_device *device_obj,
 	}
 
 exit:
-	up(&hyperv_mmio_lock);
+	mutex_unlock(&hyperv_mmio_lock);
 	return retval;
 }
 EXPORT_SYMBOL_GPL(vmbus_allocate_mmio);
@@ -2075,7 +2075,7 @@ void vmbus_free_mmio(resource_size_t start, resource_size_t size)
 {
 	struct resource *iter;
 
-	down(&hyperv_mmio_lock);
+	mutex_lock(&hyperv_mmio_lock);
 	for (iter = hyperv_mmio; iter; iter = iter->sibling) {
 		if ((iter->start >= start + size) || (iter->end <= start))
 			continue;
@@ -2083,7 +2083,7 @@ void vmbus_free_mmio(resource_size_t start, resource_size_t size)
 		__release_region(iter, start, size);
 	}
 	release_mem_region(start, size);
-	up(&hyperv_mmio_lock);
+	mutex_unlock(&hyperv_mmio_lock);
 
 }
 EXPORT_SYMBOL_GPL(vmbus_free_mmio);
-- 
2.16.4


^ permalink raw reply related

* Re: BUG: MAX_LOCKDEP_KEYS too low!
From: syzbot @ 2019-11-01 15:08 UTC (permalink / raw)
  To: a, alex.aring, allison, andrew, andy, ap420073, aroulin, ast,
	b.a.t.m.a.n, bridge, cleech, daniel, davem, dcaratti, dsa,
	edumazet, f.fainelli, fw, gregkh, gustavo, gvaradar, haiyangz,
	idosch, info, ivan.khoronzhuk, j.vosburgh, j, jakub.kicinski, jhs,
	jiri, jiri, johan.hedberg, johannes.berg, john.hurley, jwi,
	kstewart, kvalo, kys, lariel, linmiaohe, linux-bluetooth,
	linux-hams, linux-hyperv, linux-kernel, linux-ppp, linux-wireless,
	linux-wpan, liuhangbin, marcel, mareklindner
In-Reply-To: <0000000000009ea5720595dc03a3@google.com>

syzbot has found a reproducer for the following crash on:

HEAD commit:    49afce6d Add linux-next specific files for 20191031
git tree:       linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=163aeef4e00000
kernel config:  https://syzkaller.appspot.com/x/.config?x=3c5f119b33031056
dashboard link: https://syzkaller.appspot.com/bug?extid=692f39f040c1f415567b
compiler:       gcc (GCC) 9.0.0 20181231 (experimental)
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=173fa1f4e00000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=12b68f6ce00000

The bug was bisected to:

commit ab92d68fc22f9afab480153bd82a20f6e2533769
Author: Taehee Yoo <ap420073@gmail.com>
Date:   Mon Oct 21 18:47:51 2019 +0000

     net: core: add generic lockdep keys

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=12e05224e00000
final crash:    https://syzkaller.appspot.com/x/report.txt?x=11e05224e00000
console output: https://syzkaller.appspot.com/x/log.txt?x=16e05224e00000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+692f39f040c1f415567b@syzkaller.appspotmail.com
Fixes: ab92d68fc22f ("net: core: add generic lockdep keys")

BUG: MAX_LOCKDEP_KEYS too low!
turning off the locking correctness validator.
CPU: 1 PID: 421 Comm: kworker/u4:6 Not tainted 5.4.0-rc5-next-20191031 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
Workqueue: netns cleanup_net
Call Trace:
  __dump_stack lib/dump_stack.c:77 [inline]
  dump_stack+0x172/0x1f0 lib/dump_stack.c:113
  register_lock_class.cold+0x1b/0x27 kernel/locking/lockdep.c:1222
  __lock_acquire+0xf4/0x4a00 kernel/locking/lockdep.c:3837
  lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4487
  __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
  _raw_spin_lock_bh+0x33/0x50 kernel/locking/spinlock.c:175
  spin_lock_bh include/linux/spinlock.h:343 [inline]
  netif_addr_lock_bh include/linux/netdevice.h:4071 [inline]
  dev_uc_flush+0x1e/0x40 net/core/dev_addr_lists.c:710
  rollback_registered_many+0x903/0x10d0 net/core/dev.c:8753
  unregister_netdevice_many.part.0+0x1b/0x1f0 net/core/dev.c:9906
  unregister_netdevice_many+0x3b/0x50 net/core/dev.c:9905
  ip6gre_exit_batch_net+0x53c/0x760 net/ipv6/ip6_gre.c:1604
  ops_exit_list.isra.0+0x10c/0x160 net/core/net_namespace.c:175
  cleanup_net+0x538/0xaf0 net/core/net_namespace.c:597
  process_one_work+0x9af/0x1740 kernel/workqueue.c:2263
  worker_thread+0x98/0xe40 kernel/workqueue.c:2409
  kthread+0x361/0x430 kernel/kthread.c:255
  ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352
kobject: 'rx-0' (00000000df096fcc): kobject_cleanup, parent 000000005ebc1b98
kobject: 'rx-0' (00000000df096fcc): auto cleanup 'remove' event
kobject: 'rx-0' (00000000df096fcc): kobject_uevent_env
kobject: 'rx-0' (00000000df096fcc): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000df096fcc): auto cleanup kobject_del
kobject: 'rx-0' (00000000df096fcc): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000f21c003e): kobject_cleanup, parent 000000005ebc1b98
kobject: 'tx-0' (00000000f21c003e): auto cleanup 'remove' event
kobject: 'tx-0' (00000000f21c003e): kobject_uevent_env
kobject: 'tx-0' (00000000f21c003e): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000f21c003e): auto cleanup kobject_del
kobject: 'tx-0' (00000000f21c003e): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (000000005ebc1b98): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (000000005ebc1b98): calling ktype release
kobject: 'queues' (000000005ebc1b98): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (0000000040664ce7): kobject_uevent_env
kobject: 'ip6gre0' (0000000040664ce7): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000007bcba50e): kobject_cleanup, parent 00000000a6950e4e
kobject: 'rx-0' (000000007bcba50e): auto cleanup 'remove' event
kobject: 'rx-0' (000000007bcba50e): kobject_uevent_env
kobject: 'rx-0' (000000007bcba50e): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000007bcba50e): auto cleanup kobject_del
kobject: 'rx-0' (000000007bcba50e): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (000000003f3e671b): kobject_cleanup, parent 00000000a6950e4e
kobject: 'tx-0' (000000003f3e671b): auto cleanup 'remove' event
kobject: 'tx-0' (000000003f3e671b): kobject_uevent_env
kobject: 'tx-0' (000000003f3e671b): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (000000003f3e671b): auto cleanup kobject_del
kobject: 'tx-0' (000000003f3e671b): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000a6950e4e): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000a6950e4e): calling ktype release
kobject: 'queues' (00000000a6950e4e): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000f160681a): kobject_uevent_env
kobject: 'ip6gre0' (00000000f160681a): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000a23f6ff2): kobject_cleanup, parent 00000000ad4e5ebd
kobject: 'rx-0' (00000000a23f6ff2): auto cleanup 'remove' event
kobject: 'rx-0' (00000000a23f6ff2): kobject_uevent_env
kobject: 'rx-0' (00000000a23f6ff2): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000a23f6ff2): auto cleanup kobject_del
kobject: 'rx-0' (00000000a23f6ff2): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (000000001ee0d59b): kobject_cleanup, parent 00000000ad4e5ebd
kobject: 'tx-0' (000000001ee0d59b): auto cleanup 'remove' event
kobject: 'tx-0' (000000001ee0d59b): kobject_uevent_env
kobject: 'tx-0' (000000001ee0d59b): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (000000001ee0d59b): auto cleanup kobject_del
kobject: 'tx-0' (000000001ee0d59b): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000ad4e5ebd): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000ad4e5ebd): calling ktype release
kobject: 'queues' (00000000ad4e5ebd): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000acb58072): kobject_uevent_env
kobject: 'ip6gre0' (00000000acb58072): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000fc6f68a2): kobject_cleanup, parent 000000009f4c7c01
kobject: 'rx-0' (00000000fc6f68a2): auto cleanup 'remove' event
kobject: 'rx-0' (00000000fc6f68a2): kobject_uevent_env
kobject: 'rx-0' (00000000fc6f68a2): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000fc6f68a2): auto cleanup kobject_del
kobject: 'rx-0' (00000000fc6f68a2): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (0000000028c9c9c4): kobject_cleanup, parent 000000009f4c7c01
kobject: 'tx-0' (0000000028c9c9c4): auto cleanup 'remove' event
kobject: 'tx-0' (0000000028c9c9c4): kobject_uevent_env
kobject: 'tx-0' (0000000028c9c9c4): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (0000000028c9c9c4): auto cleanup kobject_del
kobject: 'tx-0' (0000000028c9c9c4): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (000000009f4c7c01): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (000000009f4c7c01): calling ktype release
kobject: 'queues' (000000009f4c7c01): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (0000000017406e86): kobject_uevent_env
kobject: 'ip6gre0' (0000000017406e86): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000007e51ab80): kobject_cleanup, parent 0000000040ad8bc9
kobject: 'rx-0' (000000007e51ab80): auto cleanup 'remove' event
kobject: 'rx-0' (000000007e51ab80): kobject_uevent_env
kobject: 'rx-0' (000000007e51ab80): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000007e51ab80): auto cleanup kobject_del
kobject: 'rx-0' (000000007e51ab80): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000a9491b56): kobject_cleanup, parent 0000000040ad8bc9
kobject: 'tx-0' (00000000a9491b56): auto cleanup 'remove' event
kobject: 'tx-0' (00000000a9491b56): kobject_uevent_env
kobject: 'tx-0' (00000000a9491b56): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000a9491b56): auto cleanup kobject_del
kobject: 'tx-0' (00000000a9491b56): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (0000000040ad8bc9): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (0000000040ad8bc9): calling ktype release
kobject: 'queues' (0000000040ad8bc9): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000de892406): kobject_uevent_env
kobject: 'ip6gre0' (00000000de892406): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000009d7a7acf): kobject_cleanup, parent 00000000fad31440
kobject: 'rx-0' (000000009d7a7acf): auto cleanup 'remove' event
kobject: 'rx-0' (000000009d7a7acf): kobject_uevent_env
kobject: 'rx-0' (000000009d7a7acf): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000009d7a7acf): auto cleanup kobject_del
kobject: 'rx-0' (000000009d7a7acf): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (000000006a2dce3c): kobject_cleanup, parent 00000000fad31440
kobject: 'tx-0' (000000006a2dce3c): auto cleanup 'remove' event
kobject: 'tx-0' (000000006a2dce3c): kobject_uevent_env
kobject: 'tx-0' (000000006a2dce3c): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (000000006a2dce3c): auto cleanup kobject_del
kobject: 'tx-0' (000000006a2dce3c): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000fad31440): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000fad31440): calling ktype release
kobject: 'queues' (00000000fad31440): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000c8c9d4af): kobject_uevent_env
kobject: 'ip6gre0' (00000000c8c9d4af): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000671a694a): kobject_cleanup, parent 000000003f5c6e6d
kobject: 'rx-0' (00000000671a694a): auto cleanup 'remove' event
kobject: 'rx-0' (00000000671a694a): kobject_uevent_env
kobject: 'rx-0' (00000000671a694a): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000671a694a): auto cleanup kobject_del
kobject: 'rx-0' (00000000671a694a): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (000000007e0c81b4): kobject_cleanup, parent 000000003f5c6e6d
kobject: 'tx-0' (000000007e0c81b4): auto cleanup 'remove' event
kobject: 'tx-0' (000000007e0c81b4): kobject_uevent_env
kobject: 'tx-0' (000000007e0c81b4): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (000000007e0c81b4): auto cleanup kobject_del
kobject: 'tx-0' (000000007e0c81b4): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (000000003f5c6e6d): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (000000003f5c6e6d): calling ktype release
kobject: 'queues' (000000003f5c6e6d): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (000000004c4e4277): kobject_uevent_env
kobject: 'ip6gre0' (000000004c4e4277): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000002a35e203): kobject_cleanup, parent 000000006176464a
kobject: 'rx-0' (000000002a35e203): auto cleanup 'remove' event
kobject: 'rx-0' (000000002a35e203): kobject_uevent_env
kobject: 'rx-0' (000000002a35e203): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000002a35e203): auto cleanup kobject_del
kobject: 'rx-0' (000000002a35e203): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000f7fbcf6d): kobject_cleanup, parent 000000006176464a
kobject: 'tx-0' (00000000f7fbcf6d): auto cleanup 'remove' event
kobject: 'tx-0' (00000000f7fbcf6d): kobject_uevent_env
kobject: 'tx-0' (00000000f7fbcf6d): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000f7fbcf6d): auto cleanup kobject_del
kobject: 'tx-0' (00000000f7fbcf6d): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (000000006176464a): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (000000006176464a): calling ktype release
kobject: 'queues' (000000006176464a): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (000000002b00a2ed): kobject_uevent_env
kobject: 'ip6gre0' (000000002b00a2ed): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000b0877a20): kobject_cleanup, parent 00000000be2a5605
kobject: 'rx-0' (00000000b0877a20): auto cleanup 'remove' event
kobject: 'rx-0' (00000000b0877a20): kobject_uevent_env
kobject: 'rx-0' (00000000b0877a20): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000b0877a20): auto cleanup kobject_del
kobject: 'rx-0' (00000000b0877a20): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000b788c38b): kobject_cleanup, parent 00000000be2a5605
kobject: 'tx-0' (00000000b788c38b): auto cleanup 'remove' event
kobject: 'tx-0' (00000000b788c38b): kobject_uevent_env
kobject: 'tx-0' (00000000b788c38b): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000b788c38b): auto cleanup kobject_del
kobject: 'tx-0' (00000000b788c38b): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000be2a5605): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000be2a5605): calling ktype release
kobject: 'queues' (00000000be2a5605): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (000000000256280f): kobject_uevent_env
kobject: 'ip6gre0' (000000000256280f): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000408ff8b5): kobject_cleanup, parent 000000009413b7d5
kobject: 'rx-0' (00000000408ff8b5): auto cleanup 'remove' event
kobject: 'rx-0' (00000000408ff8b5): kobject_uevent_env
kobject: 'rx-0' (00000000408ff8b5): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000408ff8b5): auto cleanup kobject_del
kobject: 'rx-0' (00000000408ff8b5): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (000000009d76a43a): kobject_cleanup, parent 000000009413b7d5
kobject: 'tx-0' (000000009d76a43a): auto cleanup 'remove' event
kobject: 'tx-0' (000000009d76a43a): kobject_uevent_env
kobject: 'tx-0' (000000009d76a43a): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (000000009d76a43a): auto cleanup kobject_del
kobject: 'tx-0' (000000009d76a43a): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (000000009413b7d5): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (000000009413b7d5): calling ktype release
kobject: 'queues' (000000009413b7d5): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000c13934a9): kobject_uevent_env
kobject: 'ip6gre0' (00000000c13934a9): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000f3c207ee): kobject_cleanup, parent 00000000a94ecf37
kobject: 'rx-0' (00000000f3c207ee): auto cleanup 'remove' event
kobject: 'rx-0' (00000000f3c207ee): kobject_uevent_env
kobject: 'rx-0' (00000000f3c207ee): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000f3c207ee): auto cleanup kobject_del
kobject: 'rx-0' (00000000f3c207ee): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (000000000b4524b0): kobject_cleanup, parent 00000000a94ecf37
kobject: 'tx-0' (000000000b4524b0): auto cleanup 'remove' event
kobject: 'tx-0' (000000000b4524b0): kobject_uevent_env
kobject: 'tx-0' (000000000b4524b0): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (000000000b4524b0): auto cleanup kobject_del
kobject: 'tx-0' (000000000b4524b0): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000a94ecf37): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000a94ecf37): calling ktype release
kobject: 'queues' (00000000a94ecf37): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000fe76375a): kobject_uevent_env
kobject: 'ip6gre0' (00000000fe76375a): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000bea507ab): kobject_cleanup, parent 00000000269a53ac
kobject: 'rx-0' (00000000bea507ab): auto cleanup 'remove' event
kobject: 'rx-0' (00000000bea507ab): kobject_uevent_env
kobject: 'rx-0' (00000000bea507ab): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000bea507ab): auto cleanup kobject_del
kobject: 'rx-0' (00000000bea507ab): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (000000002b7b9170): kobject_cleanup, parent 00000000269a53ac
kobject: 'tx-0' (000000002b7b9170): auto cleanup 'remove' event
kobject: 'tx-0' (000000002b7b9170): kobject_uevent_env
kobject: 'tx-0' (000000002b7b9170): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (000000002b7b9170): auto cleanup kobject_del
kobject: 'tx-0' (000000002b7b9170): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000269a53ac): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000269a53ac): calling ktype release
kobject: 'queues' (00000000269a53ac): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (000000004e9019f2): kobject_uevent_env
kobject: 'ip6gre0' (000000004e9019f2): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000003de34d47): kobject_cleanup, parent 000000005e0b5f3a
kobject: 'rx-0' (000000003de34d47): auto cleanup 'remove' event
kobject: 'rx-0' (000000003de34d47): kobject_uevent_env
kobject: 'rx-0' (000000003de34d47): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000003de34d47): auto cleanup kobject_del
kobject: 'rx-0' (000000003de34d47): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (000000001baeeadf): kobject_cleanup, parent 000000005e0b5f3a
kobject: 'tx-0' (000000001baeeadf): auto cleanup 'remove' event
kobject: 'tx-0' (000000001baeeadf): kobject_uevent_env
kobject: 'tx-0' (000000001baeeadf): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (000000001baeeadf): auto cleanup kobject_del
kobject: 'tx-0' (000000001baeeadf): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (000000005e0b5f3a): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (000000005e0b5f3a): calling ktype release
kobject: 'queues' (000000005e0b5f3a): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000ee08daa2): kobject_uevent_env
kobject: 'ip6gre0' (00000000ee08daa2): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000e8a48cb0): kobject_cleanup, parent 00000000075eb5ac
kobject: 'rx-0' (00000000e8a48cb0): auto cleanup 'remove' event
kobject: 'rx-0' (00000000e8a48cb0): kobject_uevent_env
kobject: 'rx-0' (00000000e8a48cb0): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000e8a48cb0): auto cleanup kobject_del
kobject: 'rx-0' (00000000e8a48cb0): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (000000004a036007): kobject_cleanup, parent 00000000075eb5ac
kobject: 'tx-0' (000000004a036007): auto cleanup 'remove' event
kobject: 'tx-0' (000000004a036007): kobject_uevent_env
kobject: 'tx-0' (000000004a036007): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (000000004a036007): auto cleanup kobject_del
kobject: 'tx-0' (000000004a036007): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000075eb5ac): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000075eb5ac): calling ktype release
kobject: 'queues' (00000000075eb5ac): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (000000001c0dcda3): kobject_uevent_env
kobject: 'ip6gre0' (000000001c0dcda3): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000b6130418): kobject_cleanup, parent 000000003c39afeb
kobject: 'rx-0' (00000000b6130418): auto cleanup 'remove' event
kobject: 'rx-0' (00000000b6130418): kobject_uevent_env
kobject: 'rx-0' (00000000b6130418): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000b6130418): auto cleanup kobject_del
kobject: 'rx-0' (00000000b6130418): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (000000002bae04b9): kobject_cleanup, parent 000000003c39afeb
kobject: 'tx-0' (000000002bae04b9): auto cleanup 'remove' event
kobject: 'tx-0' (000000002bae04b9): kobject_uevent_env
kobject: 'tx-0' (000000002bae04b9): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (000000002bae04b9): auto cleanup kobject_del
kobject: 'tx-0' (000000002bae04b9): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (000000003c39afeb): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (000000003c39afeb): calling ktype release
kobject: 'queues' (000000003c39afeb): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000ab968d08): kobject_uevent_env
kobject: 'ip6gre0' (00000000ab968d08): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000931b5a7d): kobject_cleanup, parent 000000002ef51c00
kobject: 'rx-0' (00000000931b5a7d): auto cleanup 'remove' event
kobject: 'rx-0' (00000000931b5a7d): kobject_uevent_env
kobject: 'rx-0' (00000000931b5a7d): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000931b5a7d): auto cleanup kobject_del
kobject: 'rx-0' (00000000931b5a7d): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000e9a5562a): kobject_cleanup, parent 000000002ef51c00
kobject: 'tx-0' (00000000e9a5562a): auto cleanup 'remove' event
kobject: 'tx-0' (00000000e9a5562a): kobject_uevent_env
kobject: 'tx-0' (00000000e9a5562a): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000e9a5562a): auto cleanup kobject_del
kobject: 'tx-0' (00000000e9a5562a): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (000000002ef51c00): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (000000002ef51c00): calling ktype release
kobject: 'queues' (000000002ef51c00): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000f7871405): kobject_uevent_env
kobject: 'ip6gre0' (00000000f7871405): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000fef07d0d): kobject_cleanup, parent 00000000b30db419
kobject: 'rx-0' (00000000fef07d0d): auto cleanup 'remove' event
kobject: 'rx-0' (00000000fef07d0d): kobject_uevent_env
kobject: 'rx-0' (00000000fef07d0d): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000fef07d0d): auto cleanup kobject_del
kobject: 'rx-0' (00000000fef07d0d): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000479f1718): kobject_cleanup, parent 00000000b30db419
kobject: 'tx-0' (00000000479f1718): auto cleanup 'remove' event
kobject: 'tx-0' (00000000479f1718): kobject_uevent_env
kobject: 'tx-0' (00000000479f1718): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000479f1718): auto cleanup kobject_del
kobject: 'tx-0' (00000000479f1718): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000b30db419): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000b30db419): calling ktype release
kobject: 'queues' (00000000b30db419): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (000000000aa7e3fe): kobject_uevent_env
kobject: 'ip6gre0' (000000000aa7e3fe): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000002594c733): kobject_cleanup, parent 000000007a89b00c
kobject: 'rx-0' (000000002594c733): auto cleanup 'remove' event
kobject: 'rx-0' (000000002594c733): kobject_uevent_env
kobject: 'rx-0' (000000002594c733): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000002594c733): auto cleanup kobject_del
kobject: 'rx-0' (000000002594c733): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000b2e83822): kobject_cleanup, parent 000000007a89b00c
kobject: 'tx-0' (00000000b2e83822): auto cleanup 'remove' event
kobject: 'tx-0' (00000000b2e83822): kobject_uevent_env
kobject: 'tx-0' (00000000b2e83822): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000b2e83822): auto cleanup kobject_del
kobject: 'tx-0' (00000000b2e83822): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (000000007a89b00c): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (000000007a89b00c): calling ktype release
kobject: 'queues' (000000007a89b00c): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000ee8b6038): kobject_uevent_env
kobject: 'ip6gre0' (00000000ee8b6038): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (0000000057d4664e): kobject_cleanup, parent 00000000cd8bcc04
kobject: 'rx-0' (0000000057d4664e): auto cleanup 'remove' event
kobject: 'rx-0' (0000000057d4664e): kobject_uevent_env
kobject: 'rx-0' (0000000057d4664e): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (0000000057d4664e): auto cleanup kobject_del
kobject: 'rx-0' (0000000057d4664e): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000d579e94e): kobject_cleanup, parent 00000000cd8bcc04
kobject: 'tx-0' (00000000d579e94e): auto cleanup 'remove' event
kobject: 'tx-0' (00000000d579e94e): kobject_uevent_env
kobject: 'tx-0' (00000000d579e94e): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000d579e94e): auto cleanup kobject_del
kobject: 'tx-0' (00000000d579e94e): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000cd8bcc04): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000cd8bcc04): calling ktype release
kobject: 'queues' (00000000cd8bcc04): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (0000000053e5a548): kobject_uevent_env
kobject: 'ip6gre0' (0000000053e5a548): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (0000000065a532bc): kobject_cleanup, parent 000000004c3594cb
kobject: 'rx-0' (0000000065a532bc): auto cleanup 'remove' event
kobject: 'rx-0' (0000000065a532bc): kobject_uevent_env
kobject: 'rx-0' (0000000065a532bc): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (0000000065a532bc): auto cleanup kobject_del
kobject: 'rx-0' (0000000065a532bc): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000871b8eaa): kobject_cleanup, parent 000000004c3594cb
kobject: 'tx-0' (00000000871b8eaa): auto cleanup 'remove' event
kobject: 'tx-0' (00000000871b8eaa): kobject_uevent_env
kobject: 'tx-0' (00000000871b8eaa): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000871b8eaa): auto cleanup kobject_del
kobject: 'tx-0' (00000000871b8eaa): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (000000004c3594cb): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (000000004c3594cb): calling ktype release
kobject: 'queues' (000000004c3594cb): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000b0759121): kobject_uevent_env
kobject: 'ip6gre0' (00000000b0759121): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000d7b62218): kobject_cleanup, parent 00000000610f56ba
kobject: 'rx-0' (00000000d7b62218): auto cleanup 'remove' event
kobject: 'rx-0' (00000000d7b62218): kobject_uevent_env
kobject: 'rx-0' (00000000d7b62218): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000d7b62218): auto cleanup kobject_del
kobject: 'rx-0' (00000000d7b62218): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000a67ca687): kobject_cleanup, parent 00000000610f56ba
kobject: 'tx-0' (00000000a67ca687): auto cleanup 'remove' event
kobject: 'tx-0' (00000000a67ca687): kobject_uevent_env
kobject: 'tx-0' (00000000a67ca687): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000a67ca687): auto cleanup kobject_del
kobject: 'tx-0' (00000000a67ca687): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000610f56ba): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000610f56ba): calling ktype release
kobject: 'queues' (00000000610f56ba): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000bd0a06d6): kobject_uevent_env
kobject: 'ip6gre0' (00000000bd0a06d6): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (0000000089287da5): kobject_cleanup, parent 00000000d45afbf4
kobject: 'rx-0' (0000000089287da5): auto cleanup 'remove' event
kobject: 'rx-0' (0000000089287da5): kobject_uevent_env
kobject: 'rx-0' (0000000089287da5): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (0000000089287da5): auto cleanup kobject_del
kobject: 'rx-0' (0000000089287da5): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (000000006811ab10): kobject_cleanup, parent 00000000d45afbf4
kobject: 'tx-0' (000000006811ab10): auto cleanup 'remove' event
kobject: 'tx-0' (000000006811ab10): kobject_uevent_env
kobject: 'tx-0' (000000006811ab10): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (000000006811ab10): auto cleanup kobject_del
kobject: 'tx-0' (000000006811ab10): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000d45afbf4): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000d45afbf4): calling ktype release
kobject: 'queues' (00000000d45afbf4): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (000000007a0efe6b): kobject_uevent_env
kobject: 'ip6gre0' (000000007a0efe6b): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000f29316ba): kobject_cleanup, parent 00000000e201f66c
kobject: 'rx-0' (00000000f29316ba): auto cleanup 'remove' event
kobject: 'rx-0' (00000000f29316ba): kobject_uevent_env
kobject: 'rx-0' (00000000f29316ba): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000f29316ba): auto cleanup kobject_del
kobject: 'rx-0' (00000000f29316ba): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000cb2d1b3f): kobject_cleanup, parent 00000000e201f66c
kobject: 'tx-0' (00000000cb2d1b3f): auto cleanup 'remove' event
kobject: 'tx-0' (00000000cb2d1b3f): kobject_uevent_env
kobject: 'tx-0' (00000000cb2d1b3f): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000cb2d1b3f): auto cleanup kobject_del
kobject: 'tx-0' (00000000cb2d1b3f): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000e201f66c): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000e201f66c): calling ktype release
kobject: 'queues' (00000000e201f66c): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000ed6cd2b9): kobject_uevent_env
kobject: 'ip6gre0' (00000000ed6cd2b9): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000945b59a7): kobject_cleanup, parent 00000000a107c4cd
kobject: 'rx-0' (00000000945b59a7): auto cleanup 'remove' event
kobject: 'rx-0' (00000000945b59a7): kobject_uevent_env
kobject: 'rx-0' (00000000945b59a7): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000945b59a7): auto cleanup kobject_del
kobject: 'rx-0' (00000000945b59a7): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (000000002e5963fd): kobject_cleanup, parent 00000000a107c4cd
kobject: 'tx-0' (000000002e5963fd): auto cleanup 'remove' event
kobject: 'tx-0' (000000002e5963fd): kobject_uevent_env
kobject: 'tx-0' (000000002e5963fd): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (000000002e5963fd): auto cleanup kobject_del
kobject: 'tx-0' (000000002e5963fd): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000a107c4cd): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000a107c4cd): calling ktype release
kobject: 'queues' (00000000a107c4cd): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (000000005e65baa9): kobject_uevent_env
kobject: 'ip6gre0' (000000005e65baa9): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (0000000009936e97): kobject_cleanup, parent 000000008ec9e778
kobject: 'rx-0' (0000000009936e97): auto cleanup 'remove' event
kobject: 'rx-0' (0000000009936e97): kobject_uevent_env
kobject: 'rx-0' (0000000009936e97): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (0000000009936e97): auto cleanup kobject_del
kobject: 'rx-0' (0000000009936e97): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (000000001d86a1e2): kobject_cleanup, parent 000000008ec9e778
kobject: 'tx-0' (000000001d86a1e2): auto cleanup 'remove' event
kobject: 'tx-0' (000000001d86a1e2): kobject_uevent_env
kobject: 'tx-0' (000000001d86a1e2): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (000000001d86a1e2): auto cleanup kobject_del
kobject: 'tx-0' (000000001d86a1e2): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (000000008ec9e778): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (000000008ec9e778): calling ktype release
kobject: 'queues' (000000008ec9e778): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000cd1ee44d): kobject_uevent_env
kobject: 'ip6gre0' (00000000cd1ee44d): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000a76e9df2): kobject_cleanup, parent 0000000023fcd277
kobject: 'rx-0' (00000000a76e9df2): auto cleanup 'remove' event
kobject: 'rx-0' (00000000a76e9df2): kobject_uevent_env
kobject: 'rx-0' (00000000a76e9df2): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000a76e9df2): auto cleanup kobject_del
kobject: 'rx-0' (00000000a76e9df2): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000f2d38e7f): kobject_cleanup, parent 0000000023fcd277
kobject: 'tx-0' (00000000f2d38e7f): auto cleanup 'remove' event
kobject: 'tx-0' (00000000f2d38e7f): kobject_uevent_env
kobject: 'tx-0' (00000000f2d38e7f): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000f2d38e7f): auto cleanup kobject_del
kobject: 'tx-0' (00000000f2d38e7f): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (0000000023fcd277): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (0000000023fcd277): calling ktype release
kobject: 'queues' (0000000023fcd277): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (0000000043e42a8f): kobject_uevent_env
kobject: 'ip6gre0' (0000000043e42a8f): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000406426f1): kobject_cleanup, parent 000000007746cc46
kobject: 'rx-0' (00000000406426f1): auto cleanup 'remove' event
kobject: 'rx-0' (00000000406426f1): kobject_uevent_env
kobject: 'rx-0' (00000000406426f1): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000406426f1): auto cleanup kobject_del
kobject: 'rx-0' (00000000406426f1): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000dc1a620b): kobject_cleanup, parent 000000007746cc46
kobject: 'tx-0' (00000000dc1a620b): auto cleanup 'remove' event
kobject: 'tx-0' (00000000dc1a620b): kobject_uevent_env
kobject: 'tx-0' (00000000dc1a620b): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000dc1a620b): auto cleanup kobject_del
kobject: 'tx-0' (00000000dc1a620b): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (000000007746cc46): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (000000007746cc46): calling ktype release
kobject: 'queues' (000000007746cc46): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (000000009464ec70): kobject_uevent_env
kobject: 'ip6gre0' (000000009464ec70): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000aa648a91): kobject_cleanup, parent 00000000a14404ed
kobject: 'rx-0' (00000000aa648a91): auto cleanup 'remove' event
kobject: 'rx-0' (00000000aa648a91): kobject_uevent_env
kobject: 'rx-0' (00000000aa648a91): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000aa648a91): auto cleanup kobject_del
kobject: 'rx-0' (00000000aa648a91): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000e01cdeea): kobject_cleanup, parent 00000000a14404ed
kobject: 'tx-0' (00000000e01cdeea): auto cleanup 'remove' event
kobject: 'tx-0' (00000000e01cdeea): kobject_uevent_env
kobject: 'tx-0' (00000000e01cdeea): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000e01cdeea): auto cleanup kobject_del
kobject: 'tx-0' (00000000e01cdeea): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000a14404ed): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000a14404ed): calling ktype release
kobject: 'queues' (00000000a14404ed): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000dcf9157f): kobject_uevent_env
kobject: 'ip6gre0' (00000000dcf9157f): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000bcfcbeb2): kobject_cleanup, parent 00000000f9140c0a
kobject: 'rx-0' (00000000bcfcbeb2): auto cleanup 'remove' event
kobject: 'rx-0' (00000000bcfcbeb2): kobject_uevent_env
kobject: 'rx-0' (00000000bcfcbeb2): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000bcfcbeb2): auto cleanup kobject_del
kobject: 'rx-0' (00000000bcfcbeb2): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000e6a85471): kobject_cleanup, parent 00000000f9140c0a
kobject: 'tx-0' (00000000e6a85471): auto cleanup 'remove' event
kobject: 'tx-0' (00000000e6a85471): kobject_uevent_env
kobject: 'tx-0' (00000000e6a85471): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000e6a85471): auto cleanup kobject_del
kobject: 'tx-0' (00000000e6a85471): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000f9140c0a): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000f9140c0a): calling ktype release
kobject: 'queues' (00000000f9140c0a): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000c73ea5ea): kobject_uevent_env
kobject: 'ip6gre0' (00000000c73ea5ea): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000c94c7e61): kobject_cleanup, parent 00000000bbaf8d5c
kobject: 'rx-0' (00000000c94c7e61): auto cleanup 'remove' event
kobject: 'rx-0' (00000000c94c7e61): kobject_uevent_env
kobject: 'rx-0' (00000000c94c7e61): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000c94c7e61): auto cleanup kobject_del
kobject: 'rx-0' (00000000c94c7e61): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000e7802118): kobject_cleanup, parent 00000000bbaf8d5c
kobject: 'tx-0' (00000000e7802118): auto cleanup 'remove' event
kobject: 'tx-0' (00000000e7802118): kobject_uevent_env
kobject: 'tx-0' (00000000e7802118): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000e7802118): auto cleanup kobject_del
kobject: 'tx-0' (00000000e7802118): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000bbaf8d5c): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000bbaf8d5c): calling ktype release
kobject: 'queues' (00000000bbaf8d5c): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000bd426f43): kobject_uevent_env
kobject: 'ip6gre0' (00000000bd426f43): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000ae224d7b): kobject_cleanup, parent 00000000f53e37c2
kobject: 'rx-0' (00000000ae224d7b): auto cleanup 'remove' event
kobject: 'rx-0' (00000000ae224d7b): kobject_uevent_env
kobject: 'rx-0' (00000000ae224d7b): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000ae224d7b): auto cleanup kobject_del
kobject: 'rx-0' (00000000ae224d7b): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (000000007ed38c32): kobject_cleanup, parent 00000000f53e37c2
kobject: 'tx-0' (000000007ed38c32): auto cleanup 'remove' event
kobject: 'tx-0' (000000007ed38c32): kobject_uevent_env
kobject: 'tx-0' (000000007ed38c32): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (000000007ed38c32): auto cleanup kobject_del
kobject: 'tx-0' (000000007ed38c32): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000f53e37c2): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000f53e37c2): calling ktype release
kobject: 'queues' (00000000f53e37c2): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000e5b68383): kobject_uevent_env
kobject: 'ip6gre0' (00000000e5b68383): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (0000000032b7d82d): kobject_cleanup, parent 0000000046a4b147
kobject: 'rx-0' (0000000032b7d82d): auto cleanup 'remove' event
kobject: 'rx-0' (0000000032b7d82d): kobject_uevent_env
kobject: 'rx-0' (0000000032b7d82d): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (0000000032b7d82d): auto cleanup kobject_del
kobject: 'rx-0' (0000000032b7d82d): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000ecee562b): kobject_cleanup, parent 0000000046a4b147
kobject: 'tx-0' (00000000ecee562b): auto cleanup 'remove' event
kobject: 'tx-0' (00000000ecee562b): kobject_uevent_env
kobject: 'tx-0' (00000000ecee562b): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000ecee562b): auto cleanup kobject_del
kobject: 'tx-0' (00000000ecee562b): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (0000000046a4b147): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (0000000046a4b147): calling ktype release
kobject: 'queues' (0000000046a4b147): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (0000000034e8fce4): kobject_uevent_env
kobject: 'ip6gre0' (0000000034e8fce4): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000d64b193d): kobject_cleanup, parent 00000000d3240690
kobject: 'rx-0' (00000000d64b193d): auto cleanup 'remove' event
kobject: 'rx-0' (00000000d64b193d): kobject_uevent_env
kobject: 'rx-0' (00000000d64b193d): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000d64b193d): auto cleanup kobject_del
kobject: 'rx-0' (00000000d64b193d): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000de823788): kobject_cleanup, parent 00000000d3240690
kobject: 'tx-0' (00000000de823788): auto cleanup 'remove' event
kobject: 'tx-0' (00000000de823788): kobject_uevent_env
kobject: 'tx-0' (00000000de823788): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000de823788): auto cleanup kobject_del
kobject: 'tx-0' (00000000de823788): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000d3240690): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000d3240690): calling ktype release
kobject: 'queues' (00000000d3240690): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (0000000037469a49): kobject_uevent_env
kobject: 'ip6gre0' (0000000037469a49): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000007256ed19): kobject_cleanup, parent 00000000b6cac8e1
kobject: 'rx-0' (000000007256ed19): auto cleanup 'remove' event
kobject: 'rx-0' (000000007256ed19): kobject_uevent_env
kobject: 'rx-0' (000000007256ed19): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000007256ed19): auto cleanup kobject_del
kobject: 'rx-0' (000000007256ed19): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000976f5487): kobject_cleanup, parent 00000000b6cac8e1
kobject: 'tx-0' (00000000976f5487): auto cleanup 'remove' event
kobject: 'tx-0' (00000000976f5487): kobject_uevent_env
kobject: 'tx-0' (00000000976f5487): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000976f5487): auto cleanup kobject_del
kobject: 'tx-0' (00000000976f5487): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000b6cac8e1): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000b6cac8e1): calling ktype release
kobject: 'queues' (00000000b6cac8e1): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000dd6f5b20): kobject_uevent_env
kobject: 'ip6gre0' (00000000dd6f5b20): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000c310e950): kobject_cleanup, parent 0000000001335301
kobject: 'rx-0' (00000000c310e950): auto cleanup 'remove' event
kobject: 'rx-0' (00000000c310e950): kobject_uevent_env
kobject: 'rx-0' (00000000c310e950): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000c310e950): auto cleanup kobject_del
kobject: 'rx-0' (00000000c310e950): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000a22dac40): kobject_cleanup, parent 0000000001335301
kobject: 'tx-0' (00000000a22dac40): auto cleanup 'remove' event
kobject: 'tx-0' (00000000a22dac40): kobject_uevent_env
kobject: 'tx-0' (00000000a22dac40): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000a22dac40): auto cleanup kobject_del
kobject: 'tx-0' (00000000a22dac40): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (0000000001335301): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (0000000001335301): calling ktype release
kobject: 'queues' (0000000001335301): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000b49b9097): kobject_uevent_env
kobject: 'ip6gre0' (00000000b49b9097): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000002c2dc2a0): kobject_cleanup, parent 00000000dfc006bd
kobject: 'rx-0' (000000002c2dc2a0): auto cleanup 'remove' event
kobject: 'rx-0' (000000002c2dc2a0): kobject_uevent_env
kobject: 'rx-0' (000000002c2dc2a0): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000002c2dc2a0): auto cleanup kobject_del
kobject: 'rx-0' (000000002c2dc2a0): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000811d59fd): kobject_cleanup, parent 00000000dfc006bd
kobject: 'tx-0' (00000000811d59fd): auto cleanup 'remove' event
kobject: 'tx-0' (00000000811d59fd): kobject_uevent_env
kobject: 'tx-0' (00000000811d59fd): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000811d59fd): auto cleanup kobject_del
kobject: 'tx-0' (00000000811d59fd): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000dfc006bd): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000dfc006bd): calling ktype release
kobject: 'queues' (00000000dfc006bd): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000d8ca0851): kobject_uevent_env
kobject: 'ip6gre0' (00000000d8ca0851): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000005798ac69): kobject_cleanup, parent 0000000092e18f41
kobject: 'rx-0' (000000005798ac69): auto cleanup 'remove' event
kobject: 'rx-0' (000000005798ac69): kobject_uevent_env
kobject: 'rx-0' (000000005798ac69): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000005798ac69): auto cleanup kobject_del
kobject: 'rx-0' (000000005798ac69): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000d77f11e5): kobject_cleanup, parent 0000000092e18f41
kobject: 'tx-0' (00000000d77f11e5): auto cleanup 'remove' event
kobject: 'tx-0' (00000000d77f11e5): kobject_uevent_env
kobject: 'tx-0' (00000000d77f11e5): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000d77f11e5): auto cleanup kobject_del
kobject: 'tx-0' (00000000d77f11e5): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (0000000092e18f41): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (0000000092e18f41): calling ktype release
kobject: 'queues' (0000000092e18f41): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (000000001173cf96): kobject_uevent_env
kobject: 'ip6gre0' (000000001173cf96): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (0000000054f51df6): kobject_cleanup, parent 0000000085cf13b7
kobject: 'rx-0' (0000000054f51df6): auto cleanup 'remove' event
kobject: 'rx-0' (0000000054f51df6): kobject_uevent_env
kobject: 'rx-0' (0000000054f51df6): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (0000000054f51df6): auto cleanup kobject_del
kobject: 'rx-0' (0000000054f51df6): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000617e0395): kobject_cleanup, parent 0000000085cf13b7
kobject: 'tx-0' (00000000617e0395): auto cleanup 'remove' event
kobject: 'tx-0' (00000000617e0395): kobject_uevent_env
kobject: 'tx-0' (00000000617e0395): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000617e0395): auto cleanup kobject_del
kobject: 'tx-0' (00000000617e0395): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (0000000085cf13b7): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (0000000085cf13b7): calling ktype release
kobject: 'queues' (0000000085cf13b7): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000479b8166): kobject_uevent_env
kobject: 'ip6gre0' (00000000479b8166): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (0000000068682a1f): kobject_cleanup, parent 0000000017973315
kobject: 'rx-0' (0000000068682a1f): auto cleanup 'remove' event
kobject: 'rx-0' (0000000068682a1f): kobject_uevent_env
kobject: 'rx-0' (0000000068682a1f): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (0000000068682a1f): auto cleanup kobject_del
kobject: 'rx-0' (0000000068682a1f): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (000000004ab32a00): kobject_cleanup, parent 0000000017973315
kobject: 'tx-0' (000000004ab32a00): auto cleanup 'remove' event
kobject: 'tx-0' (000000004ab32a00): kobject_uevent_env
kobject: 'tx-0' (000000004ab32a00): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (000000004ab32a00): auto cleanup kobject_del
kobject: 'tx-0' (000000004ab32a00): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (0000000017973315): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (0000000017973315): calling ktype release
kobject: 'queues' (0000000017973315): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000d4b0a8ed): kobject_uevent_env
kobject: 'ip6gre0' (00000000d4b0a8ed): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000002fad872b): kobject_cleanup, parent 000000003f89e112
kobject: 'rx-0' (000000002fad872b): auto cleanup 'remove' event
kobject: 'rx-0' (000000002fad872b): kobject_uevent_env
kobject: 'rx-0' (000000002fad872b): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000002fad872b): auto cleanup kobject_del
kobject: 'rx-0' (000000002fad872b): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000fe420941): kobject_cleanup, parent 000000003f89e112
kobject: 'tx-0' (00000000fe420941): auto cleanup 'remove' event
kobject: 'tx-0' (00000000fe420941): kobject_uevent_env
kobject: 'tx-0' (00000000fe420941): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000fe420941): auto cleanup kobject_del
kobject: 'tx-0' (00000000fe420941): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (000000003f89e112): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (000000003f89e112): calling ktype release
kobject: 'queues' (000000003f89e112): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (0000000020dd0ad9): kobject_uevent_env
kobject: 'ip6gre0' (0000000020dd0ad9): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000003dd3d97e): kobject_cleanup, parent 00000000f4ba214f
kobject: 'rx-0' (000000003dd3d97e): auto cleanup 'remove' event
kobject: 'rx-0' (000000003dd3d97e): kobject_uevent_env
kobject: 'rx-0' (000000003dd3d97e): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000003dd3d97e): auto cleanup kobject_del
kobject: 'rx-0' (000000003dd3d97e): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (000000000495b423): kobject_cleanup, parent 00000000f4ba214f
kobject: 'tx-0' (000000000495b423): auto cleanup 'remove' event
kobject: 'tx-0' (000000000495b423): kobject_uevent_env
kobject: 'tx-0' (000000000495b423): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (000000000495b423): auto cleanup kobject_del
kobject: 'tx-0' (000000000495b423): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000f4ba214f): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000f4ba214f): calling ktype release
kobject: 'queues' (00000000f4ba214f): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (000000002a3f422a): kobject_uevent_env
kobject: 'ip6gre0' (000000002a3f422a): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000009a2510fb): kobject_cleanup, parent 0000000053b27ac3
kobject: 'rx-0' (000000009a2510fb): auto cleanup 'remove' event
kobject: 'rx-0' (000000009a2510fb): kobject_uevent_env
kobject: 'rx-0' (000000009a2510fb): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000009a2510fb): auto cleanup kobject_del
kobject: 'rx-0' (000000009a2510fb): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (0000000076ddb05c): kobject_cleanup, parent 0000000053b27ac3
kobject: 'tx-0' (0000000076ddb05c): auto cleanup 'remove' event
kobject: 'tx-0' (0000000076ddb05c): kobject_uevent_env
kobject: 'tx-0' (0000000076ddb05c): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (0000000076ddb05c): auto cleanup kobject_del
kobject: 'tx-0' (0000000076ddb05c): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (0000000053b27ac3): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (0000000053b27ac3): calling ktype release
kobject: 'queues' (0000000053b27ac3): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (0000000033eb3622): kobject_uevent_env
kobject: 'ip6gre0' (0000000033eb3622): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000008fe75e83): kobject_cleanup, parent 00000000d00673c1
kobject: 'rx-0' (000000008fe75e83): auto cleanup 'remove' event
kobject: 'rx-0' (000000008fe75e83): kobject_uevent_env
kobject: 'rx-0' (000000008fe75e83): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000008fe75e83): auto cleanup kobject_del
kobject: 'rx-0' (000000008fe75e83): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (0000000026ddbd9e): kobject_cleanup, parent 00000000d00673c1
kobject: 'tx-0' (0000000026ddbd9e): auto cleanup 'remove' event
kobject: 'tx-0' (0000000026ddbd9e): kobject_uevent_env
kobject: 'tx-0' (0000000026ddbd9e): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (0000000026ddbd9e): auto cleanup kobject_del
kobject: 'tx-0' (0000000026ddbd9e): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000d00673c1): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000d00673c1): calling ktype release
kobject: 'queues' (00000000d00673c1): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000a25f02da): kobject_uevent_env
kobject: 'ip6gre0' (00000000a25f02da): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000001fee3c3a): kobject_cleanup, parent 0000000064191e03
kobject: 'rx-0' (000000001fee3c3a): auto cleanup 'remove' event
kobject: 'rx-0' (000000001fee3c3a): kobject_uevent_env
kobject: 'rx-0' (000000001fee3c3a): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000001fee3c3a): auto cleanup kobject_del
kobject: 'rx-0' (000000001fee3c3a): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (000000000105a2af): kobject_cleanup, parent 0000000064191e03
kobject: 'tx-0' (000000000105a2af): auto cleanup 'remove' event
kobject: 'tx-0' (000000000105a2af): kobject_uevent_env
kobject: 'tx-0' (000000000105a2af): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (000000000105a2af): auto cleanup kobject_del
kobject: 'tx-0' (000000000105a2af): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (0000000064191e03): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (0000000064191e03): calling ktype release
kobject: 'queues' (0000000064191e03): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000bac7ac3b): kobject_uevent_env
kobject: 'ip6gre0' (00000000bac7ac3b): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000a445ce90): kobject_cleanup, parent 00000000f017e284
kobject: 'rx-0' (00000000a445ce90): auto cleanup 'remove' event
kobject: 'rx-0' (00000000a445ce90): kobject_uevent_env
kobject: 'rx-0' (00000000a445ce90): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000a445ce90): auto cleanup kobject_del
kobject: 'rx-0' (00000000a445ce90): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000941ca72f): kobject_cleanup, parent 00000000f017e284
kobject: 'tx-0' (00000000941ca72f): auto cleanup 'remove' event
kobject: 'tx-0' (00000000941ca72f): kobject_uevent_env
kobject: 'tx-0' (00000000941ca72f): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000941ca72f): auto cleanup kobject_del
kobject: 'tx-0' (00000000941ca72f): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000f017e284): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000f017e284): calling ktype release
kobject: 'queues' (00000000f017e284): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (000000005f6f82e0): kobject_uevent_env
kobject: 'ip6gre0' (000000005f6f82e0): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000c5398820): kobject_cleanup, parent 000000001b0d3b24
kobject: 'rx-0' (00000000c5398820): auto cleanup 'remove' event
kobject: 'rx-0' (00000000c5398820): kobject_uevent_env
kobject: 'rx-0' (00000000c5398820): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000c5398820): auto cleanup kobject_del
kobject: 'rx-0' (00000000c5398820): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (000000004b831d4d): kobject_cleanup, parent 000000001b0d3b24
kobject: 'tx-0' (000000004b831d4d): auto cleanup 'remove' event
kobject: 'tx-0' (000000004b831d4d): kobject_uevent_env
kobject: 'tx-0' (000000004b831d4d): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (000000004b831d4d): auto cleanup kobject_del
kobject: 'tx-0' (000000004b831d4d): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (000000001b0d3b24): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (000000001b0d3b24): calling ktype release
kobject: 'queues' (000000001b0d3b24): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (000000009c06ad0b): kobject_uevent_env
kobject: 'ip6gre0' (000000009c06ad0b): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000002d41e5c3): kobject_cleanup, parent 00000000acc8c62e
kobject: 'rx-0' (000000002d41e5c3): auto cleanup 'remove' event
kobject: 'rx-0' (000000002d41e5c3): kobject_uevent_env
kobject: 'rx-0' (000000002d41e5c3): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (000000002d41e5c3): auto cleanup kobject_del
kobject: 'rx-0' (000000002d41e5c3): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000800dcff0): kobject_cleanup, parent 00000000acc8c62e
kobject: 'tx-0' (00000000800dcff0): auto cleanup 'remove' event
kobject: 'tx-0' (00000000800dcff0): kobject_uevent_env
kobject: 'tx-0' (00000000800dcff0): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000800dcff0): auto cleanup kobject_del
kobject: 'tx-0' (00000000800dcff0): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000acc8c62e): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000acc8c62e): calling ktype release
kobject: 'queues' (00000000acc8c62e): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000efd045c3): kobject_uevent_env
kobject: 'ip6gre0' (00000000efd045c3): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000c06223f7): kobject_cleanup, parent 00000000889d7b34
kobject: 'rx-0' (00000000c06223f7): auto cleanup 'remove' event
kobject: 'rx-0' (00000000c06223f7): kobject_uevent_env
kobject: 'rx-0' (00000000c06223f7): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (00000000c06223f7): auto cleanup kobject_del
kobject: 'rx-0' (00000000c06223f7): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (000000009583fb49): kobject_cleanup, parent 00000000889d7b34
kobject: 'tx-0' (000000009583fb49): auto cleanup 'remove' event
kobject: 'tx-0' (000000009583fb49): kobject_uevent_env
kobject: 'tx-0' (000000009583fb49): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (000000009583fb49): auto cleanup kobject_del
kobject: 'tx-0' (000000009583fb49): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000889d7b34): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000889d7b34): calling ktype release
kobject: 'queues' (00000000889d7b34): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000d262c90e): kobject_uevent_env
kobject: 'ip6gre0' (00000000d262c90e): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (0000000093d2092f): kobject_cleanup, parent 0000000025d6c973
kobject: 'rx-0' (0000000093d2092f): auto cleanup 'remove' event
kobject: 'rx-0' (0000000093d2092f): kobject_uevent_env
kobject: 'rx-0' (0000000093d2092f): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (0000000093d2092f): auto cleanup kobject_del
kobject: 'rx-0' (0000000093d2092f): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (000000007124fc58): kobject_cleanup, parent 0000000025d6c973
kobject: 'tx-0' (000000007124fc58): auto cleanup 'remove' event
kobject: 'tx-0' (000000007124fc58): kobject_uevent_env
kobject: 'tx-0' (000000007124fc58): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (000000007124fc58): auto cleanup kobject_del
kobject: 'tx-0' (000000007124fc58): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (0000000025d6c973): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (0000000025d6c973): calling ktype release
kobject: 'queues' (0000000025d6c973): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (0000000048e5fada): kobject_uevent_env
kobject: 'ip6gre0' (0000000048e5fada): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (0000000083b36769): kobject_cleanup, parent 00000000642902b0
kobject: 'rx-0' (0000000083b36769): auto cleanup 'remove' event
kobject: 'rx-0' (0000000083b36769): kobject_uevent_env
kobject: 'rx-0' (0000000083b36769): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (0000000083b36769): auto cleanup kobject_del
kobject: 'rx-0' (0000000083b36769): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000d79fe629): kobject_cleanup, parent 00000000642902b0
kobject: 'tx-0' (00000000d79fe629): auto cleanup 'remove' event
kobject: 'tx-0' (00000000d79fe629): kobject_uevent_env
kobject: 'tx-0' (00000000d79fe629): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000d79fe629): auto cleanup kobject_del
kobject: 'tx-0' (00000000d79fe629): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000642902b0): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000642902b0): calling ktype release
kobject: 'queues' (00000000642902b0): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (00000000db2ff39f): kobject_uevent_env
kobject: 'ip6gre0' (00000000db2ff39f): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (0000000027d95c1d): kobject_cleanup, parent 00000000167ee37f
kobject: 'rx-0' (0000000027d95c1d): auto cleanup 'remove' event
kobject: 'rx-0' (0000000027d95c1d): kobject_uevent_env
kobject: 'rx-0' (0000000027d95c1d): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'rx-0' (0000000027d95c1d): auto cleanup kobject_del
kobject: 'rx-0' (0000000027d95c1d): calling ktype release
kobject: 'rx-0': free name
kobject: 'tx-0' (00000000b2e02b16): kobject_cleanup, parent 00000000167ee37f
kobject: 'tx-0' (00000000b2e02b16): auto cleanup 'remove' event
kobject: 'tx-0' (00000000b2e02b16): kobject_uevent_env
kobject: 'tx-0' (00000000b2e02b16): kobject_uevent_env: uevent_suppress  
caused the event to drop!
kobject: 'tx-0' (00000000b2e02b16): auto cleanup kobject_del
kobject: 'tx-0' (00000000b2e02b16): calling ktype release
kobject: 'tx-0': free name
kobject: 'queues' (00000000167ee37f): kobject_cleanup, parent  
0000000074ba00ba
kobject: 'queues' (00000000167ee37f): calling ktype release
kobject: 'queues' (00000000167ee37f): kset_release
kobject: 'queues': free name
kobject: 'ip6gre0' (0000000088a31351): kobject_uevent_env
kobject: 'ip6gre0' (0000000088a31351): kobject_uevent_env: uevent_suppress  
cau

^ permalink raw reply

* Re: [PATCH net-next 11/14] vsock: add multi-transports support
From: Stefano Garzarella @ 2019-10-31  8:54 UTC (permalink / raw)
  To: Jorgen Hansen
  Cc: Sasha Levin, linux-hyperv@vger.kernel.org, Stephen Hemminger,
	Arnd Bergmann, kvm, Michael S. Tsirkin, Greg Kroah-Hartman,
	Dexuan Cui, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, Haiyang Zhang,
	Stefan Hajnoczi, David S. Miller, netdev@vger.kernel.org
In-Reply-To: <MWHPR05MB3376E623764F54D39D8135A9DA600@MWHPR05MB3376.namprd05.prod.outlook.com>

On Wed, Oct 30, 2019 at 03:40:05PM +0000, Jorgen Hansen wrote:
> > From: Stefano Garzarella [mailto:sgarzare@redhat.com]
> > > +/* Assign a transport to a socket and call the .init transport callback.
> > > + *
> > > + * Note: for stream socket this must be called when vsk->remote_addr
> > > +is set
> > > + * (e.g. during the connect() or when a connection request on a
> > > +listener
> > > + * socket is received).
> > > + * The vsk->remote_addr is used to decide which transport to use:
> > > + *  - remote CID > VMADDR_CID_HOST will use host->guest transport
> > > + *  - remote CID <= VMADDR_CID_HOST will use guest->host transport
> > > +*/ int vsock_assign_transport(struct vsock_sock *vsk, struct
> > > +vsock_sock *psk) {
> > > +       const struct vsock_transport *new_transport;
> > > +       struct sock *sk = sk_vsock(vsk);
> > > +
> > > +       switch (sk->sk_type) {
> > > +       case SOCK_DGRAM:
> > > +               new_transport = transport_dgram;
> > > +               break;
> > > +       case SOCK_STREAM:
> > > +               if (vsk->remote_addr.svm_cid > VMADDR_CID_HOST)
> > > +                       new_transport = transport_h2g;
> > > +               else
> > > +                       new_transport = transport_g2h;
> > 
> > I just noticed that this break the loopback in the guest.
> > As a fix, we should use 'transport_g2h' when remote_cid <=
> > VMADDR_CID_HOST or remote_cid is the id of 'transport_g2h'.
> > 
> > To do that we also need to avoid that L2 guests can have the same CID of L1.
> > For vhost_vsock I can call vsock_find_cid() in vhost_vsock_set_cid()
> > 
> > @Jorgen: for vmci we need to do the same? or it is guaranteed, since it's
> > already support nested VMs, that a L2 guests cannot have the same CID as
> > the L1.
> 
> As far as I can tell, we have the same issue with the current support for nested VMs in
> VMCI. If we have an L2 guest with the same CID as the L1 guest, we will always send to
> the L2 guest, and we may assign an L2 guest the same CID as L1. It should be straight
> forward to avoid this, though.
> 

Yes, I think so.

For the v2 I'm exposing the vsock_find_cid() to the transports, in this
way I can reject requests to set the same L1 CID for L2 guests.

Thanks,
Stefano

^ permalink raw reply

* Re: [PATCH net-next 07/14] vsock: handle buffer_size sockopts in the core
From: Stefano Garzarella @ 2019-10-31  8:50 UTC (permalink / raw)
  To: Jorgen Hansen, Dexuan Cui
  Cc: Michael S. Tsirkin, kvm@vger.kernel.org, Greg Kroah-Hartman,
	Jason Wang, David S. Miller, Haiyang Zhang, Sasha Levin,
	linux-kernel@vger.kernel.org, Arnd Bergmann, Stefan Hajnoczi,
	linux-hyperv@vger.kernel.org, K. Y. Srinivasan, Stephen Hemminger,
	virtualization@lists.linux-foundation.org, netdev@vger.kernel.org
In-Reply-To: <MWHPR05MB337657F8FFE2C0BB4F90B261DA600@MWHPR05MB3376.namprd05.prod.outlook.com>

On Wed, Oct 30, 2019 at 03:08:15PM +0000, Jorgen Hansen wrote:
> > From: Stefano Garzarella [mailto:sgarzare@redhat.com]
> > Sent: Wednesday, October 23, 2019 11:56 AM
> > Subject: [PATCH net-next 07/14] vsock: handle buffer_size sockopts in the
> > core
> > 
> > virtio_transport and vmci_transport handle the buffer_size sockopts in a
> > very similar way.
> > 
> > In order to support multiple transports, this patch moves this handling in the
> > core to allow the user to change the options also if the socket is not yet
> > assigned to any transport.
> > 
> > This patch also adds the '.notify_buffer_size' callback in the 'struct
> > virtio_transport' in order to inform the transport, when the buffer_size is
> > changed by the user. It is also useful to limit the 'buffer_size' requested (e.g.
> > virtio transports).
> > 
> > Acked-by: Dexuan Cui <decui@microsoft.com>
> > Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
> > ---
> > RFC -> v1:
> > - changed .notify_buffer_size return to void (Stefan)
> > - documented that .notify_buffer_size is called with sk_lock held (Stefan)
> > ---
> >  drivers/vhost/vsock.c                   |  7 +-
> >  include/linux/virtio_vsock.h            | 15 +----
> >  include/net/af_vsock.h                  | 15 ++---
> >  net/vmw_vsock/af_vsock.c                | 43 ++++++++++---
> >  net/vmw_vsock/hyperv_transport.c        | 36 -----------
> >  net/vmw_vsock/virtio_transport.c        |  8 +--
> >  net/vmw_vsock/virtio_transport_common.c | 79 ++++-------------------
> >  net/vmw_vsock/vmci_transport.c          | 86 +++----------------------
> >  net/vmw_vsock/vmci_transport.h          |  3 -
> >  9 files changed, 65 insertions(+), 227 deletions(-)
> > 
> > diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index
> > 92ab3852c954..6d7e4f022748 100644
> > --- a/drivers/vhost/vsock.c
> > +++ b/drivers/vhost/vsock.c
> > @@ -418,13 +418,8 @@ static struct virtio_transport vhost_transport = {
> >  		.notify_send_pre_block    =
> > virtio_transport_notify_send_pre_block,
> >  		.notify_send_pre_enqueue  =
> > virtio_transport_notify_send_pre_enqueue,
> >  		.notify_send_post_enqueue =
> > virtio_transport_notify_send_post_enqueue,
> > +		.notify_buffer_size       = virtio_transport_notify_buffer_size,
> > 
> > -		.set_buffer_size          = virtio_transport_set_buffer_size,
> > -		.set_min_buffer_size      =
> > virtio_transport_set_min_buffer_size,
> > -		.set_max_buffer_size      =
> > virtio_transport_set_max_buffer_size,
> > -		.get_buffer_size          = virtio_transport_get_buffer_size,
> > -		.get_min_buffer_size      =
> > virtio_transport_get_min_buffer_size,
> > -		.get_max_buffer_size      =
> > virtio_transport_get_max_buffer_size,
> >  	},
> > 
> >  	.send_pkt = vhost_transport_send_pkt,
> > diff --git a/include/linux/virtio_vsock.h b/include/linux/virtio_vsock.h index
> > 96d8132acbd7..b79befd2a5a4 100644
> > --- a/include/linux/virtio_vsock.h
> > +++ b/include/linux/virtio_vsock.h
> > @@ -7,9 +7,6 @@
> >  #include <net/sock.h>
> >  #include <net/af_vsock.h>
> > 
> > -#define VIRTIO_VSOCK_DEFAULT_MIN_BUF_SIZE	128
> > -#define VIRTIO_VSOCK_DEFAULT_BUF_SIZE		(1024 * 256)
> > -#define VIRTIO_VSOCK_DEFAULT_MAX_BUF_SIZE	(1024 * 256)
> >  #define VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE	(1024 * 4)
> >  #define VIRTIO_VSOCK_MAX_BUF_SIZE		0xFFFFFFFFUL
> >  #define VIRTIO_VSOCK_MAX_PKT_BUF_SIZE		(1024 * 64)
> > @@ -25,11 +22,6 @@ enum {
> >  struct virtio_vsock_sock {
> >  	struct vsock_sock *vsk;
> > 
> > -	/* Protected by lock_sock(sk_vsock(trans->vsk)) */
> > -	u32 buf_size;
> > -	u32 buf_size_min;
> > -	u32 buf_size_max;
> > -
> >  	spinlock_t tx_lock;
> >  	spinlock_t rx_lock;
> > 
> > @@ -93,12 +85,6 @@ s64 virtio_transport_stream_has_space(struct
> > vsock_sock *vsk);
> > 
> >  int virtio_transport_do_socket_init(struct vsock_sock *vsk,
> >  				 struct vsock_sock *psk);
> > -u64 virtio_transport_get_buffer_size(struct vsock_sock *vsk);
> > -u64 virtio_transport_get_min_buffer_size(struct vsock_sock *vsk);
> > -u64 virtio_transport_get_max_buffer_size(struct vsock_sock *vsk); -void
> > virtio_transport_set_buffer_size(struct vsock_sock *vsk, u64 val); -void
> > virtio_transport_set_min_buffer_size(struct vsock_sock *vsk, u64 val); -void
> > virtio_transport_set_max_buffer_size(struct vsock_sock *vs, u64 val);  int
> > virtio_transport_notify_poll_in(struct vsock_sock *vsk,
> >  				size_t target,
> > @@ -125,6 +111,7 @@ int
> > virtio_transport_notify_send_pre_enqueue(struct vsock_sock *vsk,
> >  	struct vsock_transport_send_notify_data *data);  int
> > virtio_transport_notify_send_post_enqueue(struct vsock_sock *vsk,
> >  	ssize_t written, struct vsock_transport_send_notify_data *data);
> > +void virtio_transport_notify_buffer_size(struct vsock_sock *vsk, u64
> > +*val);
> > 
> >  u64 virtio_transport_stream_rcvhiwat(struct vsock_sock *vsk);  bool
> > virtio_transport_stream_is_active(struct vsock_sock *vsk); diff --git
> > a/include/net/af_vsock.h b/include/net/af_vsock.h index
> > 2ca67d048de4..4b5d16840fd4 100644
> > --- a/include/net/af_vsock.h
> > +++ b/include/net/af_vsock.h
> > @@ -65,6 +65,11 @@ struct vsock_sock {
> >  	bool sent_request;
> >  	bool ignore_connecting_rst;
> > 
> > +	/* Protected by lock_sock(sk) */
> > +	u64 buffer_size;
> > +	u64 buffer_min_size;
> > +	u64 buffer_max_size;
> > +
> >  	/* Private to transport. */
> >  	void *trans;
> >  };
> > @@ -140,18 +145,12 @@ struct vsock_transport {
> >  		struct vsock_transport_send_notify_data *);
> >  	int (*notify_send_post_enqueue)(struct vsock_sock *, ssize_t,
> >  		struct vsock_transport_send_notify_data *);
> > +	/* sk_lock held by the caller */
> > +	void (*notify_buffer_size)(struct vsock_sock *, u64 *);
> > 
> >  	/* Shutdown. */
> >  	int (*shutdown)(struct vsock_sock *, int);
> > 
> > -	/* Buffer sizes. */
> > -	void (*set_buffer_size)(struct vsock_sock *, u64);
> > -	void (*set_min_buffer_size)(struct vsock_sock *, u64);
> > -	void (*set_max_buffer_size)(struct vsock_sock *, u64);
> > -	u64 (*get_buffer_size)(struct vsock_sock *);
> > -	u64 (*get_min_buffer_size)(struct vsock_sock *);
> > -	u64 (*get_max_buffer_size)(struct vsock_sock *);
> > -
> >  	/* Addressing. */
> >  	u32 (*get_local_cid)(void);
> >  };
> > diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index
> > eaea159006c8..90ac46ea12ef 100644
> > --- a/net/vmw_vsock/af_vsock.c
> > +++ b/net/vmw_vsock/af_vsock.c
> > @@ -126,6 +126,10 @@ static struct proto vsock_proto = {
> >   */
> >  #define VSOCK_DEFAULT_CONNECT_TIMEOUT (2 * HZ)
> > 
> > +#define VSOCK_DEFAULT_BUFFER_SIZE     (1024 * 256)
> > +#define VSOCK_DEFAULT_BUFFER_MAX_SIZE (1024 * 256) #define
> > +VSOCK_DEFAULT_BUFFER_MIN_SIZE 128
> > +
> >  static const struct vsock_transport *transport_single;  static
> > DEFINE_MUTEX(vsock_register_mutex);
> > 
> > @@ -613,10 +617,16 @@ struct sock *__vsock_create(struct net *net,
> >  		vsk->trusted = psk->trusted;
> >  		vsk->owner = get_cred(psk->owner);
> >  		vsk->connect_timeout = psk->connect_timeout;
> > +		vsk->buffer_size = psk->buffer_size;
> > +		vsk->buffer_min_size = psk->buffer_min_size;
> > +		vsk->buffer_max_size = psk->buffer_max_size;
> >  	} else {
> >  		vsk->trusted = capable(CAP_NET_ADMIN);
> >  		vsk->owner = get_current_cred();
> >  		vsk->connect_timeout =
> > VSOCK_DEFAULT_CONNECT_TIMEOUT;
> > +		vsk->buffer_size = VSOCK_DEFAULT_BUFFER_SIZE;
> > +		vsk->buffer_min_size =
> > VSOCK_DEFAULT_BUFFER_MIN_SIZE;
> > +		vsk->buffer_max_size =
> > VSOCK_DEFAULT_BUFFER_MAX_SIZE;
> >  	}
> > 
> >  	if (vsk->transport->init(vsk, psk) < 0) { @@ -1368,6 +1378,23 @@
> > static int vsock_listen(struct socket *sock, int backlog)
> >  	return err;
> >  }
> > 
> > +static void vsock_update_buffer_size(struct vsock_sock *vsk,
> > +				     const struct vsock_transport *transport,
> > +				     u64 val)
> > +{
> > +	if (val > vsk->buffer_max_size)
> > +		val = vsk->buffer_max_size;
> > +
> > +	if (val < vsk->buffer_min_size)
> > +		val = vsk->buffer_min_size;
> > +
> > +	if (val != vsk->buffer_size &&
> > +	    transport && transport->notify_buffer_size)
> > +		transport->notify_buffer_size(vsk, &val);
> > +
> > +	vsk->buffer_size = val;
> > +}
> > +
> >  static int vsock_stream_setsockopt(struct socket *sock,
> >  				   int level,
> >  				   int optname,
> > @@ -1405,17 +1432,19 @@ static int vsock_stream_setsockopt(struct socket
> > *sock,
> >  	switch (optname) {
> >  	case SO_VM_SOCKETS_BUFFER_SIZE:
> >  		COPY_IN(val);
> > -		transport->set_buffer_size(vsk, val);
> > +		vsock_update_buffer_size(vsk, transport, val);
> >  		break;
> > 
> >  	case SO_VM_SOCKETS_BUFFER_MAX_SIZE:
> >  		COPY_IN(val);
> > -		transport->set_max_buffer_size(vsk, val);
> > +		vsk->buffer_max_size = val;
> > +		vsock_update_buffer_size(vsk, transport, vsk->buffer_size);
> >  		break;
> > 
> >  	case SO_VM_SOCKETS_BUFFER_MIN_SIZE:
> >  		COPY_IN(val);
> > -		transport->set_min_buffer_size(vsk, val);
> > +		vsk->buffer_min_size = val;
> > +		vsock_update_buffer_size(vsk, transport, vsk->buffer_size);
> >  		break;
> > 
> >  	case SO_VM_SOCKETS_CONNECT_TIMEOUT: {
> > @@ -1456,7 +1485,6 @@ static int vsock_stream_getsockopt(struct socket
> > *sock,
> >  	int len;
> >  	struct sock *sk;
> >  	struct vsock_sock *vsk;
> > -	const struct vsock_transport *transport;
> >  	u64 val;
> > 
> >  	if (level != AF_VSOCK)
> > @@ -1480,21 +1508,20 @@ static int vsock_stream_getsockopt(struct socket
> > *sock,
> >  	err = 0;
> >  	sk = sock->sk;
> >  	vsk = vsock_sk(sk);
> > -	transport = vsk->transport;
> > 
> >  	switch (optname) {
> >  	case SO_VM_SOCKETS_BUFFER_SIZE:
> > -		val = transport->get_buffer_size(vsk);
> > +		val = vsk->buffer_size;
> >  		COPY_OUT(val);
> >  		break;
> > 
> >  	case SO_VM_SOCKETS_BUFFER_MAX_SIZE:
> > -		val = transport->get_max_buffer_size(vsk);
> > +		val = vsk->buffer_max_size;
> >  		COPY_OUT(val);
> >  		break;
> > 
> >  	case SO_VM_SOCKETS_BUFFER_MIN_SIZE:
> > -		val = transport->get_min_buffer_size(vsk);
> > +		val = vsk->buffer_min_size;
> >  		COPY_OUT(val);
> >  		break;
> > 
> > diff --git a/net/vmw_vsock/hyperv_transport.c
> > b/net/vmw_vsock/hyperv_transport.c
> > index bef8772116ec..d62297a62ca6 100644
> > --- a/net/vmw_vsock/hyperv_transport.c
> > +++ b/net/vmw_vsock/hyperv_transport.c
> > @@ -845,36 +845,6 @@ int hvs_notify_send_post_enqueue(struct
> > vsock_sock *vsk, ssize_t written,
> >  	return 0;
> >  }
> > 
> > -static void hvs_set_buffer_size(struct vsock_sock *vsk, u64 val) -{
> > -	/* Ignored. */
> > -}
> > -
> > -static void hvs_set_min_buffer_size(struct vsock_sock *vsk, u64 val) -{
> > -	/* Ignored. */
> > -}
> > -
> > -static void hvs_set_max_buffer_size(struct vsock_sock *vsk, u64 val) -{
> > -	/* Ignored. */
> > -}
> > -
> > -static u64 hvs_get_buffer_size(struct vsock_sock *vsk) -{
> > -	return -ENOPROTOOPT;
> > -}
> > -
> > -static u64 hvs_get_min_buffer_size(struct vsock_sock *vsk) -{
> > -	return -ENOPROTOOPT;
> > -}
> > -
> > -static u64 hvs_get_max_buffer_size(struct vsock_sock *vsk) -{
> > -	return -ENOPROTOOPT;
> > -}
> > -
> >  static struct vsock_transport hvs_transport = {
> >  	.get_local_cid            = hvs_get_local_cid,
> > 
> > @@ -908,12 +878,6 @@ static struct vsock_transport hvs_transport = {
> >  	.notify_send_pre_enqueue  = hvs_notify_send_pre_enqueue,
> >  	.notify_send_post_enqueue = hvs_notify_send_post_enqueue,
> > 
> > -	.set_buffer_size          = hvs_set_buffer_size,
> > -	.set_min_buffer_size      = hvs_set_min_buffer_size,
> > -	.set_max_buffer_size      = hvs_set_max_buffer_size,
> > -	.get_buffer_size          = hvs_get_buffer_size,
> > -	.get_min_buffer_size      = hvs_get_min_buffer_size,
> > -	.get_max_buffer_size      = hvs_get_max_buffer_size,
> >  };
> > 
> >  static int hvs_probe(struct hv_device *hdev, diff --git
> > a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
> > index 3756f0857946..fb1fc7760e8c 100644
> > --- a/net/vmw_vsock/virtio_transport.c
> > +++ b/net/vmw_vsock/virtio_transport.c
> > @@ -494,13 +494,7 @@ static struct virtio_transport virtio_transport = {
> >  		.notify_send_pre_block    =
> > virtio_transport_notify_send_pre_block,
> >  		.notify_send_pre_enqueue  =
> > virtio_transport_notify_send_pre_enqueue,
> >  		.notify_send_post_enqueue =
> > virtio_transport_notify_send_post_enqueue,
> > -
> > -		.set_buffer_size          = virtio_transport_set_buffer_size,
> > -		.set_min_buffer_size      =
> > virtio_transport_set_min_buffer_size,
> > -		.set_max_buffer_size      =
> > virtio_transport_set_max_buffer_size,
> > -		.get_buffer_size          = virtio_transport_get_buffer_size,
> > -		.get_min_buffer_size      =
> > virtio_transport_get_min_buffer_size,
> > -		.get_max_buffer_size      =
> > virtio_transport_get_max_buffer_size,
> > +		.notify_buffer_size       = virtio_transport_notify_buffer_size,
> >  	},
> > 
> >  	.send_pkt = virtio_transport_send_pkt, diff --git
> > a/net/vmw_vsock/virtio_transport_common.c
> > b/net/vmw_vsock/virtio_transport_common.c
> > index 37a1c7e7c7fe..b2a310dfa158 100644
> > --- a/net/vmw_vsock/virtio_transport_common.c
> > +++ b/net/vmw_vsock/virtio_transport_common.c
> > @@ -456,17 +456,13 @@ int virtio_transport_do_socket_init(struct
> > vsock_sock *vsk,
> >  	if (psk) {
> >  		struct virtio_vsock_sock *ptrans = psk->trans;
> > 
> > -		vvs->buf_size	= ptrans->buf_size;
> > -		vvs->buf_size_min = ptrans->buf_size_min;
> > -		vvs->buf_size_max = ptrans->buf_size_max;
> >  		vvs->peer_buf_alloc = ptrans->peer_buf_alloc;
> > -	} else {
> > -		vvs->buf_size = VIRTIO_VSOCK_DEFAULT_BUF_SIZE;
> > -		vvs->buf_size_min =
> > VIRTIO_VSOCK_DEFAULT_MIN_BUF_SIZE;
> > -		vvs->buf_size_max =
> > VIRTIO_VSOCK_DEFAULT_MAX_BUF_SIZE;
> >  	}
> > 
> > -	vvs->buf_alloc = vvs->buf_size;
> > +	if (vsk->buffer_size > VIRTIO_VSOCK_MAX_BUF_SIZE)
> > +		vsk->buffer_size = VIRTIO_VSOCK_MAX_BUF_SIZE;
> > +
> > +	vvs->buf_alloc = vsk->buffer_size;
> > 
> >  	spin_lock_init(&vvs->rx_lock);
> >  	spin_lock_init(&vvs->tx_lock);
> > @@ -476,71 +472,20 @@ int virtio_transport_do_socket_init(struct
> > vsock_sock *vsk,  }  EXPORT_SYMBOL_GPL(virtio_transport_do_socket_init);
> > 
> > -u64 virtio_transport_get_buffer_size(struct vsock_sock *vsk) -{
> > -	struct virtio_vsock_sock *vvs = vsk->trans;
> > -
> > -	return vvs->buf_size;
> > -}
> > -EXPORT_SYMBOL_GPL(virtio_transport_get_buffer_size);
> > -
> > -u64 virtio_transport_get_min_buffer_size(struct vsock_sock *vsk)
> > +/* sk_lock held by the caller */
> > +void virtio_transport_notify_buffer_size(struct vsock_sock *vsk, u64
> > +*val)
> >  {
> >  	struct virtio_vsock_sock *vvs = vsk->trans;
> > 
> > -	return vvs->buf_size_min;
> > -}
> > -EXPORT_SYMBOL_GPL(virtio_transport_get_min_buffer_size);
> > -
> > -u64 virtio_transport_get_max_buffer_size(struct vsock_sock *vsk) -{
> > -	struct virtio_vsock_sock *vvs = vsk->trans;
> > -
> > -	return vvs->buf_size_max;
> > -}
> > -EXPORT_SYMBOL_GPL(virtio_transport_get_max_buffer_size);
> > -
> > -void virtio_transport_set_buffer_size(struct vsock_sock *vsk, u64 val) -{
> > -	struct virtio_vsock_sock *vvs = vsk->trans;
> > +	if (*val > VIRTIO_VSOCK_MAX_BUF_SIZE)
> > +		*val = VIRTIO_VSOCK_MAX_BUF_SIZE;
> > 
> > -	if (val > VIRTIO_VSOCK_MAX_BUF_SIZE)
> > -		val = VIRTIO_VSOCK_MAX_BUF_SIZE;
> > -	if (val < vvs->buf_size_min)
> > -		vvs->buf_size_min = val;
> > -	if (val > vvs->buf_size_max)
> > -		vvs->buf_size_max = val;
> > -	vvs->buf_size = val;
> > -	vvs->buf_alloc = val;
> > +	vvs->buf_alloc = *val;
> > 
> >  	virtio_transport_send_credit_update(vsk,
> > VIRTIO_VSOCK_TYPE_STREAM,
> >  					    NULL);
> >  }
> > -EXPORT_SYMBOL_GPL(virtio_transport_set_buffer_size);
> > -
> > -void virtio_transport_set_min_buffer_size(struct vsock_sock *vsk, u64 val)
> > -{
> > -	struct virtio_vsock_sock *vvs = vsk->trans;
> > -
> > -	if (val > VIRTIO_VSOCK_MAX_BUF_SIZE)
> > -		val = VIRTIO_VSOCK_MAX_BUF_SIZE;
> > -	if (val > vvs->buf_size)
> > -		vvs->buf_size = val;
> > -	vvs->buf_size_min = val;
> > -}
> > -EXPORT_SYMBOL_GPL(virtio_transport_set_min_buffer_size);
> > -
> > -void virtio_transport_set_max_buffer_size(struct vsock_sock *vsk, u64 val)
> > -{
> > -	struct virtio_vsock_sock *vvs = vsk->trans;
> > -
> > -	if (val > VIRTIO_VSOCK_MAX_BUF_SIZE)
> > -		val = VIRTIO_VSOCK_MAX_BUF_SIZE;
> > -	if (val < vvs->buf_size)
> > -		vvs->buf_size = val;
> > -	vvs->buf_size_max = val;
> > -}
> > -EXPORT_SYMBOL_GPL(virtio_transport_set_max_buffer_size);
> > +EXPORT_SYMBOL_GPL(virtio_transport_notify_buffer_size);
> > 
> >  int
> >  virtio_transport_notify_poll_in(struct vsock_sock *vsk, @@ -632,9 +577,7
> > @@ EXPORT_SYMBOL_GPL(virtio_transport_notify_send_post_enqueue);
> > 
> >  u64 virtio_transport_stream_rcvhiwat(struct vsock_sock *vsk)  {
> > -	struct virtio_vsock_sock *vvs = vsk->trans;
> > -
> > -	return vvs->buf_size;
> > +	return vsk->buffer_size;
> >  }
> >  EXPORT_SYMBOL_GPL(virtio_transport_stream_rcvhiwat);
> 
> While the VMCI transport uses a transport local consumer_size for stream_rcvhiwat,
> that consumer_size is always the same as buffer_size (a vmci queue pair allows the
> producer and consumer queues to be of different sizes, but vsock doesn't use that).
> So we could move the stream_rcvhiwat code to the common code as well, and just
> use buffer_size, if that simplifies things.
> 

Thanks to let me know. It could be another step to clean up the
transports. I'm only worried about hyperv_transport, because it returns
HVS_MTU_SIZE + 1.

@Dexuan Do you have any advice?


> > diff --git a/net/vmw_vsock/vmci_transport.c
> > b/net/vmw_vsock/vmci_transport.c index f8e3131ac480..8290d37b6587
> > 100644
> > --- a/net/vmw_vsock/vmci_transport.c
> > +++ b/net/vmw_vsock/vmci_transport.c
> > @@ -74,10 +74,6 @@ static u32 vmci_transport_qp_resumed_sub_id =
> > VMCI_INVALID_ID;
> > 
> >  static int PROTOCOL_OVERRIDE = -1;
> > 
> > -#define VMCI_TRANSPORT_DEFAULT_QP_SIZE_MIN   128
> > -#define VMCI_TRANSPORT_DEFAULT_QP_SIZE       262144
> > -#define VMCI_TRANSPORT_DEFAULT_QP_SIZE_MAX   262144
> > -
> >  /* Helper function to convert from a VMCI error code to a VSock error code.
> > */
> > 
> >  static s32 vmci_transport_error_to_vsock_error(s32 vmci_error) @@ -
> > 1025,11 +1021,11 @@ static int vmci_transport_recv_listen(struct sock *sk,
> >  	/* If the proposed size fits within our min/max, accept it. Otherwise
> >  	 * propose our own size.
> >  	 */
> > -	if (pkt->u.size >= vmci_trans(vpending)->queue_pair_min_size &&
> > -	    pkt->u.size <= vmci_trans(vpending)->queue_pair_max_size) {
> > +	if (pkt->u.size >= vpending->buffer_min_size &&
> > +	    pkt->u.size <= vpending->buffer_max_size) {
> >  		qp_size = pkt->u.size;
> >  	} else {
> > -		qp_size = vmci_trans(vpending)->queue_pair_size;
> > +		qp_size = vpending->buffer_size;
> >  	}
> > 
> >  	/* Figure out if we are using old or new requests based on the @@ -
> > 1098,7 +1094,7 @@ static int vmci_transport_recv_listen(struct sock *sk,
> >  	pending->sk_state = TCP_SYN_SENT;
> >  	vmci_trans(vpending)->produce_size =
> >  		vmci_trans(vpending)->consume_size = qp_size;
> > -	vmci_trans(vpending)->queue_pair_size = qp_size;
> > +	vpending->buffer_size = qp_size;
> > 
> >  	vmci_trans(vpending)->notify_ops->process_request(pending);
> > 
> > @@ -1392,8 +1388,8 @@ static int
> > vmci_transport_recv_connecting_client_negotiate(
> >  	vsk->ignore_connecting_rst = false;
> > 
> >  	/* Verify that we're OK with the proposed queue pair size */
> > -	if (pkt->u.size < vmci_trans(vsk)->queue_pair_min_size ||
> > -	    pkt->u.size > vmci_trans(vsk)->queue_pair_max_size) {
> > +	if (pkt->u.size < vsk->buffer_min_size ||
> > +	    pkt->u.size > vsk->buffer_max_size) {
> >  		err = -EINVAL;
> >  		goto destroy;
> >  	}
> > @@ -1498,8 +1494,7 @@
> > vmci_transport_recv_connecting_client_invalid(struct sock *sk,
> >  		vsk->sent_request = false;
> >  		vsk->ignore_connecting_rst = true;
> > 
> > -		err = vmci_transport_send_conn_request(
> > -			sk, vmci_trans(vsk)->queue_pair_size);
> > +		err = vmci_transport_send_conn_request(sk, vsk-
> > >buffer_size);
> >  		if (err < 0)
> >  			err = vmci_transport_error_to_vsock_error(err);
> >  		else
> > @@ -1583,21 +1578,6 @@ static int vmci_transport_socket_init(struct
> > vsock_sock *vsk,
> >  	INIT_LIST_HEAD(&vmci_trans(vsk)->elem);
> >  	vmci_trans(vsk)->sk = &vsk->sk;
> >  	spin_lock_init(&vmci_trans(vsk)->lock);
> > -	if (psk) {
> > -		vmci_trans(vsk)->queue_pair_size =
> > -			vmci_trans(psk)->queue_pair_size;
> > -		vmci_trans(vsk)->queue_pair_min_size =
> > -			vmci_trans(psk)->queue_pair_min_size;
> > -		vmci_trans(vsk)->queue_pair_max_size =
> > -			vmci_trans(psk)->queue_pair_max_size;
> > -	} else {
> > -		vmci_trans(vsk)->queue_pair_size =
> > -			VMCI_TRANSPORT_DEFAULT_QP_SIZE;
> > -		vmci_trans(vsk)->queue_pair_min_size =
> > -			 VMCI_TRANSPORT_DEFAULT_QP_SIZE_MIN;
> > -		vmci_trans(vsk)->queue_pair_max_size =
> > -			VMCI_TRANSPORT_DEFAULT_QP_SIZE_MAX;
> > -	}
> > 
> >  	return 0;
> >  }
> > @@ -1813,8 +1793,7 @@ static int vmci_transport_connect(struct
> > vsock_sock *vsk)
> > 
> >  	if (vmci_transport_old_proto_override(&old_pkt_proto) &&
> >  		old_pkt_proto) {
> > -		err = vmci_transport_send_conn_request(
> > -			sk, vmci_trans(vsk)->queue_pair_size);
> > +		err = vmci_transport_send_conn_request(sk, vsk-
> > >buffer_size);
> >  		if (err < 0) {
> >  			sk->sk_state = TCP_CLOSE;
> >  			return err;
> > @@ -1822,8 +1801,7 @@ static int vmci_transport_connect(struct
> > vsock_sock *vsk)
> >  	} else {
> >  		int supported_proto_versions =
> >  			vmci_transport_new_proto_supported_versions();
> > -		err = vmci_transport_send_conn_request2(
> > -				sk, vmci_trans(vsk)->queue_pair_size,
> > +		err = vmci_transport_send_conn_request2(sk, vsk-
> > >buffer_size,
> >  				supported_proto_versions);
> >  		if (err < 0) {
> >  			sk->sk_state = TCP_CLOSE;
> > @@ -1876,46 +1854,6 @@ static bool
> > vmci_transport_stream_is_active(struct vsock_sock *vsk)
> >  	return !vmci_handle_is_invalid(vmci_trans(vsk)->qp_handle);
> >  }
> > 
> > -static u64 vmci_transport_get_buffer_size(struct vsock_sock *vsk) -{
> > -	return vmci_trans(vsk)->queue_pair_size;
> > -}
> > -
> > -static u64 vmci_transport_get_min_buffer_size(struct vsock_sock *vsk) -{
> > -	return vmci_trans(vsk)->queue_pair_min_size;
> > -}
> > -
> > -static u64 vmci_transport_get_max_buffer_size(struct vsock_sock *vsk) -{
> > -	return vmci_trans(vsk)->queue_pair_max_size;
> > -}
> > -
> > -static void vmci_transport_set_buffer_size(struct vsock_sock *vsk, u64 val)
> > -{
> > -	if (val < vmci_trans(vsk)->queue_pair_min_size)
> > -		vmci_trans(vsk)->queue_pair_min_size = val;
> > -	if (val > vmci_trans(vsk)->queue_pair_max_size)
> > -		vmci_trans(vsk)->queue_pair_max_size = val;
> > -	vmci_trans(vsk)->queue_pair_size = val;
> > -}
> > -
> > -static void vmci_transport_set_min_buffer_size(struct vsock_sock *vsk,
> > -					       u64 val)
> > -{
> > -	if (val > vmci_trans(vsk)->queue_pair_size)
> > -		vmci_trans(vsk)->queue_pair_size = val;
> > -	vmci_trans(vsk)->queue_pair_min_size = val;
> > -}
> > -
> > -static void vmci_transport_set_max_buffer_size(struct vsock_sock *vsk,
> > -					       u64 val)
> > -{
> > -	if (val < vmci_trans(vsk)->queue_pair_size)
> > -		vmci_trans(vsk)->queue_pair_size = val;
> > -	vmci_trans(vsk)->queue_pair_max_size = val;
> > -}
> > -
> >  static int vmci_transport_notify_poll_in(
> >  	struct vsock_sock *vsk,
> >  	size_t target,
> > @@ -2098,12 +2036,6 @@ static const struct vsock_transport vmci_transport
> > = {
> >  	.notify_send_pre_enqueue =
> > vmci_transport_notify_send_pre_enqueue,
> >  	.notify_send_post_enqueue =
> > vmci_transport_notify_send_post_enqueue,
> >  	.shutdown = vmci_transport_shutdown,
> > -	.set_buffer_size = vmci_transport_set_buffer_size,
> > -	.set_min_buffer_size = vmci_transport_set_min_buffer_size,
> > -	.set_max_buffer_size = vmci_transport_set_max_buffer_size,
> > -	.get_buffer_size = vmci_transport_get_buffer_size,
> > -	.get_min_buffer_size = vmci_transport_get_min_buffer_size,
> > -	.get_max_buffer_size = vmci_transport_get_max_buffer_size,
> >  	.get_local_cid = vmci_transport_get_local_cid,  };
> > 
> > diff --git a/net/vmw_vsock/vmci_transport.h
> > b/net/vmw_vsock/vmci_transport.h index 1ca1e8640b31..b7b072194282
> > 100644
> > --- a/net/vmw_vsock/vmci_transport.h
> > +++ b/net/vmw_vsock/vmci_transport.h
> > @@ -108,9 +108,6 @@ struct vmci_transport {
> >  	struct vmci_qp *qpair;
> >  	u64 produce_size;
> >  	u64 consume_size;
> > -	u64 queue_pair_size;
> > -	u64 queue_pair_min_size;
> > -	u64 queue_pair_max_size;
> >  	u32 detach_sub_id;
> >  	union vmci_transport_notify notify;
> >  	const struct vmci_transport_notify_ops *notify_ops;
> > --
> > 2.21.0
> 
> Reviewed-by: Jorgen Hansen <jhansen@vmware.com>

Thanks for the reviews,
Stefano

^ permalink raw reply

* Re: [PATCH net, 0/2] hv_netvsc: fix error handling in netvsc_attach/set_features
From: David Miller @ 2019-10-31  1:17 UTC (permalink / raw)
  To: haiyangz
  Cc: sashal, linux-hyperv, netdev, kys, sthemmin, olaf, vkuznets,
	linux-kernel
In-Reply-To: <1572449471-5219-1-git-send-email-haiyangz@microsoft.com>

From: Haiyang Zhang <haiyangz@microsoft.com>
Date: Wed, 30 Oct 2019 15:32:05 +0000

> The error handling code path in these functions are not correct.
> This patch set fixes them.

Series applied, thank you.

^ permalink raw reply

* RE: [PATCH 1/1] x86/hyperv: Initialize clockevents earlier in CPU onlining
From: Michael Kelley @ 2019-10-30 20:50 UTC (permalink / raw)
  To: Dexuan Cui, linux-kernel@vger.kernel.org, tglx@linutronix.de,
	daniel.lezcano@linaro.org, vkuznets, KY Srinivasan,
	Stephen Hemminger, sashal@kernel.org, mingo@redhat.com,
	bp@alien8.de, hpa@zytor.com, x86@kernel.org, will@kernel.org,
	Ganapatrao.Kulkarni@cavium.com, james.morse@arm.com,
	steven.price@arm.com, josephl@nvidia.com,
	m.szyprowski@samsung.com, linux-hyperv@vger.kernel.org
In-Reply-To: <PU1P153MB0169592424FCCD3226B88BEFBF610@PU1P153MB0169.APCP153.PROD.OUTLOOK.COM>

From: Dexuan Cui <decui@microsoft.com> Sent: Tuesday, October 29, 2019 1:34 PM
> 
> Should we add the 2 lines:
> 
> Cc: stable@vger.kernel.org
> Fixes: fd1fea6834d0 ("clocksource/drivers: Make Hyper-V clocksource ISA agnostic")
> 
> fd1fea6834d0() removes the clockevents_unbind_device() call and this patch adds it back.

I thought about this, but the changes in this patch seem more extensive than
we might want to take as a stable fix.  The previous removal of
clockevents_unbind_device() does not have any negative effects except on
the in-progress hibernation work.  We really want to have this patch
go with the hibernation patches, so backporting these changes to stable
isn't necessary for hibernation support.  But whether to backport to
stable is a judgment call, and I'm open to arguments in favor.

> 
> > --- a/arch/x86/hyperv/hv_init.c
> > +++ b/arch/x86/hyperv/hv_init.c
> > @@ -323,8 +323,15 @@ void __init hyperv_init(void)
> >
> >  	x86_init.pci.arch_init = hv_pci_init;
> >
> > +	if (hv_stimer_alloc())
> > +		goto remove_hypercall_page;
> > +
> 
> The error handling is imperfect here: when I force hv_stimer_alloc() to return
> -ENOMEM, I get a panic in hv_apic_eoi_write(). It looks it is because we have cleared
> the pointer 'hv_vp_assist_page' to NULL, but hv_apic_eoi_write() is still in-use.

This can be fixed by doing hv_stimer_alloc() before the call to hv_apic_init().
> 
> In case hv_stimer_alloc() fails, can we set 'direct_mode_enabled' to false
> and go on with the legacy Hyper-V timer or LAPIC timer? If not, maybe
> we can use a BUG_ON() to explicitly panic?

I'll look into what can be done here.

> 
> >  	return;
> >
> > +remove_hypercall_page:
> > +	hypercall_msr.as_uint64 = 0;
> > +	wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
> > +	hv_hypercall_pg = NULL;
> >  remove_cpuhp_state:
> >  	cpuhp_remove_state(cpuhp);
> >  free_vp_assist_page:
> 
> > -void hv_stimer_cleanup(unsigned int cpu)
> > +static int hv_stimer_cleanup(unsigned int cpu)
> >  {
> >  	struct clock_event_device *ce;
> >
> >  	/* Turn off clockevent device */
> >  	if (ms_hyperv.features & HV_MSR_SYNTIMER_AVAILABLE) {
> >  		ce = per_cpu_ptr(hv_clock_event, cpu);
> > +
> > +		/*
> > +		 * In the legacy case where Direct Mode is not enabled
> > +		 * (which can only be on x86/64), stimer cleanup happens
> > +		 * relatively early in the CPU offlining process. We
> > +		 * must unbind the stimer-based clockevent device so
> > +		 * that the LAPIC timer can take over until clockevents
> > +		 * are no longer needed in the offlining process. The
> > +		 * unbind should not be done when Direct Mode is enabled
> > +		 * because we may be on an architecture where there are
> > +		 * no other clockevents devices to fallback to.
> > +		 */
> > +		if (!direct_mode_enabled)
> > +			clockevents_unbind_device(ce, cpu);
> >  		hv_ce_shutdown(ce);
> 
> In the legacy stimer0 mode, IMO this hv_ce_shutdown() is unnecessary,
> because "clockevents_unbind_device(ce, cpu)" automatically calls
> ce->set_state_shutdown(), if ce is active:
> clockevents_unbind
>    __clockevents_unbind
>     clockevents_replace
>       tick_install_replacement
>         clockevents_exchange_device
>           clockevents_switch_state(old, CLOCK_EVT_STATE_DETACHED)
>             __clockevents_switch_state

Agreed.  This is a carryover from even before reorganizing the code
into the separate Hyper-V clocksource driver, where this code was
present in hv_synic_cleanup():

	/* Turn off clockevent device */
	if (ms_hyperv.features & HV_MSR_SYNTIMER_AVAILABLE) {
		struct hv_per_cpu_context *hv_cpu
			= this_cpu_ptr(hv_context.cpu_context);

		clockevents_unbind_device(hv_cpu->clk_evt, cpu);
		hv_ce_shutdown(hv_cpu->clk_evt);
	}

But I'll fix it.

> 
> And, in both modes (legacy mode and direct mode), it looks incorrect to
> call hv_ce_shutdown() if the current processid id != 'cpu', because
> hv_ce_shutdown() -> hv_init_timer() can only access the current CPU's
> MSR. Maybe we should use an IPI to run hv_ce_shutdown() on the target
> CPU in direct mode?

Agreed.  I'll figure out a fix.

> 
> > -int hv_stimer_alloc(int sint)
> > +int hv_stimer_alloc(void)
> > ...
> > +		ret = cpuhp_setup_state(CPUHP_AP_HYPERV_TIMER_STARTING,
> > +				"clockevents/hyperv/stimer:starting",
> > +				hv_stimer_init, hv_stimer_cleanup);
> > +		if (ret < 0)
> > +			goto free_stimer0_irq;
> > +		stimer0_cpuhp = ret;
> >  	}
> > +	return ret;
> 
> stimer0_cpuhp is 0 when the call is successful, so IMO the logic in
> hv_stimer_free() is incorrect. Please see below.
> 
> >  void hv_stimer_free(void)
> >  {
> > -	if (direct_mode_enabled && (stimer0_irq != 0)) {
> > -		hv_remove_stimer0_irq(stimer0_irq);
> > -		stimer0_irq = 0;
> > +	if (direct_mode_enabled) {
> > +		if (stimer0_cpuhp) {
> > +			cpuhp_remove_state(stimer0_cpuhp);
> > +			stimer0_cpuhp = 0;
> > +		}
> > +		if (stimer0_irq) {
> > +			hv_remove_stimer0_irq(stimer0_irq);
> > +			stimer0_irq = 0;
> > +		}
> >  	}
> 
> IMO this should be
> if (direct_mode_enabled) {
>         if (stimer0_cpuhp == 0)
>                 cpuhp_remove_state(CPUHP_AP_HYPERV_TIMER_STARTING);
> 
>         if (stimer0_irq) {
>                 hv_remove_stimer0_irq(stimer0_irq);
>                 stimer0_irq = 0;
>         }
> }
> 
> BTW, the default value of 'stimer0_cpuhp' is 0, which means success.
> Should we change the default value to a non-zero value, e.g. -1 ?

Indeed, you are correct.  I was treating the return value from 
cphup_setup_state() like the case when the state is
CPUHP_AP_ONLINE_DYN.  I'll fix it.

> 
> >  	free_percpu(hv_clock_event);
> >  	hv_clock_event = NULL;
> > @@ -190,14 +274,11 @@ void hv_stimer_free(void)
> >  void hv_stimer_global_cleanup(void)
> >  {
> >  	int	cpu;
> > -	struct clock_event_device *ce;
> >
> > -	if (ms_hyperv.features & HV_MSR_SYNTIMER_AVAILABLE) {
> > -		for_each_present_cpu(cpu) {
> > -			ce = per_cpu_ptr(hv_clock_event, cpu);
> > -			clockevents_unbind_device(ce, cpu);
> > -		}
> > +	for_each_present_cpu(cpu) {
> > +		hv_stimer_cleanup(cpu);
> 
> hv_stimer_cleanup() -> hv_ce_shutdown() -> hv_init_timer() can not
> access a remote CPU's MSR.

Agreed, per above.

> 
> > @@ -2310,7 +2305,6 @@ static void hv_crash_handler(struct pt_regs *regs)
> >  	 */
> >  	vmbus_connection.conn_state = DISCONNECTED;
> >  	cpu = smp_processor_id();
> > -	hv_stimer_cleanup(cpu);
> >  	hv_synic_cleanup(cpu);
> >  	hyperv_cleanup();
> 
> Why should we remove the line hv_stimer_cleanup() in the crash handler?
> In the crash handler, IMO we'd better disable the timer before we proceed.

With the stimer in legacy mode, the cleanup should happen in
hv_synic_cleanup().  But that actually highlights a previously unrecognized
problem in that hv_synic_cleanup() usually doesn't do anything because it
returns -EBUSY if there is a channel interrupt assigned to "cpu".  So even
in the older code before the clock/timer reorg, none of the timers or
other synic functionality actually got cleaned up.

With the stimer in DirectMode, the cleanup should probably happen in
hyperv_cleanup(), to mirror the initialization in hyperv_init().  I'll make
that change.  Fixing the legacy path is probably a separate patch
because we'll need fix the synic cleanup problem by distinguishing
between a normal cleanup due to CPU offlining or hibernation, and the
crash path.

Thanks for the careful review!

Michael

^ permalink raw reply

* RE: [PATCH net-next 11/14] vsock: add multi-transports support
From: Jorgen Hansen @ 2019-10-30 15:40 UTC (permalink / raw)
  To: 'Stefano Garzarella'
  Cc: Sasha Levin, linux-hyperv@vger.kernel.org, Stephen Hemminger,
	Arnd Bergmann, kvm, Michael S. Tsirkin, Greg Kroah-Hartman,
	Dexuan Cui, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, Haiyang Zhang,
	Stefan Hajnoczi, David S. Miller, netdev@vger.kernel.org
In-Reply-To: <CAGxU2F7n48kBy_y2GB=mcvraK=mw_2Jn8=2hvQnEOWqWuT9OjA@mail.gmail.com>

> From: Stefano Garzarella [mailto:sgarzare@redhat.com]
> > +/* Assign a transport to a socket and call the .init transport callback.
> > + *
> > + * Note: for stream socket this must be called when vsk->remote_addr
> > +is set
> > + * (e.g. during the connect() or when a connection request on a
> > +listener
> > + * socket is received).
> > + * The vsk->remote_addr is used to decide which transport to use:
> > + *  - remote CID > VMADDR_CID_HOST will use host->guest transport
> > + *  - remote CID <= VMADDR_CID_HOST will use guest->host transport
> > +*/ int vsock_assign_transport(struct vsock_sock *vsk, struct
> > +vsock_sock *psk) {
> > +       const struct vsock_transport *new_transport;
> > +       struct sock *sk = sk_vsock(vsk);
> > +
> > +       switch (sk->sk_type) {
> > +       case SOCK_DGRAM:
> > +               new_transport = transport_dgram;
> > +               break;
> > +       case SOCK_STREAM:
> > +               if (vsk->remote_addr.svm_cid > VMADDR_CID_HOST)
> > +                       new_transport = transport_h2g;
> > +               else
> > +                       new_transport = transport_g2h;
> 
> I just noticed that this break the loopback in the guest.
> As a fix, we should use 'transport_g2h' when remote_cid <=
> VMADDR_CID_HOST or remote_cid is the id of 'transport_g2h'.
> 
> To do that we also need to avoid that L2 guests can have the same CID of L1.
> For vhost_vsock I can call vsock_find_cid() in vhost_vsock_set_cid()
> 
> @Jorgen: for vmci we need to do the same? or it is guaranteed, since it's
> already support nested VMs, that a L2 guests cannot have the same CID as
> the L1.

As far as I can tell, we have the same issue with the current support for nested VMs in
VMCI. If we have an L2 guest with the same CID as the L1 guest, we will always send to
the L2 guest, and we may assign an L2 guest the same CID as L1. It should be straight
forward to avoid this, though.


^ permalink raw reply

* [PATCH net, 0/2] hv_netvsc: fix error handling in netvsc_attach/set_features
From: Haiyang Zhang @ 2019-10-30 15:32 UTC (permalink / raw)
  To: sashal@kernel.org, linux-hyperv@vger.kernel.org,
	netdev@vger.kernel.org
  Cc: Haiyang Zhang, KY Srinivasan, Stephen Hemminger, olaf@aepfle.de,
	vkuznets, davem@davemloft.net, linux-kernel@vger.kernel.org

The error handling code path in these functions are not correct.
This patch set fixes them.

Haiyang Zhang (2):
  hv_netvsc: Fix error handling in netvsc_set_features()
  hv_netvsc: Fix error handling in netvsc_attach()

 drivers/net/hyperv/netvsc_drv.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

-- 
1.8.3.1


^ permalink raw reply

* [PATCH net, 2/2] hv_netvsc: Fix error handling in netvsc_attach()
From: Haiyang Zhang @ 2019-10-30 15:32 UTC (permalink / raw)
  To: sashal@kernel.org, linux-hyperv@vger.kernel.org,
	netdev@vger.kernel.org
  Cc: Haiyang Zhang, KY Srinivasan, Stephen Hemminger, olaf@aepfle.de,
	vkuznets, davem@davemloft.net, linux-kernel@vger.kernel.org
In-Reply-To: <1572449471-5219-1-git-send-email-haiyangz@microsoft.com>

If rndis_filter_open() fails, we need to remove the rndis device created
in earlier steps, before returning an error code. Otherwise, the retry of
netvsc_attach() from its callers will fail and hang.

Fixes: 7b2ee50c0cd5 ("hv_netvsc: common detach logic")
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
 drivers/net/hyperv/netvsc_drv.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 734e411..a14fc8e 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -982,7 +982,7 @@ static int netvsc_attach(struct net_device *ndev,
 	if (netif_running(ndev)) {
 		ret = rndis_filter_open(nvdev);
 		if (ret)
-			return ret;
+			goto err;
 
 		rdev = nvdev->extension;
 		if (!rdev->link_state)
@@ -990,6 +990,13 @@ static int netvsc_attach(struct net_device *ndev,
 	}
 
 	return 0;
+
+err:
+	netif_device_detach(ndev);
+
+	rndis_filter_device_remove(hdev, nvdev);
+
+	return ret;
 }
 
 static int netvsc_set_channels(struct net_device *net,
-- 
1.8.3.1


^ permalink raw reply related

* [PATCH net, 1/2] hv_netvsc: Fix error handling in netvsc_set_features()
From: Haiyang Zhang @ 2019-10-30 15:32 UTC (permalink / raw)
  To: sashal@kernel.org, linux-hyperv@vger.kernel.org,
	netdev@vger.kernel.org
  Cc: Haiyang Zhang, KY Srinivasan, Stephen Hemminger, olaf@aepfle.de,
	vkuznets, davem@davemloft.net, linux-kernel@vger.kernel.org
In-Reply-To: <1572449471-5219-1-git-send-email-haiyangz@microsoft.com>

When an error is returned by rndis_filter_set_offload_params(), we should
still assign the unaffected features to ndev->features. Otherwise, these
features will be missing.

Fixes: d6792a5a0747 ("hv_netvsc: Add handler for LRO setting change")
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
 drivers/net/hyperv/netvsc_drv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 39dddcd..734e411 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -1807,8 +1807,10 @@ static int netvsc_set_features(struct net_device *ndev,
 
 	ret = rndis_filter_set_offload_params(ndev, nvdev, &offloads);
 
-	if (ret)
+	if (ret) {
 		features ^= NETIF_F_LRO;
+		ndev->features = features;
+	}
 
 syncvf:
 	if (!vf_netdev)
-- 
1.8.3.1


^ permalink raw reply related

* RE: [PATCH net-next 09/14] vsock: move vsock_insert_unbound() in the vsock_create()
From: Jorgen Hansen @ 2019-10-30 15:12 UTC (permalink / raw)
  To: 'Stefano Garzarella'
  Cc: Michael S. Tsirkin, kvm@vger.kernel.org, Greg Kroah-Hartman,
	Jason Wang, David S. Miller, Dexuan Cui, Haiyang Zhang,
	Sasha Levin, linux-kernel@vger.kernel.org, Arnd Bergmann,
	Stefan Hajnoczi, linux-hyperv@vger.kernel.org, K. Y. Srinivasan,
	Stephen Hemminger, virtualization@lists.linux-foundation.org,
	netdev@vger.kernel.org
In-Reply-To: <20191023095554.11340-10-sgarzare@redhat.com>

> From: Stefano Garzarella [mailto:sgarzare@redhat.com]
> Sent: Wednesday, October 23, 2019 11:56 AM
> Subject: [PATCH net-next 09/14] vsock: move vsock_insert_unbound() in the
> vsock_create()
> 
> vsock_insert_unbound() was called only when 'sock' parameter of
> __vsock_create() was not null. This only happened when
> __vsock_create() was called by vsock_create().
> 
> In order to simplify the multi-transports support, this patch moves
> vsock_insert_unbound() at the end of vsock_create().
> 
> Reviewed-by: Dexuan Cui <decui@microsoft.com>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
> ---
>  net/vmw_vsock/af_vsock.c | 13 +++++++++----

Reviewed-by: Jorgen Hansen <jhansen@vmware.com>

^ permalink raw reply

* RE: [PATCH net-next 08/14] vsock: add vsock_create_connected() called by transports
From: Jorgen Hansen @ 2019-10-30 15:12 UTC (permalink / raw)
  To: 'Stefano Garzarella'
  Cc: Michael S. Tsirkin, kvm@vger.kernel.org, Greg Kroah-Hartman,
	Jason Wang, David S. Miller, Dexuan Cui, Haiyang Zhang,
	Sasha Levin, linux-kernel@vger.kernel.org, Arnd Bergmann,
	Stefan Hajnoczi, linux-hyperv@vger.kernel.org, K. Y. Srinivasan,
	Stephen Hemminger, virtualization@lists.linux-foundation.org,
	netdev@vger.kernel.org
In-Reply-To: <20191023095554.11340-9-sgarzare@redhat.com>

> From: Stefano Garzarella [mailto:sgarzare@redhat.com]
> Sent: Wednesday, October 23, 2019 11:56 AM
> Subject: [PATCH net-next 08/14] vsock: add vsock_create_connected() called
> by transports
> 
> All transports call __vsock_create() with the same parameters,
> most of them depending on the parent socket. In order to simplify
> the VSOCK core APIs exposed to the transports, this patch adds
> the vsock_create_connected() callable from transports to create
> a new socket when a connection request is received.
> We also unexported the __vsock_create().
> 
> Suggested-by: Stefan Hajnoczi <stefanha@redhat.com>
> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
> ---
>  include/net/af_vsock.h                  |  5 +----
>  net/vmw_vsock/af_vsock.c                | 20 +++++++++++++-------
>  net/vmw_vsock/hyperv_transport.c        |  3 +--
>  net/vmw_vsock/virtio_transport_common.c |  3 +--
>  net/vmw_vsock/vmci_transport.c          |  3 +--
>  5 files changed, 17 insertions(+), 17 deletions(-)

Reviewed-by: Jorgen Hansen <jhansen@vmware.com>

^ permalink raw reply

* RE: [PATCH net-next 07/14] vsock: handle buffer_size sockopts in the core
From: Jorgen Hansen @ 2019-10-30 15:08 UTC (permalink / raw)
  To: 'Stefano Garzarella'
  Cc: Michael S. Tsirkin, kvm@vger.kernel.org, Greg Kroah-Hartman,
	Jason Wang, David S. Miller, Dexuan Cui, Haiyang Zhang,
	Sasha Levin, linux-kernel@vger.kernel.org, Arnd Bergmann,
	Stefan Hajnoczi, linux-hyperv@vger.kernel.org, K. Y. Srinivasan,
	Stephen Hemminger, virtualization@lists.linux-foundation.org,
	netdev@vger.kernel.org
In-Reply-To: <20191023095554.11340-8-sgarzare@redhat.com>

> From: Stefano Garzarella [mailto:sgarzare@redhat.com]
> Sent: Wednesday, October 23, 2019 11:56 AM
> Subject: [PATCH net-next 07/14] vsock: handle buffer_size sockopts in the
> core
> 
> virtio_transport and vmci_transport handle the buffer_size sockopts in a
> very similar way.
> 
> In order to support multiple transports, this patch moves this handling in the
> core to allow the user to change the options also if the socket is not yet
> assigned to any transport.
> 
> This patch also adds the '.notify_buffer_size' callback in the 'struct
> virtio_transport' in order to inform the transport, when the buffer_size is
> changed by the user. It is also useful to limit the 'buffer_size' requested (e.g.
> virtio transports).
> 
> Acked-by: Dexuan Cui <decui@microsoft.com>
> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
> ---
> RFC -> v1:
> - changed .notify_buffer_size return to void (Stefan)
> - documented that .notify_buffer_size is called with sk_lock held (Stefan)
> ---
>  drivers/vhost/vsock.c                   |  7 +-
>  include/linux/virtio_vsock.h            | 15 +----
>  include/net/af_vsock.h                  | 15 ++---
>  net/vmw_vsock/af_vsock.c                | 43 ++++++++++---
>  net/vmw_vsock/hyperv_transport.c        | 36 -----------
>  net/vmw_vsock/virtio_transport.c        |  8 +--
>  net/vmw_vsock/virtio_transport_common.c | 79 ++++-------------------
>  net/vmw_vsock/vmci_transport.c          | 86 +++----------------------
>  net/vmw_vsock/vmci_transport.h          |  3 -
>  9 files changed, 65 insertions(+), 227 deletions(-)
> 
> diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index
> 92ab3852c954..6d7e4f022748 100644
> --- a/drivers/vhost/vsock.c
> +++ b/drivers/vhost/vsock.c
> @@ -418,13 +418,8 @@ static struct virtio_transport vhost_transport = {
>  		.notify_send_pre_block    =
> virtio_transport_notify_send_pre_block,
>  		.notify_send_pre_enqueue  =
> virtio_transport_notify_send_pre_enqueue,
>  		.notify_send_post_enqueue =
> virtio_transport_notify_send_post_enqueue,
> +		.notify_buffer_size       = virtio_transport_notify_buffer_size,
> 
> -		.set_buffer_size          = virtio_transport_set_buffer_size,
> -		.set_min_buffer_size      =
> virtio_transport_set_min_buffer_size,
> -		.set_max_buffer_size      =
> virtio_transport_set_max_buffer_size,
> -		.get_buffer_size          = virtio_transport_get_buffer_size,
> -		.get_min_buffer_size      =
> virtio_transport_get_min_buffer_size,
> -		.get_max_buffer_size      =
> virtio_transport_get_max_buffer_size,
>  	},
> 
>  	.send_pkt = vhost_transport_send_pkt,
> diff --git a/include/linux/virtio_vsock.h b/include/linux/virtio_vsock.h index
> 96d8132acbd7..b79befd2a5a4 100644
> --- a/include/linux/virtio_vsock.h
> +++ b/include/linux/virtio_vsock.h
> @@ -7,9 +7,6 @@
>  #include <net/sock.h>
>  #include <net/af_vsock.h>
> 
> -#define VIRTIO_VSOCK_DEFAULT_MIN_BUF_SIZE	128
> -#define VIRTIO_VSOCK_DEFAULT_BUF_SIZE		(1024 * 256)
> -#define VIRTIO_VSOCK_DEFAULT_MAX_BUF_SIZE	(1024 * 256)
>  #define VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE	(1024 * 4)
>  #define VIRTIO_VSOCK_MAX_BUF_SIZE		0xFFFFFFFFUL
>  #define VIRTIO_VSOCK_MAX_PKT_BUF_SIZE		(1024 * 64)
> @@ -25,11 +22,6 @@ enum {
>  struct virtio_vsock_sock {
>  	struct vsock_sock *vsk;
> 
> -	/* Protected by lock_sock(sk_vsock(trans->vsk)) */
> -	u32 buf_size;
> -	u32 buf_size_min;
> -	u32 buf_size_max;
> -
>  	spinlock_t tx_lock;
>  	spinlock_t rx_lock;
> 
> @@ -93,12 +85,6 @@ s64 virtio_transport_stream_has_space(struct
> vsock_sock *vsk);
> 
>  int virtio_transport_do_socket_init(struct vsock_sock *vsk,
>  				 struct vsock_sock *psk);
> -u64 virtio_transport_get_buffer_size(struct vsock_sock *vsk);
> -u64 virtio_transport_get_min_buffer_size(struct vsock_sock *vsk);
> -u64 virtio_transport_get_max_buffer_size(struct vsock_sock *vsk); -void
> virtio_transport_set_buffer_size(struct vsock_sock *vsk, u64 val); -void
> virtio_transport_set_min_buffer_size(struct vsock_sock *vsk, u64 val); -void
> virtio_transport_set_max_buffer_size(struct vsock_sock *vs, u64 val);  int
> virtio_transport_notify_poll_in(struct vsock_sock *vsk,
>  				size_t target,
> @@ -125,6 +111,7 @@ int
> virtio_transport_notify_send_pre_enqueue(struct vsock_sock *vsk,
>  	struct vsock_transport_send_notify_data *data);  int
> virtio_transport_notify_send_post_enqueue(struct vsock_sock *vsk,
>  	ssize_t written, struct vsock_transport_send_notify_data *data);
> +void virtio_transport_notify_buffer_size(struct vsock_sock *vsk, u64
> +*val);
> 
>  u64 virtio_transport_stream_rcvhiwat(struct vsock_sock *vsk);  bool
> virtio_transport_stream_is_active(struct vsock_sock *vsk); diff --git
> a/include/net/af_vsock.h b/include/net/af_vsock.h index
> 2ca67d048de4..4b5d16840fd4 100644
> --- a/include/net/af_vsock.h
> +++ b/include/net/af_vsock.h
> @@ -65,6 +65,11 @@ struct vsock_sock {
>  	bool sent_request;
>  	bool ignore_connecting_rst;
> 
> +	/* Protected by lock_sock(sk) */
> +	u64 buffer_size;
> +	u64 buffer_min_size;
> +	u64 buffer_max_size;
> +
>  	/* Private to transport. */
>  	void *trans;
>  };
> @@ -140,18 +145,12 @@ struct vsock_transport {
>  		struct vsock_transport_send_notify_data *);
>  	int (*notify_send_post_enqueue)(struct vsock_sock *, ssize_t,
>  		struct vsock_transport_send_notify_data *);
> +	/* sk_lock held by the caller */
> +	void (*notify_buffer_size)(struct vsock_sock *, u64 *);
> 
>  	/* Shutdown. */
>  	int (*shutdown)(struct vsock_sock *, int);
> 
> -	/* Buffer sizes. */
> -	void (*set_buffer_size)(struct vsock_sock *, u64);
> -	void (*set_min_buffer_size)(struct vsock_sock *, u64);
> -	void (*set_max_buffer_size)(struct vsock_sock *, u64);
> -	u64 (*get_buffer_size)(struct vsock_sock *);
> -	u64 (*get_min_buffer_size)(struct vsock_sock *);
> -	u64 (*get_max_buffer_size)(struct vsock_sock *);
> -
>  	/* Addressing. */
>  	u32 (*get_local_cid)(void);
>  };
> diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index
> eaea159006c8..90ac46ea12ef 100644
> --- a/net/vmw_vsock/af_vsock.c
> +++ b/net/vmw_vsock/af_vsock.c
> @@ -126,6 +126,10 @@ static struct proto vsock_proto = {
>   */
>  #define VSOCK_DEFAULT_CONNECT_TIMEOUT (2 * HZ)
> 
> +#define VSOCK_DEFAULT_BUFFER_SIZE     (1024 * 256)
> +#define VSOCK_DEFAULT_BUFFER_MAX_SIZE (1024 * 256) #define
> +VSOCK_DEFAULT_BUFFER_MIN_SIZE 128
> +
>  static const struct vsock_transport *transport_single;  static
> DEFINE_MUTEX(vsock_register_mutex);
> 
> @@ -613,10 +617,16 @@ struct sock *__vsock_create(struct net *net,
>  		vsk->trusted = psk->trusted;
>  		vsk->owner = get_cred(psk->owner);
>  		vsk->connect_timeout = psk->connect_timeout;
> +		vsk->buffer_size = psk->buffer_size;
> +		vsk->buffer_min_size = psk->buffer_min_size;
> +		vsk->buffer_max_size = psk->buffer_max_size;
>  	} else {
>  		vsk->trusted = capable(CAP_NET_ADMIN);
>  		vsk->owner = get_current_cred();
>  		vsk->connect_timeout =
> VSOCK_DEFAULT_CONNECT_TIMEOUT;
> +		vsk->buffer_size = VSOCK_DEFAULT_BUFFER_SIZE;
> +		vsk->buffer_min_size =
> VSOCK_DEFAULT_BUFFER_MIN_SIZE;
> +		vsk->buffer_max_size =
> VSOCK_DEFAULT_BUFFER_MAX_SIZE;
>  	}
> 
>  	if (vsk->transport->init(vsk, psk) < 0) { @@ -1368,6 +1378,23 @@
> static int vsock_listen(struct socket *sock, int backlog)
>  	return err;
>  }
> 
> +static void vsock_update_buffer_size(struct vsock_sock *vsk,
> +				     const struct vsock_transport *transport,
> +				     u64 val)
> +{
> +	if (val > vsk->buffer_max_size)
> +		val = vsk->buffer_max_size;
> +
> +	if (val < vsk->buffer_min_size)
> +		val = vsk->buffer_min_size;
> +
> +	if (val != vsk->buffer_size &&
> +	    transport && transport->notify_buffer_size)
> +		transport->notify_buffer_size(vsk, &val);
> +
> +	vsk->buffer_size = val;
> +}
> +
>  static int vsock_stream_setsockopt(struct socket *sock,
>  				   int level,
>  				   int optname,
> @@ -1405,17 +1432,19 @@ static int vsock_stream_setsockopt(struct socket
> *sock,
>  	switch (optname) {
>  	case SO_VM_SOCKETS_BUFFER_SIZE:
>  		COPY_IN(val);
> -		transport->set_buffer_size(vsk, val);
> +		vsock_update_buffer_size(vsk, transport, val);
>  		break;
> 
>  	case SO_VM_SOCKETS_BUFFER_MAX_SIZE:
>  		COPY_IN(val);
> -		transport->set_max_buffer_size(vsk, val);
> +		vsk->buffer_max_size = val;
> +		vsock_update_buffer_size(vsk, transport, vsk->buffer_size);
>  		break;
> 
>  	case SO_VM_SOCKETS_BUFFER_MIN_SIZE:
>  		COPY_IN(val);
> -		transport->set_min_buffer_size(vsk, val);
> +		vsk->buffer_min_size = val;
> +		vsock_update_buffer_size(vsk, transport, vsk->buffer_size);
>  		break;
> 
>  	case SO_VM_SOCKETS_CONNECT_TIMEOUT: {
> @@ -1456,7 +1485,6 @@ static int vsock_stream_getsockopt(struct socket
> *sock,
>  	int len;
>  	struct sock *sk;
>  	struct vsock_sock *vsk;
> -	const struct vsock_transport *transport;
>  	u64 val;
> 
>  	if (level != AF_VSOCK)
> @@ -1480,21 +1508,20 @@ static int vsock_stream_getsockopt(struct socket
> *sock,
>  	err = 0;
>  	sk = sock->sk;
>  	vsk = vsock_sk(sk);
> -	transport = vsk->transport;
> 
>  	switch (optname) {
>  	case SO_VM_SOCKETS_BUFFER_SIZE:
> -		val = transport->get_buffer_size(vsk);
> +		val = vsk->buffer_size;
>  		COPY_OUT(val);
>  		break;
> 
>  	case SO_VM_SOCKETS_BUFFER_MAX_SIZE:
> -		val = transport->get_max_buffer_size(vsk);
> +		val = vsk->buffer_max_size;
>  		COPY_OUT(val);
>  		break;
> 
>  	case SO_VM_SOCKETS_BUFFER_MIN_SIZE:
> -		val = transport->get_min_buffer_size(vsk);
> +		val = vsk->buffer_min_size;
>  		COPY_OUT(val);
>  		break;
> 
> diff --git a/net/vmw_vsock/hyperv_transport.c
> b/net/vmw_vsock/hyperv_transport.c
> index bef8772116ec..d62297a62ca6 100644
> --- a/net/vmw_vsock/hyperv_transport.c
> +++ b/net/vmw_vsock/hyperv_transport.c
> @@ -845,36 +845,6 @@ int hvs_notify_send_post_enqueue(struct
> vsock_sock *vsk, ssize_t written,
>  	return 0;
>  }
> 
> -static void hvs_set_buffer_size(struct vsock_sock *vsk, u64 val) -{
> -	/* Ignored. */
> -}
> -
> -static void hvs_set_min_buffer_size(struct vsock_sock *vsk, u64 val) -{
> -	/* Ignored. */
> -}
> -
> -static void hvs_set_max_buffer_size(struct vsock_sock *vsk, u64 val) -{
> -	/* Ignored. */
> -}
> -
> -static u64 hvs_get_buffer_size(struct vsock_sock *vsk) -{
> -	return -ENOPROTOOPT;
> -}
> -
> -static u64 hvs_get_min_buffer_size(struct vsock_sock *vsk) -{
> -	return -ENOPROTOOPT;
> -}
> -
> -static u64 hvs_get_max_buffer_size(struct vsock_sock *vsk) -{
> -	return -ENOPROTOOPT;
> -}
> -
>  static struct vsock_transport hvs_transport = {
>  	.get_local_cid            = hvs_get_local_cid,
> 
> @@ -908,12 +878,6 @@ static struct vsock_transport hvs_transport = {
>  	.notify_send_pre_enqueue  = hvs_notify_send_pre_enqueue,
>  	.notify_send_post_enqueue = hvs_notify_send_post_enqueue,
> 
> -	.set_buffer_size          = hvs_set_buffer_size,
> -	.set_min_buffer_size      = hvs_set_min_buffer_size,
> -	.set_max_buffer_size      = hvs_set_max_buffer_size,
> -	.get_buffer_size          = hvs_get_buffer_size,
> -	.get_min_buffer_size      = hvs_get_min_buffer_size,
> -	.get_max_buffer_size      = hvs_get_max_buffer_size,
>  };
> 
>  static int hvs_probe(struct hv_device *hdev, diff --git
> a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
> index 3756f0857946..fb1fc7760e8c 100644
> --- a/net/vmw_vsock/virtio_transport.c
> +++ b/net/vmw_vsock/virtio_transport.c
> @@ -494,13 +494,7 @@ static struct virtio_transport virtio_transport = {
>  		.notify_send_pre_block    =
> virtio_transport_notify_send_pre_block,
>  		.notify_send_pre_enqueue  =
> virtio_transport_notify_send_pre_enqueue,
>  		.notify_send_post_enqueue =
> virtio_transport_notify_send_post_enqueue,
> -
> -		.set_buffer_size          = virtio_transport_set_buffer_size,
> -		.set_min_buffer_size      =
> virtio_transport_set_min_buffer_size,
> -		.set_max_buffer_size      =
> virtio_transport_set_max_buffer_size,
> -		.get_buffer_size          = virtio_transport_get_buffer_size,
> -		.get_min_buffer_size      =
> virtio_transport_get_min_buffer_size,
> -		.get_max_buffer_size      =
> virtio_transport_get_max_buffer_size,
> +		.notify_buffer_size       = virtio_transport_notify_buffer_size,
>  	},
> 
>  	.send_pkt = virtio_transport_send_pkt, diff --git
> a/net/vmw_vsock/virtio_transport_common.c
> b/net/vmw_vsock/virtio_transport_common.c
> index 37a1c7e7c7fe..b2a310dfa158 100644
> --- a/net/vmw_vsock/virtio_transport_common.c
> +++ b/net/vmw_vsock/virtio_transport_common.c
> @@ -456,17 +456,13 @@ int virtio_transport_do_socket_init(struct
> vsock_sock *vsk,
>  	if (psk) {
>  		struct virtio_vsock_sock *ptrans = psk->trans;
> 
> -		vvs->buf_size	= ptrans->buf_size;
> -		vvs->buf_size_min = ptrans->buf_size_min;
> -		vvs->buf_size_max = ptrans->buf_size_max;
>  		vvs->peer_buf_alloc = ptrans->peer_buf_alloc;
> -	} else {
> -		vvs->buf_size = VIRTIO_VSOCK_DEFAULT_BUF_SIZE;
> -		vvs->buf_size_min =
> VIRTIO_VSOCK_DEFAULT_MIN_BUF_SIZE;
> -		vvs->buf_size_max =
> VIRTIO_VSOCK_DEFAULT_MAX_BUF_SIZE;
>  	}
> 
> -	vvs->buf_alloc = vvs->buf_size;
> +	if (vsk->buffer_size > VIRTIO_VSOCK_MAX_BUF_SIZE)
> +		vsk->buffer_size = VIRTIO_VSOCK_MAX_BUF_SIZE;
> +
> +	vvs->buf_alloc = vsk->buffer_size;
> 
>  	spin_lock_init(&vvs->rx_lock);
>  	spin_lock_init(&vvs->tx_lock);
> @@ -476,71 +472,20 @@ int virtio_transport_do_socket_init(struct
> vsock_sock *vsk,  }  EXPORT_SYMBOL_GPL(virtio_transport_do_socket_init);
> 
> -u64 virtio_transport_get_buffer_size(struct vsock_sock *vsk) -{
> -	struct virtio_vsock_sock *vvs = vsk->trans;
> -
> -	return vvs->buf_size;
> -}
> -EXPORT_SYMBOL_GPL(virtio_transport_get_buffer_size);
> -
> -u64 virtio_transport_get_min_buffer_size(struct vsock_sock *vsk)
> +/* sk_lock held by the caller */
> +void virtio_transport_notify_buffer_size(struct vsock_sock *vsk, u64
> +*val)
>  {
>  	struct virtio_vsock_sock *vvs = vsk->trans;
> 
> -	return vvs->buf_size_min;
> -}
> -EXPORT_SYMBOL_GPL(virtio_transport_get_min_buffer_size);
> -
> -u64 virtio_transport_get_max_buffer_size(struct vsock_sock *vsk) -{
> -	struct virtio_vsock_sock *vvs = vsk->trans;
> -
> -	return vvs->buf_size_max;
> -}
> -EXPORT_SYMBOL_GPL(virtio_transport_get_max_buffer_size);
> -
> -void virtio_transport_set_buffer_size(struct vsock_sock *vsk, u64 val) -{
> -	struct virtio_vsock_sock *vvs = vsk->trans;
> +	if (*val > VIRTIO_VSOCK_MAX_BUF_SIZE)
> +		*val = VIRTIO_VSOCK_MAX_BUF_SIZE;
> 
> -	if (val > VIRTIO_VSOCK_MAX_BUF_SIZE)
> -		val = VIRTIO_VSOCK_MAX_BUF_SIZE;
> -	if (val < vvs->buf_size_min)
> -		vvs->buf_size_min = val;
> -	if (val > vvs->buf_size_max)
> -		vvs->buf_size_max = val;
> -	vvs->buf_size = val;
> -	vvs->buf_alloc = val;
> +	vvs->buf_alloc = *val;
> 
>  	virtio_transport_send_credit_update(vsk,
> VIRTIO_VSOCK_TYPE_STREAM,
>  					    NULL);
>  }
> -EXPORT_SYMBOL_GPL(virtio_transport_set_buffer_size);
> -
> -void virtio_transport_set_min_buffer_size(struct vsock_sock *vsk, u64 val)
> -{
> -	struct virtio_vsock_sock *vvs = vsk->trans;
> -
> -	if (val > VIRTIO_VSOCK_MAX_BUF_SIZE)
> -		val = VIRTIO_VSOCK_MAX_BUF_SIZE;
> -	if (val > vvs->buf_size)
> -		vvs->buf_size = val;
> -	vvs->buf_size_min = val;
> -}
> -EXPORT_SYMBOL_GPL(virtio_transport_set_min_buffer_size);
> -
> -void virtio_transport_set_max_buffer_size(struct vsock_sock *vsk, u64 val)
> -{
> -	struct virtio_vsock_sock *vvs = vsk->trans;
> -
> -	if (val > VIRTIO_VSOCK_MAX_BUF_SIZE)
> -		val = VIRTIO_VSOCK_MAX_BUF_SIZE;
> -	if (val < vvs->buf_size)
> -		vvs->buf_size = val;
> -	vvs->buf_size_max = val;
> -}
> -EXPORT_SYMBOL_GPL(virtio_transport_set_max_buffer_size);
> +EXPORT_SYMBOL_GPL(virtio_transport_notify_buffer_size);
> 
>  int
>  virtio_transport_notify_poll_in(struct vsock_sock *vsk, @@ -632,9 +577,7
> @@ EXPORT_SYMBOL_GPL(virtio_transport_notify_send_post_enqueue);
> 
>  u64 virtio_transport_stream_rcvhiwat(struct vsock_sock *vsk)  {
> -	struct virtio_vsock_sock *vvs = vsk->trans;
> -
> -	return vvs->buf_size;
> +	return vsk->buffer_size;
>  }
>  EXPORT_SYMBOL_GPL(virtio_transport_stream_rcvhiwat);

While the VMCI transport uses a transport local consumer_size for stream_rcvhiwat,
that consumer_size is always the same as buffer_size (a vmci queue pair allows the
producer and consumer queues to be of different sizes, but vsock doesn't use that).
So we could move the stream_rcvhiwat code to the common code as well, and just
use buffer_size, if that simplifies things.

> diff --git a/net/vmw_vsock/vmci_transport.c
> b/net/vmw_vsock/vmci_transport.c index f8e3131ac480..8290d37b6587
> 100644
> --- a/net/vmw_vsock/vmci_transport.c
> +++ b/net/vmw_vsock/vmci_transport.c
> @@ -74,10 +74,6 @@ static u32 vmci_transport_qp_resumed_sub_id =
> VMCI_INVALID_ID;
> 
>  static int PROTOCOL_OVERRIDE = -1;
> 
> -#define VMCI_TRANSPORT_DEFAULT_QP_SIZE_MIN   128
> -#define VMCI_TRANSPORT_DEFAULT_QP_SIZE       262144
> -#define VMCI_TRANSPORT_DEFAULT_QP_SIZE_MAX   262144
> -
>  /* Helper function to convert from a VMCI error code to a VSock error code.
> */
> 
>  static s32 vmci_transport_error_to_vsock_error(s32 vmci_error) @@ -
> 1025,11 +1021,11 @@ static int vmci_transport_recv_listen(struct sock *sk,
>  	/* If the proposed size fits within our min/max, accept it. Otherwise
>  	 * propose our own size.
>  	 */
> -	if (pkt->u.size >= vmci_trans(vpending)->queue_pair_min_size &&
> -	    pkt->u.size <= vmci_trans(vpending)->queue_pair_max_size) {
> +	if (pkt->u.size >= vpending->buffer_min_size &&
> +	    pkt->u.size <= vpending->buffer_max_size) {
>  		qp_size = pkt->u.size;
>  	} else {
> -		qp_size = vmci_trans(vpending)->queue_pair_size;
> +		qp_size = vpending->buffer_size;
>  	}
> 
>  	/* Figure out if we are using old or new requests based on the @@ -
> 1098,7 +1094,7 @@ static int vmci_transport_recv_listen(struct sock *sk,
>  	pending->sk_state = TCP_SYN_SENT;
>  	vmci_trans(vpending)->produce_size =
>  		vmci_trans(vpending)->consume_size = qp_size;
> -	vmci_trans(vpending)->queue_pair_size = qp_size;
> +	vpending->buffer_size = qp_size;
> 
>  	vmci_trans(vpending)->notify_ops->process_request(pending);
> 
> @@ -1392,8 +1388,8 @@ static int
> vmci_transport_recv_connecting_client_negotiate(
>  	vsk->ignore_connecting_rst = false;
> 
>  	/* Verify that we're OK with the proposed queue pair size */
> -	if (pkt->u.size < vmci_trans(vsk)->queue_pair_min_size ||
> -	    pkt->u.size > vmci_trans(vsk)->queue_pair_max_size) {
> +	if (pkt->u.size < vsk->buffer_min_size ||
> +	    pkt->u.size > vsk->buffer_max_size) {
>  		err = -EINVAL;
>  		goto destroy;
>  	}
> @@ -1498,8 +1494,7 @@
> vmci_transport_recv_connecting_client_invalid(struct sock *sk,
>  		vsk->sent_request = false;
>  		vsk->ignore_connecting_rst = true;
> 
> -		err = vmci_transport_send_conn_request(
> -			sk, vmci_trans(vsk)->queue_pair_size);
> +		err = vmci_transport_send_conn_request(sk, vsk-
> >buffer_size);
>  		if (err < 0)
>  			err = vmci_transport_error_to_vsock_error(err);
>  		else
> @@ -1583,21 +1578,6 @@ static int vmci_transport_socket_init(struct
> vsock_sock *vsk,
>  	INIT_LIST_HEAD(&vmci_trans(vsk)->elem);
>  	vmci_trans(vsk)->sk = &vsk->sk;
>  	spin_lock_init(&vmci_trans(vsk)->lock);
> -	if (psk) {
> -		vmci_trans(vsk)->queue_pair_size =
> -			vmci_trans(psk)->queue_pair_size;
> -		vmci_trans(vsk)->queue_pair_min_size =
> -			vmci_trans(psk)->queue_pair_min_size;
> -		vmci_trans(vsk)->queue_pair_max_size =
> -			vmci_trans(psk)->queue_pair_max_size;
> -	} else {
> -		vmci_trans(vsk)->queue_pair_size =
> -			VMCI_TRANSPORT_DEFAULT_QP_SIZE;
> -		vmci_trans(vsk)->queue_pair_min_size =
> -			 VMCI_TRANSPORT_DEFAULT_QP_SIZE_MIN;
> -		vmci_trans(vsk)->queue_pair_max_size =
> -			VMCI_TRANSPORT_DEFAULT_QP_SIZE_MAX;
> -	}
> 
>  	return 0;
>  }
> @@ -1813,8 +1793,7 @@ static int vmci_transport_connect(struct
> vsock_sock *vsk)
> 
>  	if (vmci_transport_old_proto_override(&old_pkt_proto) &&
>  		old_pkt_proto) {
> -		err = vmci_transport_send_conn_request(
> -			sk, vmci_trans(vsk)->queue_pair_size);
> +		err = vmci_transport_send_conn_request(sk, vsk-
> >buffer_size);
>  		if (err < 0) {
>  			sk->sk_state = TCP_CLOSE;
>  			return err;
> @@ -1822,8 +1801,7 @@ static int vmci_transport_connect(struct
> vsock_sock *vsk)
>  	} else {
>  		int supported_proto_versions =
>  			vmci_transport_new_proto_supported_versions();
> -		err = vmci_transport_send_conn_request2(
> -				sk, vmci_trans(vsk)->queue_pair_size,
> +		err = vmci_transport_send_conn_request2(sk, vsk-
> >buffer_size,
>  				supported_proto_versions);
>  		if (err < 0) {
>  			sk->sk_state = TCP_CLOSE;
> @@ -1876,46 +1854,6 @@ static bool
> vmci_transport_stream_is_active(struct vsock_sock *vsk)
>  	return !vmci_handle_is_invalid(vmci_trans(vsk)->qp_handle);
>  }
> 
> -static u64 vmci_transport_get_buffer_size(struct vsock_sock *vsk) -{
> -	return vmci_trans(vsk)->queue_pair_size;
> -}
> -
> -static u64 vmci_transport_get_min_buffer_size(struct vsock_sock *vsk) -{
> -	return vmci_trans(vsk)->queue_pair_min_size;
> -}
> -
> -static u64 vmci_transport_get_max_buffer_size(struct vsock_sock *vsk) -{
> -	return vmci_trans(vsk)->queue_pair_max_size;
> -}
> -
> -static void vmci_transport_set_buffer_size(struct vsock_sock *vsk, u64 val)
> -{
> -	if (val < vmci_trans(vsk)->queue_pair_min_size)
> -		vmci_trans(vsk)->queue_pair_min_size = val;
> -	if (val > vmci_trans(vsk)->queue_pair_max_size)
> -		vmci_trans(vsk)->queue_pair_max_size = val;
> -	vmci_trans(vsk)->queue_pair_size = val;
> -}
> -
> -static void vmci_transport_set_min_buffer_size(struct vsock_sock *vsk,
> -					       u64 val)
> -{
> -	if (val > vmci_trans(vsk)->queue_pair_size)
> -		vmci_trans(vsk)->queue_pair_size = val;
> -	vmci_trans(vsk)->queue_pair_min_size = val;
> -}
> -
> -static void vmci_transport_set_max_buffer_size(struct vsock_sock *vsk,
> -					       u64 val)
> -{
> -	if (val < vmci_trans(vsk)->queue_pair_size)
> -		vmci_trans(vsk)->queue_pair_size = val;
> -	vmci_trans(vsk)->queue_pair_max_size = val;
> -}
> -
>  static int vmci_transport_notify_poll_in(
>  	struct vsock_sock *vsk,
>  	size_t target,
> @@ -2098,12 +2036,6 @@ static const struct vsock_transport vmci_transport
> = {
>  	.notify_send_pre_enqueue =
> vmci_transport_notify_send_pre_enqueue,
>  	.notify_send_post_enqueue =
> vmci_transport_notify_send_post_enqueue,
>  	.shutdown = vmci_transport_shutdown,
> -	.set_buffer_size = vmci_transport_set_buffer_size,
> -	.set_min_buffer_size = vmci_transport_set_min_buffer_size,
> -	.set_max_buffer_size = vmci_transport_set_max_buffer_size,
> -	.get_buffer_size = vmci_transport_get_buffer_size,
> -	.get_min_buffer_size = vmci_transport_get_min_buffer_size,
> -	.get_max_buffer_size = vmci_transport_get_max_buffer_size,
>  	.get_local_cid = vmci_transport_get_local_cid,  };
> 
> diff --git a/net/vmw_vsock/vmci_transport.h
> b/net/vmw_vsock/vmci_transport.h index 1ca1e8640b31..b7b072194282
> 100644
> --- a/net/vmw_vsock/vmci_transport.h
> +++ b/net/vmw_vsock/vmci_transport.h
> @@ -108,9 +108,6 @@ struct vmci_transport {
>  	struct vmci_qp *qpair;
>  	u64 produce_size;
>  	u64 consume_size;
> -	u64 queue_pair_size;
> -	u64 queue_pair_min_size;
> -	u64 queue_pair_max_size;
>  	u32 detach_sub_id;
>  	union vmci_transport_notify notify;
>  	const struct vmci_transport_notify_ops *notify_ops;
> --
> 2.21.0

Reviewed-by: Jorgen Hansen <jhansen@vmware.com>

^ permalink raw reply

* RE: [PATCH net-next 06/14] vsock: add 'struct vsock_sock *' param to vsock_core_get_transport()
From: Jorgen Hansen @ 2019-10-30 15:01 UTC (permalink / raw)
  To: 'Stefano Garzarella'
  Cc: Michael S. Tsirkin, kvm@vger.kernel.org, Greg Kroah-Hartman,
	Jason Wang, David S. Miller, Dexuan Cui, Haiyang Zhang,
	Sasha Levin, linux-kernel@vger.kernel.org, Arnd Bergmann,
	Stefan Hajnoczi, linux-hyperv@vger.kernel.org, K. Y. Srinivasan,
	Stephen Hemminger, virtualization@lists.linux-foundation.org,
	netdev@vger.kernel.org
In-Reply-To: <20191023095554.11340-7-sgarzare@redhat.com>

> From: Stefano Garzarella [mailto:sgarzare@redhat.com]
> Sent: Wednesday, October 23, 2019 11:56 AM
> Subject: [PATCH net-next 06/14] vsock: add 'struct vsock_sock *' param to
> vsock_core_get_transport()
> 
> Since now the 'struct vsock_sock' object contains a pointer to the transport,
> this patch adds a parameter to the
> vsock_core_get_transport() to return the right transport assigned to the
> socket.
> 
> This patch modifies also the virtio_transport_get_ops(), that uses the
> vsock_core_get_transport(), adding the 'struct vsock_sock *' parameter.
> 
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
> ---
> RFC -> v1:
> - Removed comment about protecting transport_single (Stefan)
> ---
>  include/net/af_vsock.h                  | 2 +-
>  net/vmw_vsock/af_vsock.c                | 7 ++-----
>  net/vmw_vsock/virtio_transport_common.c | 9 +++++----
>  3 files changed, 8 insertions(+), 10 deletions(-)
> 
> diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h index
> a5e1e134261d..2ca67d048de4 100644
> --- a/include/net/af_vsock.h
> +++ b/include/net/af_vsock.h
> @@ -166,7 +166,7 @@ static inline int vsock_core_init(const struct
> vsock_transport *t)  void vsock_core_exit(void);
> 
>  /* The transport may downcast this to access transport-specific functions */
> -const struct vsock_transport *vsock_core_get_transport(void);
> +const struct vsock_transport *vsock_core_get_transport(struct
> +vsock_sock *vsk);
> 
>  /**** UTILS ****/
> 
> diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index
> c3a14f853eb0..eaea159006c8 100644
> --- a/net/vmw_vsock/af_vsock.c
> +++ b/net/vmw_vsock/af_vsock.c
> @@ -2001,12 +2001,9 @@ void vsock_core_exit(void)  }
> EXPORT_SYMBOL_GPL(vsock_core_exit);
> 
> -const struct vsock_transport *vsock_core_get_transport(void)
> +const struct vsock_transport *vsock_core_get_transport(struct
> +vsock_sock *vsk)
>  {
> -	/* vsock_register_mutex not taken since only the transport uses this
> -	 * function and only while registered.
> -	 */
> -	return transport_single;
> +	return vsk->transport;
>  }
>  EXPORT_SYMBOL_GPL(vsock_core_get_transport);
> 
> diff --git a/net/vmw_vsock/virtio_transport_common.c
> b/net/vmw_vsock/virtio_transport_common.c
> index 9763394f7a61..37a1c7e7c7fe 100644
> --- a/net/vmw_vsock/virtio_transport_common.c
> +++ b/net/vmw_vsock/virtio_transport_common.c
> @@ -29,9 +29,10 @@
>  /* Threshold for detecting small packets to copy */  #define
> GOOD_COPY_LEN  128
> 
> -static const struct virtio_transport *virtio_transport_get_ops(void)
> +static const struct virtio_transport *
> +virtio_transport_get_ops(struct vsock_sock *vsk)
>  {
> -	const struct vsock_transport *t = vsock_core_get_transport();
> +	const struct vsock_transport *t = vsock_core_get_transport(vsk);
> 
>  	return container_of(t, struct virtio_transport, transport);  } @@ -
> 168,7 +169,7 @@ static int virtio_transport_send_pkt_info(struct vsock_sock
> *vsk,
>  	struct virtio_vsock_pkt *pkt;
>  	u32 pkt_len = info->pkt_len;
> 
> -	src_cid = virtio_transport_get_ops()->transport.get_local_cid();
> +	src_cid = virtio_transport_get_ops(vsk)->transport.get_local_cid();
>  	src_port = vsk->local_addr.svm_port;
>  	if (!info->remote_cid) {
>  		dst_cid	= vsk->remote_addr.svm_cid;
> @@ -201,7 +202,7 @@ static int virtio_transport_send_pkt_info(struct
> vsock_sock *vsk,
> 
>  	virtio_transport_inc_tx_pkt(vvs, pkt);
> 
> -	return virtio_transport_get_ops()->send_pkt(pkt);
> +	return virtio_transport_get_ops(vsk)->send_pkt(pkt);
>  }
> 
>  static bool virtio_transport_inc_rx_pkt(struct virtio_vsock_sock *vvs,
> --
> 2.21.0

Reviewed-by: Jorgen Hansen <jhansen@vmware.com>

^ permalink raw reply

* RE: [PATCH net-next 04/14] vsock: add 'transport' member in the struct vsock_sock
From: Jorgen Hansen @ 2019-10-30 14:57 UTC (permalink / raw)
  To: 'Stefano Garzarella'
  Cc: Michael S. Tsirkin, kvm@vger.kernel.org, Greg Kroah-Hartman,
	Jason Wang, David S. Miller, Dexuan Cui, Haiyang Zhang,
	Sasha Levin, linux-kernel@vger.kernel.org, Arnd Bergmann,
	Stefan Hajnoczi, linux-hyperv@vger.kernel.org, K. Y. Srinivasan,
	Stephen Hemminger, virtualization@lists.linux-foundation.org,
	netdev@vger.kernel.org
In-Reply-To: <20191023095554.11340-5-sgarzare@redhat.com>

> From: Stefano Garzarella [mailto:sgarzare@redhat.com]
> Sent: Wednesday, October 23, 2019 11:56 AM
> Subject: [PATCH net-next 04/14] vsock: add 'transport' member in the struct
> vsock_sock
> 
> As a preparation to support multiple transports, this patch adds the
> 'transport' member at the 'struct vsock_sock'.
> This new field is initialized during the creation in the
> __vsock_create() function.
> 
> This patch also renames the global 'transport' pointer to 'transport_single',
> since for now we're only supporting a single transport registered at run-time.
> 
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
> ---
>  include/net/af_vsock.h   |  1 +
>  net/vmw_vsock/af_vsock.c | 56 +++++++++++++++++++++++++++----------
> ---
>  2 files changed, 39 insertions(+), 18 deletions(-)
> 
> diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h index
> c660402b10f2..a5e1e134261d 100644
> --- a/include/net/af_vsock.h
> +++ b/include/net/af_vsock.h
> @@ -27,6 +27,7 @@ extern spinlock_t vsock_table_lock;  struct vsock_sock {
>  	/* sk must be the first member. */
>  	struct sock sk;
> +	const struct vsock_transport *transport;
>  	struct sockaddr_vm local_addr;
>  	struct sockaddr_vm remote_addr;
>  	/* Links for the global tables of bound and connected sockets. */ diff
> --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index
> 2f2582fb7fdd..c3a14f853eb0 100644
> --- a/net/vmw_vsock/af_vsock.c
> +++ b/net/vmw_vsock/af_vsock.c
> @@ -126,7 +126,7 @@ static struct proto vsock_proto = {
>   */
>  #define VSOCK_DEFAULT_CONNECT_TIMEOUT (2 * HZ)
> 
> -static const struct vsock_transport *transport;
> +static const struct vsock_transport *transport_single;
>  static DEFINE_MUTEX(vsock_register_mutex);
> 
>  /**** UTILS ****/
> @@ -408,7 +408,9 @@ static bool vsock_is_pending(struct sock *sk)
> 
>  static int vsock_send_shutdown(struct sock *sk, int mode)  {
> -	return transport->shutdown(vsock_sk(sk), mode);
> +	struct vsock_sock *vsk = vsock_sk(sk);
> +
> +	return vsk->transport->shutdown(vsk, mode);
>  }
> 
>  static void vsock_pending_work(struct work_struct *work) @@ -518,7
> +520,7 @@ static int __vsock_bind_stream(struct vsock_sock *vsk,  static int
> __vsock_bind_dgram(struct vsock_sock *vsk,
>  			      struct sockaddr_vm *addr)
>  {
> -	return transport->dgram_bind(vsk, addr);
> +	return vsk->transport->dgram_bind(vsk, addr);
>  }
> 
>  static int __vsock_bind(struct sock *sk, struct sockaddr_vm *addr) @@ -
> 536,7 +538,7 @@ static int __vsock_bind(struct sock *sk, struct sockaddr_vm
> *addr)
>  	 * like AF_INET prevents binding to a non-local IP address (in most
>  	 * cases), we only allow binding to the local CID.
>  	 */
> -	cid = transport->get_local_cid();
> +	cid = vsk->transport->get_local_cid();
>  	if (addr->svm_cid != cid && addr->svm_cid != VMADDR_CID_ANY)
>  		return -EADDRNOTAVAIL;
> 
> @@ -586,6 +588,7 @@ struct sock *__vsock_create(struct net *net,
>  		sk->sk_type = type;
> 
>  	vsk = vsock_sk(sk);
> +	vsk->transport = transport_single;
>  	vsock_addr_init(&vsk->local_addr, VMADDR_CID_ANY,
> VMADDR_PORT_ANY);
>  	vsock_addr_init(&vsk->remote_addr, VMADDR_CID_ANY,
> VMADDR_PORT_ANY);
> 
> @@ -616,7 +619,7 @@ struct sock *__vsock_create(struct net *net,
>  		vsk->connect_timeout =
> VSOCK_DEFAULT_CONNECT_TIMEOUT;
>  	}
> 
> -	if (transport->init(vsk, psk) < 0) {
> +	if (vsk->transport->init(vsk, psk) < 0) {
>  		sk_free(sk);
>  		return NULL;
>  	}
> @@ -641,7 +644,7 @@ static void __vsock_release(struct sock *sk, int level)
>  		/* The release call is supposed to use lock_sock_nested()
>  		 * rather than lock_sock(), if a sock lock should be acquired.
>  		 */
> -		transport->release(vsk);
> +		vsk->transport->release(vsk);
> 
>  		/* When "level" is SINGLE_DEPTH_NESTING, use the nested
>  		 * version to avoid the warning "possible recursive locking
> @@ -670,7 +673,7 @@ static void vsock_sk_destruct(struct sock *sk)  {
>  	struct vsock_sock *vsk = vsock_sk(sk);
> 
> -	transport->destruct(vsk);
> +	vsk->transport->destruct(vsk);
> 
>  	/* When clearing these addresses, there's no need to set the family
> and
>  	 * possibly register the address family with the kernel.
> @@ -694,13 +697,13 @@ static int vsock_queue_rcv_skb(struct sock *sk,
> struct sk_buff *skb)
> 
>  s64 vsock_stream_has_data(struct vsock_sock *vsk)  {
> -	return transport->stream_has_data(vsk);
> +	return vsk->transport->stream_has_data(vsk);
>  }
>  EXPORT_SYMBOL_GPL(vsock_stream_has_data);
> 
>  s64 vsock_stream_has_space(struct vsock_sock *vsk)  {
> -	return transport->stream_has_space(vsk);
> +	return vsk->transport->stream_has_space(vsk);
>  }
>  EXPORT_SYMBOL_GPL(vsock_stream_has_space);
> 
> @@ -869,6 +872,7 @@ static __poll_t vsock_poll(struct file *file, struct
> socket *sock,
>  			mask |= EPOLLOUT | EPOLLWRNORM |
> EPOLLWRBAND;
> 
>  	} else if (sock->type == SOCK_STREAM) {
> +		const struct vsock_transport *transport = vsk->transport;
>  		lock_sock(sk);
> 
>  		/* Listening sockets that have connections in their accept
> @@ -944,6 +948,7 @@ static int vsock_dgram_sendmsg(struct socket *sock,
> struct msghdr *msg,
>  	struct sock *sk;
>  	struct vsock_sock *vsk;
>  	struct sockaddr_vm *remote_addr;
> +	const struct vsock_transport *transport;
> 
>  	if (msg->msg_flags & MSG_OOB)
>  		return -EOPNOTSUPP;
> @@ -952,6 +957,7 @@ static int vsock_dgram_sendmsg(struct socket *sock,
> struct msghdr *msg,
>  	err = 0;
>  	sk = sock->sk;
>  	vsk = vsock_sk(sk);
> +	transport = vsk->transport;
> 
>  	lock_sock(sk);
> 
> @@ -1036,8 +1042,8 @@ static int vsock_dgram_connect(struct socket
> *sock,
>  	if (err)
>  		goto out;
> 
> -	if (!transport->dgram_allow(remote_addr->svm_cid,
> -				    remote_addr->svm_port)) {
> +	if (!vsk->transport->dgram_allow(remote_addr->svm_cid,
> +					 remote_addr->svm_port)) {
>  		err = -EINVAL;
>  		goto out;
>  	}
> @@ -1053,7 +1059,9 @@ static int vsock_dgram_connect(struct socket
> *sock,  static int vsock_dgram_recvmsg(struct socket *sock, struct msghdr
> *msg,
>  			       size_t len, int flags)
>  {
> -	return transport->dgram_dequeue(vsock_sk(sock->sk), msg, len,
> flags);
> +	struct vsock_sock *vsk = vsock_sk(sock->sk);
> +
> +	return vsk->transport->dgram_dequeue(vsk, msg, len, flags);
>  }
> 
>  static const struct proto_ops vsock_dgram_ops = { @@ -1079,6 +1087,8 @@
> static const struct proto_ops vsock_dgram_ops = {
> 
>  static int vsock_transport_cancel_pkt(struct vsock_sock *vsk)  {
> +	const struct vsock_transport *transport = vsk->transport;
> +
>  	if (!transport->cancel_pkt)
>  		return -EOPNOTSUPP;
> 
> @@ -1115,6 +1125,7 @@ static int vsock_stream_connect(struct socket
> *sock, struct sockaddr *addr,
>  	int err;
>  	struct sock *sk;
>  	struct vsock_sock *vsk;
> +	const struct vsock_transport *transport;
>  	struct sockaddr_vm *remote_addr;
>  	long timeout;
>  	DEFINE_WAIT(wait);
> @@ -1122,6 +1133,7 @@ static int vsock_stream_connect(struct socket
> *sock, struct sockaddr *addr,
>  	err = 0;
>  	sk = sock->sk;
>  	vsk = vsock_sk(sk);
> +	transport = vsk->transport;
> 
>  	lock_sock(sk);
> 
> @@ -1365,6 +1377,7 @@ static int vsock_stream_setsockopt(struct socket
> *sock,
>  	int err;
>  	struct sock *sk;
>  	struct vsock_sock *vsk;
> +	const struct vsock_transport *transport;
>  	u64 val;
> 
>  	if (level != AF_VSOCK)
> @@ -1385,6 +1398,7 @@ static int vsock_stream_setsockopt(struct socket
> *sock,
>  	err = 0;
>  	sk = sock->sk;
>  	vsk = vsock_sk(sk);
> +	transport = vsk->transport;
> 
>  	lock_sock(sk);
> 
> @@ -1442,6 +1456,7 @@ static int vsock_stream_getsockopt(struct socket
> *sock,
>  	int len;
>  	struct sock *sk;
>  	struct vsock_sock *vsk;
> +	const struct vsock_transport *transport;
>  	u64 val;
> 
>  	if (level != AF_VSOCK)
> @@ -1465,6 +1480,7 @@ static int vsock_stream_getsockopt(struct socket
> *sock,
>  	err = 0;
>  	sk = sock->sk;
>  	vsk = vsock_sk(sk);
> +	transport = vsk->transport;
> 
>  	switch (optname) {
>  	case SO_VM_SOCKETS_BUFFER_SIZE:
> @@ -1509,6 +1525,7 @@ static int vsock_stream_sendmsg(struct socket
> *sock, struct msghdr *msg,  {
>  	struct sock *sk;
>  	struct vsock_sock *vsk;
> +	const struct vsock_transport *transport;
>  	ssize_t total_written;
>  	long timeout;
>  	int err;
> @@ -1517,6 +1534,7 @@ static int vsock_stream_sendmsg(struct socket
> *sock, struct msghdr *msg,
> 
>  	sk = sock->sk;
>  	vsk = vsock_sk(sk);
> +	transport = vsk->transport;
>  	total_written = 0;
>  	err = 0;
> 
> @@ -1648,6 +1666,7 @@ vsock_stream_recvmsg(struct socket *sock, struct
> msghdr *msg, size_t len,  {
>  	struct sock *sk;
>  	struct vsock_sock *vsk;
> +	const struct vsock_transport *transport;
>  	int err;
>  	size_t target;
>  	ssize_t copied;
> @@ -1658,6 +1677,7 @@ vsock_stream_recvmsg(struct socket *sock, struct
> msghdr *msg, size_t len,
> 
>  	sk = sock->sk;
>  	vsk = vsock_sk(sk);
> +	transport = vsk->transport;
>  	err = 0;
> 
>  	lock_sock(sk);
> @@ -1872,7 +1892,7 @@ static long vsock_dev_do_ioctl(struct file *filp,
> 
>  	switch (cmd) {
>  	case IOCTL_VM_SOCKETS_GET_LOCAL_CID:
> -		if (put_user(transport->get_local_cid(), p) != 0)
> +		if (put_user(transport_single->get_local_cid(), p) != 0)
>  			retval = -EFAULT;
>  		break;
> 
> @@ -1919,7 +1939,7 @@ int __vsock_core_init(const struct vsock_transport
> *t, struct module *owner)
>  	if (err)
>  		return err;
> 
> -	if (transport) {
> +	if (transport_single) {
>  		err = -EBUSY;
>  		goto err_busy;
>  	}
> @@ -1928,7 +1948,7 @@ int __vsock_core_init(const struct vsock_transport
> *t, struct module *owner)
>  	 * unload while there are open sockets.
>  	 */
>  	vsock_proto.owner = owner;
> -	transport = t;
> +	transport_single = t;
> 
>  	vsock_device.minor = MISC_DYNAMIC_MINOR;
>  	err = misc_register(&vsock_device);
> @@ -1958,7 +1978,7 @@ int __vsock_core_init(const struct vsock_transport
> *t, struct module *owner)
>  err_deregister_misc:
>  	misc_deregister(&vsock_device);
>  err_reset_transport:
> -	transport = NULL;
> +	transport_single = NULL;
>  err_busy:
>  	mutex_unlock(&vsock_register_mutex);
>  	return err;
> @@ -1975,7 +1995,7 @@ void vsock_core_exit(void)
> 
>  	/* We do not want the assignment below re-ordered. */
>  	mb();
> -	transport = NULL;
> +	transport_single = NULL;
> 
>  	mutex_unlock(&vsock_register_mutex);
>  }
> @@ -1986,7 +2006,7 @@ const struct vsock_transport
> *vsock_core_get_transport(void)
>  	/* vsock_register_mutex not taken since only the transport uses this
>  	 * function and only while registered.
>  	 */
> -	return transport;
> +	return transport_single;
>  }
>  EXPORT_SYMBOL_GPL(vsock_core_get_transport);
> 
> --
> 2.21.0

Reviewed-by: Jorgen Hansen <jhansen@vmware.com>

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox