summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/devices')
-rw-r--r--src/vnet/devices/tap/tap.c7
-rw-r--r--src/vnet/devices/virtio/device.c3
-rw-r--r--src/vnet/devices/virtio/pci.c4
-rw-r--r--src/vnet/devices/virtio/vhost_user_inline.h4
4 files changed, 1 insertions, 17 deletions
diff --git a/src/vnet/devices/tap/tap.c b/src/vnet/devices/tap/tap.c
index 288099e2685..38f0605277d 100644
--- a/src/vnet/devices/tap/tap.c
+++ b/src/vnet/devices/tap/tap.c
@@ -583,7 +583,6 @@ tap_create_if (vlib_main_t * vm, tap_create_if_args_t * args)
if (args->tap_flags & TAP_FLAG_GSO)
{
hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO;
- vnm->interface_main.gso_interface_count++;
}
vnet_hw_interface_set_input_node (vnm, vif->hw_if_index,
virtio_input_node.index);
@@ -640,10 +639,6 @@ tap_delete_if (vlib_main_t * vm, u32 sw_if_index)
if (vif->type != VIRTIO_IF_TYPE_TAP)
return VNET_API_ERROR_INVALID_INTERFACE;
- /* decrement if this was a GSO interface */
- if (hw->flags & VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO)
- vnm->interface_main.gso_interface_count--;
-
/* bring down the interface */
vnet_hw_interface_set_flags (vnm, vif->hw_if_index, 0);
vnet_sw_interface_set_flags (vnm, vif->sw_if_index, 0);
@@ -683,7 +678,6 @@ tap_gso_enable_disable (vlib_main_t * vm, u32 sw_if_index, int enable_disable)
{
if ((hw->flags & VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO) == 0)
{
- vnm->interface_main.gso_interface_count++;
hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO;
}
}
@@ -691,7 +685,6 @@ tap_gso_enable_disable (vlib_main_t * vm, u32 sw_if_index, int enable_disable)
{
if ((hw->flags & VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO) != 0)
{
- vnm->interface_main.gso_interface_count--;
hw->flags &= ~VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO;
}
}
diff --git a/src/vnet/devices/virtio/device.c b/src/vnet/devices/virtio/device.c
index f9a1677f53f..16d1c808643 100644
--- a/src/vnet/devices/virtio/device.c
+++ b/src/vnet/devices/virtio/device.c
@@ -313,9 +313,8 @@ VNET_DEVICE_CLASS_TX_FN (virtio_device_class) (vlib_main_t * vm,
virtio_main_t *nm = &virtio_main;
vnet_interface_output_runtime_t *rund = (void *) node->runtime_data;
virtio_if_t *vif = pool_elt_at_index (nm->interfaces, rund->dev_instance);
- vnet_main_t *vnm = vnet_get_main ();
- if (vnm->interface_main.gso_interface_count > 0)
+ if (vif->gso_enabled > 0)
return virtio_interface_tx_inline (vm, node, frame, vif, 1 /* do_gso */ );
else
return virtio_interface_tx_inline (vm, node, frame, vif,
diff --git a/src/vnet/devices/virtio/pci.c b/src/vnet/devices/virtio/pci.c
index 5cbf75f6187..925c6f5cb87 100644
--- a/src/vnet/devices/virtio/pci.c
+++ b/src/vnet/devices/virtio/pci.c
@@ -1207,7 +1207,6 @@ virtio_pci_create_if (vlib_main_t * vm, virtio_pci_create_if_args_t * args)
{
vif->gso_enabled = 1;
hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO;
- vnm->interface_main.gso_interface_count++;
}
}
if (vif->features & VIRTIO_FEATURE (VIRTIO_NET_F_MQ))
@@ -1248,9 +1247,6 @@ virtio_pci_delete_if (vlib_main_t * vm, virtio_if_t * vif)
virtio_pci_legacy_reset (vm, vif);
- if (vif->gso_enabled)
- vnm->interface_main.gso_interface_count--;
-
if (vif->hw_if_index)
{
vnet_hw_interface_set_flags (vnm, vif->hw_if_index, 0);
diff --git a/src/vnet/devices/virtio/vhost_user_inline.h b/src/vnet/devices/virtio/vhost_user_inline.h
index 8725c969046..e4a1d596040 100644
--- a/src/vnet/devices/virtio/vhost_user_inline.h
+++ b/src/vnet/devices/virtio/vhost_user_inline.h
@@ -277,20 +277,16 @@ vui_is_link_up (vhost_user_intf_t * vui)
static_always_inline void
vhost_user_update_gso_interface_count (vhost_user_intf_t * vui, u8 add)
{
- vnet_main_t *vnm = vnet_get_main ();
vhost_user_main_t *vum = &vhost_user_main;
if (vui->enable_gso)
{
if (add)
{
- vnm->interface_main.gso_interface_count++;
vum->gso_count++;
}
else
{
- ASSERT (vnm->interface_main.gso_interface_count > 0);
- vnm->interface_main.gso_interface_count--;
ASSERT (vum->gso_count > 0);
vum->gso_count--;
}