[Patch v2] Storvsc: Select channel based on available percentage of ring buffer to write

2018-04-19 Thread Long Li
From: Long Li <lon...@microsoft.com> This is a best effort for estimating on how busy the ring buffer is for that channel, based on available buffer to write in percentage. It is still possible that at the time of actual ring buffer write, the space may not be available due to other process

RE: [PATCH v2] storvsc: Set up correct queue depth values for IDE devices

2018-04-18 Thread Long Li
> Subject: Re: [PATCH v2] storvsc: Set up correct queue depth values for IDE > devices > > > Long, > > > Can you take a look at the following patch? > > >> > + max_sub_channels = > >> > +(num_cpus - 1) / storvsc_vcpus_per_sub_channel; > > What happens if num_cpus = 1? If

RE: [PATCH v2] storvsc: Set up correct queue depth values for IDE devices

2018-04-18 Thread Long Li
Hi Martin Can you take a look at the following patch? Long > > -Original Message- > > From: linux-kernel-ow...@vger.kernel.org > > <linux-kernel-ow...@vger.kernel.org> On Behalf Of Long Li > > Sent: Thursday, March 22, 2018 2:47 PM > > To: KY Srin

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

2018-04-13 Thread Long Li
> Subject: RE: [Resend Patch 3/3] Storvsc: Select channel based on available > percentage of ring buffer to write > > > -Original Message- > > From: linux-kernel-ow...@vger.kernel.org > > <linux-kernel-ow...@vger.kernel.org> On Behalf Of Long Li > >

RE: [Resend Patch 1/3] Vmbus: Add function to report available ring buffer to write in total ring size percentage

2018-03-28 Thread Long Li
> Subject: Re: [Resend Patch 1/3] Vmbus: Add function to report available ring > buffer to write in total ring size percentage > > > Long, > > > Netvsc has a function to calculate how much ring buffer in percentage > > is available to write. This function is also useful for storvsc and > >

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

2018-03-27 Thread Long Li
From: Long Li <lon...@microsoft.com> In Vmbus, we 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 <lon...@microsoft.com> --- drivers/net/hyperv/hyperv_net.h | 1 - driver

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

2018-03-27 Thread Long Li
From: Long Li <lon...@microsoft.com> This is a best effort for estimating on how busy the ring buffer is for that channel, based on available buffer to write in percentage. It is still possible that at the time of actual ring buffer write, the space may not be available due to other process

[Resend Patch 1/3] Vmbus: Add function to report available ring buffer to write in total ring size percentage

2018-03-27 Thread Long Li
From: Long Li <lon...@microsoft.com> Netvsc has a function to calculate how much ring buffer in percentage is available to write. This function is also useful for storvsc and other vmbus devices. Define a similar function in vmbus to be used by other vmbus devices. Signed-off-by: Long L

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

2018-03-23 Thread Long Li
> Subject: RE: [PATCH 2/3] Netvsc: Use the vmbus functiton to calculate ring > buffer percentage > > > > > -Original Message- > > From: Haiyang Zhang > > Sent: Friday, March 23, 2018 8:01 AM > > To: Long Li <lon...@linuxonhyperv.com>; KY

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

2018-03-22 Thread Long Li
From: Long Li <lon...@microsoft.com> This is a best effort for estimating on how busy the ring buffer is for that channel, based on available buffer to write in percentage. It is still possible that at the time of actual ring buffer write, the space may not be available due to other process

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

2018-03-22 Thread Long Li
From: Long Li <lon...@microsoft.com> In Vmbus, we have defined a function to calculate available ring buffer percentage to write. Use that function and remove duplicate netvsc code. Signed-off-by: Long Li <lon...@microsoft.com> --- drivers/net/hyperv/netvs

[PATCH 1/3] Vmbus: Add function to report available ring buffer to write in total ring size percentage

2018-03-22 Thread Long Li
From: Long Li <lon...@microsoft.com> Netvsc has a similar function to calculate how much ring buffer in percentage is available to write. This function is useful for storvsc and other vmbus devices. Define a similar function in vmbus to be used by storvsc. Signed-off-by: Long L

[PATCH v2] storvsc: Set up correct queue depth values for IDE devices

2018-03-22 Thread Long Li
From: Long Li <lon...@microsoft.com> Unlike SCSI and FC, we don't use multiple channels for IDE. Also fix the calculation for sub-channels. Change log: v2: Addressed comment on incorrect number of sub-channels. (Michael Kelley <michael.h.kel...@microsoft.com>) Signed-off-by:

RE: [PATCH] storvsc: Set up correct queue depth values for IDE devices

2018-03-16 Thread Long Li
> > Subject: [PATCH] storvsc: Set up correct queue depth values for IDE > > devices > > > > From: Long Li <lon...@microsoft.com> > > > > Unlike SCSI and FC, we don't use multiple channels for IDE. So set > > queue depth correctly for IDE. > >

