[PATCH] vdpa/ifc: add live migration for block device

2022-12-14 Thread Andy Pei
we have to make sure that each IO is completed. When we terminate the above mediated virtio ring, we stop notifying queue about new IOs, wait for all the in-flight IOs to be completed. Signed-off-by: Andy Pei --- drivers/vdpa/ifc/ifcvf_vdpa.c | 22 ++ 1 file changed, 22

[PATCH] vdpa/ifc: improve device stop logic for block device

2022-12-13 Thread Andy Pei
For block device, we make sure no IO is inflight before we stop device. We terminate the notify relay process and wait for all inflight IOs to be completed. So in this period, we wait for hardware to update used index, there is no need to relay new kick. Signed-off-by: Andy Pei --- drivers/vdpa

[PATCH] vdpa/ifc: fix reconnetion issue in SW assisted live migration

2022-12-12 Thread Andy Pei
form DMA map. Fixes: 4bb531e152d3 ("net/ifc: support SW assisted VDPA live migration") Cc: sta...@dpdk.org Signed-off-by: Andy Pei --- drivers/vdpa/ifc/ifcvf_vdpa.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c index

[PATCH] vdpa/ifc: fix argument compatibility check

2022-12-01 Thread Andy Pei
ot;net/ifc: add LM mode parameter") Cc: sta...@dpdk.org Signed-off-by: Andy Pei --- drivers/vdpa/ifc/ifcvf_vdpa.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c index 49d68ad..9468f66 100644 --- a/drivers/vdpa/ifc/ifcvf_

[PATCH v9 12/12] vhost: improve vDPA blk device configure condition

2022-10-19 Thread Andy Pei
To support multi-queue, configure device after call fd of all queues are set. Signed-off-by: Andy Pei Signed-off-by: Huang Wei Reviewed-by: Chenbo Xia Reviewed-by: Maxime Coquelin --- lib/vhost/vhost_user.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a

[PATCH v9 11/12] vhost: vDPA blk device gets ready when the first queue is ready

2022-10-19 Thread Andy Pei
When boot from virtio blk device, seabios in QEMU only enables one queue. To work in this scenario, vDPA BLK device back-end configure device when the first queue is ready. Signed-off-by: Andy Pei Signed-off-by: Huang Wei Reviewed-by: Chenbo Xia Reviewed-by: Maxime Coquelin --- lib/vhost

[PATCH v9 10/12] vhost: add type to rte vdpa device

2022-10-19 Thread Andy Pei
Add type to rte_vdpa_device to store device type. Call vdpa ops get_dev_type to fill type when register vdpa device. Signed-off-by: Andy Pei Reviewed-by: Chenbo Xia Reviewed-by: Maxime Coquelin --- lib/vhost/socket.c | 15 +-- lib/vhost/vdpa.c| 15 +++ lib

[PATCH v9 09/12] vdpa/ifc: improve internal list logic

2022-10-19 Thread Andy Pei
Insert internal list element to internal list before register vdpa device, in order to call vdpa ops during vdpa device registration. Signed-off-by: Andy Pei Reviewed-by: Maxime Coquelin --- drivers/vdpa/ifc/ifcvf_vdpa.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff

[PATCH v9 08/12] vdpa/ifc: add internal API to get device

2022-10-19 Thread Andy Pei
Add new internal API "find_internal_resource_by_rte_dev" to get device. Signed-off-by: Andy Pei Reviewed-by: Chenbo Xia Reviewed-by: Maxime Coquelin --- drivers/vdpa/ifc/ifcvf_vdpa.c | 28 ++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/dr

[PATCH v9 07/12] vdpa/ifc: change internal function name

2022-10-19 Thread Andy Pei
Change internal function name "find_internal_resource_by_dev" to "find_internal_resource_by_pci_dev". Signed-off-by: Andy Pei Reviewed-by: Chenbo Xia Reviewed-by: Maxime Coquelin --- drivers/vdpa/ifc/ifcvf_vdpa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH v9 05/12] vdpa/ifc: only configure enabled queue

2022-10-19 Thread Andy Pei
When configuring the hardware queue, we only configure queues which have been enabled by vhost. Signed-off-by: Andy Pei Signed-off-by: Huang Wei Reviewed-by: Chenbo Xia --- drivers/vdpa/ifc/base/ifcvf.c | 3 +++ drivers/vdpa/ifc/ifcvf_vdpa.c | 16 ++-- 2 files changed, 17

[PATCH v9 04/12] vdpa/ifc: write queue count to MQ register

2022-10-19 Thread Andy Pei
Write queue count to IFCVF_MQ_OFFSET register to enable multi-queue feature. Signed-off-by: Andy Pei Signed-off-by: Huang Wei Reviewed-by: Chenbo Xia --- drivers/vdpa/ifc/base/ifcvf.c | 32 1 file changed, 32 insertions(+) diff --git a/drivers/vdpa/ifc/base

[PATCH v9 06/12] vdpa/ifc: support dynamic enable/disable queue

2022-10-19 Thread Andy Pei
From: Huang Wei Support dynamic enable or disable queue. For front end, like QEMU, user can use ethtool to configure queue. For example, "ethtool -L eth0 combined 3" to enable 3 queues pairs. Signed-off-by: Huang Wei Signed-off-by: Andy Pei Reviewed-by: Chenbo Xia --- drivers/vdp

