[PATCH v2] IB/mlx5: avoid excessive warning msgs when creating VFs on 2nd port

2018-07-23 Thread Qing Huang
traversing mlx5_ib_dev_list, mlx5_ib_add_slave_port() repeatedly attempts to bind the new mpi structure to every device on the list until it finds an unbound device. Change the log level from warn to dbg to avoid log flooding as the warning should be harmless. Signed-off-by: Qing Huang --- v1 -&g

[PATCH v2] IB/mlx5: avoid excessive warning msgs when creating VFs on 2nd port

2018-07-23 Thread Qing Huang
traversing mlx5_ib_dev_list, mlx5_ib_add_slave_port() repeatedly attempts to bind the new mpi structure to every device on the list until it finds an unbound device. Change the log level from warn to dbg to avoid log flooding as the warning should be harmless. Signed-off-by: Qing Huang --- v1 -&g

Re: [PATCH] IB/mlx5: avoid binding a new mpi unit to the same devices repeatedly

2018-07-23 Thread Qing Huang
Hi Daniel, On 7/23/2018 11:11 AM, Daniel Jurgens wrote: On 7/23/2018 10:36 AM, Qing Huang wrote: Hi Daniel/Parav, Have you got a chance to review this patch? Thanks! Hi Qing, sorry for the delay, I just got back to the office today. I don't agree with the proposed fix, I provided

Re: [PATCH] IB/mlx5: avoid binding a new mpi unit to the same devices repeatedly

2018-07-23 Thread Qing Huang
Hi Daniel, On 7/23/2018 11:11 AM, Daniel Jurgens wrote: On 7/23/2018 10:36 AM, Qing Huang wrote: Hi Daniel/Parav, Have you got a chance to review this patch? Thanks! Hi Qing, sorry for the delay, I just got back to the office today. I don't agree with the proposed fix, I provided

Re: [PATCH] IB/mlx5: avoid binding a new mpi unit to the same devices repeatedly

2018-07-23 Thread Qing Huang
On 7/15/2018 12:48 PM, Daniel Jurgens wrote: On 7/14/2018 10:57 AM, Or Gerlitz wrote: On Sat, Jul 14, 2018 at 2:50 AM, Qing Huang wrote: When a CX5 device is configured in dual-port RoCE mode, after creating many VFs against port 1, creating the same number of VFs against port 2 will flood

Re: [PATCH] IB/mlx5: avoid binding a new mpi unit to the same devices repeatedly

2018-07-23 Thread Qing Huang
On 7/15/2018 12:48 PM, Daniel Jurgens wrote: On 7/14/2018 10:57 AM, Or Gerlitz wrote: On Sat, Jul 14, 2018 at 2:50 AM, Qing Huang wrote: When a CX5 device is configured in dual-port RoCE mode, after creating many VFs against port 1, creating the same number of VFs against port 2 will flood

[PATCH] IB/mlx5: avoid binding a new mpi unit to the same devices repeatedly

2018-07-13 Thread Qing Huang
traversing mlx5_ib_dev_list, mlx5_ib_add_slave_port() shouldn't repeatedly attempt to bind the new mpi data unit to every device on the list until it finds an unbound device. Reported-by: Gerald Gibson Signed-off-by: Qing Huang --- drivers/infiniband/hw/mlx5/main.c | 3 ++- 1 file changed, 2 insert

[PATCH] IB/mlx5: avoid binding a new mpi unit to the same devices repeatedly

2018-07-13 Thread Qing Huang
traversing mlx5_ib_dev_list, mlx5_ib_add_slave_port() shouldn't repeatedly attempt to bind the new mpi data unit to every device on the list until it finds an unbound device. Reported-by: Gerald Gibson Signed-off-by: Qing Huang --- drivers/infiniband/hw/mlx5/main.c | 3 ++- 1 file changed, 2 insert

Re: [PATCH V4] mlx4_core: allocate ICM memory in page size chunks

2018-05-31 Thread Qing Huang
On 5/31/2018 2:10 AM, Michal Hocko wrote: On Thu 31-05-18 10:55:32, Michal Hocko wrote: On Thu 31-05-18 04:35:31, Eric Dumazet wrote: [...] I merely copied/pasted from alloc_skb_with_frags() :/ I will have a look at it. Thanks! OK, so this is an example of an incremental development ;).

