RE: [PATCH hyperv-next] scsi: storvsc: Use blk_mq_unique_tag() to generate requestIDs

2021-04-15 Thread Michael Kelley
From: Andrea Parri (Microsoft) Sent: Thursday, April 15, 2021 3:59 AM > > Use blk_mq_unique_tag() to generate requestIDs for StorVSC, avoiding > all issues with allocating enough entries in the VMbus requestor. > > Suggested-by: Michael Kelley > Signed-off-by: Andre

RE: [PATCH hyperv-next] Drivers: hv: vmbus: Copy packets sent by Hyper-V out of the ring buffer

2021-04-09 Thread Michael Kelley
_MAX_XFER_PAGE_RANGES? It used to be a fixed 375, but now is NVSP_RSC_MAX, which is 562. If that's the only change, then Reviewed-by: Michael Kelley > > Signed-off-by: Andres Beltran > Co-developed-by: Andrea Parri (Microsoft) > Signed-off-by: Andrea Parri (Mic

RE: [RFC PATCH hyperv-next] scsi: storvsc: Use blk_mq_unique_tag() to generate requestIDs

2021-04-09 Thread Michael Kelley
thout too much complexity. See a few comments inline below. > > Suggested-by: Michael Kelley > Signed-off-by: Andrea Parri (Microsoft) > --- > drivers/hv/channel.c | 14 +++--- > drivers/hv/ring_buffer.c | 12 ++--- > drivers/net/hyperv/netvsc.c

RE: [PATCH v3 hyperv-next 4/4] hv_netvsc: Restrict configurations on isolated guests

2021-02-01 Thread Michael Kelley
len); > + if (hv_is_isolation_supported()) > + netdev_err(ndev, "Ignore VF_ASSOCIATION msg from the > host supporting isolation\n"); > + else > + netvsc_send_vf(ndev, nvmsg, msglen); > break; > } > } > -- > 2.25.1 Reviewed-by: Michael Kelley

RE: [PATCH v2 4/4] hv_netvsc: Restrict configurations on isolated guests

2021-01-28 Thread Michael Kelley
From: Andrea Parri (Microsoft) Sent: Tuesday, January 26, 2021 3:57 AM > > Restrict the NVSP protocol version(s) that will be negotiated with the > host to be NVSP_PROTOCOL_VERSION_61 or greater if the guest is running > isolated. Moreover, do not advertise the SR-IOV capability and ignore > NV

RE: [PATCH AUTOSEL 4.14 40/66] hv_netvsc: Validate number of allocated sub-channels

2020-12-22 Thread Michael Kelley
From: Sasha Levin Sent: Tuesday, December 22, 2020 6:22 PM > > From: "Andrea Parri (Microsoft)" > > [ Upstream commit 206ad34d52a2f1205c84d08c12fc116aad0eb407 ] > > Lack of validation could lead to out-of-bound reads and information > leaks (cf. usage of nvdev->chan_table[]). Check that the n

RE: [PATCH v3] Drivers: hv: vmbus: Copy packets sent by Hyper-V out of the ring buffer

2020-12-22 Thread Michael Kelley
hyperv_net.h | 3 ++ > drivers/net/hyperv/netvsc.c | 2 + > drivers/net/hyperv/rndis_filter.c | 2 + > drivers/scsi/storvsc_drv.c| 10 > include/linux/hyperv.h| 48 +++--- > net/vmw_vsock/hyperv_transport.c | 4 +- > 11 files changed, 139 insertions(+), 25 deletions(-) > Reviewed-by: Michael Kelley

RE: [PATCH] hv_netvsc: Validate number of allocated sub-channels

2020-12-13 Thread Michael Kelley
_err(ndev, "invalid number of allocated sub channel\n"); > + return -EINVAL; > + } > nvdev->num_chn = 1 + > init_packet->msg.v5_msg.subchn_comp.num_subchannels; > > -- > 2.25.1 Reviewed-by: Michael Kelley

RE: [PATCH v2] Drivers: hv: vmbus: Copy packets sent by Hyper-V out of the ring buffer