[PATCH] storvsc: Set up correct queue depth values for IDE devices

2018-03-15 Thread Long Li
From: Long Li <lon...@microsoft.com> Unlike SCSI and FC, we don't use multiple channels for IDE. So set queue depth correctly for IDE. Also set the correct cmd_per_lun for all devices. Signed-off-by: Long Li <lon...@microsoft.com> --- drivers/scsi/storvsc_drv.c | 8 ++-- 1 fil

[PATCH] scsi: storvsc: missing error code in storvsc_probe()

2018-02-08 Thread Long Li
From: Long Li <lon...@microsoft.com> This patch backports upstream commit ca8dc694045e9aa248e9916e0f614deb0494cb3d for 4.14-stable. commit ca8dc694045e9aa248e9916e0f614deb0494cb3d: We should set the error code if fc_remote_port_add() fails. Cc: <sta...@vger.kernel.org> #

RE: [PATCH 1/1] scsi: storvsc: Spread interrupts when picking a channel for I/O requests

2018-01-31 Thread Long Li
> Subject: RE: [PATCH 1/1] scsi: storvsc: Spread interrupts when picking a > channel for I/O requests > > > From: Long Li > > Sent: Wednesday, January 31, 2018 12:23 PM > > To: Michael Kelley (EOSG) <michael.h.kel...@microsoft.com>; KY > > Srinivasan

RE: [PATCH 1/1] scsi: storvsc: Spread interrupts when picking a channel for I/O requests

2018-01-31 Thread Long Li
> Subject: RE: [PATCH 1/1] scsi: storvsc: Spread interrupts when picking a > channel for I/O requests > > Updated/corrected two email addresses ... > > > -Original Message- > > From: Michael Kelley (EOSG) > > Sent: Wednesday, January 24, 2018 2:14 PM > > To: KY Srinivasan

[PATCH v2] storvsc: do not assume SG list is continuous when doing bounce buffers (for 4.1 and prior stable kernels)

2018-01-10 Thread Long Li
From: Long Li <lon...@microsoft.com> The original patch was made for stable 4.1 and was Acked on 08/22/2017, but for some reason it never made it to the stable tree. Change from v1: Changed comment that this patch is for linux-stable 4.1 and all prior stable kernels. storvsc checks the S

RE: [PATCH] storvsc: do not assume SG list is continuous when doing bounce buffers (for 4.1 stable only)

2018-01-09 Thread Long Li
> Christoph, > > > Ok. If the stable maintainers are ok with your small fix I'm not > > going to complain too loudly. But I'm always worried about stable > > trees divering too much from mainline. > > The seemingly innocuous transition from SG_GAPS to virt boundary has > caused several data

RE: [PATCH] storvsc: Avoid excessive host scan on controller change

2017-11-06 Thread Long Li
> From: Martin K. Petersen [mailto:martin.peter...@oracle.com] > Sent: Monday, November 6, 2017 7:40 PM > To: Long Li <lon...@microsoft.com> > Cc: KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>; Stephen Hemminger > <sthem...@

RE: [PATCH v2] hv: kvp: Avoid reading past allocated blocks from KVP file

2017-11-01 Thread Long Li
> -Original Message- > From: Greg KH [mailto:g...@kroah.com] > Sent: Wednesday, November 1, 2017 11:54 AM > To: Long Li <lon...@microsoft.com> > Cc: KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>; Stephen Hemm

[Revised PATCH v2] hv: kvp: Avoid reading past allocated blocks from KVP file

2017-11-01 Thread Long Li
ed-off-by. Signed-off-by: Paul Meyer <paul.me...@microsoft.com> Signed-off-by: Long Li <lon...@microsoft.com> --- tools/hv/hv_kvp_daemon.c | 66 1 file changed, 10 insertions(+), 56 deletions(-) diff --git a/tools/hv/hv_kvp_daemon.c b/tools/

RE: [PATCH v2] hv: kvp: Avoid reading past allocated blocks from KVP file

2017-11-01 Thread Long Li
> From: Greg KH [mailto:g...@kroah.com] > Sent: Tuesday, October 31, 2017 11:50 PM > To: Long Li <lon...@microsoft.com> > Cc: KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>; Stephen Hemminger > <sthem...@microsoft.com>;

[PATCH] storvsc: Avoid excessive host scan on controller change

2017-10-31 Thread Long Li
From: Long Li <lon...@microsoft.com> When there are multiple disks attached to the same SCSI controller, the host may send several VSTOR_OPERATION_REMOVE_DEVICE or VSTOR_OPERATION_ENUMERATE_BUS messages in a row, to indicate there is a change on the SCSI controller. In response, storvsc r

RE: [PATCH] hv: kvp: Avoid reading past allocated blocks from KVP file

