[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 30/41] vhost-net: Notify the backend about the host M
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 30/41] vhost-net: Notify the backend about the host MTU |
Date: |
Tue, 10 Jan 2017 07:40:35 +0200 |
From: Maxime Coquelin <address@hidden>
This patch provides a way for virtio-net to notify the
backend about the host MTU set by the user.
Cc: Michael S. Tsirkin <address@hidden>
Cc: Aaron Conole <address@hidden>
Signed-off-by: Maxime Coquelin <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
include/net/vhost_net.h | 2 ++
hw/net/vhost_net.c | 18 ++++++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/include/net/vhost_net.h b/include/net/vhost_net.h
index 5a08eff..afc1499 100644
--- a/include/net/vhost_net.h
+++ b/include/net/vhost_net.h
@@ -35,4 +35,6 @@ int vhost_set_vring_enable(NetClientState * nc, int enable);
uint64_t vhost_net_get_acked_features(VHostNetState *net);
+int vhost_net_set_mtu(struct vhost_net *net, uint16_t mtu);
+
#endif
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index f2d49ad..6280422 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -51,6 +51,7 @@ static const int kernel_feature_bits[] = {
VIRTIO_RING_F_EVENT_IDX,
VIRTIO_NET_F_MRG_RXBUF,
VIRTIO_F_VERSION_1,
+ VIRTIO_NET_F_MTU,
VHOST_INVALID_FEATURE_BIT
};
@@ -74,6 +75,7 @@ static const int user_feature_bits[] = {
VIRTIO_NET_F_HOST_ECN,
VIRTIO_NET_F_HOST_UFO,
VIRTIO_NET_F_MRG_RXBUF,
+ VIRTIO_NET_F_MTU,
/* This bit implies RARP isn't sent by QEMU out of band */
VIRTIO_NET_F_GUEST_ANNOUNCE,
@@ -435,6 +437,17 @@ int vhost_set_vring_enable(NetClientState *nc, int enable)
return 0;
}
+int vhost_net_set_mtu(struct vhost_net *net, uint16_t mtu)
+{
+ const VhostOps *vhost_ops = net->dev.vhost_ops;
+
+ if (!vhost_ops->vhost_net_set_mtu) {
+ return 0;
+ }
+
+ return vhost_ops->vhost_net_set_mtu(&net->dev, mtu);
+}
+
#else
uint64_t vhost_net_get_max_queues(VHostNetState *net)
{
@@ -501,4 +514,9 @@ int vhost_set_vring_enable(NetClientState *nc, int enable)
{
return 0;
}
+
+int vhost_net_set_mtu(struct vhost_net *net, uint16_t mtu)
+{
+ return 0;
+}
#endif
--
MST
- [Qemu-devel] [PULL 20/41] virtio-crypto: zeroize the key material before free, (continued)
- [Qemu-devel] [PULL 20/41] virtio-crypto: zeroize the key material before free, Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 21/41] pcie_aer: Convert pcie_aer_init to Error, Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 23/41] virtio: fix vq->inuse recalc after migr, Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 22/41] pcie_aer: support configurable AER capa version, Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 24/41] balloon: Don't balloon roms, Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 25/41] net: Add virtio queue interface to update used index from vring state, Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 27/41] virtio: Introduce virtqueue_drop_all procedure, Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 26/41] net: vhost stop updates virtio queue state, Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 28/41] net: virtio-net discards TX data after link down, Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 29/41] vhost-user: Add MTU protocol feature and op, Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 30/41] vhost-net: Notify the backend about the host MTU,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 31/41] virtio-net: Add MTU feature support, Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 32/41] tests: pc: add memory hotplug acpi tables tests, Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 34/41] memhp: move build_memory_devices() into memory_hotplug.c, Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 35/41] memhp: consolidate scattered MHPD device declaration, Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 33/41] memhp: move build_memory_hotplug_aml() into memory_hotplug.c, Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 36/41] memhp: merge build_memory_devices() into build_memory_hotplug_aml(), Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 38/41] memhp: move memory hotplug only defines to memory_hotplug.c, Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 37/41] memhp: move GPE handler_E03 into build_memory_hotplug_aml(), Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 39/41] memhp: don't generate memory hotplug AML if it's not enabled/supported, Michael S. Tsirkin, 2017/01/10
- [Qemu-devel] [PULL 40/41] memhp: move DIMM devices into dedicated scope with related common methods, Michael S. Tsirkin, 2017/01/10