Skip to content

Commit

Permalink
virtio-net: Expose MAX_VLAN
Browse files Browse the repository at this point in the history
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>
Message-Id: <ca03403319c6405ea7c400836a572255bbc9ceba.1690106284.git.yin31149@gmail.com>
Tested-by: Lei Yang <leiyang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
JiaweiHawk authored and mstsirkin committed Oct 4, 2023
1 parent 06b636a commit e19751a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 0 additions & 2 deletions hw/net/virtio-net.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions include/hw/virtio/virtio-net.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e19751a

Please sign in to comment.