Re: [PATCH vfio 03/11] virtio-pci: Introduce admin virtqueue

2023-10-02 Thread Feng Liu via Virtualization
On 2023-09-27 p.m.5:27, Michael S. Tsirkin wrote: If an existing device exposes a small capability matching old size, then you change size then the check will fail on the existing device and driver won't load. All this happens way before feature bit checks. Will do Thanks Feng

Re: [PATCH vfio 01/11] virtio-pci: Use virtio pci device layer vq info instead of generic one

2023-09-27 Thread Feng Liu via Virtualization
On 2023-09-26 p.m.3:13, Feng Liu via Virtualization wrote: External email: Use caution opening links or attachments On 2023-09-21 a.m.9:46, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Thu, Sep 21, 2023 at 03:40:30PM +0300, Yishai Hadas wrote

Re: [PATCH vfio 03/11] virtio-pci: Introduce admin virtqueue

2023-09-27 Thread Feng Liu via Virtualization
On 2023-09-26 p.m.3:23, Feng Liu via Virtualization wrote: External email: Use caution opening links or attachments On 2023-09-21 a.m.9:57, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Thu, Sep 21, 2023 at 03:40:32PM +0300, Yishai Hadas wrote

Re: [PATCH vfio 01/11] virtio-pci: Use virtio pci device layer vq info instead of generic one

2023-09-26 Thread Feng Liu via Virtualization
On 2023-09-21 a.m.9:46, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Thu, Sep 21, 2023 at 03:40:30PM +0300, Yishai Hadas wrote: From: Feng Liu Currently VQ deletion callback vp_del_vqs() processes generic virtio_device level VQ list instead of VQ

Re: [PATCH vfio 03/11] virtio-pci: Introduce admin virtqueue

2023-09-26 Thread Feng Liu via Virtualization
On 2023-09-21 a.m.9:57, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Thu, Sep 21, 2023 at 03:40:32PM +0300, Yishai Hadas wrote: From: Feng Liu Introduce support for the admin virtqueue. By negotiating VIRTIO_F_ADMIN_VQ feature, driver detects

Re: [PATCH net-next v4 2/2] virtio-net: add cond_resched() to the command waiting loop

2023-10-05 Thread Feng Liu via Virtualization
On 2023-07-24 a.m.2:46, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Fri, Jul 21, 2023 at 10:18:03PM +0200, Maxime Coquelin wrote: On 7/21/23 17:10, Michael S. Tsirkin wrote: On Fri, Jul 21, 2023 at 04:58:04PM +0200, Maxime Coquelin wrote: On

[PATCH net-next v2] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting

2023-08-17 Thread Feng Liu via Virtualization
The virtio_net driver currently deals with different versions and types of virtio net headers, such as virtio_net_hdr_mrg_rxbuf, virtio_net_hdr_v1_hash, etc. Due to these variations, the code relies on multiple type casts to convert memory between different structures, potentially leading to bugs

Re: [PATCH net-next v2] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting

2023-08-17 Thread Feng Liu via Virtualization
On 2023-08-17 p.m.6:11, Willem de Bruijn wrote: You mean virtio_net_common_hdr? It is a typo, will correct it. will do I'm not sure I follow the reasoning. Because then hdr_len might be sizeof(virtio_net_hdr_mrg_rxbuf), but sizeof(virtio_net_common_hdr) is larger. So the same issue

[PATCH net-next v3] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting

2023-08-21 Thread Feng Liu via Virtualization
The virtio_net driver currently deals with different versions and types of virtio net headers, such as virtio_net_hdr_mrg_rxbuf, virtio_net_hdr_v1_hash, etc. Due to these variations, the code relies on multiple type casts to convert memory between different structures, potentially leading to bugs

Re: [PATCH net v1] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting

2023-08-15 Thread Feng Liu via Virtualization
On 2023-08-15 a.m.6:51, Simon Horman wrote: External email: Use caution opening links or attachments On Mon, Aug 14, 2023 at 01:18:45PM -0400, Feng Liu wrote: + "David S. Miller" Eric Dumazet Jakub Kicinski Paolo Abeni Thanks for adding David S. Miller. The virtio_net

Re: [PATCH net v1] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting

2023-08-16 Thread Feng Liu via Virtualization
On 2023-08-16 a.m.10:53, Willem de Bruijn wrote: External email: Use caution opening links or attachments Thanks for the detailed explanation. I kept virtio_net_hdr_mrg_rxbuf and virtio_net_hdr_v1_hash structures in virtio_net.h, which can be forward compatible with existing user

Re: [PATCH net-next v2] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting

2023-08-17 Thread Feng Liu via Virtualization
On 2023-08-17 p.m.2:26, Willem de Bruijn wrote: External email: Use caution opening links or attachments On Thu, Aug 17, 2023 at 11:20 AM Feng Liu wrote: The virtio_net driver currently deals with different versions and types of virtio net headers, such as virtio_net_hdr_mrg_rxbuf,

Re: [PATCH net v1] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting

2023-08-15 Thread Feng Liu via Virtualization
On 2023-08-15 p.m.2:13, Willem de Bruijn wrote: External email: Use caution opening links or attachments On Tue, Aug 15, 2023 at 12:29 PM Simon Horman wrote: On Tue, Aug 15, 2023 at 11:09:02AM -0400, Feng Liu wrote: To clarify: In general new Networking features go via the net-next

Re: [PATCH net-next v3] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting

2023-08-22 Thread Feng Liu via Virtualization
Hi Jason , MST Could you help to review this patch ? Any more comments? Thanks Feng On 2023-08-21 a.m.10:27, Feng Liu wrote: The virtio_net driver currently deals with different versions and types of virtio net headers, such as virtio_net_hdr_mrg_rxbuf, virtio_net_hdr_v1_hash, etc. Due to

Re: [PATCH 3/3] virtio_ring: Use const to annotate read-only pointer params

2023-03-08 Thread Feng Liu via Virtualization
On 2023-03-08 a.m.9:28, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Wed, Mar 08, 2023 at 09:19:38AM -0500, Feng Liu wrote: On 2023-03-08 a.m.9:16, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Wed, Mar

Re: [PATCH 3/3] virtio_ring: Use const to annotate read-only pointer params

2023-03-08 Thread Feng Liu via Virtualization
On 2023-03-08 a.m.9:47, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Wed, Mar 08, 2023 at 09:40:03AM -0500, Feng Liu wrote: In fact, I compiled and tested locally. I just looked it up and it might be that I was missing a “git add” action which caused

Re: [PATCH 3/3] virtio_ring: Use const to annotate read-only pointer params

2023-03-08 Thread Feng Liu via Virtualization
On 2023-03-08 a.m.9:16, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Wed, Mar 08, 2023 at 09:07:49AM -0500, Feng Liu wrote: On 2023-03-08 a.m.12:58, Jason Wang wrote: External email: Use caution opening links or attachments On Tue, Mar 7, 2023

Re: [PATCH 3/3] virtio_ring: Use const to annotate read-only pointer params

2023-03-08 Thread Feng Liu via Virtualization
On 2023-03-08 a.m.9:07, Feng Liu via Virtualization wrote: External email: Use caution opening links or attachments On 2023-03-08 a.m.12:58, Jason Wang wrote: External email: Use caution opening links or attachments On Tue, Mar 7, 2023 at 11:57 AM Feng Liu wrote: Add const to make

Re: [PATCH 3/3] virtio_ring: Use const to annotate read-only pointer params

2023-03-08 Thread Feng Liu via Virtualization
On 2023-03-08 a.m.9:13, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Tue, Mar 07, 2023 at 09:17:55PM +, Feng Liu wrote: On 2023-03-07 04:14, David Edmondson wrote: External email: Use caution opening links or attachments Feng Liu via