2017-10-31 Thread Long Li
t a v2. > > Signed-off-by: Paul Meyer <paul.me...@microsoft.com> > Reviewed-by: Long Li <lon...@microsoft.com> > --- > tools/hv/hv_kvp_daemon.c | 66 > > 1 file changed, 10 insertions(+), 56 deletions(-) > >

[PATCH v2] hv: kvp: Avoid reading past allocated blocks from KVP file

2017-10-31 Thread Long Li
reads more than one block over the previous capacity (e.g. reading more than 100 KVP records whereas the in-memory database was empty before). Fix this by reading the correct number of KVP records from file each time. Signed-off-by: Paul Meyer <paul.me...@microsoft.com> Signed-off-by:

RE: [PATCH] hv: kvp: Avoid reading past allocated blocks from KVP file

2017-10-31 Thread Long Li
> On Tue, Oct 31, 2017 at 06:10:00PM +0000, Long Li wrote: > > > From: Greg KH [mailto:gre...@linuxfoundation.org] > > > Sent: Tuesday, October 31, 2017 1:43 AM > > > To: Long Li <lon...@microsoft.com> > > > Cc: KY Srinivasan <k...@microsoft.c

[PATCH] hv: kvp: Avoid reading past allocated blocks from KVP file

2017-10-31 Thread Long Li
reads more than one block over the previous capacity (e.g. reading more than 100 KVP records whereas the in-memory database was empty before). Fix this by reading the correct number of KVP records from file each time. Signed-off-by: Paul Meyer <paul.me...@microsoft.com> Reviewed-by:

RE: [PATCH] hv: kvp: Avoid reading past allocated blocks from KVP file

2017-10-31 Thread Long Li
> From: Greg KH [mailto:gre...@linuxfoundation.org] > Sent: Tuesday, October 31, 2017 1:43 AM > To: Long Li <lon...@microsoft.com> > Cc: KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>; Stephen Hemminger <sthem...@microsoft.com>

[PATCH] hv: kvp: Avoid reading past allocated blocks from KVP file

2017-10-30 Thread Long Li
From: Paul Meyer While reading in more than one block (50) of KVP records, the allocation goes per block, but the reads used the total number of allocated records (without resetting the pointer/stream). This causes the records buffer to overrun when the refresh reads

RE: [PATCH V2] scsi: storvsc: Allow only one remove lun work item to be issued per lun

