RE: [PATCH v2 06/15] vdpa/mlx5: pre-create virtq in the prob

2022-06-18 Thread Li Zhang
Thanks for your comments and will fix it on V3. Regards, Li Zhang > -Original Message- > From: Maxime Coquelin > Sent: Friday, June 17, 2022 11:54 PM > To: Li Zhang ; Ori Kam ; Slava > Ovsiienko ; Matan Azrad ; > Shahaf Shuler > Cc: dev@dpdk.org; NBU-Contact-Thomas Monjalon (EXTERNAL) >

RE: [PATCH v2 02/15] vdpa/mlx5: support pre create virtq resource

2022-06-18 Thread Li Zhang
Thanks for your comment and will fix it on V3. Regards, Li Zhang > -Original Message- > From: Maxime Coquelin > Sent: Friday, June 17, 2022 11:37 PM > To: Li Zhang ; Ori Kam ; Slava > Ovsiienko ; Matan Azrad ; > Shahaf Shuler > Cc: dev@dpdk.org; NBU-Contact-Thomas Monjalon (EXTERNAL) >

[PATCH v3 00/15] mlx5/vdpa: optimize live migration time

2022-06-18 Thread Li Zhang
Allow the driver to use internal threads to obtain fast configuration. All the threads will be open on the same core of the event completion queue scheduling thread. Add max_conf_threads parameter to configure the maximum number of internal threads in addition to the caller thread (8 is suggested)

[PATCH v3 01/15] vdpa/mlx5: fix usage of capability for max number of virtqs

2022-06-18 Thread Li Zhang
The driver wrongly takes the capability value for the number of virtq pairs instead of just the number of virtqs. Adjust all the usages of it to be the number of virtqs. Fixes: c2eb33a ("vdpa/mlx5: manage virtqs by array") Cc: sta...@dpdk.org Signed-off-by: Li Zhang Acked-by: Matan Azrad Revie

[PATCH v3 02/15] vdpa/mlx5: support pre create virtq resource

