Type: fix
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Idada695432d2bfac8808f35f1e8cd16f84d963c6
"error encountered during packet buffering init");
goto error;
}
"error encountered during packet buffering init");
goto error;
}
+ /*
+ * packet buffering flag needs to be set 1 before calling the
+ * virtio_pre_input_node_enable but after the successful initialization
+ * of buffering queues above.
+ * Packet buffering flag set to 0 if there will be any error during
+ * buffering initialization.
+ */
+ vif->packet_buffering = 1;
+ virtio_pre_input_node_enable (vm, vif);
- virtio_pre_input_node_enable (vm, vif);
virtio_vring_set_rx_queues (vm, vif);
virtio_vring_set_tx_queues (vm, vif);
virtio_vring_set_rx_queues (vm, vif);
virtio_vring_set_tx_queues (vm, vif);
vlib_pci_intr_disable (vm, vif->pci_dev_handle);
vlib_pci_intr_disable (vm, vif->pci_dev_handle);
- for (i = 0; i < vif->max_queue_pairs; i++)
+ if (vif->virtio_pci_func)
- vif->virtio_pci_func->del_queue (vm, vif, RX_QUEUE (i));
- vif->virtio_pci_func->del_queue (vm, vif, TX_QUEUE (i));
- }
+ for (i = 0; i < vif->max_queue_pairs; i++)
+ {
+ vif->virtio_pci_func->del_queue (vm, vif, RX_QUEUE (i));
+ vif->virtio_pci_func->del_queue (vm, vif, TX_QUEUE (i));
+ }
- if (vif->features & VIRTIO_FEATURE (VIRTIO_NET_F_CTRL_VQ))
- vif->virtio_pci_func->del_queue (vm, vif, vif->max_queue_pairs * 2);
+ if (vif->features & VIRTIO_FEATURE (VIRTIO_NET_F_CTRL_VQ))
+ vif->virtio_pci_func->del_queue (vm, vif, vif->max_queue_pairs * 2);
- if (vif->virtio_pci_func)
- vif->virtio_pci_func->device_reset (vm, vif);
+ vif->virtio_pci_func->device_reset (vm, vif);
+ }
vlib_physmem_free (vm, vring->desc);
}
vlib_physmem_free (vm, vring->desc);
}
- virtio_pre_input_node_disable (vm, vif);
+ if (vif->packet_buffering)
+ virtio_pre_input_node_disable (vm, vif);
vec_foreach_index (i, vif->txq_vrings)
{
vec_foreach_index (i, vif->txq_vrings)
{
vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, vif->hw_if_index);
vnet_virtio_vring_t *vring;
clib_error_t *error = 0;
vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, vif->hw_if_index);
vnet_virtio_vring_t *vring;
clib_error_t *error = 0;
- vif->packet_buffering = 1;
vec_foreach (vring, vif->txq_vrings)
{
vec_foreach (vring, vif->txq_vrings)
{