2017-10-19 Thread Long Li
n't need > the separate allocation. > > But I'm not sure if Tejun is fine with using __WQ_LEGACY directly.. > > Except for this nit this looks fine to me: > > Reviewed-by: Christoph Hellwig <h...@lst.de> The work storvsc_host_scan (scheduled from function storvsc_on_rece

RE: [PATCH] storvsc: fix memory leak on ring buffer busy

2017-08-30 Thread Long Li
> Long, > > >> Which kernel version is this patch aimed at? > > > > Martin, thanks for pointing this out. This should also go to stable > > trees. > > The reason I asked is that it didn't apply to neither fixes, nor for-next. > > I applied it to 4.13/scsi-fixes by hand and added a stable tag.

RE: [PATCH] storvsc: fix memory leak on ring buffer busy

2017-08-29 Thread Long Li
> -Original Message- > From: Martin K. Petersen [mailto:martin.peter...@oracle.com] > Sent: Tuesday, August 29, 2017 6:31 PM > To: Long Li <lon...@microsoft.com> > Cc: KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>

[PATCH] storvsc: fix memory leak on ring buffer busy

2017-08-28 Thread Long Li
From: Long Li <lon...@microsoft.com> When storvsc is sending I/O to Hyper-v, it may allocate a bigger buffer descriptor for large data payload that can't fit into a pre-allocated buffer descriptor. This bigger buffer is freed on return path. If I/O request to Hyper-v fails due to ring

RE: [PATCH] storvsc: do not assume SG list is continuous when doing bounce buffers (for 4.1 stable only)

2017-08-22 Thread Long Li
> Wouldn't it make sense to backport the changes to set the virt_boundary > (which probably still is the SG_GAPS flag in such an old kernel)? We can make storvsc use SG_GAPS. But the following patch is missing in 4.1 stable block layer to make this work on some I/O situations. Backporting is

[PATCH] storvsc: do not assume SG list is continuous when doing bounce buffers (for 4.1 stable only)

2017-08-21 Thread Long Li
From: Long Li <lon...@microsoft.com> This patch is for linux-stable 4.1 branch only. storvsc checks the SG list for gaps before passing them to Hyper-v device. If there are gaps, data is copied to a bounce buffer and a continuous data buffer is passed to Hyper-V. The check on gaps assu

RE: [REGRESSION][Stable][v3.12.y][v4.4.y][v4.9.y][v4.10.y][v4.11-rc1] scsi: storvsc: properly set residual data length on errors

2017-04-03 Thread Long Li
> > > -Original Message- > > From: Joseph Salisbury [mailto:joseph.salisb...@canonical.com] > > Sent: Tuesday, March 28, 2017 7:29 AM > > To: Stephen Hemminger <sthem...@microsoft.com>; Long Li > > <lon...@microsoft.com> > > Cc: KY Srinivasa

RE: [PATCH 2/2] pci-hyperv: Fix an atomic bug

2017-03-27 Thread Long Li
omic bug > > From: K. Y. Srinivasan <k...@microsoft.com> > > The memory allocation here needs to be non-blocking. > Fix the issue. > > Signed-off-by: K. Y. Srinivasan <k...@microsoft.com> > Cc: <sta...@vger.kernel.org> Reviewed-by: Long Li <lon...@mi

RE: [PATCH 1/2] pci-hyperv: Fix a bug in specifying CPU affinity

2017-03-27 Thread Long Li
in specifying CPU affinity > > From: K. Y. Srinivasan <k...@microsoft.com> > > When we have 32 or more CPUs in the affinity mask, we should use a special > constant to specify that to the host. Fix this issue. > > Signed-off-by: K. Y. Srinivasan <k...@mic

[PATCH v3] HV: properly delay KVP packets when negotiation is in progress

2017-03-24 Thread Long Li
From: Long Li <lon...@microsoft.com> The host may send multiple negotiation packets (due to timeout) before the KVP user-mode daemon is connected. We need to defer processing those packets until the daemon is negotiated and connected. It's okay for guest to respond to all negotiation p

[PATCH v3] HV: properly delay KVP packets when negotiation is in progress

2017-03-24 Thread Long Li
From: Long Li <lon...@microsoft.com> The host may send multiple negotiation packets (due to timeout) before the KVP user-mode daemon is connected. We need to defer processing those packets until the daemon is negotiated and connected. It's okay for guest to respond to all negotiation p

[PATCH 2/2 v5] pci-hyperv: lock pci bus on device eject

2017-03-23 Thread Long Li
From: Long Li <lon...@microsoft.com> A PCI_EJECT message can arrive at the same time we are calling pci_scan_child_bus in the workqueue for the previous PCI_BUS_RELATIONS message or in create_root_hv_pci_bus(), in this case we could potentially modify the bus from multiple places. Properl

[PATCH 1/2 v5] pci-hyperv: properly handle pci bus remove

2017-03-23 Thread Long Li
From: Long Li <lon...@microsoft.com> hv_pci_devices_present is called in hv_pci_remove when we remove a PCI device from host (e.g. by disabling SRIOV on a device). In hv_pci_remove, the bus is already removed before the call, so we don't need to rescan the bus in the workqueue schedule

[Please ignore this is a test] pci-hyperv: properly handle pci bus remove

2017-03-23 Thread Long Li
From: Long Li <lon...@microsoft.com> hv_pci_devices_present is called in hv_pci_remove when we remove a PCI device from host (e.g. by disabling SRIOV on a device). In hv_pci_remove, the bus is already removed before the call, so we don't need to rescan the bus in the workqueue schedule

RE: [PATCH v2] HV: properly delay KVP packets when negotiation is in progress

2017-03-23 Thread Long Li
> -Original Message- > From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] > Sent: Thursday, March 23, 2017 9:04 AM > To: Long Li <lon...@microsoft.com> > Cc: KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>; Stephen Hemm

RE: [PATCH 1/2 v4] pci-hyperv: properly handle pci bus remove

2017-03-22 Thread Long Li
> -Original Message- > From: Bjorn Helgaas [mailto:helg...@kernel.org] > Sent: Thursday, March 16, 2017 1:07 PM > To: Long Li <lon...@microsoft.com> > Cc: KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>; Bjorn

[PATCH v2] HV: properly delay KVP packets when negotiation is in progress

2017-03-22 Thread Long Li
<vkuzn...@redhat.com>. Signed-off-by: Long Li <lon...@microsoft.com> --- drivers/hv/hv_kvp.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c index de26371..845b70b 100644 --- a/drivers/hv/hv_kvp.c +++ b/d

RE: [PATCH] HV: properly delay KVP packets when negotiation is in progress

2017-03-20 Thread Long Li
> -Original Message- > From: Long Li > Sent: Sunday, March 19, 2017 7:49 PM > To: 'Vitaly Kuznetsov' <vkuzn...@redhat.com> > Cc: KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>; Stephen Hemminger > <sthem...@microsoft

RE: [PATCH] HV: properly delay KVP packets when negotiation is in progress

2017-03-19 Thread Long Li
> -Original Message- > From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] > Sent: Friday, March 17, 2017 9:16 AM > To: Long Li <lon...@microsoft.com> > Cc: KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>; Stephen Hemm

RE: [PATCH 1/2 v4] pci-hyperv: properly handle pci bus remove

2017-03-16 Thread Long Li
> -Original Message- > From: Bjorn Helgaas [mailto:helg...@kernel.org] > Sent: Thursday, March 16, 2017 1:07 PM > To: Long Li <lon...@microsoft.com> > Cc: KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>; Bjorn