[PATCH v9 03/12] vdpa/ifc: set max queues based on virtio spec

2022-10-19 Thread Andy Pei
Set max_queues according to virtio spec. For virtio BLK device, set max_queues to the value of num_queues in struct virtio_blk_config. For virtio NET device, read num_queues from struct ifcvf_pci_common_cfg, get the queue pair number using num_queues and set max_queues to it. Signed-off-by: Andy

[PATCH v9 02/12] vdpa/ifc: add multi-queue support

2022-10-19 Thread Andy Pei
Enable VHOST_USER_PROTOCOL_F_MQ feature. Expose IFCVF_MQ_OFFSET register to enable multi-queue. Signed-off-by: Andy Pei Signed-off-by: Huang Wei Reviewed-by: Chenbo Xia --- drivers/vdpa/ifc/base/ifcvf.c | 9 + drivers/vdpa/ifc/base/ifcvf.h | 2 ++ drivers/vdpa/ifc/ifcvf_vdpa.c | 1

[PATCH v9 00/12] vdpa/ifc: add multi queue support

2022-10-19 Thread Andy Pei
ome code logic. v4: fix some commit message. add some commets to code. fix some code to reduce confusion. v3: rename device ID macro name. fix some patch title and commit message. delete some used marco. rework some code logic. v2: fix some coding style issue. support dynamic enable/disabl

[PATCH v9 01/12] vdpa/ifc: add new device ID for legacy network device

2022-10-19 Thread Andy Pei
From: Huang Wei Add new device id to support IFCVF_NET_TRANSITIONAL_DEVICE_ID (0x1000). Rename macro from "IFCVF_BLK_DEVICE_ID" to "IFCVF_SUBSYS_BLK_DEVICE_ID". Signed-off-by: Huang Wei Signed-off-by: Andy Pei Reviewed-by: Chenbo Xia Reviewed-by: Maxime Coquelin --- d

[PATCH v8 12/12] vhost: improve vDPA blk device configure condition

2022-10-18 Thread Andy Pei
To support multi-queue, configure device after call fd of all queues are set. Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- lib/vhost/vhost_user.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c index

[PATCH v8 11/12] vhost: vDPA blk device gets ready when the first queue is ready

2022-10-18 Thread Andy Pei
When boot from virtio blk device, seabios in QEMU only enables one queue. To work in this scenario, vDPA BLK device back-end configure device when the first queue is ready. Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- lib/vhost/vhost_user.c | 33 + 1

[PATCH v8 10/12] vhost: add type to rte vdpa device

2022-10-18 Thread Andy Pei
Add type to rte_vdpa_device to store device type. Call vdpa ops get_dev_type to fill type when register vdpa device. Signed-off-by: Andy Pei --- lib/vhost/socket.c | 15 +-- lib/vhost/vdpa.c| 15 +++ lib/vhost/vdpa_driver.h | 2 ++ 3 files changed, 18

[PATCH v8 09/12] vdpa/ifc: change some driver logic

2022-10-18 Thread Andy Pei
Insert internal list element to internal list before register vdpa device, in order to call vdpa ops during vdpa device registration. Signed-off-by: Andy Pei --- drivers/vdpa/ifc/ifcvf_vdpa.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/vdpa/ifc

[PATCH v8 08/12] vdpa/ifc: add internal API to get device

2022-10-18 Thread Andy Pei
Add new internal API "find_internal_resource_by_rte_dev" to get device. Signed-off-by: Andy Pei --- drivers/vdpa/ifc/ifcvf_vdpa.c | 28 ++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vd

[PATCH v8 07/12] vdpa/ifc: change internal function name

2022-10-18 Thread Andy Pei
Change internal function name "find_internal_resource_by_dev" to "find_internal_resource_by_pci_dev". Signed-off-by: Andy Pei --- drivers/vdpa/ifc/ifcvf_vdpa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/v

[PATCH v8 06/12] vdpa/ifc: support dynamic enable/disable queue

2022-10-18 Thread Andy Pei
From: Huang Wei Support dynamic enable or disable queue. For front end, like QEMU, user can use ethtool to configure queue. For example, "ethtool -L eth0 combined 3" to enable 3 queues pairs. Signed-off-by: Huang Wei Signed-off-by: Andy Pei Reviewed-by: Chenbo Xia --- drivers/vdp

[PATCH v8 05/12] vdpa/ifc: only configure enabled queue

2022-10-18 Thread Andy Pei
When configuring the hardware queue, we only configure queues which have been enabled by vhost. Signed-off-by: Andy Pei Signed-off-by: Huang Wei Reviewed-by: Chenbo Xia --- drivers/vdpa/ifc/base/ifcvf.c | 3 +++ drivers/vdpa/ifc/ifcvf_vdpa.c | 16 ++-- 2 files changed, 17

[PATCH v8 04/12] vdpa/ifc: write queue count to MQ register

2022-10-18 Thread Andy Pei
Write queue count to IFCVF_MQ_OFFSET register to enable multi-queue feature. Signed-off-by: Andy Pei Signed-off-by: Huang Wei Reviewed-by: Chenbo Xia --- drivers/vdpa/ifc/base/ifcvf.c | 32 1 file changed, 32 insertions(+) diff --git a/drivers/vdpa/ifc/base