2020-12-06 Thread Michael Kelley
From: Andrea Parri (Microsoft) Sent: Monday, November 9, 2020 2:07 AM > > From: Andres Beltran > > Pointers to ring-buffer packets sent by Hyper-V are used within the > guest VM. Hyper-V can send packets with erroneous values or modify > packet fields after they are processed by the guest. To

RE: [PATCH v4 10/11] Driver: hv: util: Use VMBUS_RING_SIZE() for ringbuffer sizes

2020-09-26 Thread Michael Kelley
ll be minus 4k (the size of header when > PAGE_SIZE = 4k) than the original value to keep the ringbuffer total > size unchanged when PAGE_SIZE = 4k. > > Signed-off-by: Boqun Feng > Cc: Michael Kelley > > --- > Michael, > > I drop your Reviewed-by tag because of

RE: [PATCH v4 09/11] HID: hyperv: Use VMBUS_RING_SIZE() for ringbuffer sizes

2020-09-26 Thread Michael Kelley
ll be minus 4k (the size of header when > PAGE_SIZE = 4k) than the original value to keep the ringbuffer total > size unchanged when PAGE_SIZE = 4k. > > Signed-off-by: Boqun Feng > Cc: Jiri Kosina > Cc: Michael Kelley > --- > Michael and Jiri, > > I change the code bec

RE: [PATCH v4 08/11] Input: hyperv-keyboard: Use VMBUS_RING_SIZE() for ringbuffer sizes

2020-09-26 Thread Michael Kelley
ll be minus 4k (the size of header when > PAGE_SIZE = 4k) than the original value to keep the ringbuffer total > size unchanged when PAGE_SIZE = 4k. > > Signed-off-by: Boqun Feng > Cc: Michael Kelley > Cc: Dmitry Torokhov > --- > Michael and Dmitry, > > I change the cod

RE: [PATCH v3 11/11] scsi: storvsc: Support PAGE_SIZE larger than 4K

2020-09-12 Thread Michael Kelley
payload->range.offset = sgl[0].offset & ~HV_HYP_PAGE_MASK; Another nit. The right hand side of the above assignment is already calculated as hvpg_offset. Nits aside, Reviewed-by: Michael Kelley > + hvpgoff = sgl[0].offset >> HV_HYP_P

RE: [PATCH v3 10/11] Driver: hv: util: Make ringbuffer at least take two pages

2020-09-12 Thread Michael Kelley
). > > So make sure the ringbuffer sizes to be at least 2 * PAGE_SIZE when > using vmbus_open() to establish the vmbus connection. > > Signed-off-by: Boqun Feng > --- > drivers/hv/hv_util.c | 16 > 1 file changed, 12 insertions(+), 4 deletions(-) > Reviewed-by: Michael Kelley

RE: [PATCH v3 09/11] HID: hyperv: Make ringbuffer at least take two pages

2020-09-12 Thread Michael Kelley
version (casting > 2 * PAGE_SIZE into int to avoid compiler warnings), and it make no > functional change. If the change is inappropriate, please let me know. > > drivers/hid/hid-hyperv.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > Reviewed-by: Michael Kelley

RE: [PATCH v3 08/11] Input: hyperv-keyboard: Make ringbuffer at least take two pages

2020-09-12 Thread Michael Kelley
pping). > > So make sure the ringbuffer sizes to be at least 2 * PAGE_SIZE when > using vmbus_open() to establish the vmbus connection. > > Signed-off-by: Boqun Feng > --- > drivers/input/serio/hyperv-keyboard.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > Reviewed-by: Michael Kelley

RE: [PATCH v3 07/11] hv_netvsc: Use HV_HYP_PAGE_SIZE for Hyper-V communication

2020-09-12 Thread Michael Kelley
drivers/net/hyperv/netvsc.c | 2 +- > drivers/net/hyperv/netvsc_drv.c | 46 +++ > drivers/net/hyperv/rndis_filter.c | 13 - > 3 files changed, 30 insertions(+), 31 deletions(-) > Reviewed-by: Michael Kelley

RE: [PATCH v3 06/11] hv: hyperv.h: Introduce some hvpfn helper functions