Re: [PATCH V4] mlx4_core: allocate ICM memory in page size chunks

2018-05-31 Thread Qing Huang
On 5/31/2018 2:10 AM, Michal Hocko wrote: On Thu 31-05-18 10:55:32, Michal Hocko wrote: On Thu 31-05-18 04:35:31, Eric Dumazet wrote: [...] I merely copied/pasted from alloc_skb_with_frags() :/ I will have a look at it. Thanks! OK, so this is an example of an incremental development ;).

[PATCH V4] mlx4_core: allocate ICM memory in page size chunks

2018-05-23 Thread Qing Huang
for each mtt entry). So we need a 16MB allocation for a table->icm pointer array to hold 2M pointers which can easily cause kcalloc to fail. The solution is to use kvzalloc to replace kcalloc which will fall back to vmalloc automatically if kmalloc fails. Signed-off-by: Qing Huang <q

[PATCH V4] mlx4_core: allocate ICM memory in page size chunks

2018-05-23 Thread Qing Huang
for each mtt entry). So we need a 16MB allocation for a table->icm pointer array to hold 2M pointers which can easily cause kcalloc to fail. The solution is to use kvzalloc to replace kcalloc which will fall back to vmalloc automatically if kmalloc fails. Signed-off-by: Qing Huang Acked-by: Dan

Re: [PATCH v3] mlx4_core: allocate ICM memory in page size chunks

2018-05-22 Thread Qing Huang
On 5/22/2018 8:33 AM, Tariq Toukan wrote: On 18/05/2018 12:45 AM, Qing Huang wrote: On 5/17/2018 2:14 PM, Eric Dumazet wrote: On 05/17/2018 01:53 PM, Qing Huang wrote: When a system is under memory presure (high usage with fragments), the original 256KB ICM chunk allocations will likely

Re: [PATCH v3] mlx4_core: allocate ICM memory in page size chunks

2018-05-22 Thread Qing Huang
On 5/22/2018 8:33 AM, Tariq Toukan wrote: On 18/05/2018 12:45 AM, Qing Huang wrote: On 5/17/2018 2:14 PM, Eric Dumazet wrote: On 05/17/2018 01:53 PM, Qing Huang wrote: When a system is under memory presure (high usage with fragments), the original 256KB ICM chunk allocations will likely

Re: [PATCH v3] mlx4_core: allocate ICM memory in page size chunks

2018-05-17 Thread Qing Huang
On 5/17/2018 2:14 PM, Eric Dumazet wrote: On 05/17/2018 01:53 PM, Qing Huang wrote: When a system is under memory presure (high usage with fragments), the original 256KB ICM chunk allocations will likely trigger kernel memory management to enter slow path doing memory compact/migration ops

Re: [PATCH v3] mlx4_core: allocate ICM memory in page size chunks

2018-05-17 Thread Qing Huang
On 5/17/2018 2:14 PM, Eric Dumazet wrote: On 05/17/2018 01:53 PM, Qing Huang wrote: When a system is under memory presure (high usage with fragments), the original 256KB ICM chunk allocations will likely trigger kernel memory management to enter slow path doing memory compact/migration ops

[PATCH v3] mlx4_core: allocate ICM memory in page size chunks

2018-05-17 Thread Qing Huang
ned-off-by: Qing Huang <qing.hu...@oracle.com> Acked-by: Daniel Jurgens <dani...@mellanox.com> Reviewed-by: Zhu Yanjun <yanjun@oracle.com> --- v3: use PAGE_SIZE instead of PAGE_SHIFT add comma to the end of enum variables include vmalloc.h header file to avoid buil

[PATCH v3] mlx4_core: allocate ICM memory in page size chunks

2018-05-17 Thread Qing Huang
ned-off-by: Qing Huang Acked-by: Daniel Jurgens Reviewed-by: Zhu Yanjun --- v3: use PAGE_SIZE instead of PAGE_SHIFT add comma to the end of enum variables include vmalloc.h header file to avoid build issues on Sparc v2: adjuste chunk size to reflect different architectures drivers/

