qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] vdpa: refactor vdpa_feature_bits array
@ 2023-06-30  8:54 Hawkins Jiawei
  2023-06-30  8:54 ` [PATCH v2 1/2] vdpa: delete duplicated VIRTIO_NET_F_RSS in vdpa_feature_bits Hawkins Jiawei
  2023-06-30  8:54 ` [PATCH v2 2/2] vdpa: order vdpa_feature_bits array Hawkins Jiawei
  0 siblings, 2 replies; 6+ messages in thread
From: Hawkins Jiawei @ 2023-06-30  8:54 UTC (permalink / raw)
  To: jasowang, mst, eperezma; +Cc: qemu-devel, yin31149, 18801353760

This patchset removes the duplicated VIRTIO_NET_F_RSS entry
in vdpa_feature_bits array and reorganizes the vdpa_feature_bits array
in ascending order based on its value to avoid future duplicates.

Changelog
=========
v2:
  - resolve conflicts with the master branch

v1: https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg01583.html

Hawkins Jiawei (2):
  vdpa: delete duplicated VIRTIO_NET_F_RSS in vdpa_feature_bits
  vdpa: order vdpa_feature_bits array

 net/vhost-vdpa.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

-- 
2.25.1



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 1/2] vdpa: delete duplicated VIRTIO_NET_F_RSS in vdpa_feature_bits
  2023-06-30  8:54 [PATCH v2 0/2] vdpa: refactor vdpa_feature_bits array Hawkins Jiawei
@ 2023-06-30  8:54 ` Hawkins Jiawei
  2023-06-30 10:19   ` Philippe Mathieu-Daudé
  2023-06-30  8:54 ` [PATCH v2 2/2] vdpa: order vdpa_feature_bits array Hawkins Jiawei
  1 sibling, 1 reply; 6+ messages in thread
From: Hawkins Jiawei @ 2023-06-30  8:54 UTC (permalink / raw)
  To: jasowang, mst, eperezma; +Cc: qemu-devel, yin31149, 18801353760

This entry was duplicated on referenced commit. Removing it.

Fixes: 402378407dbd ("vhost-vdpa: multiqueue support")
Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
---
 net/vhost-vdpa.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index e19ab063fa..0479988a79 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -74,7 +74,6 @@ const int vdpa_feature_bits[] = {
     VIRTIO_NET_F_CTRL_RX_EXTRA,
     VIRTIO_NET_F_CTRL_VLAN,
     VIRTIO_NET_F_CTRL_MAC_ADDR,
-    VIRTIO_NET_F_RSS,
     VIRTIO_NET_F_MQ,
     VIRTIO_NET_F_CTRL_VQ,
     VIRTIO_F_IOMMU_PLATFORM,
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/2] vdpa: order vdpa_feature_bits array
  2023-06-30  8:54 [PATCH v2 0/2] vdpa: refactor vdpa_feature_bits array Hawkins Jiawei
  2023-06-30  8:54 ` [PATCH v2 1/2] vdpa: delete duplicated VIRTIO_NET_F_RSS in vdpa_feature_bits Hawkins Jiawei
@ 2023-06-30  8:54 ` Hawkins Jiawei
  2023-06-30 10:20   ` Philippe Mathieu-Daudé
  1 sibling, 1 reply; 6+ messages in thread
From: Hawkins Jiawei @ 2023-06-30  8:54 UTC (permalink / raw)
  To: jasowang, mst, eperezma; +Cc: qemu-devel, yin31149, 18801353760

This patch reorganizes the vdpa_feature_bits array
in ascending order based on its value to avoid future duplicates.

Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
---
v2:
  - resolve conflicts with the master branch

v1: https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg01585.html

 net/vhost-vdpa.c | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 0479988a79..db7f1241af 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -50,15 +50,12 @@ typedef struct VhostVDPAState {
     bool started;
 } VhostVDPAState;
 