[PATCH v8 03/12] vdpa/ifc: set max queues based on virtio spec

2022-10-18 Thread Andy Pei
Set max_queues according to virtio spec. For virtio BLK device, set max_queues to the value of num_queues in struct virtio_blk_config. For virtio NET device, read num_queues from struct ifcvf_pci_common_cfg, get the queue pair number using num_queues and set max_queues to it. Signed-off-by: Andy

[PATCH v8 02/12] vdpa/ifc: add multi-queue support

2022-10-18 Thread Andy Pei
Enable VHOST_USER_PROTOCOL_F_MQ feature. Expose IFCVF_MQ_OFFSET register to enable multi-queue. Signed-off-by: Andy Pei Signed-off-by: Huang Wei Reviewed-by: Chenbo Xia --- drivers/vdpa/ifc/base/ifcvf.c | 9 + drivers/vdpa/ifc/base/ifcvf.h | 2 ++ drivers/vdpa/ifc/ifcvf_vdpa.c | 1

[PATCH v8 01/12] vdpa/ifc: add new device ID for legacy network device

2022-10-18 Thread Andy Pei
From: Huang Wei Add new device id to support IFCVF_NET_TRANSITIONAL_DEVICE_ID (0x1000). Rename macro from "IFCVF_BLK_DEVICE_ID" to "IFCVF_SUBSYS_BLK_DEVICE_ID". Signed-off-by: Huang Wei Signed-off-by: Andy Pei Reviewed-by: Chenbo Xia Reviewed-by: Maxime Coquelin --- d

[PATCH v8 00/12] vdpa/ifc: add multi queue support

2022-10-18 Thread Andy Pei
mit message. add some commets to code. fix some code to reduce confusion. v3: rename device ID macro name. fix some patch title and commit message. delete some used marco. rework some code logic. v2: fix some coding style issue. support dynamic enable/disable queue at run time. Andy P

[PATCH v7 12/12] vhost: improve vDPA blk device configure condition

2022-10-17 Thread Andy Pei
To support multi-queue, configure device after call fd of all queues are set. Signed-off-by: Andy Pei Signed-off-by: Huang Wei Reviewed-by: Chenbo Xia --- lib/vhost/vhost_user.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/vhost/vhost_user.c b/lib

[PATCH v7 11/12] vhost: vDPA blk device gets ready when the first queue is ready

2022-10-17 Thread Andy Pei
When boot from virtio blk device, seabios in QEMU only enables one queue. To work in this scenario, vDPA BLK device back-end configure device when the first queue is ready. Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- lib/vhost/vhost_user.c | 33 ++--- 1

[PATCH v7 10/12] vhost: add vdpa device type to rte vdpa device

2022-10-17 Thread Andy Pei
Add vdpa_device_type to rte_vdpa_device to store device type. Call vdpa ops get_dev_type to fill vdpa_device_type when register vdpa device. Signed-off-by: Andy Pei --- lib/vhost/socket.c | 15 +-- lib/vhost/vdpa.c| 17 + lib/vhost/vdpa_driver.h | 2

[PATCH v7 09/12] vdpa/ifc: change some driver logic

2022-10-17 Thread Andy Pei
Insert internal list element to internal list before register vdpa device, in order to call vdpa ops during vdpa device registration. Signed-off-by: Andy Pei --- drivers/vdpa/ifc/ifcvf_vdpa.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/vdpa/ifc

[PATCH v7 08/12] vdpa/ifc: add internal API to get device

2022-10-17 Thread Andy Pei
Add new internal API "find_internal_resource_by_rte_dev" to get device. Signed-off-by: Andy Pei --- drivers/vdpa/ifc/ifcvf_vdpa.c | 28 ++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vd

[PATCH v7 07/12] vdpa/ifc: change internal function name

2022-10-17 Thread Andy Pei
Change internal function name "find_internal_resource_by_dev" to "find_internal_resource_by_pci_dev". Signed-off-by: Andy Pei --- drivers/vdpa/ifc/ifcvf_vdpa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/v

[PATCH v7 06/12] vdpa/ifc: support dynamic enable/disable queue

2022-10-17 Thread Andy Pei
From: Huang Wei Support dynamic enable or disable queue. For front end, like QEMU, user can use ethtool to configure queue. For example, "ethtool -L eth0 combined 3" to enable 3 queues pairs. Signed-off-by: Huang Wei Signed-off-by: Andy Pei Reviewed-by: Chenbo Xia --- drivers/vdp

[PATCH v7 05/12] vdpa/ifc: only configure enabled queue

2022-10-17 Thread Andy Pei
When configuring the hardware queue, we only configure queues which have been enabled by vhost. Signed-off-by: Andy Pei Signed-off-by: Huang Wei Reviewed-by: Chenbo Xia --- drivers/vdpa/ifc/base/ifcvf.c | 3 +++ drivers/vdpa/ifc/ifcvf_vdpa.c | 16 ++-- 2 files changed, 17

[PATCH v7 04/12] vdpa/ifc: write queue count to MQ register