Re: [PATCH 3/3] virtio_ring: Use const to annotate read-only pointer params

2023-03-08 Thread Feng Liu via Virtualization
: External email: Use caution opening links or attachments On Tue, Mar 07, 2023 at 09:17:55PM +, Feng Liu wrote: On 2023-03-07 04:14, David Edmondson wrote: External email: Use caution opening links or attachments Feng Liu via Virtualization writes: Add const to make the read-only pointer

Re: [PATCH 3/3] virtio_ring: Use const to annotate read-only pointer params

2023-03-08 Thread Feng Liu via Virtualization
On 2023-03-08 a.m.12:58, Jason Wang wrote: External email: Use caution opening links or attachments On Tue, Mar 7, 2023 at 11:57 AM Feng Liu wrote: Add const to make the read-only pointer parameters clear, similar to many existing functions. Signed-off-by: Feng Liu Reviewed-by: Jiri

Re: [PATCH 1/3] virtio_pci_modern: Remove unnecessary num zero check

2023-03-08 Thread Feng Liu via Virtualization
On 2023-03-08 a.m.9:23, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Tue, Mar 07, 2023 at 05:57:03AM +0200, Feng Liu wrote: is_power_of_2() already performs the zero check. Hence avoid duplicate check. While at it, move the query of size check also

Re: [PATCH 3/3] virtio_ring: Use const to annotate read-only pointer params

2023-03-08 Thread Feng Liu via Virtualization
07, 2023 at 09:17:55PM +, Feng Liu wrote: On 2023-03-07 04:14, David Edmondson wrote: External email: Use caution opening links or attachments Feng Liu via Virtualization writes: Add const to make the read-only pointer parameters clear, similar to many existing functions. In many

[PATCH v2 2/3] virtio_ring: Avoid using inline for small functions

2023-03-09 Thread Feng Liu via Virtualization
According to kernel coding style [1], defining inline functions is not necessary and beneficial for simple functions. Hence clean up the code by removing the inline keyword. It is verified with GCC 12.2.0, the generated code with/without inline is same. Additionally tested with pktgen and iperf,

[PATCH v2 3/3] virtio_ring: Use const to annotate read-only pointer params

2023-03-09 Thread Feng Liu via Virtualization
Add const to make the read-only pointer parameters clear, similar to many existing functions. To implement this change, the commit also introduces the use of `container_of_const` to implement `to_vvq`, which ensures the const-ness of read-only parameters and avoids accidental modification of

[PATCH v2 0/3] virtio_ring: Clean up code for virtio ring and pci

2023-03-09 Thread Feng Liu via Virtualization
This patch series performs a clean up of the code in virtio_ring and virtio_pci, modifying it to conform with the Linux kernel coding style guidance [1]. The modifications ensure the code easy to read and understand. This small series does few short cleanups in the code. Patch-1 Allow non power

[PATCH v2 1/3] virtio_pci_modern: Allow non power of 2 sizes for virtqueues

2023-03-09 Thread Feng Liu via Virtualization
According to the Virtio Specification, the Queue Size parameter of a virtqueue corresponds to the maximum number of descriptors in that queue, and it does not have to be a power of 2 for packed virtqueues. However, the virtio_pci_modern driver enforced a power of 2 check for virtqueue sizes, which

[PATCH 1/3] virtio_pci_modern: Remove unnecessary num zero check

2023-03-06 Thread Feng Liu via Virtualization
is_power_of_2() already performs the zero check. Hence avoid duplicate check. While at it, move the query of size check also adjacent to where its used for the disabled vq. Signed-off-by: Feng Liu Reviewed-by: Jiri Pirko Reviewed-by: Parav Pandit Reviewed-by: Gavin Li Reviewed-by: Bodong Wang

[PATCH 0/3] virtio_ring: Clean up code for virtio ring and pci

2023-03-06 Thread Feng Liu via Virtualization
This patch series performs a clean up of the code in virtio_ring and virtio_pci, modifying it to conform with the Linux kernel coding style guidance [1]. The modifications ensure the code easy to read and understand. This small series does few short cleanups in the code. Patch-1 Remove