Re: [PATCH V2] mlx4_core: allocate ICM memory in page size chunks

2018-05-15 Thread Qing Huang
On 5/15/2018 12:08 PM, Eric Dumazet wrote: On 05/15/2018 11:53 AM, Qing Huang wrote: This is control path so it is less latency-sensitive. Let's not produce unnecessary degradation here, please call kvzalloc so we maintain a similar behavior when contiguous memory is available

Re: [PATCH V2] mlx4_core: allocate ICM memory in page size chunks

2018-05-15 Thread Qing Huang
On 5/15/2018 12:08 PM, Eric Dumazet wrote: On 05/15/2018 11:53 AM, Qing Huang wrote: This is control path so it is less latency-sensitive. Let's not produce unnecessary degradation here, please call kvzalloc so we maintain a similar behavior when contiguous memory is available

Re: [PATCH V2] mlx4_core: allocate ICM memory in page size chunks

2018-05-15 Thread Qing Huang
On 5/15/2018 2:19 AM, Tariq Toukan wrote: On 14/05/2018 7:41 PM, Qing Huang wrote: On 5/13/2018 2:00 AM, Tariq Toukan wrote: On 11/05/2018 10:23 PM, Qing Huang wrote: When a system is under memory presure (high usage with fragments), the original 256KB ICM chunk allocations

Re: [PATCH V2] mlx4_core: allocate ICM memory in page size chunks

2018-05-15 Thread Qing Huang
On 5/15/2018 2:19 AM, Tariq Toukan wrote: On 14/05/2018 7:41 PM, Qing Huang wrote: On 5/13/2018 2:00 AM, Tariq Toukan wrote: On 11/05/2018 10:23 PM, Qing Huang wrote: When a system is under memory presure (high usage with fragments), the original 256KB ICM chunk allocations

Re: [PATCH V2] mlx4_core: allocate ICM memory in page size chunks

2018-05-14 Thread Qing Huang
On 5/13/2018 2:00 AM, Tariq Toukan wrote: On 11/05/2018 10:23 PM, Qing Huang wrote: When a system is under memory presure (high usage with fragments), the original 256KB ICM chunk allocations will likely trigger kernel memory management to enter slow path doing memory compact/migration ops

Re: [PATCH V2] mlx4_core: allocate ICM memory in page size chunks

2018-05-14 Thread Qing Huang
On 5/13/2018 2:00 AM, Tariq Toukan wrote: On 11/05/2018 10:23 PM, Qing Huang wrote: When a system is under memory presure (high usage with fragments), the original 256KB ICM chunk allocations will likely trigger kernel memory management to enter slow path doing memory compact/migration ops

[PATCH V2] mlx4_core: allocate ICM memory in page size chunks

2018-05-11 Thread Qing Huang
ned-off-by: Qing Huang <qing.hu...@oracle.com> Acked-by: Daniel Jurgens <dani...@mellanox.com> Reviewed-by: Zhu Yanjun <yanjun@oracle.com> --- v2 -> v1: adjusted chunk size to reflect different architectures. drivers/net/ethernet/mellanox/mlx4/icm.c | 14 +++--- 1 fi

[PATCH V2] mlx4_core: allocate ICM memory in page size chunks

2018-05-11 Thread Qing Huang
ned-off-by: Qing Huang Acked-by: Daniel Jurgens Reviewed-by: Zhu Yanjun --- v2 -> v1: adjusted chunk size to reflect different architectures. drivers/net/ethernet/mellanox/mlx4/icm.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/mellano

Re: [PATCH] mlx4_core: allocate 4KB ICM chunks

2018-05-11 Thread Qing Huang
On 5/11/2018 3:27 AM, Håkon Bugge wrote: On 11 May 2018, at 01:31, Qing Huang<qing.hu...@oracle.com> wrote: When a system is under memory presure (high usage with fragments), the original 256KB ICM chunk allocations will likely trigger kernel memory management to enter slow path doing

Re: [PATCH] mlx4_core: allocate 4KB ICM chunks