[PATCH] HV: properly delay KVP packets when negotiation is in progress

2017-03-16 Thread Long Li
The host may send multiple KVP packets before the negotiation with daemon is finished. We need to keep those packets in ring buffer until the daemon is negotiated and connected. This patch is based on the work of Nick Meier <nick.me...@microsoft.com> Signed-off-by: Long Li <lon...@micr

[PATCH 2/2 v4] pci-hyperv: lock pci bus on device eject

2017-02-27 Thread Long Li
<de...@microsoft.com> for pointing out the race condition in create_root_hv_pci_bus(). Signed-off-by: Long Li <lon...@microsoft.com> Reported-by: Xiaofeng Wang <xiaof...@redhat.com> Acked-by: K. Y. Srinivasan <k...@microsoft.com> --- drivers/pci/host/pci-hyperv.c | 4

[PATCH 1/2 v4] pci-hyperv: properly handle pci bus remove

2017-02-27 Thread Long Li
status hv_pcibus_removed, we can avoid this situation. Signed-off-by: Long Li <lon...@microsoft.com> Reported-by: Xiaofeng Wang <xiaof...@redhat.com> Acked-by: K. Y. Srinivasan <k...@microsoft.com> --- drivers/pci/host/pci-hyperv.c | 20 +--- 1 file changed, 1

RE: [Resend PATCH 2/2 v3] pci-hyperv: lock pci bus on device eject

2017-02-27 Thread Long Li
Ok, I will resend. > -Original Message- > From: Greg KH [mailto:g...@kroah.com] > Sent: Saturday, February 25, 2017 12:02 AM > To: Long Li <lon...@microsoft.com> > Cc: KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>; Bjorn

[Resend PATCH 2/2 v3] pci-hyperv: lock pci bus on device eject

2017-02-24 Thread Long Li
<de...@microsoft.com> for pointing out the race condition in create_root_hv_pci_bus(). Signed-off-by: Long Li <lon...@microsoft.com> Reported-by: Xiaofeng Wang <xiaof...@redhat.com> Acked-by: K. Y. Srinivasan <k...@microsoft.com> --- drivers/pci/host/pci-hyperv.c | 4

[Resend PATCH 1/2 v3] pci-hyperv: properly handle pci bus remove

2017-02-24 Thread Long Li
status hv_pcibus_removed, we can avoid this situation. Signed-off-by: Long Li <lon...@microsoft.com> Reported-by: Xiaofeng Wang <xiaof...@redhat.com> Acked-by: K. Y. Srinivasan <k...@microsoft.com> --- drivers/pci/host/pci-hyperv.c | 20 +--- 1 file changed, 1

RE: [Resend PATCH 1/2 v3] pci-hyperv: properly handle pci bus remove

2017-02-13 Thread Long Li
> -Original Message- > From: Bjorn Helgaas [mailto:bhelg...@google.com] > Sent: Saturday, February 11, 2017 9:35 AM > To: Long Li <lon...@microsoft.com> > Cc: KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>; de..

RE: [Resend PATCH 1/2 v3] pci-hyperv: properly handle pci bus remove

2017-02-10 Thread Long Li
> Sent: Friday, January 27, 2017 10:42 AM > To: Long Li <lon...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>; Bjorn Helgaas <bhelg...@google.com> > Cc: de...@linuxdriverproject.org; linux-...@vger.kernel.org; linux- > ker...@vger.kernel.org; Long Li <lo

RE: [PATCH] hv: use substraction to update ring buffer index

2017-01-20 Thread Long Li
> -Original Message- > From: Dexuan Cui > Sent: Sunday, January 15, 2017 7:12 PM > To: Long Li <lon...@microsoft.com>; KY Srinivasan <k...@microsoft.com>; > Haiyang Zhang <haiya...@microsoft.com> > Cc: de...@linuxdriverproject.org; linux-ker...@vger.

RE: [PATCH 2/2 v3] pci-hyperv: lock pci bus on device eject

2017-01-09 Thread Long Li
Hi Bjorn, The patch is still pending (along with 1/2 v3). Please let me know if you want me to resend the two patches. Thanks Long > -Original Message- > From: KY Srinivasan > Sent: Tuesday, October 4, 2016 1:49 PM > To: Long Li <lon...@microsoft.com>; Haiy

RE: [PATCH 1/2 v3] pci-hyperv: properly handle pci bus remove

2017-01-09 Thread Long Li
Hi Bjorn This patch is still pending. The patch has been ack'ed. Do you want me to resend this patch? Thanks Long > -Original Message- > From: KY Srinivasan > Sent: Friday, November 11, 2016 2:21 PM > To: Bjorn Helgaas <helg...@kernel.org>; Long Li <lon...@microso

RE: [PATCH v2] hv: retry infinitely on hypercall transient failures