2020-09-12 Thread Michael Kelley
upporting guest whose PAGE_SIZE is not 4k. > > Signed-off-by: Boqun Feng > --- > include/linux/hyperv.h | 5 + > 1 file changed, 5 insertions(+) > Reviewed-by: Michael Kelley

RE: [PATCH v3 05/11] Drivers: hv: vmbus: Move virt_to_hvpfn() to hyperv header

2020-09-12 Thread Michael Kelley
t; drivers/hv/channel.c | 13 - > include/linux/hyperv.h | 15 +++ > 2 files changed, 15 insertions(+), 13 deletions(-) > Reviewed-by: Michael Kelley

RE: [PATCH v3 04/11] Drivers: hv: Use HV_HYP_PAGE in hv_synic_enable_regs()

2020-09-12 Thread Michael Kelley
sertions(+), 2 deletions(-) > Reviewed-by: Michael Kelley

RE: [PATCH v3 03/11] Drivers: hv: vmbus: Introduce types of GPADL

2020-09-12 Thread Michael Kelley
everal general interfaces to > describe the differences between normal buffer GPADL and ringbuffer > GPADL. > > Signed-off-by: Boqun Feng > --- > drivers/hv/channel.c | 160 +++-- > include/linux/hyperv.h | 44 +++- > 2 files changed, 183 insertions(+), 21 deletions(-) > Reviewed-by: Michael Kelley

RE: [PATCH v3 02/11] Drivers: hv: vmbus: Move __vmbus_open()

2020-09-12 Thread Michael Kelley
s_open() in two patches to make it easy to review. > > Signed-off-by: Boqun Feng > Reviewed-by: Wei Liu > --- > drivers/hv/channel.c | 309 ++- > 1 file changed, 155 insertions(+), 154 deletions(-) > Reviewed-by: Michael Kelley

RE: [PATCH v3 01/11] Drivers: hv: vmbus: Always use HV_HYP_PAGE_SIZE for gpadl

2020-09-12 Thread Michael Kelley
size guests. No functional changes on x86, since PAGE_SIZE is always 4k > (equals to HV_HYP_PAGE_SIZE). > > Signed-off-by: Boqun Feng > --- > drivers/hv/channel.c | 13 + > 1 file changed, 5 insertions(+), 8 deletions(-) > Reviewed-by: Michael Kelley

RE: [PATCH net v2] hv_netvsc: Fix hibernation for mlx5 VF driver

2020-09-08 Thread Michael Kelley
From: Dexuan Cui Sent: Monday, September 7, 2020 12:14 AM > > mlx5_suspend()/resume() keep the network interface, so during hibernation > netvsc_unregister_vf() and netvsc_register_vf() are not called, and hence > netvsc_resume() should call netvsc_vf_changed() to switch the data path > back to

RE: [PATCH v7 3/3] hv_netvsc: Use vmbus_requestor to generate transaction IDs for VMBus hardening

2020-09-07 Thread Michael Kelley
| 1 + > include/linux/hyperv.h | 1 + > 4 files changed, 31 insertions(+), 6 deletions(-) > Reviewed-by: Michael Kelley

RE: [RFC v2 11/11] scsi: storvsc: Support PAGE_SIZE larger than 4K