2022-06-18 Thread Li Zhang
From: Yajun Wu The motivation of this change is to reduce vDPA device queue creation time by creating some queue resource in vDPA device probe stage. In VM live migration scenario, this can reduce 0.8ms for each queue creation, thus reduce LM network downtime. To create queue resource(umem/coun

[PATCH v3 04/15] vdpa/mlx5: support event qp reuse

2022-06-18 Thread Li Zhang
From: Yajun Wu To speed up queue create time, event qp and cq will create only once. Each virtq creation will reuse same event qp and cq. Because FW will set event qp to error state during virtq destroy, need modify event qp to RESET state, then modify qp to RTS state as usual. This can save abo

[PATCH v3 03/15] common/mlx5: add DevX API to move QP to reset state

2022-06-18 Thread Li Zhang
From: Yajun Wu Support set QP to RESET state. Signed-off-by: Yajun Wu Acked-by: Matan Azrad Reviewed-by: Maxime Coquelin --- drivers/common/mlx5/mlx5_devx_cmds.c | 7 +++ drivers/common/mlx5/mlx5_prm.h | 17 + 2 files changed, 24 insertions(+) diff --git a/drivers

[PATCH v3 05/15] common/mlx5: extend virtq modifiable fields

2022-06-18 Thread Li Zhang
A virtq configuration can be modified after the virtq creation. Added the following modifiable fields: 1.address fields: desc_addr/used_addr/available_addr 2.hw_available_index 3.hw_used_index 4.virtio_q_type 5.version type 6.queue mkey 7.feature bit mask: tso_ipv4/tso_ipv6/tx_csum/rx_csum 8.event

[PATCH v3 06/15] vdpa/mlx5: pre-create virtq at probe time

2022-06-18 Thread Li Zhang
dev_config operation is called in LM progress. LM time is very critical because all the VM packets are dropped directly at that time. Move the virtq creation to probe time and only modify the configuration later in the dev_config stage using the new ability to modify virtq. This optimization acce

[PATCH v3 09/15] vdpa/mlx5: add task ring for MT management

2022-06-18 Thread Li Zhang
The configuration threads tasks need a container to support multiple tasks assigned to a thread in parallel. Use rte_ring container per thread to manage the thread tasks without locks. The caller thread from the user context opens a task to a thread and enqueue it to the thread ring. The thread pol

[PATCH v3 08/15] vdpa/mlx5: add multi-thread management for configuration

2022-06-18 Thread Li Zhang
The LM process includes a lot of objects creations and destructions in the source and the destination servers. As much as LM time increases, the packet drop of the VM increases. To improve LM time need to parallel the configurations for mlx5 FW. Add internal multi-thread management in the driver fo

[PATCH v3 07/15] vdpa/mlx5: optimize datapath-control synchronization

2022-06-18 Thread Li Zhang
The driver used a single global lock for any synchronization needed for the datapath and control path. It is better to group the critical sections with the other ones that should be synchronized. Replace the global lock with the following locks: 1.virtq locks(per virtq) synchronize datapath polli

[PATCH v3 10/15] vdpa/mlx5: add MT task for VM memory registration

2022-06-18 Thread Li Zhang
The driver creates a direct MR object of the HW for each VM memory region, which maps the VM physical address to the actual physical address. Later, after all the MRs are ready, the driver creates an indirect MR to group all the direct MRs into one virtual space from the HW perspective. Create di

[PATCH v3 11/15] vdpa/mlx5: add virtq creation task for MT management

2022-06-18 Thread Li Zhang
The virtq object and all its sub-resources use a lot of FW commands and can be accelerated by the MT management. Split the virtqs creation between the configuration threads. This accelerates the LM process and reduces its time by 20%. Signed-off-by: Li Zhang Acked-by: Matan Azrad --- drivers/vd

[PATCH v3 12/15] vdpa/mlx5: add virtq LM log task

2022-06-18 Thread Li Zhang
Split the virtqs LM log between the configuration threads. This accelerates the LM process and reduces its time by 20%. Signed-off-by: Li Zhang Acked-by: Matan Azrad --- drivers/vdpa/mlx5/mlx5_vdpa.h | 3 + drivers/vdpa/mlx5/mlx5_vdpa_cthread.c | 34 +++ drivers/vdpa/mlx5/mlx5_

[PATCH v3 13/15] vdpa/mlx5: add device close task

2022-06-18 Thread Li Zhang
Split the virtqs device close tasks after stopping virt-queue between the configuration threads. This accelerates the LM process and reduces its time by 50%. Signed-off-by: Li Zhang Acked-by: Matan Azrad --- drivers/vdpa/mlx5/mlx5_vdpa.c | 56 +-- drivers/vdpa/ml

[PATCH v3 14/15] vdpa/mlx5: add virtq sub-resources creation

2022-06-18 Thread Li Zhang
pre-created virt-queue sub-resource in device probe stage and then modify virtqueue in device config stage. Steer table also need to support dummy virt-queue. This accelerates the LM process and reduces its time by 40%. Signed-off-by: Li Zhang Signed-off-by: Yajun Wu Acked-by: Matan Azrad ---

[PATCH v3 15/15] vdpa/mlx5: prepare virtqueue resource creation

2022-06-18 Thread Li Zhang
Split the virtqs virt-queue resource between the configuration threads. Also need pre-created virt-queue resource after virtq destruction. This accelerates the LM process and reduces its time by 30%. Signed-off-by: Li Zhang Acked-by: Matan Azrad --- doc/guides/rel_notes/release_22_07.rst | 1

[PATCH v4 00/15] mlx5/vdpa: optimize live migration time

2022-06-18 Thread Li Zhang
Allow the driver to use internal threads to obtain fast configuration. All the threads will be open on the same core of the event completion queue scheduling thread. Add max_conf_threads parameter to configure the maximum number of internal threads in addition to the caller thread (8 is suggested)

[PATCH v4 01/15] vdpa/mlx5: fix usage of capability for max number of virtqs

2022-06-18 Thread Li Zhang
The driver wrongly takes the capability value for the number of virtq pairs instead of just the number of virtqs. Adjust all the usages of it to be the number of virtqs. Fixes: c2eb33a ("vdpa/mlx5: manage virtqs by array") Cc: sta...@dpdk.org Signed-off-by: Li Zhang Acked-by: Matan Azrad Revie

[PATCH v4 02/15] vdpa/mlx5: support pre create virtq resource

2022-06-18 Thread Li Zhang
From: Yajun Wu The motivation of this change is to reduce vDPA device queue creation time by creating some queue resource in vDPA device probe stage. In VM live migration scenario, this can reduce 0.8ms for each queue creation, thus reduce LM network downtime. To create queue resource(umem/coun

[PATCH v4 03/15] common/mlx5: add DevX API to move QP to reset state

2022-06-18 Thread Li Zhang
From: Yajun Wu Support set QP to RESET state. Signed-off-by: Yajun Wu Acked-by: Matan Azrad Reviewed-by: Maxime Coquelin --- drivers/common/mlx5/mlx5_devx_cmds.c | 7 +++ drivers/common/mlx5/mlx5_prm.h | 17 + 2 files changed, 24 insertions(+) diff --git a/drivers

[PATCH v4 04/15] vdpa/mlx5: support event qp reuse

2022-06-18 Thread Li Zhang
From: Yajun Wu To speed up queue create time, event qp and cq will create only once. Each virtq creation will reuse same event qp and cq. Because FW will set event qp to error state during virtq destroy, need modify event qp to RESET state, then modify qp to RTS state as usual. This can save abo

[PATCH v4 05/15] common/mlx5: extend virtq modifiable fields

2022-06-18 Thread Li Zhang
A virtq configuration can be modified after the virtq creation. Added the following modifiable fields: 1.address fields: desc_addr/used_addr/available_addr 2.hw_available_index 3.hw_used_index 4.virtio_q_type 5.version type 6.queue mkey 7.feature bit mask: tso_ipv4/tso_ipv6/tx_csum/rx_csum 8.event

[PATCH v4 06/15] vdpa/mlx5: pre-create virtq at probe time

2022-06-18 Thread Li Zhang
dev_config operation is called in LM progress. LM time is very critical because all the VM packets are dropped directly at that time. Move the virtq creation to probe time and only modify the configuration later in the dev_config stage using the new ability to modify virtq. This optimization acce

[PATCH v4 07/15] vdpa/mlx5: optimize datapath-control synchronization

2022-06-18 Thread Li Zhang
The driver used a single global lock for any synchronization needed for the datapath and control path. It is better to group the critical sections with the other ones that should be synchronized. Replace the global lock with the following locks: 1.virtq locks(per virtq) synchronize datapath polli

[PATCH v4 08/15] vdpa/mlx5: add multi-thread management for configuration

2022-06-18 Thread Li Zhang
The LM process includes a lot of objects creations and destructions in the source and the destination servers. As much as LM time increases, the packet drop of the VM increases. To improve LM time need to parallel the configurations for mlx5 FW. Add internal multi-thread management in the driver fo

[PATCH v4 09/15] vdpa/mlx5: add task ring for MT management

2022-06-18 Thread Li Zhang
The configuration threads tasks need a container to support multiple tasks assigned to a thread in parallel. Use rte_ring container per thread to manage the thread tasks without locks. The caller thread from the user context opens a task to a thread and enqueue it to the thread ring. The thread pol

[PATCH v4 10/15] vdpa/mlx5: add MT task for VM memory registration

2022-06-18 Thread Li Zhang
The driver creates a direct MR object of the HW for each VM memory region, which maps the VM physical address to the actual physical address. Later, after all the MRs are ready, the driver creates an indirect MR to group all the direct MRs into one virtual space from the HW perspective. Create di

[PATCH v4 11/15] vdpa/mlx5: add virtq creation task for MT management

2022-06-18 Thread Li Zhang
The virtq object and all its sub-resources use a lot of FW commands and can be accelerated by the MT management. Split the virtqs creation between the configuration threads. This accelerates the LM process and reduces its time by 20%. Signed-off-by: Li Zhang Acked-by: Matan Azrad --- drivers/vd

[PATCH v4 12/15] vdpa/mlx5: add virtq LM log task

2022-06-18 Thread Li Zhang
Split the virtqs LM log between the configuration threads. This accelerates the LM process and reduces its time by 20%. Signed-off-by: Li Zhang Acked-by: Matan Azrad --- drivers/vdpa/mlx5/mlx5_vdpa.h | 3 + drivers/vdpa/mlx5/mlx5_vdpa_cthread.c | 34 +++ drivers/vdpa/mlx5/mlx5_

[PATCH v4 13/15] vdpa/mlx5: add device close task

2022-06-18 Thread Li Zhang
Split the virtqs device close tasks after stopping virt-queue between the configuration threads. This accelerates the LM process and reduces its time by 50%. Signed-off-by: Li Zhang Acked-by: Matan Azrad --- drivers/vdpa/mlx5/mlx5_vdpa.c | 56 +-- drivers/vdpa/ml

[PATCH v4 14/15] vdpa/mlx5: add virtq sub-resources creation

2022-06-18 Thread Li Zhang
pre-created virt-queue sub-resource in device probe stage and then modify virtqueue in device config stage. Steer table also need to support dummy virt-queue. This accelerates the LM process and reduces its time by 40%. Signed-off-by: Li Zhang Signed-off-by: Yajun Wu Acked-by: Matan Azrad ---

[PATCH v4 15/15] vdpa/mlx5: prepare virtqueue resource creation

2022-06-18 Thread Li Zhang
Split the virtqs virt-queue resource between the configuration threads. Also need pre-created virt-queue resource after virtq destruction. This accelerates the LM process and reduces its time by 30%. Signed-off-by: Li Zhang Acked-by: Matan Azrad --- doc/guides/rel_notes/release_22_07.rst | 1

RE: [PATCH v2] vdpa/ifc: fix null pointer dereference

2022-06-18 Thread Pei, Andy
Hi Maxime, Thanks for your effort. > -Original Message- > From: Maxime Coquelin > Sent: Friday, June 17, 2022 10:08 PM > To: Pei, Andy ; dev@dpdk.org > Cc: Xia, Chenbo ; Wang, Xiao W > ; Xu, Rosen ; Xiao, QimaiX > > Subject: Re: [PATCH v2] vdpa/ifc: fix null pointer dereference > > >

RE: [PATCH v2 1/5] telemetry: escape special char when tel string

2022-06-18 Thread Morten Brørup
+CC: Ciara Power, Telemetry library maintainer > From: fengchengwen [mailto:fengcheng...@huawei.com] > Sent: Saturday, 18 June 2022 05.52 > > On 2022/6/18 1:05, Stephen Hemminger wrote: > > On Fri, 17 Jun 2022 12:25:04 +0100 > > Bruce Richardson wrote: > > > >> On Fri, Jun 17, 2022 at 01:16:08PM

Re:Re: [PATCH v7] ip_frag: add IPv4 options fragment and test data

2022-06-18 Thread Huichao Cai
Hi,Stephen Thank you very much for your reply! >I would just replace all of the rte_memcpy with memcpy I will replace all of the rte_memcpy with memcpy. >I expect that rte_memcpy() is able to do better than memcpy() for larger >copies because it is >likely to use bigger vector instructions and c

Re: [PATCH] eal: fixes the bug where rte_malloc() fails to allocates memory

2022-06-18 Thread Dmitry Kozlyuk
Hi Fidaullah, Thanks for the fix, Acked-by: Dmitry Kozlyuk Anatoly, I noticed a couple of other things while testing this. 1. Consider: elt_size = pg_sz - MALLOC_ELEM_OVERHEAD rte_malloc(align=0) which is converted to align = 1. Obviously, such an element fits into one page, however: alloc_

Re: [PATCH v2 2/6] eal: add thread lifetime management

2022-06-18 Thread Dmitry Kozlyuk
2022-06-14 16:47 (UTC-0700), Tyler Retzlaff: > On Windows, the function executed by a thread when the thread starts is > represeneted by a function pointer of type DWORD (*func) (void*). > On other platforms, the function pointer is a void* (*func) (void*). > > Performing a cast between these two

[PATCH] ip_frag: replace the rte memcpy with memcpy

2022-06-18 Thread Huichao Cai
To resolve the compilation warning,replace the rte_memcpy with memcpy. Modify in file test_ipfrag.c and rte_ipv4_fragmentation.c. Signed-off-by: Huichao Cai --- app/test/test_ipfrag.c | 13 ++--- lib/ip_frag/rte_ipv4_fragmentation.c | 7 +++ 2 files changed, 9 insertio

Re: dpdk address sanitizer

2022-06-18 Thread Juan Pablo L .
Thank you for your feedback, i will look into that .. any suggestions on what technique I can use to find memory leaks, invalid accesses, etc etc ? thanks!!! From: Stephen Hemminger Sent: Friday, June 17, 2022 4:17 PM To: David Marchand Cc: Juan Pablo L. ;

[PATCH v1 0/2] Fix meter flow fail when matching E-Switch Manager

2022-06-18 Thread Shun Hao
When using a meter in flow that matches E-Switch Manager, it will fail due to not handling E-Switch Manager match item correctly. This series fix this by using correct handling of parsing E-Switch Manager item. Shun Hao (2): net/mlx5: add limitation for E-Switch Manager match net/mlx5: fix met

[PATCH v1 1/2] net/mlx5: add limitation for E-Switch Manager match

2022-06-18 Thread Shun Hao
For BF with old FW which doesn't expose the E-Switch Manager vport ID, E-Switch Manager port matching works correctly only when BF is in embedded CPU mode. This patch adds the limitation description. Fixes: a564038699f9 ("net/mlx5: support E-Switch manager egress traffic match") Cc: sta...@dpdk.o

[PATCH v1 2/2] net/mlx5: fix meter fail when used on E-Switch Manager

2022-06-18 Thread Shun Hao
When meter is used by E-Switch Manager port, there's an error that cannot get correct port ID. This patch fixes this by using specific parsing process to get port ID for E-Switch Manager. Fixes: 3c481324baf3 ("net/mlx5: fix meter flow direction check") Cc: sta...@dpdk.org Signed-off-by: Shun Hao