2017-01-07 Thread Long Li
> -Original Message- > From: Greg KH [mailto:g...@kroah.com] > Sent: Friday, January 06, 2017 11:43 PM > To: Long Li <lon...@microsoft.com> > Cc: KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>; de...@linuxdriverproject.

RE: [PATCH v2] hv: retry infinitely on hypercall transient failures

2017-01-06 Thread Long Li
> -Original Message- > From: Greg KH [mailto:g...@kroah.com] > Sent: Wednesday, January 04, 2017 11:48 PM > To: Long Li <lon...@microsoft.com> > Cc: KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>; de...@linuxdriverproject.

RE: [PATCH] hv: use substraction to update ring buffer index

2017-01-06 Thread Long Li
> -Original Message- > From: Dan Carpenter [mailto:dan.carpen...@oracle.com] > Sent: Thursday, January 05, 2017 3:40 AM > To: Long Li <lon...@microsoft.com> > Cc: KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>; de...@

[PATCH] hv: use substraction to update ring buffer index

2017-01-04 Thread Long Li
From: Long Li <lon...@microsoft.com> The ring buffer code uses %= to calculate index. For x86/64, %= compiles to div, more than 10 times slower than sub. Replace div with sub for this data heavy code path. Signed-off-by: Long Li <lon...@microsoft.com> --- drivers/hv/ring_

[PATCH v2] hv: retry infinitely on hypercall transient failures

2017-01-04 Thread Long Li
From: Long Li <lon...@microsoft.com> Hyper-v host guarantees that a hypercall will finish in reasonable time. Retry infinitely on transient failures to avoid returning error to upper layer. Signed-off-by: Long Li <lon...@microsoft.com> --- drivers/hv/conne

RE: [PATCH] Retry infinitely for hypercall

2017-01-04 Thread Long Li
> -Original Message- > From: Dan Carpenter [mailto:dan.carpen...@oracle.com] > Sent: Wednesday, January 4, 2017 1:48 PM > To: Long Li <lon...@microsoft.com> > Cc: KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>; de...@

RE: [PATCH] Retry infinitely for hypercall

2017-01-04 Thread Long Li
> -Original Message- > From: Greg KH [mailto:g...@kroah.com] > Sent: Wednesday, January 4, 2017 12:51 PM > To: Long Li <lon...@microsoft.com> > Cc: KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>; de...@linuxdriverproject.

[PATCH] Retry infinitely for hypercall

2017-01-04 Thread Long Li
From: Long Li <lon...@microsoft.com> Hyper-v host guarantees that a hypercall will succeed. Retry infinitely to avoid returning transient failures to upper layer. Signed-off-by: Long Li <lon...@microsoft.com> --- drivers/hv/connection.c | 17 - 1 file changed,

RE: [PATCH] pci-hyperv: use kmalloc to allocate hypercall params buffer

2016-12-05 Thread Long Li
> -Original Message- > From: Stephen Hemminger [mailto:step...@networkplumber.org] > Sent: Monday, December 5, 2016 8:53 AM > To: Long Li <lon...@microsoft.com> > Cc: KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>; Bjorn

RE: [PATCH] pci-hyperv: use kmalloc to allocate hypercall params buffer