[PATCH 2/3] virtio_ring: Avoid using inline for small functions

2023-03-06 Thread Feng Liu via Virtualization
According to kernel coding style [1], defining inline functions is not necessary and beneficial for simple functions. Hence clean up the code by removing the inline keyword. It is verified with GCC 12.2.0, the generated code with/without inline is same. Additionally tested with pktgen and iperf,

[PATCH 3/3] virtio_ring: Use const to annotate read-only pointer params

2023-03-06 Thread Feng Liu via Virtualization
Add const to make the read-only pointer parameters clear, similar to many existing functions. Signed-off-by: Feng Liu Reviewed-by: Jiri Pirko Reviewed-by: Parav Pandit Reviewed-by: Gavin Li Reviewed-by: Bodong Wang --- drivers/virtio/virtio_ring.c | 25 -

Re: [PATCH v2 0/3] virtio_ring: Clean up code for virtio ring and pci

2023-03-10 Thread Feng Liu via Virtualization
On 2023-03-10 a.m.3:06, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Fri, Mar 10, 2023 at 07:34:25AM +0200, Feng Liu wrote: This patch series performs a clean up of the code in virtio_ring and virtio_pci, modifying it to conform with the Linux

Re: [PATCH v2 1/3] virtio_pci_modern: Allow non power of 2 sizes for virtqueues

2023-03-10 Thread Feng Liu via Virtualization
On 2023-03-10 a.m.8:36, Parav Pandit wrote: From: Feng Liu Sent: Friday, March 10, 2023 12:34 AM - if (!is_power_of_2(num)) { - dev_warn(_dev->pci_dev->dev, "bad queue size %u", num); - return ERR_PTR(-EINVAL); - } - The check is still valid

Re: [PATCH v2 0/3] virtio_ring: Clean up code for virtio ring and pci

2023-03-11 Thread Feng Liu via Virtualization
On 2023-03-11 p.m.2:06, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Fri, Mar 10, 2023 at 08:21:31AM -0500, Feng Liu wrote: On 2023-03-10 a.m.3:06, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Fri, Mar

Re: [PATCH v2 1/3] virtio_pci_modern: Allow non power of 2 sizes for virtqueues

2023-03-11 Thread Feng Liu via Virtualization
On 2023-03-11 p.m.2:05, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Fri, Mar 10, 2023 at 10:23:16AM -0500, Feng Liu wrote: On 2023-03-10 a.m.8:36, Parav Pandit wrote: From: Feng Liu Sent: Friday, March 10, 2023 12:34 AM - if

Re: [PATCH v2 0/3] virtio_ring: Clean up code for virtio ring and pci

2023-03-12 Thread Feng Liu via Virtualization
On 2023-03-12 a.m.1:47, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Sat, Mar 11, 2023 at 05:19:43PM -0500, Feng Liu wrote: On 2023-03-11 p.m.2:06, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Fri, Mar

Re: [PATCH v2 1/3] virtio_pci_modern: Allow non power of 2 sizes for virtqueues

2023-03-12 Thread Feng Liu via Virtualization
On 2023-03-12 a.m.1:46, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Sat, Mar 11, 2023 at 05:25:04PM -0500, Feng Liu wrote: On 2023-03-11 p.m.2:05, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Fri, Mar

[PATCH v2 0/3] virtio_ring: Clean up code for virtio ring and pci

2023-03-15 Thread Feng Liu via Virtualization
This patch series performs a clean up of the code in virtio_ring and virtio_pci, modifying it to conform with the Linux kernel coding style guidance [1]. The modifications ensure the code easy to read and understand. This small series does few short cleanups in the code. Patch-1 Allow non power

[PATCH v2 1/3] virtio_ring: Allow non power of 2 sizes for packed virtqueue