2022-10-17 Thread Andy Pei
Write queue count to IFCVF_MQ_OFFSET register to enable multi-queue feature. Signed-off-by: Andy Pei Signed-off-by: Huang Wei Reviewed-by: Chenbo Xia --- drivers/vdpa/ifc/base/ifcvf.c | 32 1 file changed, 32 insertions(+) diff --git a/drivers/vdpa/ifc/base

[PATCH v7 03/12] vdpa/ifc: set max queues based on virtio spec

2022-10-17 Thread Andy Pei
Set max_queues according to virtio spec. For virtio BLK device, set max_queues to the value of num_queues in struct virtio_blk_config. For virtio NET device, read num_queues from struct ifcvf_pci_common_cfg, get the queue pair number using num_queues and set max_queues to it. Signed-off-by: Andy

[PATCH v7 02/12] vdpa/ifc: add multi-queue support

2022-10-17 Thread Andy Pei
Enable VHOST_USER_PROTOCOL_F_MQ feature. Expose IFCVF_MQ_OFFSET register to enable multi-queue. Signed-off-by: Andy Pei Signed-off-by: Huang Wei Reviewed-by: Chenbo Xia --- drivers/vdpa/ifc/base/ifcvf.c | 9 + drivers/vdpa/ifc/base/ifcvf.h | 2 ++ drivers/vdpa/ifc/ifcvf_vdpa.c | 1

[PATCH v7 01/12] vdpa/ifc: add new device ID for legacy network device

2022-10-17 Thread Andy Pei
From: Huang Wei Add new device id to support IFCVF_NET_TRANSITIONAL_DEVICE_ID (0x1000). Rename macro from "IFCVF_BLK_DEVICE_ID" to "IFCVF_SUBSYS_BLK_DEVICE_ID". Signed-off-by: Huang Wei Signed-off-by: Andy Pei Reviewed-by: Chenbo Xia Reviewed-by: Maxime Coquelin --- d

[PATCH v7 00/12] vdpa/ifc: add multi queue support

2022-10-17 Thread Andy Pei
ID macro name. fix some patch title and commit message. delete some used marco. rework some code logic. v2: fix some coding style issue. support dynamic enable/disable queue at run time. Andy Pei (10): vdpa/ifc: add multi-queue support vdpa/ifc: set max queues based on virtio spec vdpa

[PATCH v6 8/8] vhost: improve vDPA blk device configure condition

2022-10-17 Thread Andy Pei
To support multi-queue, configure device after call fd of all queues are set. Signed-off-by: Andy Pei Signed-off-by: Huang Wei Reviewed-by: Chenbo Xia --- lib/vhost/vhost_user.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/vhost/vhost_user.c b/lib

[PATCH v6 6/8] vdpa/ifc: support dynamic enable/disable queue

2022-10-17 Thread Andy Pei
From: Huang Wei Support dynamic enable or disable queue. For front end, like QEMU, user can use ethtool to configure queue. For example, "ethtool -L eth0 combined 3" to enable 3 queues pairs. Signed-off-by: Huang Wei Signed-off-by: Andy Pei Reviewed-by: Chenbo Xia --- drivers/vdp

[PATCH v6 7/8] vhost: vDPA blk device gets ready when the first queue is ready

2022-10-17 Thread Andy Pei
When boot from virtio blk device, seabios in QEMU only enables one queue. To work in this scenario, vDPA BLK device back-end configure device when any queue is ready. Add vdpa_device_type to rte_vdpa_device to store vDPA device type. Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- lib

[PATCH v6 5/8] vdpa/ifc: only configure enabled queue

2022-10-17 Thread Andy Pei
When configuring the hardware queue, we only configure queues which have been enabled by vhost. Signed-off-by: Andy Pei Signed-off-by: Huang Wei Reviewed-by: Chenbo Xia --- drivers/vdpa/ifc/base/ifcvf.c | 3 +++ drivers/vdpa/ifc/ifcvf_vdpa.c | 16 ++-- 2 files changed, 17

[PATCH v6 4/8] vdpa/ifc: write queue count to MQ register

2022-10-17 Thread Andy Pei
Write queue count to IFCVF_MQ_OFFSET register to enable multi-queue feature. Signed-off-by: Andy Pei Signed-off-by: Huang Wei Reviewed-by: Chenbo Xia --- drivers/vdpa/ifc/base/ifcvf.c | 32 1 file changed, 32 insertions(+) diff --git a/drivers/vdpa/ifc/base

[PATCH v6 3/8] vdpa/ifc: set max queues based on virtio spec

2022-10-17 Thread Andy Pei
Set max_queues according to virtio spec. For virtio BLK device, set max_queues to the value of num_queues in struct virtio_blk_config. For virtio NET device, read num_queues from struct ifcvf_pci_common_cfg, get the queue pair number using num_queues and set max_queues to it. Signed-off-by: Andy

[PATCH v6 2/8] vdpa/ifc: add multi-queue support

2022-10-17 Thread Andy Pei
Enable VHOST_USER_PROTOCOL_F_MQ feature. Expose IFCVF_MQ_OFFSET register to enable multi-queue. Signed-off-by: Andy Pei Signed-off-by: Huang Wei Reviewed-by: Chenbo Xia --- drivers/vdpa/ifc/base/ifcvf.c | 9 + drivers/vdpa/ifc/base/ifcvf.h | 2 ++ drivers/vdpa/ifc/ifcvf_vdpa.c | 1