2020-09-05 Thread Michael Kelley
From: Boqun Feng Sent: Saturday, September 5, 2020 7:15 AM > > On Sat, Sep 05, 2020 at 02:55:48AM +, Michael Kelley wrote: > > From: Boqun Feng Sent: Tuesday, September 1, 2020 > > 8:01 PM > > > > > > Hyper-V always use 4k page size (HV_HYP_PAGE_SIZ

RE: [RFC v2 11/11] scsi: storvsc: Support PAGE_SIZE larger than 4K

2020-09-04 Thread Michael Kelley
From: Boqun Feng Sent: Tuesday, September 1, 2020 8:01 PM > > Hyper-V always use 4k page size (HV_HYP_PAGE_SIZE), so when > communicating with Hyper-V, a guest should always use HV_HYP_PAGE_SIZE > as the unit for page related data. For storvsc, the data is > vmbus_packet_mpb_array. And since in s

RE: [RFC v2 07/11] hv_netvsc: Use HV_HYP_PAGE_SIZE for Hyper-V communication

2020-09-04 Thread Michael Kelley
From: Boqun Feng Sent: Tuesday, September 1, 2020 8:01 PM > > When communicating with Hyper-V, HV_HYP_PAGE_SIZE should be used since > that's the page size used by Hyper-V and Hyper-V expects all > page-related data using the unit of HY_HYP_PAGE_SIZE, for example, the > "pfn" in hv_page_buffer is

RE: [RFC v2 03/11] Drivers: hv: vmbus: Introduce types of GPADL

2020-09-04 Thread Michael Kelley
From: Boqun Feng Sent: Tuesday, September 1, 2020 8:01 PM > > This patch introduces two types of GPADL: HV_GPADL_{BUFFER, RING}. The > types of GPADL are purely the concept in the guest, IOW the hypervisor > treat them as the same. > > The reason of introducing the types of GPADL is to support g

RE: [RFC v2 02/11] Drivers: hv: vmbus: Move __vmbus_open()

2020-09-04 Thread Michael Kelley
From: Boqun Feng Sent: Tuesday, September 1, 2020 8:01 PM > > Pure function movement, no functional changes. The move is made, because > in a later change, __vmbus_open() will rely on some static functions > afterwards, so we sperate the move and the modification of s/sperate/separate/ > __vmbu

RE: [RFC 11/11] scsi: storvsc: Support PAGE_SIZE larger than 4K

2020-07-22 Thread Michael Kelley
From: boqun.f...@gmail.com Sent: Wednesday, July 22, 2020 6:52 PM > > On Thu, Jul 23, 2020 at 12:13:07AM +, Michael Kelley wrote: > > From: Boqun Feng Sent: Monday, July 20, 2020 6:42 PM > > > > > > Hyper-V always use 4k page size (HV_HYP_PAGE_SIZE), so when

RE: [RFC 11/11] scsi: storvsc: Support PAGE_SIZE larger than 4K

2020-07-22 Thread Michael Kelley
From: Boqun Feng Sent: Monday, July 20, 2020 6:42 PM > > Hyper-V always use 4k page size (HV_HYP_PAGE_SIZE), so when > communicating with Hyper-V, a guest should always use HV_HYP_PAGE_SIZE > as the unit for page related data. For storvsc, the data is > vmbus_packet_mpb_array. And since in scsi_c

RE: [RFC 03/11] Drivers: hv: vmbus: Introduce types of GPADL

2020-07-22 Thread Michael Kelley
From: Boqun Feng Sent: Wednesday, July 22, 2020 4:43 PM > > On Wed, Jul 22, 2020 at 11:25:18PM +, Michael Kelley wrote: > > From: Boqun Feng Sent: Monday, July 20, 2020 6:41 PM > > > > > > This patch introduces two types of GPADL: HV_GPADL_{BUFFER, RING}. The &

RE: [RFC 09/11] HID: hyperv: Make ringbuffer at least take two pages

2020-07-22 Thread Michael Kelley
From: Boqun Feng Sent: Monday, July 20, 2020 6:42 PM > > When PAGE_SIZE > HV_HYP_PAGE_SIZE, we need the ringbuffer size to be at > least 2 * PAGE_SIZE: one page for the header and at least one page of > the data part (because of the alignment requirement for double mapping). > > So make sure the

RE: [RFC 03/11] Drivers: hv: vmbus: Introduce types of GPADL

2020-07-22 Thread Michael Kelley
From: Boqun Feng Sent: Monday, July 20, 2020 6:41 PM > > This patch introduces two types of GPADL: HV_GPADL_{BUFFER, RING}. The > types of GPADL are purely the concept in the guest, IOW the hypervisor > treat them as the same. > > The reason of introducing the types of GPADL is to support guests

RE: [PATCH v3 0/3] Drivers: hv: vmbus: vmbus_requestor data structure for VMBus hardening

2020-06-30 Thread Michael Kelley
From: Stephen Hemminger Sent: Tuesday, June 30, 2020 10:16 AM > > On Tue, 30 Jun 2020 11:31:57 -0400 > Andres Beltran wrote: > > > Currently, VMbus drivers use pointers into guest memory as request IDs > > for interactions with Hyper-V. To be more robust in the face of errors > > or malicious

RE: [PATCH v2] hv_netvsc: Fix netvsc_start_xmit's return type

2020-04-29 Thread Michael Kelley
From: Nathan Chancellor Sent: Tuesday, April 28, 2020 10:55 AM > > Do note that netvsc_xmit still returns int because netvsc_xmit has a > potential return from netvsc_vf_xmit, which does not return netdev_tx_t > because of the call to dev_queue_xmit. > > I am not sure if that is an oversight th

RE: Hyperv netvsc - regression for 32-PAE kernel

2019-05-02 Thread Michael Kelley
From: Juliana Rodrigueiro Sent: Thursday, May 2, 2019 9:14 AM > > So I got to the following commit: > > commit 6ba34171bcbd10321c6cf554e0c1144d170f9d1a > Author: Michael Kelley > Date: Thu Aug 2 03:08:24 2018 + > > Drivers: hv: vmbus: Remove

RE: [PATCH hyperv-fixes,3/3] Fix hash key value reset after other ops

2019-01-18 Thread Michael Kelley
t/hyperv/netvsc.c | 2 +- > drivers/net/hyperv/netvsc_drv.c | 5 - > drivers/net/hyperv/rndis_filter.c | 9 +++-- > 4 files changed, 19 insertions(+), 7 deletions(-) > Reviewed-by: Michael Kelley

RE: [PATCH hyperv-fixes,2/3] Refactor assignments of struct netvsc_device_info

2019-01-18 Thread Michael Kelley
> drivers/net/hyperv/netvsc_drv.c | 134 > 1 file changed, 85 insertions(+), 49 deletions(-) > Reviewed-by: Michael Kelley

RE: [PATCH hyperv-fixes,1/3] Fix ethtool change hash key error

2019-01-18 Thread Michael Kelley
f RSS indirection table") > Reported-by: Wei Hu > Signed-off-by: Haiyang Zhang > --- > drivers/net/hyperv/rndis_filter.c | 25 +++-- > 1 file changed, 19 insertions(+), 6 deletions(-) > Reviewed-by: Michael Kelley

RE: [Resend Patch 2/3] Netvsc: Use the vmbus functiton to calculate ring buffer percentage

2018-04-13 Thread Michael Kelley (EOSG)
e have defined a function to calculate available ring buffer > percentage to write. > > Use that function and remove netvsc's private version. > > Signed-off-by: Long Li Reviewed-by: Michael Kelley > --- > drivers/net/hyperv/hyperv_net.h | 1 - > drivers/net/hyperv/n

RE: [Resend Patch 3/3] Storvsc: Select channel based on available percentage of ring buffer to write

2018-04-13 Thread Michael Kelley (EOSG)
> -Original Message- > From: linux-kernel-ow...@vger.kernel.org > On Behalf > Of Long Li > Sent: Tuesday, March 27, 2018 5:49 PM > To: KY Srinivasan ; Haiyang Zhang > ; Stephen > Hemminger ; James E . J . Bottomley > ; > Martin K . Petersen ; > de...@linuxdriverproject.org; linux- > s.

RE: [PATCH net-next,1/2] hv_netvsc: Fix the return status in RX path

2018-03-24 Thread Michael Kelley (EOSG)
> -Original Message- > From: linux-kernel-ow...@vger.kernel.org > On Behalf > Of Haiyang Zhang > Sent: Thursday, March 22, 2018 12:01 PM > To: da...@davemloft.net; netdev@vger.kernel.org > Cc: Haiyang Zhang ; KY Srinivasan > ; Stephen > Hemminger ; o...@aepfle.de; vkuzn...@redhat.com; >

[PATCH net-next 1/1] netvsc: Add #include's for csum_* function declarations

2017-05-30 Thread Michael Kelley
Add direct #include statements for declarations of csum_tcpudp_magic() and csum_ipv6_magic(). While the needed #include's are picked up indirectly for the x86 architecture, they aren't on other architectures, resulting in compile errors. Signed-off-by: Michael Kelley --- drivers/