2023-03-15 Thread Feng Liu via Virtualization
According to the Virtio Specification, the Queue Size parameter of a virtqueue corresponds to the maximum number of descriptors in that queue, and it does not have to be a power of 2 for packed virtqueues. However, the virtio_pci_modern driver enforced a power of 2 check for virtqueue sizes, which

[PATCH v2 3/3] virtio_ring: Use const to annotate read-only pointer params

2023-03-15 Thread Feng Liu via Virtualization
Add const to make the read-only pointer parameters clear, similar to many existing functions. Use `container_of_const` to implement `to_vvq`, which ensures the const-ness of read-only parameters and avoids accidental modification of their members. Signed-off-by: Feng Liu Reviewed-by: Jiri Pirko

[PATCH v2 2/3] virtio_ring: Avoid using inline for small functions

2023-03-15 Thread Feng Liu via Virtualization
Remove the inline keyword, according to kernel coding style [1], defining inline functions is not necessary for samll functions. It is verified with GCC 12.2.0, the generated code with/without inline is the same. Additionally tested with kernel pktgen and iperf, and verified the result, pps of

Re: [PATCH 3/3] virtio_ring: Use const to annotate read-only pointer params

2023-03-07 Thread Feng Liu via Virtualization
On 2023-03-07 04:14, David Edmondson wrote: > External email: Use caution opening links or attachments > > > Feng Liu via Virtualization > writes: > >> Add const to make the read-only pointer parameters clear, similar to >> many existing functions. > &g

[PATCH net v1 2/2] virtio_net: Close queue pairs using helper function

2023-04-28 Thread Feng Liu via Virtualization
Use newly introduced helper function that exactly does the same of closing the queue pairs. Signed-off-by: Feng Liu Reviewed-by: William Tu Reviewed-by: Parav Pandit --- drivers/net/virtio_net.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git

[PATCH net v1 1/2] virtio_net: Fix error unwinding of XDP initialization

2023-04-28 Thread Feng Liu via Virtualization
When initializing XDP in virtnet_open(), some rq xdp initialization may hit an error causing net device open failed. However, previous rqs have already initialized XDP and enabled NAPI, which is not the expected behavior. Need to roll back the previous rq initialization to avoid leaks in error

Re: [PATCH net v1 2/2] virtio_net: Close queue pairs using helper function

2023-05-01 Thread Feng Liu via Virtualization
On 2023-05-01 a.m.10:14, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Mon, May 01, 2023 at 09:58:18AM -0400, Feng Liu wrote: On 2023-05-01 a.m.8:44, Simon Horman wrote: External email: Use caution opening links or attachments On Fri, Apr 28,

Re: [PATCH net v1 2/2] virtio_net: Close queue pairs using helper function

2023-05-01 Thread Feng Liu via Virtualization
On 2023-05-01 a.m.8:44, Simon Horman wrote: External email: Use caution opening links or attachments On Fri, Apr 28, 2023 at 06:43:46PM -0400, Feng Liu wrote: Use newly introduced helper function that exactly does the same of closing the queue pairs. Signed-off-by: Feng Liu Reviewed-by:

[PATCH net v2] virtio_net: Fix error unwinding of XDP initialization

2023-05-02 Thread Feng Liu via Virtualization
When initializing XDP in virtnet_open(), some rq xdp initialization may hit an error causing net device open failed. However, previous rqs have already initialized XDP and enabled NAPI, which is not the expected behavior. Need to roll back the previous rq initialization to avoid leaks in error

Re: [PATCH v2 3/3] virtio_ring: Use const to annotate read-only pointer params

2023-03-30 Thread Feng Liu via Virtualization
On 2023-03-30 p.m.4:27, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Thu, Mar 30, 2023 at 02:22:44PM -0400, Feng Liu wrote: On 2023-03-16 p.m.11:17, Jason Wang wrote: External email: Use caution opening links or attachments On Thu, Mar 16, 2023

Re: [PATCH v2 3/3] virtio_ring: Use const to annotate read-only pointer params

