diff mbox series

[RFC,2/2] vdpa: order vdpa_feature_bits array

Message ID 38d3ca3e9fdb9600c611ec24a09e14e1735674a9.1686137925.git.yin31149@gmail.com (mailing list archive)
State New, archived
Headers show
Series vdpa: refactor vdpa_feature_bits array | expand

Commit Message

Hawkins Jiawei June 7, 2023, 12:12 p.m. UTC
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>
---
 net/vhost-vdpa.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)
diff mbox series

Patch

diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index d90c8e2796..87c5e6a700 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -47,13 +47,9 @@  typedef struct VhostVDPAState {
 } VhostVDPAState;
 
 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_MTU,
     VIRTIO_NET_F_GSO,
     VIRTIO_NET_F_GUEST_TSO4,
     VIRTIO_NET_F_GUEST_TSO6,
@@ -64,19 +60,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
 };