[PATCH v6 1/8] vdpa/ifc: add new device ID for legacy network device

2022-10-17 Thread Andy Pei
From: Huang Wei Add new device id to support IFCVF_NET_TRANSITIONAL_DEVICE_ID (0x1000). Rename macro from "IFCVF_BLK_DEVICE_ID" to "IFCVF_SUBSYS_BLK_DEVICE_ID". Signed-off-by: Huang Wei Signed-off-by: Andy Pei Reviewed-by: Chenbo Xia Reviewed-by: Maxime Coquelin --- d

[PATCH v6 0/8] vdpa/ifc: add multi queue support

2022-10-17 Thread Andy Pei
. delete some used marco. rework some code logic. v2: fix some coding style issue. support dynamic enable/disable queue at run time. Andy Pei (6): vdpa/ifc: add multi-queue support vdpa/ifc: set max queues based on virtio spec vdpa/ifc: write queue count to MQ register vdpa/ifc: only

[PATCH v5 8/8] vhost: improve vDPA blk device configure condition

2022-10-17 Thread Andy Pei
To support multi-queue, configure device after call fd of all queues are set. Signed-off-by: Andy Pei Signed-off-by: Huang Wei Reviewed-by: Chenbo Xia --- lib/vhost/vhost_user.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/vhost/vhost_user.c b/lib

[PATCH v5 7/8] vhost: vDPA blk device gets ready when the first queue is ready

2022-10-17 Thread Andy Pei
When boot from virtio blk device, seabios in QEMU only enables one queue. To work in this scenario, vDPA BLK device back-end configure device when any queue is ready. Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- lib/vhost/vhost_user.c | 31 +++ 1 file

[PATCH v5 5/8] vdpa/ifc: only configure enabled queue

2022-10-17 Thread Andy Pei
When configuring the hardware queue, we only configure queues which have been enabled by vhost. Signed-off-by: Andy Pei Signed-off-by: Huang Wei Reviewed-by: Chenbo Xia --- drivers/vdpa/ifc/base/ifcvf.c | 3 +++ drivers/vdpa/ifc/ifcvf_vdpa.c | 16 ++-- 2 files changed, 17

[PATCH v5 6/8] vdpa/ifc: support dynamic enable/disable queue

2022-10-17 Thread Andy Pei
From: Huang Wei Support dynamic enable or disable queue. For front end, like QEMU, user can use ethtool to configure queue. For example, "ethtool -L eth0 combined 3" to enable 3 queues pairs. Signed-off-by: Huang Wei Signed-off-by: Andy Pei Reviewed-by: Chenbo Xia --- drivers/vdp

[PATCH v5 4/8] vdpa/ifc: write queue count to MQ register

2022-10-17 Thread Andy Pei
Write queue count to IFCVF_MQ_OFFSET register to enable multi-queue feature. Signed-off-by: Andy Pei Signed-off-by: Huang Wei Reviewed-by: Chenbo Xia --- drivers/vdpa/ifc/base/ifcvf.c | 32 1 file changed, 32 insertions(+) diff --git a/drivers/vdpa/ifc/base

[PATCH v5 3/8] vdpa/ifc: set max queues based on virtio spec

2022-10-17 Thread Andy Pei
Set max_queues according to virtio spec. For virtio BLK device, set max_queues to the value of num_queues in struct virtio_blk_config. For virtio NET device, read num_queues from struct ifcvf_pci_common_cfg, get the queue pair number using num_queues and set max_queues to it. Signed-off-by: Andy

[PATCH v5 2/8] vdpa/ifc: add multi-queue support

2022-10-17 Thread Andy Pei
Enable VHOST_USER_PROTOCOL_F_MQ feature. Expose IFCVF_MQ_OFFSET register to enable multi-queue. Signed-off-by: Andy Pei Signed-off-by: Huang Wei Reviewed-by: Chenbo Xia --- drivers/vdpa/ifc/base/ifcvf.c | 9 + drivers/vdpa/ifc/base/ifcvf.h | 2 ++ drivers/vdpa/ifc/ifcvf_vdpa.c | 1

[PATCH v5 1/8] vdpa/ifc: add new device ID for legacy network device

2022-10-17 Thread Andy Pei
From: Huang Wei Add new device id to support IFCVF_NET_TRANSITIONAL_DEVICE_ID (0x1000). Rename macro from "IFCVF_BLK_DEVICE_ID" to "IFCVF_SUBSYS_BLK_DEVICE_ID". Signed-off-by: Huang Wei Signed-off-by: Andy Pei Reviewed-by: Chenbo Xia Reviewed-by: Maxime Coquelin --- d

[PATCH v5 0/8] vdpa/ifc: add multi queue support

2022-10-17 Thread Andy Pei
style issue. support dynamic enable/disable queue at run time. Andy Pei (6): vdpa/ifc: add multi-queue support vdpa/ifc: set max queues based on virtio spec vdpa/ifc: write queue count to MQ register vdpa/ifc: only configure enabled queue vhost: vDPA blk device gets ready when the first

[PATCH v4 8/8] vhost: improve vDPA blk device configure condition