2023-03-30 Thread Feng Liu via Virtualization
On 2023-03-16 p.m.11:17, Jason Wang wrote: External email: Use caution opening links or attachments On Thu, Mar 16, 2023 at 2:55 AM Feng Liu wrote: Add const to make the read-only pointer parameters clear, similar to many existing functions. Use `container_of_const` to implement

Re: [PATCH v2 2/3] virtio_ring: Avoid using inline for small functions

2023-03-30 Thread Feng Liu via Virtualization
On 2023-03-16 p.m.11:16, Jason Wang wrote: External email: Use caution opening links or attachments On Thu, Mar 16, 2023 at 2:55 AM Feng Liu wrote: Remove the inline keyword, according to kernel coding style [1], defining inline functions is not necessary for samll functions. It is

Re: [PATCH v2 1/3] virtio_ring: Allow non power of 2 sizes for packed virtqueue

2023-03-30 Thread Feng Liu via Virtualization
On 2023-03-16 p.m.11:16, Jason Wang wrote: External email: Use caution opening links or attachments On Thu, Mar 16, 2023 at 2:55 AM Feng Liu wrote: According to the Virtio Specification, the Queue Size parameter of a virtqueue corresponds to the maximum number of descriptors in that

[PATCH net v3] virtio_net: Fix error unwinding of XDP initialization

2023-05-02 Thread Feng Liu via Virtualization
When initializing XDP in virtnet_open(), some rq xdp initialization may hit an error causing net device open failed. However, previous rqs have already initialized XDP and enabled NAPI, which is not the expected behavior. Need to roll back the previous rq initialization to avoid leaks in error

Re: [PATCH net v2] virtio_net: Fix error unwinding of XDP initialization

2023-05-02 Thread Feng Liu via Virtualization
On 2023-05-02 p.m.2:32, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Tue, May 02, 2023 at 01:41:34PM -0400, Feng Liu wrote: When initializing XDP in virtnet_open(), some rq xdp initialization may hit an error causing net device open failed. However,

[PATCH v1] virtio-pci: Fix legacy device flag setting error in probe

2023-07-19 Thread Feng Liu via Virtualization
The 'is_legacy' flag is used to differentiate between legacy vs modern device. Currently, it is based on the value of vp_dev->ldev.ioaddr. However, due to the shared memory of the union between struct virtio_pci_legacy_device and struct virtio_pci_modern_device, when virtio_pci_modern_probe

Re: [PATCH v1] virtio-pci: Fix legacy device flag setting error in probe

2023-07-19 Thread Feng Liu via Virtualization
On 2023-07-19 p.m.10:27, Jason Wang wrote: External email: Use caution opening links or attachments On Wed, Jul 19, 2023 at 11:46 PM Feng Liu wrote: The 'is_legacy' flag is used to differentiate between legacy vs modern device. Currently, it is based on the value of vp_dev->ldev.ioaddr.

Re: [PATCH v1] virtio-pci: Fix legacy device flag setting error in probe

2023-07-20 Thread Feng Liu via Virtualization
On 2023-07-19 p.m.10:27, Jason Wang wrote: External email: Use caution opening links or attachments On Wed, Jul 19, 2023 at 11:46 PM Feng Liu wrote: The 'is_legacy' flag is used to differentiate between legacy vs modern device. Currently, it is based on the value of vp_dev->ldev.ioaddr.

[PATCH v1] virtio-pci: Improve code style for including header files

2023-05-29 Thread Feng Liu via Virtualization
Fix code style related to including header file. Include header files before declaring macro definitions to avoid conflicts. Signed-off-by: Feng Liu Reviewed-by: Jiri Pirko --- drivers/virtio/virtio_pci_modern.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

Re: [PATCH v1] virtio-pci: Improve code style for including header files

2023-05-30 Thread Feng Liu via Virtualization
On 2023-05-30 a.m.7:27, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Mon, May 29, 2023 at 02:17:29PM -0400, Feng Liu wrote: Fix code style related to including header file. Include header files before declaring macro definitions to avoid conflicts.