2016-12-05 Thread Long Li
> -Original Message- > From: KY Srinivasan > Sent: Monday, December 5, 2016 1:23 PM > To: Cathy Avery <cav...@redhat.com>; Bjorn Helgaas > <helg...@kernel.org>; Long Li <lon...@microsoft.com> > Cc: de...@linuxdriverproject.org > Subject: RE: [PAT

RE: [Resend] [PATCH] pci-hyperv: use kmalloc to allocate hypercall params buffer

2016-11-08 Thread Long Li
> -Original Message- > From: devel [mailto:driverdev-devel-boun...@linuxdriverproject.org] On > Behalf Of Long Li > Sent: Tuesday, November 8, 2016 8:57 AM > To: Greg KH <gre...@linuxfoundation.org> > Cc: linux-...@vger.kernel.org; Haiyang Zhang <haiya...@

[PATCH] pci-hyperv: use kmalloc to allocate hypercall params buffer

2016-11-08 Thread Long Li
From: Long Li <lon...@microsoft.com> hv_do_hypercall assumes that we pass a segment from a physically continuous buffer. Buffer allocated on the stack may not work if CONFIG_VMAP_STACK=y is set. Change to use kmalloc to allocate this buffer. The v2 patch adds locking to access the pre-all

RE: [Resend] [PATCH] pci-hyperv: use kmalloc to allocate hypercall params buffer

2016-11-08 Thread Long Li
> -Original Message- > From: Greg KH [mailto:gre...@linuxfoundation.org] > Sent: Monday, November 7, 2016 11:00 PM > To: Long Li <lon...@microsoft.com> > Cc: KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>; Bjorn

[Resend] [PATCH] pci-hyperv: use kmalloc to allocate hypercall params buffer

2016-11-07 Thread Long Li
From: Long Li <lon...@microsoft.com> hv_do_hypercall assumes that we pass a segment from a physically continuous buffer. Buffer allocated on the stack may not work if CONFIG_VMAP_STACK=y is set. Use kmalloc to allocate this buffer. Signed-off-by: Long Li <lon...@microsoft.com&

[PATCH] pci-hyperv: move hypercall buffer from stack to heap

2016-11-01 Thread Long Li
From: Long Li <lon...@microsoft.com> We need to pass a segment from a physically continuous buffer to hv_do_hypercall. Buffer allocated on the stack may not work if CONFIG_VMAP_STACK=y is set. Moving the params buffer from stack to buffer returned by kmalloc. Signed-off-by: Long L

[PATCH 2/2 v3] pci-hyperv: lock pci bus on device eject

2016-10-03 Thread Long Li
From: Long Li <lon...@microsoft.com> A PCI_EJECT message can arrive at the same time we are calling pci_scan_child_bus in the workqueue for the previous PCI_BUS_RELATIONS message or in create_root_hv_pci_bus(), in this case we could potentailly modify the bus from multiple places. Pr

[PATCH 1/2 v3] pci-hyperv: properly handle pci bus remove

2016-10-03 Thread Long Li
From: Long Li <lon...@microsoft.com> hv_pci_devices_present is called in hv_pci_remove when we remove a PCI device from host (e.g. by disabling SRIOV on a device). In hv_pci_remove, the bus is already removed before the call, so we don't need to rescan the bus in the workqueue schedule

RE: [PATCH] hv: do not lose pending heartbeat vmbus packets

2016-09-30 Thread Long Li
> -Original Message- > From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] > Sent: Thursday, September 29, 2016 2:22 AM > To: KY Srinivasan <k...@microsoft.com>; Long Li <lon...@microsoft.com> > Cc: Haiyang Zhang <haiya...@microsoft.com>; > de.

RE: [PATCH 1/2 v2] pci-hyperv: properly handle pci bus remove

2016-09-27 Thread Long Li
> -Original Message- > From: Bjorn Helgaas [mailto:helg...@kernel.org] > Sent: Tuesday, September 27, 2016 12:30 PM > To: Long Li <lon...@microsoft.com> > Cc: KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>; Bjorn

RE: [PATCH 1/2 v2] pci-hyperv: properly handle pci bus remove

2016-09-27 Thread Long Li
2016 4:59 AM > To: driverdev-devel@linuxdriverproject.org > Subject: Re: [PATCH 1/2 v2] pci-hyperv: properly handle pci bus remove > > Hi, > > You seem to be missing the Reported-by tag. > > That's xiaof...@redhat.com. > > Cathy > > On 09/14/2016

[PATCH 2/2 v2] pci-hyperv: lock pci bus on device eject

2016-09-14 Thread Long Li
From: Long Li <lon...@microsoft.com> A PCI_EJECT message can arrive at the same time we are calling pci_scan_child_bus in the workqueue for the previous PCI_BUS_RELATIONS message or in create_root_hv_pci_bus(), in this case we could potentailly modify the bus from multiple places. Pr

[PATCH 1/2 v2] pci-hyperv: properly handle pci bus remove

2016-09-14 Thread Long Li
From: Long Li <lon...@microsoft.com> hv_pci_devices_present is called in hv_pci_remove when we remove a PCI device from host (e.g. by disabling SRIOV on a device). In hv_pci_remove, the bus is already removed before the call, so we don't need to rescan the bus in the workqueue schedule

RE: [PATCH 2/2] pci-hyperv: properly handle device eject

2016-09-14 Thread Long Li
> -Original Message- > From: Dexuan Cui > Sent: Tuesday, September 13, 2016 10:45 PM > To: Long Li <lon...@microsoft.com>; KY Srinivasan <k...@microsoft.com>; > Haiyang Zhang <haiya...@microsoft.com>; Bjorn Helgaas > <bhelg...@google.com> >

RE: [PATCH 2/2] pci-hyperv: properly handle device eject

2016-09-13 Thread Long Li
> -Original Message- > From: devel [mailto:driverdev-devel-boun...@linuxdriverproject.org] On > Behalf Of Long Li > Sent: Tuesday, September 13, 2016 10:33 AM > To: Dexuan Cui <de...@microsoft.com>; KY Srinivasan > <k...@microsoft.com>; Haiyang Zhang &

RE: [PATCH 2/2] pci-hyperv: properly handle device eject

2016-09-13 Thread Long Li
> -Original Message- > From: Dexuan Cui > Sent: Tuesday, September 13, 2016 2:51 AM > To: Long Li <lon...@microsoft.com>; KY Srinivasan <k...@microsoft.com>; > Haiyang Zhang <haiya...@microsoft.com>; Bjorn Helgaas > <bhelg...@google.com> >