2022-10-13 Thread Andy Pei
To support multi-queue, configure device after call fd of all queues are set. Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- lib/vhost/vhost_user.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c index

[PATCH v4 7/8] vhost: vDPA blk device gets ready when any queue is ready

2022-10-13 Thread Andy Pei
When boot from virtio blk device, seabios in QEMU only enables one queue. To work in this scenario, vDPA BLK device back-end configure device when any queue is ready. Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- lib/vhost/vhost_user.c | 49

[PATCH v4 5/8] vdpa/ifc: only configure enabled queue

2022-10-13 Thread Andy Pei
When configuring the hardware queue, we only configure queues which have been enabled by vhost. Signed-off-by: Andy Pei Signed-off-by: Huang Wei Reviewed-by: Chenbo Xia --- drivers/vdpa/ifc/base/ifcvf.c | 3 +++ drivers/vdpa/ifc/ifcvf_vdpa.c | 16 ++-- 2 files changed, 17

[PATCH v4 6/8] vdpa/ifc: support dynamic enable/disable queue

2022-10-13 Thread Andy Pei
From: Huang Wei Support dynamic enable or disable queue. For front end, like QEMU, user can use ethtool to configure queue. For example, "ethtool -L eth0 combined 3" to enable 3 queues pairs. Signed-off-by: Huang Wei Signed-off-by: Andy Pei --- drivers/vdpa/ifc/base/ifc

[PATCH v4 4/8] vdpa/ifc: write queue count to MQ register

2022-10-13 Thread Andy Pei
Write queue count to IFCVF_MQ_OFFSET register to enable multi-queue feature. Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- drivers/vdpa/ifc/base/ifcvf.c | 32 1 file changed, 32 insertions(+) diff --git a/drivers/vdpa/ifc/base/ifcvf.c b/drivers/vdpa/ifc

[PATCH v4 3/8] vdpa/ifc: set max queues based on virtio spec

2022-10-13 Thread Andy Pei
Set max_queues according to virtio spec. For virtio BLK device, set max_queues to the value of num_queues in struct virtio_blk_config For virtio NET device, read num_queues from struct ifcvf_pci_common_cfg, get the queue pair number using num_queues and set max_queues to it. Signed-off-by: Andy

[PATCH v4 2/8] vdpa/ifc: add multi-queue support

2022-10-13 Thread Andy Pei
Enable VHOST_USER_PROTOCOL_F_MQ feature. Expose IFCVF_MQ_OFFSET register to enable multi-queue. Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- drivers/vdpa/ifc/base/ifcvf.c | 9 + drivers/vdpa/ifc/base/ifcvf.h | 2 ++ drivers/vdpa/ifc/ifcvf_vdpa.c | 1 + 3 files changed, 12

[PATCH v4 0/8] vdpa/ifc: add multi queue support

2022-10-13 Thread Andy Pei
run time. Andy Pei (6): vdpa/ifc: add multi-queue support vdpa/ifc: set max queues based on virtio spec vdpa/ifc: write queue count to MQ register vdpa/ifc: only configure enabled queue vhost: vDPA blk device gets ready when any queue is ready vhost: improve vDPA blk device readiness

[PATCH v4 1/8] vdpa/ifc: add new device ID for legacy network device

2022-10-13 Thread Andy Pei
From: Huang Wei Add new device id to support IFCVF_NET_TRANSITIONAL_DEVICE_ID (0x1000). Rename macro from "IFCVF_BLK_DEVICE_ID" to "IFCVF_SUBSYS_BLK_DEVICE_ID". Signed-off-by: Huang Wei Signed-off-by: Andy Pei Reviewed-by: Chenbo Xia Reviewed-by: Maxime Coquelin --- d

[PATCH v2] vhost: use dedicated variable for vhost message result code

2022-09-22 Thread Andy Pei
improve readability. Signed-off-by: Andy Pei --- lib/vhost/vhost_user.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c index 0182090..6d93495 100644 --- a/lib/vhost/vhost_user.c +++ b/lib/vhost

[PATCH v3 8/8] vhost: improve vDPA blk device readiness condition

2022-09-15 Thread Andy Pei
fd are well set and make sure no IO drops. This patch only impact virtio blk vDPA device and does not impact net device. Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- lib/vhost/vhost_user.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/vhost/vhos

[PATCH v3 7/8] vhost: vDPA blk device gets ready when any queue is ready

2022-09-15 Thread Andy Pei
When boot from virtio blk device, seabios in QEMU only enables one queue. To work in this scenario, vDPA BLK device back-end conf_dev when any queue is ready. Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- lib/vhost/vhost_user.c | 51 -- 1

[PATCH v3 6/8] vdpa/ifc: support dynamic enable/disable queue

2022-09-15 Thread Andy Pei
From: Huang Wei Support dynamic enable or disable queue. For front end, like QEMU, user can use ethtool to configurate queue. For example, "ethtool -L eth0 combined 3" to enable 3 queues pairs. Signed-off-by: Huang Wei Signed-off-by: Andy Pei --- drivers/vdpa/ifc/base/if

[PATCH v3 5/8] vdpa/ifc: only configure enabled queue