Re: [PATCH v1] virtio-pci: Improve code style for including header files

2023-05-30 Thread Feng Liu via Virtualization
On 2023-05-30 a.m.11:18, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Tue, May 30, 2023 at 10:07:23AM -0400, Feng Liu wrote: On 2023-05-30 a.m.7:27, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Mon, May

Re: [PATCH v1] virtio-pci: Fix legacy device flag setting error in probe

2023-07-24 Thread Feng Liu via Virtualization
On 2023-07-20 p.m.1:14, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Thu, Jul 20, 2023 at 10:27:04AM +0800, Jason Wang wrote: On Wed, Jul 19, 2023 at 11:46 PM Feng Liu wrote: The 'is_legacy' flag is used to differentiate between legacy vs modern

Re: [PATCH v1] virtio-pci: Fix legacy device flag setting error in probe

2023-07-24 Thread Feng Liu via Virtualization
On 2023-07-24 p.m.11:41, Jason Wang wrote: External email: Use caution opening links or attachments On Mon, Jul 24, 2023 at 9:14 PM Feng Liu wrote: On 2023-07-20 p.m.1:14, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Thu, Jul 20, 2023 at

Re: [PATCH net v3] virtio_net: Fix error unwinding of XDP initialization

2023-05-08 Thread Feng Liu via Virtualization
On 2023-05-07 p.m.9:45, Xuan Zhuo wrote: External email: Use caution opening links or attachments On Sat, 6 May 2023 08:08:02 -0400, Feng Liu wrote: On 2023-05-05 p.m.10:33, Xuan Zhuo wrote: External email: Use caution opening links or attachments On Tue, 2 May 2023 20:35:25 -0400,

[PATCH net v4] virtio_net: Fix error unwinding of XDP initialization

2023-05-08 Thread Feng Liu via Virtualization
When initializing XDP in virtnet_open(), some rq xdp initialization may hit an error causing net device open failed. However, previous rqs have already initialized XDP and enabled NAPI, which is not the expected behavior. Need to roll back the previous rq initialization to avoid leaks in error

Re: [PATCH net v3] virtio_net: Fix error unwinding of XDP initialization

2023-05-10 Thread Feng Liu via Virtualization
On 2023-05-10 a.m.1:00, Jason Wang wrote: External email: Use caution opening links or attachments 在 2023/5/9 09:43, Xuan Zhuo 写道: On Mon, 8 May 2023 11:00:10 -0400, Feng Liu wrote: On 2023-05-07 p.m.9:45, Xuan Zhuo wrote: External email: Use caution opening links or attachments On

[PATCH v1] virtio_pci: Optimize virtio_pci_device structure size

2023-05-16 Thread Feng Liu via Virtualization
Improve the size of the virtio_pci_device structure, which is commonly used to represent a virtio PCI device. A given virtio PCI device can either of legacy type or modern type, with the struct virtio_pci_legacy_device occupying 32 bytes and the struct virtio_pci_modern_device occupying 88 bytes.

Re: [PATCH net v3] virtio_net: Fix error unwinding of XDP initialization

2023-05-06 Thread Feng Liu via Virtualization
On 2023-05-05 p.m.10:33, Xuan Zhuo wrote: External email: Use caution opening links or attachments On Tue, 2 May 2023 20:35:25 -0400, Feng Liu wrote: When initializing XDP in virtnet_open(), some rq xdp initialization may hit an error causing net device open failed. However, previous rqs

Re: [PATCH net v3] virtio_net: Fix error unwinding of XDP initialization

2023-05-11 Thread Feng Liu via Virtualization
On 2023-05-10 a.m.1:00, Jason Wang wrote: External email: Use caution opening links or attachments 在 2023/5/9 09:43, Xuan Zhuo 写道: On Mon, 8 May 2023 11:00:10 -0400, Feng Liu wrote: On 2023-05-07 p.m.9:45, Xuan Zhuo wrote: External email: Use caution opening links or attachments On