+/* The array is sorted in ascending order based on its value */
 const int vdpa_feature_bits[] = {
-    VIRTIO_F_NOTIFY_ON_EMPTY,
-    VIRTIO_RING_F_INDIRECT_DESC,
-    VIRTIO_RING_F_EVENT_IDX,
-    VIRTIO_F_ANY_LAYOUT,
-    VIRTIO_F_VERSION_1,
     VIRTIO_NET_F_CSUM,
     VIRTIO_NET_F_GUEST_CSUM,
     VIRTIO_NET_F_CTRL_GUEST_OFFLOADS,
+    VIRTIO_NET_F_MTU,
     VIRTIO_NET_F_GSO,
     VIRTIO_NET_F_GUEST_TSO4,
     VIRTIO_NET_F_GUEST_TSO6,
@@ -69,19 +66,24 @@ const int vdpa_feature_bits[] = {
     VIRTIO_NET_F_HOST_ECN,
     VIRTIO_NET_F_HOST_UFO,
     VIRTIO_NET_F_MRG_RXBUF,
-    VIRTIO_NET_F_MTU,
+    VIRTIO_NET_F_STATUS,
+    VIRTIO_NET_F_CTRL_VQ,
     VIRTIO_NET_F_CTRL_RX,
-    VIRTIO_NET_F_CTRL_RX_EXTRA,
     VIRTIO_NET_F_CTRL_VLAN,
-    VIRTIO_NET_F_CTRL_MAC_ADDR,
+    VIRTIO_NET_F_CTRL_RX_EXTRA,
     VIRTIO_NET_F_MQ,
-    VIRTIO_NET_F_CTRL_VQ,
+    VIRTIO_NET_F_CTRL_MAC_ADDR,
+    VIRTIO_F_NOTIFY_ON_EMPTY,
+    VIRTIO_F_ANY_LAYOUT,
+    VIRTIO_RING_F_INDIRECT_DESC,
+    VIRTIO_RING_F_EVENT_IDX,
+    VIRTIO_F_VERSION_1,
     VIRTIO_F_IOMMU_PLATFORM,
     VIRTIO_F_RING_PACKED,
     VIRTIO_F_RING_RESET,
-    VIRTIO_NET_F_RSS,
     VIRTIO_NET_F_HASH_REPORT,
-    VIRTIO_NET_F_STATUS,
+    VIRTIO_NET_F_RSS,
+    /* VHOST_INVALID_FEATURE_BIT should always be the last entry */
     VHOST_INVALID_FEATURE_BIT
 };
 
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/2] vdpa: delete duplicated VIRTIO_NET_F_RSS in vdpa_feature_bits
  2023-06-30  8:54 ` [PATCH v2 1/2] vdpa: delete duplicated VIRTIO_NET_F_RSS in vdpa_feature_bits Hawkins Jiawei
@ 2023-06-30 10:19   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-06-30 10:19 UTC (permalink / raw)
  To: Hawkins Jiawei, jasowang, mst, eperezma
  Cc: qemu-devel, 18801353760, QEMU Trivial

On 30/6/23 10:54, Hawkins Jiawei wrote:
> This entry was duplicated on referenced commit. Removing it.
> 
> Fixes: 402378407dbd ("vhost-vdpa: multiqueue support")
> Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
> ---
>   net/vhost-vdpa.c | 1 -
>   1 file changed, 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 2/2] vdpa: order vdpa_feature_bits array
  2023-06-30  8:54 ` [PATCH v2 2/2] vdpa: order vdpa_feature_bits array Hawkins Jiawei
@ 2023-06-30 10:20   ` Philippe Mathieu-Daudé
  2023-06-30 12:18     ` Hawkins Jiawei
  0 siblings, 1 reply; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-06-30 10:20 UTC (permalink / raw)
  To: Hawkins Jiawei, jasowang, mst, eperezma
  Cc: qemu-devel, 18801353760, QEMU Trivial

On 30/6/23 10:54, Hawkins Jiawei wrote:
> This patch reorganizes the vdpa_feature_bits array
> in ascending order based on its value to avoid future duplicates.
> 
> Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
> ---
> v2:
>    - resolve conflicts with the master branch
> 
> v1: https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg01585.html
> 
>   net/vhost-vdpa.c | 24 +++++++++++++-----------
>   1 file changed, 13 insertions(+), 11 deletions(-)
> 
> diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
> index 0479988a79..db7f1241af 100644
> --- a/net/vhost-vdpa.c
> +++ b/net/vhost-vdpa.c
> @@ -50,15 +50,12 @@ typedef struct VhostVDPAState {
>       bool started;
>   } VhostVDPAState;
>   
> +/* The array is sorted in ascending order based on its value */

Alphabetically would have been simpler IMO, anyhow:
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 2/2] vdpa: order vdpa_feature_bits array
  2023-06-30 10:20   ` Philippe Mathieu-Daudé
@ 2023-06-30 12:18     ` Hawkins Jiawei
  0 siblings, 0 replies; 6+ messages in thread
From: Hawkins Jiawei @ 2023-06-30 12:18 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, jasowang, mst, eperezma
  Cc: qemu-devel, 18801353760, QEMU Trivial

On 2023/6/30 18:20, Philippe Mathieu-Daudé wrote:
> On 30/6/23 10:54, Hawkins Jiawei wrote:
>> This patch reorganizes the vdpa_feature_bits array
>> in ascending order based on its value to avoid future duplicates.
>>
>> Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
>> ---
>> v2:
>>    - resolve conflicts with the master branch
>>
>> v1:
>> https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg01585.html
>>
>>   net/vhost-vdpa.c | 24 +++++++++++++-----------
>>   1 file changed, 13 insertions(+), 11 deletions(-)
>>
>> diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
>> index 0479988a79..db7f1241af 100644
>> --- a/net/vhost-vdpa.c
>> +++ b/net/vhost-vdpa.c
>> @@ -50,15 +50,12 @@ typedef struct VhostVDPAState {
>>       bool started;
>>   } VhostVDPAState;
>> +/* The array is sorted in ascending order based on its value */
>
> Alphabetically would have been simpler IMO, anyhow:

Yes, it seems that rearranging the array in alphabetical order could
improve the maintainability of the code.

I will sort the features alphabetically, excluding
VHOST_INVALID_FEATURE_BIT, according to your suggestion.

Thanks!

> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-06-30 12:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-30  8:54 [PATCH v2 0/2] vdpa: refactor vdpa_feature_bits array Hawkins Jiawei
2023-06-30  8:54 ` [PATCH v2 1/2] vdpa: delete duplicated VIRTIO_NET_F_RSS in vdpa_feature_bits Hawkins Jiawei
2023-06-30 10:19   ` Philippe Mathieu-Daudé
2023-06-30  8:54 ` [PATCH v2 2/2] vdpa: order vdpa_feature_bits array Hawkins Jiawei
2023-06-30 10:20   ` Philippe Mathieu-Daudé
2023-06-30 12:18     ` Hawkins Jiawei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).