2022-09-15 Thread Andy Pei
when configure the hardware queue, we only configure queues which have been enabled by vhost. Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- drivers/vdpa/ifc/base/ifcvf.c | 3 +++ drivers/vdpa/ifc/ifcvf_vdpa.c | 16 ++-- 2 files changed, 17 insertions(+), 2 deletions

[PATCH v3 4/8] vdpa/ifc: write queue count to MQ register

2022-09-15 Thread Andy Pei
Write queue count to IFCVF_MQ_OFFSET register to enable multi queue feature. Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- drivers/vdpa/ifc/base/ifcvf.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/drivers/vdpa/ifc/base/ifcvf.c b/drivers/vdpa/ifc

[PATCH v3 3/8] vdpa/ifc: set max queues based on virtio spec

2022-09-15 Thread Andy Pei
_queues - 1) / 2" and get queue_pairs. Set max_queues to the value of "queue_pairs". Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- drivers/vdpa/ifc/base/ifcvf.h | 2 +- drivers/vdpa/ifc/ifcvf_vdpa.c | 19 ++- 2 files changed, 19 insertions(+), 2 deletions(-) diff

[PATCH v3 2/8] vdpa/ifc: add multi-queue support

2022-09-15 Thread Andy Pei
Enable VHOST_USER_PROTOCOL_F_MQ feature. Expose IFCVF_MQ_OFFSET register to enable multi queue. Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- drivers/vdpa/ifc/base/ifcvf.c | 5 + drivers/vdpa/ifc/base/ifcvf.h | 2 ++ drivers/vdpa/ifc/ifcvf_vdpa.c | 1 + 3 files changed, 8 insertions

[PATCH v3 1/8] vdpa/ifc: add new device ID for legacy network device

2022-09-15 Thread Andy Pei
From: Huang Wei Add new device id to support IFCVF_NET_TRANSITIONAL_DEVICE_ID (0x1000). Rename macro from "IFCVF_BLK_DEVICE_ID" to "IFCVF_SUBSYS_BLK_DEVICE_ID". Signed-off-by: Huang Wei Signed-off-by: Andy Pei --- drivers/vdpa/ifc/base/ifcvf.h | 6 -- drivers/vdpa/i

[PATCH v3 0/8] vdpa/ifc: add multi queue support

2022-09-15 Thread Andy Pei
v3: rename device ID macro name. fix some patch title and commit message. delete some used marco. rework some code logic. v2: fix some coding style issue. support dynamic enable/disable queue at run time. Andy Pei (6): vdpa/ifc: add multi-queue support vdpa/ifc: set max queues based on

[PATCH v2 8/8] vhost: vDPA BLK devices configure device when all queue callfds are set

2022-09-07 Thread Andy Pei
re no IO drops. This patch only impact virtio blk vDPA device and does not impact net device. Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- lib/vhost/vhost_user.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_

[PATCH v2 7/8] vhost: configure device when any queue is ready for BLK device

2022-09-07 Thread Andy Pei
When boot from virtio blk device, seabois in QEMU only enables one queue. To work in this scenario, vDPA BLK device back-end conf_dev when any queue is ready. Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- lib/vhost/vhost_user.c | 56 +++--- 1

[PATCH v2 6/8] vdpa/ifc: support dynamic enable/disable queue

2022-09-07 Thread Andy Pei
From: Huang Wei Support dynamic enable or disable queue. For front end, like QEMU, user can use ethtool to configurate queue. For example, "ethtool -L eth0 combined 3" to enable 3 queues pairs. Signed-off-by: Huang Wei Signed-off-by: Andy Pei --- drivers/vdpa/ifc/base/ifcvf.c

[PATCH v2 5/8] vdpa/ifc: only configure enabled queue

2022-09-07 Thread Andy Pei
when configure the hardware queue, we only configure queues which have been enabled by vhost. Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- drivers/vdpa/ifc/base/ifcvf.c | 6 +- drivers/vdpa/ifc/ifcvf_vdpa.c | 16 ++-- 2 files changed, 19 insertions(+), 3 deletions

[PATCH v2 4/8] vdpa/ifc: write queue count to MQ register

2022-09-07 Thread Andy Pei
Write queue count to IFCVF_MQ_OFFSET register to enable multi queue feature. Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- drivers/vdpa/ifc/base/ifcvf.c | 33 + 1 file changed, 33 insertions(+) diff --git a/drivers/vdpa/ifc/base/ifcvf.c b/drivers/vdpa

[PATCH v2 3/8] vdpa/ifc: set max queues according to HW spec

2022-09-07 Thread Andy Pei
Set max_queues according to virtio HW spec. For virtio BLK device, set max_queues to the value of "num_queues". "num_queues" is element of struct virtio_blk_config. Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- drivers/vdpa/ifc/base/ifcvf.h | 2 +- drivers/vdpa/i

[PATCH v2 2/8] vdpa/ifc: add multi queue support

2022-09-07 Thread Andy Pei
Enable VHOST_USER_PROTOCOL_F_MQ feature. ExposeIFCVF_MQ_OFFSET register to enable multi queue. Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- drivers/vdpa/ifc/base/ifcvf.c | 5 + drivers/vdpa/ifc/base/ifcvf.h | 2 ++ drivers/vdpa/ifc/ifcvf_vdpa.c | 1 + 3 files changed, 8 insertions

