diff mbox series

[v2,2/4] virtio-net: Expose MAX_VLAN

Message ID ca03403319c6405ea7c400836a572255bbc9ceba.1690100802.git.yin31149@gmail.com (mailing list archive)
State New, archived
Headers show
Series Vhost-vdpa Shadow Virtqueue VLAN support | expand

Commit Message

Hawkins Jiawei July 23, 2023, 9:26 a.m. UTC
vhost-vdpa shadowed CVQ needs to know the maximum number of
vlans supported by the virtio-net device, so QEMU can restore
the VLAN state in a migration.

Co-developed-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
---
 hw/net/virtio-net.c            | 2 --
 include/hw/virtio/virtio-net.h | 6 ++++++
 2 files changed, 6 insertions(+), 2 deletions(-)

Comments

Jason Wang July 25, 2023, 6:47 a.m. UTC | #1
On Sun, Jul 23, 2023 at 5:27 PM Hawkins Jiawei <yin31149@gmail.com> wrote:
>
> vhost-vdpa shadowed CVQ needs to know the maximum number of
> vlans supported by the virtio-net device, so QEMU can restore
> the VLAN state in a migration.
>
> Co-developed-by: Eugenio Pérez <eperezma@redhat.com>
> Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
> Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>

Acked-by: Jason Wang <jasowang@redhat.com>

Thanks

> ---
>  hw/net/virtio-net.c            | 2 --
>  include/hw/virtio/virtio-net.h | 6 ++++++
>  2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index d20d5a63cd..a32672039d 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -49,8 +49,6 @@
>
>  #define VIRTIO_NET_VM_VERSION    11
>
> -#define MAX_VLAN    (1 << 12)   /* Per 802.1Q definition */
> -
>  /* previously fixed value */
>  #define VIRTIO_NET_RX_QUEUE_DEFAULT_SIZE 256
>  #define VIRTIO_NET_TX_QUEUE_DEFAULT_SIZE 256
> diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h
> index 5f5dcb4572..93f3bb5d97 100644
> --- a/include/hw/virtio/virtio-net.h
> +++ b/include/hw/virtio/virtio-net.h
> @@ -38,6 +38,12 @@ OBJECT_DECLARE_SIMPLE_TYPE(VirtIONet, VIRTIO_NET)
>  /* Maximum VIRTIO_NET_CTRL_MAC_TABLE_SET unicast + multicast entries. */
>  #define MAC_TABLE_ENTRIES    64
>
> +/*
> + * The maximum number of VLANs in the VLAN filter table
> + * added by VIRTIO_NET_CTRL_VLAN_ADD
> + */
> +#define MAX_VLAN    (1 << 12)   /* Per 802.1Q definition */
> +
>  typedef struct virtio_net_conf
>  {
>      uint32_t txtimer;
> --
> 2.25.1
>
diff mbox series

Patch

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index d20d5a63cd..a32672039d 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -49,8 +49,6 @@ 
 
 #define VIRTIO_NET_VM_VERSION    11
 
-#define MAX_VLAN    (1 << 12)   /* Per 802.1Q definition */
-
 /* previously fixed value */
 #define VIRTIO_NET_RX_QUEUE_DEFAULT_SIZE 256
 #define VIRTIO_NET_TX_QUEUE_DEFAULT_SIZE 256
diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h
index 5f5dcb4572..93f3bb5d97 100644
--- a/include/hw/virtio/virtio-net.h
+++ b/include/hw/virtio/virtio-net.h
@@ -38,6 +38,12 @@  OBJECT_DECLARE_SIMPLE_TYPE(VirtIONet, VIRTIO_NET)
 /* Maximum VIRTIO_NET_CTRL_MAC_TABLE_SET unicast + multicast entries. */
 #define MAC_TABLE_ENTRIES    64
 
+/*
+ * The maximum number of VLANs in the VLAN filter table
+ * added by VIRTIO_NET_CTRL_VLAN_ADD
+ */
+#define MAX_VLAN    (1 << 12)   /* Per 802.1Q definition */
+
 typedef struct virtio_net_conf
 {
     uint32_t txtimer;