net/virtio: do not limit packed ring size

Virtio spec only set rule that packed ring maximum size is up to 2^15
entries. Should not limit packed ring size to power of two.

Fixes: aea29aa5d3 ("net/virtio: enable packed virtqueues by default")
Cc: stable@dpdk.org

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
This commit is contained in:
Marvin Liu 2019-10-30 17:24:20 +08:00 committed by Ferruh Yigit
parent 56345ccb44
commit df42dde55b

View File

@ -465,8 +465,8 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx)
return -EINVAL;
}
if (!rte_is_power_of_2(vq_size)) {
PMD_INIT_LOG(ERR, "virtqueue size is not powerof 2");
if (!vtpci_packed_queue(hw) && !rte_is_power_of_2(vq_size)) {
PMD_INIT_LOG(ERR, "split virtqueue size is not powerof 2");
return -EINVAL;
}