[PATCH] hv: do not lose pending heartbeat vmbus packets

2016-09-12 Thread Long Li
From: Long Li <lon...@microsoft.com> The host keeps sending heartbeat packets independent of guest responding to them. In some situations, there might be multiple heartbeat packets pending in the ring buffer. Don't lose them, read them all. Signed-off-by: Long Li <lon...@micr

[PATCH 2/2] pci-hyperv: properly handle device eject

2016-09-12 Thread Long Li
From: Long Li <lon...@microsoft.com> A PCI_EJECT message can arrive at the same time we are calling pci_scan_child_bus in the workqueue for the previous PCI_BUS_RELATIONS message, in this case we could potentailly modify the bus from two places. Properly lock the bus access. Sign

[PATCH 1/2] pci-hyperv: properly handle pci bus remove

2016-09-12 Thread Long Li
From: Long Li <lon...@microsoft.com> hv_pci_devices_present is called in hv_pci_remove when we remove a PCI device from host (e.g. by disabling SRIOV on a device). In hv_pci_remove, the bus is already removed before the call, so we don't need to rescan the bus in the workqueue schedule

RE: [PATCH 1/3] storvsc: use tagged SRB requests if supported by the device

2016-09-07 Thread Long Li
> -Original Message- > From: Johannes Thumshirn [mailto:jthumsh...@suse.de] > Sent: Wednesday, September 7, 2016 12:47 AM > To: Long Li <lon...@exchange.microsoft.com> > Cc: KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsof

[PATCH 0/3] storvsc: fixes issues on Fiber Channel

2016-09-06 Thread Long Li
From: Long Li <lon...@microsoft.com> This patch set fixes connectivity issues and improves performance for Fiber Channel disks. Long Li (3): Use tagged SRB requests if supported by the device Properly handle SRB_ERROR when sense message is present Use block layer default segmen

[PATCH 3/3] storvsc: use block layer default segment size

2016-09-06 Thread Long Li
From: Long Li <lon...@microsoft.com> We no long have the restriction of page size limit in the SG list. Remove it. The driver can properly handle default block segment size. --- drivers/scsi/storvsc_drv.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/scsi/storvsc_d

[PATCH 2/3] storvsc: properly handle SRB_ERROR when sense message is present

2016-09-06 Thread Long Li
From: Long Li <lon...@microsoft.com> When sense message is present on error, we should pass along to the upper layer to decide how to deal with the error. This patch fixes connectivity issues with Fiber Channel devices. --- drivers/scsi/storvsc_drv.c | 3 +++ 1 file changed, 3 inse

[PATCH 1/3] storvsc: use tagged SRB requests if supported by the device

2016-09-06 Thread Long Li
From: Long Li <lon...@microsoft.com> Properly set SRB flags when hosting device supports tagged queuing. This patch improves the performance on Fiber Channel disks. --- drivers/scsi/storvsc_drv.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/scsi/storvsc_drv.c b/d

RE: [PATCH] storvsc: add more logging for error and warning messages

2015-12-04 Thread Long Li
> -Original Message- > From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] > Sent: Friday, December 4, 2015 1:53 AM > To: Long Li <lon...@microsoft.com> > Cc: KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>; James E.J. B

[PATCH v2] storvsc: add logging for error/warning messages

2015-12-03 Thread Long Li
Introduce a logging level for storvsc to log certain error/warning messages. Those messages are helpful in some environments, e.g. Microsoft Azure, for customer support and troubleshooting purposes. Signed-off-by: Long Li <lon...@microsoft.com> --- drivers/scsi/storvsc_drv.

[PATCH] storvsc: add more logging for error and warning messages

2015-12-03 Thread Long Li
Introduce a logging level for storvsc to log certain error/warning messages. Those messages are helpful in some environments, e.g. Microsoft Azure, for customer support and troubleshooting purposes. Signed-off-by: Long Li <lon...@microsoft.com> --- drivers/scsi/storvsc_drv.

RE: [PATCH] storvsc: add more logging for error and warning messages

2015-12-03 Thread Long Li
Thanks Joe. I'll send out another patch. > -Original Message- > From: Joe Perches [mailto:j...@perches.com] > Sent: Thursday, December 3, 2015 6:28 PM > To: Long Li <lon...@microsoft.com>; KY Srinivasan <k...@microsoft.com>; > Haiyang Zhang <haiya...@micros

RE: [PATCH] scsi: storvsc: use shost_for_each_device() instead of open coding

2015-07-03 Thread Long Li
-Original Message- From: KY Srinivasan Sent: Friday, July 03, 2015 11:35 AM To: Vitaly Kuznetsov; linux-s...@vger.kernel.org Cc: Long Li; Haiyang Zhang; James E.J. Bottomley; de...@linuxdriverproject.org; linux-ker...@vger.kernel.org Subject: RE: [PATCH] scsi: storvsc: use

  1   2   >