[PATCH v2 1/8] vdpa/ifc: add new device ID

2022-09-07 Thread Andy Pei
From: Huang Wei Add new device id to support IFCVF_NET_TRANSITIONAL_DEVICE_ID (0x1000). Signed-off-by: Huang Wei Signed-off-by: Andy Pei --- drivers/vdpa/ifc/base/ifcvf.h | 4 +++- drivers/vdpa/ifc/ifcvf_vdpa.c | 9 - 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a

[PATCH v2 0/8] vdpa/ifc: add multi queue support

2022-09-07 Thread Andy Pei
v2: fix some coding style issue. support dynamic enable/disable queue at run time. Andy Pei (6): vdpa/ifc: add multi queue support vdpa/ifc: set max queues according to HW spec vdpa/ifc: write queue count to MQ register vdpa/ifc: only configure enabled queue vhost: configure device

[PATCH 8/8] vhost: vDPA BLK devices configure device when all queue callfds are set

2022-08-22 Thread Andy Pei
re no IO drops. This patch only impact virtio blk vDPA device and does not impact net device. Signed-off-by: Andy Pei --- lib/vhost/vhost_user.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c index b65fba3..568030a 10

[PATCH 7/8] vhost: configure device when any queue is ready for BLK device

2022-08-22 Thread Andy Pei
When boot from virtio blk device, seabois in QEMU only enables one queue. To work in this scenario, vDPA BLK device back-end conf_dev when any queue is ready. Signed-off-by: Andy Pei --- lib/vhost/vhost_user.c | 56 +++--- 1 file changed, 44

[PATCH 6/8] vdpa/ifc: set vring state callback update data path

2022-08-22 Thread Andy Pei
. Signed-off-by: Andy Pei --- drivers/vdpa/ifc/ifcvf_vdpa.c | 27 +-- 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c index a62bcec..94c8ef1 100644 --- a/drivers/vdpa/ifc/ifcvf_vdpa.c +++ b/drivers

[PATCH 5/8] vdpa/ifc: only configure enabled queue

2022-08-22 Thread Andy Pei
when configure the hardware queue, we only configure queues which have been enabled by vhost. Signed-off-by: Andy Pei --- drivers/vdpa/ifc/base/ifcvf.c | 5 - drivers/vdpa/ifc/ifcvf_vdpa.c | 4 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/ifc/base/ifcvf.c

[PATCH 4/8] vdpa/ifc: write queue count to MQ register

2022-08-22 Thread Andy Pei
Write queue count to IFCVF_MQ_OFFSET register to enable multi queue feature. Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- drivers/vdpa/ifc/base/ifcvf.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/vdpa/ifc/base/ifcvf.c b/drivers/vdpa/ifc/base/ifcvf.c

[PATCH 3/8] vdpa/ifc: set max queues according to HW spec

2022-08-22 Thread Andy Pei
Set max_queues according to virtio HW spec. For virtio BLK device, set max_queues to the value of "num_queues". "num_queues" is element of struct virtio_blk_config. Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- drivers/vdpa/ifc/base/ifcvf.h | 2 +- drivers/vdpa/i

[PATCH 2/8] vdpa/ifc: add multi queue suppoort

2022-08-22 Thread Andy Pei
Enable VHOST_USER_PROTOCOL_F_MQ feature. ExposeIFCVF_MQ_OFFSET register to enable multi queue. Signed-off-by: Andy Pei Signed-off-by: Huang Wei --- drivers/vdpa/ifc/base/ifcvf.c | 5 + drivers/vdpa/ifc/base/ifcvf.h | 2 ++ drivers/vdpa/ifc/ifcvf_vdpa.c | 1 + 3 files changed, 8 insertions

[PATCH 1/8] vdpa/ifc: add new device ID

2022-08-22 Thread Andy Pei
From: Huang Wei Add new device id to support IFCVF_NET_TRANSITIONAL_DEVICE_ID (0x1000). Signed-off-by: Huang Wei Signed-off-by: Andy Pei --- drivers/vdpa/ifc/base/ifcvf.h | 4 +++- drivers/vdpa/ifc/ifcvf_vdpa.c | 9 - 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a

[PATCH 0/8] add multi queue support to vDPA ifc driver

2022-08-22 Thread Andy Pei
Add multi queue support to vDPA ifc driver. Multi queue support for virtio-net device and virtio-blk device. Andy Pei (7): vdpa/ifc: add multi queue suppoort vdpa/ifc: set max queues according to HW spec vdpa/ifc: write queue count to MQ register vdpa/ifc: only configure enabled queue

[PATCH] vhost: use another variable to store vhost msg result code

2022-07-17 Thread Andy Pei
readability. Signed-off-by: Andy Pei --- lib/vhost/vhost_user.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c index 4ad28ba..dac06c9 100644 --- a/lib/vhost/vhost_user.c +++ b/lib/vhost/vhost_user.c

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

2022-07-08 Thread Andy Pei
Fix null pointer dereference reported in coverity scan. Output some log information when lm_cfg is null. Make sure lm_cfg is not null before operate on lm_cfg. Coverity issue: 378882 Fixes: d7fe5a2861e7 ("net/ifc: support live migration") Signed-off-by: Andy Pei --- drivers/vdp

  1   2   3   4   5   6   >