2018-05-11 Thread Qing Huang
On 5/11/2018 3:27 AM, Håkon Bugge wrote: On 11 May 2018, at 01:31, Qing Huang wrote: When a system is under memory presure (high usage with fragments), the original 256KB ICM chunk allocations will likely trigger kernel memory management to enter slow path doing memory compact/migration ops

Re: [PATCH] mlx4_core: allocate 4KB ICM chunks

2018-05-10 Thread Qing Huang
Thank you for reviewing it! On 5/10/2018 6:23 PM, Yanjun Zhu wrote: On 2018/5/11 9:15, Qing Huang wrote: On 5/10/2018 5:13 PM, Yanjun Zhu wrote: On 2018/5/11 7:31, Qing Huang wrote: When a system is under memory presure (high usage with fragments), the original 256KB ICM chunk

Re: [PATCH] mlx4_core: allocate 4KB ICM chunks

2018-05-10 Thread Qing Huang
Thank you for reviewing it! On 5/10/2018 6:23 PM, Yanjun Zhu wrote: On 2018/5/11 9:15, Qing Huang wrote: On 5/10/2018 5:13 PM, Yanjun Zhu wrote: On 2018/5/11 7:31, Qing Huang wrote: When a system is under memory presure (high usage with fragments), the original 256KB ICM chunk

[PATCH] mlx4_core: allocate 4KB ICM chunks

2018-05-10 Thread Qing Huang
). So we need a 16MB allocation for a table->icm pointer array to hold 2M pointers which can easily cause kcalloc to fail. The solution is to use vzalloc to replace kcalloc. There is no need for contiguous memory pages for a driver meta data structure (no need of DMA ops). Signed-off-by: Qing Hu

[PATCH] mlx4_core: allocate 4KB ICM chunks

2018-05-10 Thread Qing Huang
). So we need a 16MB allocation for a table->icm pointer array to hold 2M pointers which can easily cause kcalloc to fail. The solution is to use vzalloc to replace kcalloc. There is no need for contiguous memory pages for a driver meta data structure (no need of DMA ops). Signed-off-by: Qing Hu

Re: [PATCH] net/mlx5: report persistent netdev stats across ifdown/ifup commands

2018-04-26 Thread Qing Huang
Thanks! Looks like Eran's patch will be available much sooner than v4.18 release time frame (since v4.16 was just released). We will wait. :-) On 04/26/2018 04:43 PM, Saeed Mahameed wrote: Before you address my comments, it looks like Eran's work is converging and we will finalize the

Re: [PATCH] net/mlx5: report persistent netdev stats across ifdown/ifup commands

2018-04-26 Thread Qing Huang
Thanks! Looks like Eran's patch will be available much sooner than v4.18 release time frame (since v4.16 was just released). We will wait. :-) On 04/26/2018 04:43 PM, Saeed Mahameed wrote: Before you address my comments, it looks like Eran's work is converging and we will finalize the

Re: [PATCH] net/mlx5: report persistent netdev stats across ifdown/ifup commands

2018-04-26 Thread Qing Huang
On 04/26/2018 02:50 PM, Saeed Mahameed wrote: On Thu, Apr 26, 2018 at 1:37 PM, Qing Huang <qing.hu...@oracle.com> wrote: Current stats collecting scheme in mlx5 driver is to periodically fetch aggregated stats from all the active mlx5 software channels associated with the device. Howeve

Re: [PATCH] net/mlx5: report persistent netdev stats across ifdown/ifup commands

2018-04-26 Thread Qing Huang
On 04/26/2018 02:50 PM, Saeed Mahameed wrote: On Thu, Apr 26, 2018 at 1:37 PM, Qing Huang wrote: Current stats collecting scheme in mlx5 driver is to periodically fetch aggregated stats from all the active mlx5 software channels associated with the device. However when a mlx5 interface

[PATCH] net/mlx5: report persistent netdev stats across ifdown/ifup commands

2018-04-26 Thread Qing Huang
stats into netdev stats fields, so all the accumulated stats will survive multiple runs of ifdown/ifup commands and be shown correctly. Orabug: 27548610 Signed-off-by: Qing Huang <qing.hu...@oracle.com> --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 30 +++

