"vq->vq_avail_idx=%d\n"
"vq->vq_used_cons_idx=%d\n"
"vq->vq_packed.cached_flags=0x%x\n"
- "vq->vq_packed.used_wrap_counter=%d\n",
+ "vq->vq_packed.used_wrap_counter=%d",
vq->vq_free_cnt,
vq->vq_avail_idx,
vq->vq_used_cons_idx,
rte_memzone_free(mz);
free_vq:
rte_free(vq);
+ hw->vqs[queue_idx] = NULL;
return ret;
}
return ret;
}
- if (rxmode->max_rx_pkt_len > hw->max_mtu + ether_hdr_len)
+ if ((rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) &&
+ (rxmode->max_rx_pkt_len > hw->max_mtu + ether_hdr_len))
req_features &= ~(1ULL << VIRTIO_NET_F_MTU);
- hw->max_rx_pkt_len = rxmode->max_rx_pkt_len;
+ if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME)
+ hw->max_rx_pkt_len = rxmode->max_rx_pkt_len;
+ else
+ hw->max_rx_pkt_len = ether_hdr_len + dev->data->mtu;
if (rx_offloads & (DEV_RX_OFFLOAD_UDP_CKSUM |
DEV_RX_OFFLOAD_TCP_CKSUM))
PMD_INIT_LOG(DEBUG, "%d mbufs freed", mbuf_num);
}
+static void
+virtio_tx_completed_cleanup(struct rte_eth_dev *dev)
+{
+ struct virtio_hw *hw = dev->data->dev_private;
+ struct virtqueue *vq;
+ int qidx;
+ void (*xmit_cleanup)(struct virtqueue *vq, uint16_t nb_used);
+
+ if (virtio_with_packed_queue(hw)) {
+ if (hw->use_vec_tx)
+ xmit_cleanup = &virtio_xmit_cleanup_inorder_packed;
+ else if (virtio_with_feature(hw, VIRTIO_F_IN_ORDER))
+ xmit_cleanup = &virtio_xmit_cleanup_inorder_packed;
+ else
+ xmit_cleanup = &virtio_xmit_cleanup_normal_packed;
+ } else {
+ if (hw->use_inorder_tx)
+ xmit_cleanup = &virtio_xmit_cleanup_inorder;
+ else
+ xmit_cleanup = &virtio_xmit_cleanup;
+ }
+
+ for (qidx = 0; qidx < hw->max_queue_pairs; qidx++) {
+ vq = hw->vqs[2 * qidx + VTNET_SQ_TQ_QUEUE_IDX];
+ if (vq != NULL)
+ xmit_cleanup(vq, virtqueue_nused(vq));
+ }
+}
+
/*
* Stop device: disable interrupt and mark link down
*/
goto out_unlock;
hw->started = 0;
+ virtio_tx_completed_cleanup(dev);
+
if (intr_conf->lsc || intr_conf->rxq) {
virtio_intr_disable(dev);
* The Queue Size value does not have to be a power of 2.
*/
dev_info->rx_desc_lim.nb_max = UINT16_MAX;
+ dev_info->tx_desc_lim.nb_max = UINT16_MAX;
} else {
/*
* According to 2.6 Split Virtqueues:
* Size value is 32768.
*/
dev_info->rx_desc_lim.nb_max = 32768;
+ dev_info->tx_desc_lim.nb_max = 32768;
}
/*
* Actual minimum is not the same for virtqueues of different kinds,
*/
dev_info->rx_desc_lim.nb_min = RTE_MAX(DEFAULT_RX_FREE_THRESH,
RTE_VIRTIO_VPMD_RX_REARM_THRESH);
+ dev_info->tx_desc_lim.nb_min = DEFAULT_TX_FREE_THRESH;
dev_info->rx_desc_lim.nb_align = 1;
+ dev_info->tx_desc_lim.nb_align = 1;
return 0;
}