586cba
From dffe24d5c1f5a4676e9d2a5bc032effd420b008f Mon Sep 17 00:00:00 2001
586cba
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
586cba
Date: Thu, 21 Jul 2022 15:38:55 +0200
586cba
Subject: [PATCH 08/32] virtio-net: Expose MAC_TABLE_ENTRIES
586cba
MIME-Version: 1.0
586cba
Content-Type: text/plain; charset=UTF-8
586cba
Content-Transfer-Encoding: 8bit
586cba
586cba
RH-Author: Eugenio Pérez <eperezma@redhat.com>
586cba
RH-MergeRequest: 108: Net Control Virtqueue shadow Support
586cba
RH-Commit: [8/27] 5c3b96215ddf853cafc594da47f57d7e157db4ee (eperezmartin/qemu-kvm)
586cba
RH-Bugzilla: 1939363
586cba
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
586cba
RH-Acked-by: Cindy Lu <lulu@redhat.com>
586cba
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
586cba
586cba
Bugzilla: https://bugzilla.redhat.com/1939363
586cba
586cba
Upstream Status: git://git.qemu.org/qemu.git
586cba
586cba
commit 6758c01f054c2a842d41d927d628b09f649d3254
586cba
Author: Eugenio Pérez <eperezma@redhat.com>
586cba
Date:   Wed Jul 20 08:59:27 2022 +0200
586cba
586cba
    virtio-net: Expose MAC_TABLE_ENTRIES
586cba
586cba
    vhost-vdpa control virtqueue needs to know the maximum entries supported
586cba
    by the virtio-net device, so we know if it is possible to apply the
586cba
    filter.
586cba
586cba
    Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
586cba
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
586cba
    Signed-off-by: Jason Wang <jasowang@redhat.com>
586cba
586cba
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
586cba
---
586cba
 hw/net/virtio-net.c            | 1 -
586cba
 include/hw/virtio/virtio-net.h | 3 +++
586cba
 2 files changed, 3 insertions(+), 1 deletion(-)
586cba
586cba
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
586cba
index 633de61513..2a127f0a3b 100644
586cba
--- a/hw/net/virtio-net.c
586cba
+++ b/hw/net/virtio-net.c
586cba
@@ -49,7 +49,6 @@
586cba
 
586cba
 #define VIRTIO_NET_VM_VERSION    11
586cba
 
586cba
-#define MAC_TABLE_ENTRIES    64
586cba
 #define MAX_VLAN    (1 << 12)   /* Per 802.1Q definition */
586cba
 
586cba
 /* previously fixed value */
586cba
diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h
586cba
index eb87032627..cce1c554f7 100644
586cba
--- a/include/hw/virtio/virtio-net.h
586cba
+++ b/include/hw/virtio/virtio-net.h
586cba
@@ -35,6 +35,9 @@ OBJECT_DECLARE_SIMPLE_TYPE(VirtIONet, VIRTIO_NET)
586cba
  * and latency. */
586cba
 #define TX_BURST 256
586cba
 
586cba
+/* Maximum VIRTIO_NET_CTRL_MAC_TABLE_SET unicast + multicast entries. */
586cba
+#define MAC_TABLE_ENTRIES    64
586cba
+
586cba
 typedef struct virtio_net_conf
586cba
 {
586cba
     uint32_t txtimer;
586cba
-- 
586cba
2.31.1
586cba