[PATCH] net/mlx5: report persistent netdev stats across ifdown/ifup commands

2018-04-26 Thread Qing Huang
stats into netdev stats fields, so all the accumulated stats will survive multiple runs of ifdown/ifup commands and be shown correctly. Orabug: 27548610 Signed-off-by: Qing Huang --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 30 +++ 1 file changed, 25 insertions

Re: Setting large MTU size on slave interfaces may stall the whole system

2017-12-14 Thread Qing Huang
Hi Or, On 12/13/2017 06:28 AM, Or Gerlitz wrote: On Tue, Dec 12, 2017 at 5:21 AM, Qing Huang <qing.hu...@oracle.com> wrote: Hi, We found an issue with the bonding driver when testing Mellanox devices. The following test commands will stall the whole system sometimes, with serial c

Re: Setting large MTU size on slave interfaces may stall the whole system

2017-12-14 Thread Qing Huang
Hi Or, On 12/13/2017 06:28 AM, Or Gerlitz wrote: On Tue, Dec 12, 2017 at 5:21 AM, Qing Huang wrote: Hi, We found an issue with the bonding driver when testing Mellanox devices. The following test commands will stall the whole system sometimes, with serial console flooded with log messages

Setting large MTU size on slave interfaces may stall the whole system

2017-12-11 Thread Qing Huang
(resend this email in text format) Hi, We found an issue with the bonding driver when testing Mellanox devices. The following test commands will stall the whole system sometimes, with serial console flooded with log messages from the bond_miimon_inspect() function. Setting mtu size to be

Setting large MTU size on slave interfaces may stall the whole system

2017-12-11 Thread Qing Huang
(resend this email in text format) Hi, We found an issue with the bonding driver when testing Mellanox devices. The following test commands will stall the whole system sometimes, with serial console flooded with log messages from the bond_miimon_inspect() function. Setting mtu size to be

[PATCH] IB/CM: fix memory corruption by avoiding unnecessary memset

2017-11-02 Thread Qing Huang
The size of path array could be dynamic. However the fixed number(2) of memset could cause memory corruption by writing into wrong memory space. Fixes: 9fdca4da4d8c (IB/SA: Split struct sa_path_rec based on IB ands ROCE specific fields) Signed-off-by: Qing Huang <qing.hu...@oracle.

[PATCH] IB/CM: fix memory corruption by avoiding unnecessary memset

2017-11-02 Thread Qing Huang
The size of path array could be dynamic. However the fixed number(2) of memset could cause memory corruption by writing into wrong memory space. Fixes: 9fdca4da4d8c (IB/SA: Split struct sa_path_rec based on IB ands ROCE specific fields) Signed-off-by: Qing Huang --- drivers/infiniband

Re: [PATCH] ib/core: not to set page dirty bit if it's already set.

2017-05-23 Thread Qing Huang
On 5/23/2017 12:42 AM, Christoph Hellwig wrote: On Mon, May 22, 2017 at 04:43:57PM -0700, Qing Huang wrote: On 5/19/2017 6:05 AM, Christoph Hellwig wrote: On Thu, May 18, 2017 at 04:33:53PM -0700, Qing Huang wrote: This change will optimize kernel memory deregistration operations

Re: [PATCH] ib/core: not to set page dirty bit if it's already set.

2017-05-23 Thread Qing Huang
On 5/23/2017 12:42 AM, Christoph Hellwig wrote: On Mon, May 22, 2017 at 04:43:57PM -0700, Qing Huang wrote: On 5/19/2017 6:05 AM, Christoph Hellwig wrote: On Thu, May 18, 2017 at 04:33:53PM -0700, Qing Huang wrote: This change will optimize kernel memory deregistration operations

Re: [PATCH] ib/core: not to set page dirty bit if it's already set.

2017-05-22 Thread Qing Huang
On 5/19/2017 6:05 AM, Christoph Hellwig wrote: On Thu, May 18, 2017 at 04:33:53PM -0700, Qing Huang wrote: This change will optimize kernel memory deregistration operations. __ib_umem_release() used to call set_page_dirty_lock() against every writable page in its memory region. Its purpose

