+ if (host_features & (1ULL << VIRTIO_F_RING_PACKED)) {
+ /*
+ * According to 2.7 Packed Virtqueues,
+ * 2.7.10.1 Structure Size and Alignment:
+ * 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:
+ * Queue Size value is always a power of 2. The maximum Queue
+ * 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,
+ * but to avoid tangling the code with separate branches, rely on
+ * default thresholds since desc number must be at least of their size.
+ */
+ 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;
+