[PATCH net v6] virtio_net: Fix error unwinding of XDP initialization

2023-05-12 Thread Feng Liu via Virtualization
When initializing XDP in virtnet_open(), some rq xdp initialization may hit an error causing net device open failed. However, previous rqs have already initialized XDP and enabled NAPI, which is not the expected behavior. Need to roll back the previous rq initialization to avoid leaks in error

Re: [PATCH] virtio-vdpa: Fix unchecked call to NULL set_vq_affinity

2023-05-04 Thread Feng Liu via Virtualization
On 2023-05-04 a.m.9:50, Dragos Tatulea wrote: External email: Use caution opening links or attachments The referenced patch calls set_vq_affinity without checking if the op is valid. This patch adds the check. Fixes: 3dad56823b53 ("virtio-vdpa: Support interrupt affinity spreading

Re: [PATCH] virtio-vdpa: Fix unchecked call to NULL set_vq_affinity

2023-05-04 Thread Feng Liu via Virtualization
On 2023-05-04 a.m.9:50, Dragos Tatulea wrote: External email: Use caution opening links or attachments The referenced patch calls set_vq_affinity without checking if the op is valid. This patch adds the check. Fixes: 3dad56823b53 ("virtio-vdpa: Support interrupt affinity spreading

Re: [PATCH] virtio-vdpa: Fix unchecked call to NULL set_vq_affinity

2023-05-04 Thread Feng Liu via Virtualization
On 2023-05-04 p.m.1:19, Dragos Tatulea wrote: On Thu, 2023-05-04 at 13:08 -0400, Feng Liu wrote: On 2023-05-04 a.m.9:50, Dragos Tatulea wrote: External email: Use caution opening links or attachments The referenced patch calls set_vq_affinity without checking if the op is valid. This

Re: [PATCH] virtio-vdpa: Fix unchecked call to NULL set_vq_affinity

2023-05-04 Thread Feng Liu via Virtualization
On 2023-05-04 p.m.2:51, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Thu, May 04, 2023 at 01:08:54PM -0400, Feng Liu wrote: On 2023-05-04 a.m.9:50, Dragos Tatulea wrote: External email: Use caution opening links or attachments The referenced

Re: [PATCH net v3] virtio_net: Fix error unwinding of XDP initialization

2023-05-03 Thread Feng Liu via Virtualization
On 2023-05-02 p.m.11:14, Parav Pandit wrote: From: Feng Liu Sent: Tuesday, May 2, 2023 8:35 PM Issue: 3383038 Remove this internal garbage. Fixes: 754b8a21a96d ("virtio_net: setup xdp_rxq_info") Signed-off-by: Feng Liu Reviewed-by: William Tu Reviewed-by: Parav Pandit Reviewed-by:

Re: [PATCH net v4] virtio_net: Fix error unwinding of XDP initialization

2023-05-09 Thread Feng Liu via Virtualization
On 2023-05-09 a.m.12:42, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Mon, May 08, 2023 at 06:27:08PM -0400, Feng Liu wrote: When initializing XDP in virtnet_open(), some rq xdp initialization may hit an error causing net device open failed.

[PATCH net v5] virtio_net: Fix error unwinding of XDP initialization

2023-05-09 Thread Feng Liu via Virtualization
When initializing XDP in virtnet_open(), some rq xdp initialization may hit an error causing net device open failed. However, previous rqs have already initialized XDP and enabled NAPI, which is not the expected behavior. Need to roll back the previous rq initialization to avoid leaks in error

[PATCH net v1] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting

2023-08-14 Thread Feng Liu via Virtualization
The virtio_net driver currently deals with different versions and types of virtio net headers, such as virtio_net_hdr_mrg_rxbuf, virtio_net_hdr_v1_hash, etc. Due to these variations, the code relies on multiple type casts to convert memory between different structures, potentially leading to bugs