Re: [PATCH] ib/core: not to set page dirty bit if it's already set.

2017-05-22 Thread Qing Huang
On 5/19/2017 6:05 AM, Christoph Hellwig wrote: On Thu, May 18, 2017 at 04:33:53PM -0700, Qing Huang wrote: This change will optimize kernel memory deregistration operations. __ib_umem_release() used to call set_page_dirty_lock() against every writable page in its memory region. Its purpose

[PATCH] ib/core: not to set page dirty bit if it's already set.

2017-05-18 Thread Qing Huang
choose not to set page dirty bit if it's already set by kernel prior to calling __ib_umem_release(). This reduces memory deregistration time by half or even more when we ran application simulation test program. Signed-off-by: Qing Huang <qing.hu...@oracle.com> --- drivers/infiniband/core/umem

[PATCH] ib/core: not to set page dirty bit if it's already set.

2017-05-18 Thread Qing Huang
choose not to set page dirty bit if it's already set by kernel prior to calling __ib_umem_release(). This reduces memory deregistration time by half or even more when we ran application simulation test program. Signed-off-by: Qing Huang --- drivers/infiniband/core/umem.c | 2 +- 1 file changed, 1

Re: [PATCH] device probe: add self triggered delayed work request

2016-08-09 Thread Qing Huang
On 08/09/2016 03:11 AM, Shamir Rabinovitch wrote: On Mon, Aug 08, 2016 at 05:10:05PM -0700, Qing Huang wrote: Not sure if I understood your scenario. Why there is a deadlock here? CPU0 | CPU1

Re: [PATCH] device probe: add self triggered delayed work request

2016-08-09 Thread Qing Huang
On 08/09/2016 03:11 AM, Shamir Rabinovitch wrote: On Mon, Aug 08, 2016 at 05:10:05PM -0700, Qing Huang wrote: Not sure if I understood your scenario. Why there is a deadlock here? CPU0 | CPU1

Re: [PATCH] device probe: add self triggered delayed work request

2016-08-08 Thread Qing Huang
On 08/08/2016 03:42 AM, Shamir Rabinovitch wrote: Hi Qing, I suspect there is potential dead-lock with this patch: cpu0cpu1 driver_deferred_probe_add deferred_probe_work_func ...

Re: [PATCH] device probe: add self triggered delayed work request

2016-08-08 Thread Qing Huang
On 08/08/2016 03:42 AM, Shamir Rabinovitch wrote: Hi Qing, I suspect there is potential dead-lock with this patch: cpu0cpu1 driver_deferred_probe_add deferred_probe_work_func ...

Re: [PATCH] device probe: add self triggered delayed work request

2016-08-08 Thread Qing Huang
On 08/08/2016 01:44 PM, Frank Rowand wrote: On 07/29/16 22:39, Qing Huang wrote: In normal condition, the device probe requests kept in deferred queue would only be triggered for re-probing when another new device probe is finished successfully. This change will set up a delayed trigger work

Re: [PATCH] device probe: add self triggered delayed work request

2016-08-08 Thread Qing Huang
On 08/08/2016 01:44 PM, Frank Rowand wrote: On 07/29/16 22:39, Qing Huang wrote: In normal condition, the device probe requests kept in deferred queue would only be triggered for re-probing when another new device probe is finished successfully. This change will set up a delayed trigger work

[PATCH] device probe: add self triggered delayed work request

2016-07-29 Thread Qing Huang
gre...@linuxfoundation.org> Cc: Grant Likely <grant.lik...@linaro.org> Cc: Santosh Shilimkar <santosh.shilim...@oracle.com> Signed-off-by: Qing Huang <qing.hu...@oracle.com> --- drivers/base/dd.c | 25 + 1 files changed, 25 insertions(+), 0 deletions(-) diff --g

[PATCH] device probe: add self triggered delayed work request

2016-07-29 Thread Qing Huang
Likely Cc: Santosh Shilimkar Signed-off-by: Qing Huang --- drivers/base/dd.c | 25 + 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 16688f5..251042d 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -53,6