git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/ice/base: change address parameter to 16-bit
[dpdk.git]
/
drivers
/
net
/
virtio
/
virtio_rxtx.c
diff --git
a/drivers/net/virtio/virtio_rxtx.c
b/drivers/net/virtio/virtio_rxtx.c
index
f70644b
..
97ed695
100644
(file)
--- a/
drivers/net/virtio/virtio_rxtx.c
+++ b/
drivers/net/virtio/virtio_rxtx.c
@@
-666,6
+666,8
@@
virtio_dev_rx_queue_setup(struct rte_eth_dev *dev,
struct virtqueue *vq = hw->vqs[vq_idx];
struct virtnet_rx *rxvq;
uint16_t rx_free_thresh;
struct virtqueue *vq = hw->vqs[vq_idx];
struct virtnet_rx *rxvq;
uint16_t rx_free_thresh;
+ uint16_t buf_size;
+ const char *error;
PMD_INIT_FUNC_TRACE();
PMD_INIT_FUNC_TRACE();
@@
-674,6
+676,14
@@
virtio_dev_rx_queue_setup(struct rte_eth_dev *dev,
return -EINVAL;
}
return -EINVAL;
}
+ buf_size = virtio_rx_mem_pool_buf_size(mp);
+ if (!virtio_rx_check_scatter(hw->max_rx_pkt_len, buf_size,
+ hw->rx_ol_scatter, &error)) {
+ PMD_INIT_LOG(ERR, "RxQ %u Rx scatter check failed: %s",
+ queue_idx, error);
+ return -EINVAL;
+ }
+
rx_free_thresh = rx_conf->rx_free_thresh;
if (rx_free_thresh == 0)
rx_free_thresh =
rx_free_thresh = rx_conf->rx_free_thresh;
if (rx_free_thresh == 0)
rx_free_thresh =
@@
-696,8
+706,14
@@
virtio_dev_rx_queue_setup(struct rte_eth_dev *dev,
}
vq->vq_free_thresh = rx_free_thresh;
}
vq->vq_free_thresh = rx_free_thresh;
- if (nb_desc == 0 || nb_desc > vq->vq_nentries)
+ /*
+ * For split ring vectorized path descriptors number must be
+ * equal to the ring size.
+ */
+ if (nb_desc > vq->vq_nentries ||
+ (!virtio_with_packed_queue(hw) && hw->use_vec_rx)) {
nb_desc = vq->vq_nentries;
nb_desc = vq->vq_nentries;
+ }
vq->vq_free_cnt = RTE_MIN(vq->vq_free_cnt, nb_desc);
rxvq = &vq->rxq;
vq->vq_free_cnt = RTE_MIN(vq->vq_free_cnt, nb_desc);
rxvq = &vq->rxq;
@@
-758,10
+774,11
@@
virtio_dev_rx_queue_setup_finish(struct rte_eth_dev *dev, uint16_t queue_idx)
if (unlikely(error)) {
for (i = 0; i < free_cnt; i++)
rte_pktmbuf_free(pkts[i]);
if (unlikely(error)) {
for (i = 0; i < free_cnt; i++)
rte_pktmbuf_free(pkts[i]);
+ } else {
+ nbufs += free_cnt;
}
}
}
}
- nbufs += free_cnt;
vq_update_avail_idx(vq);
}
} else {
vq_update_avail_idx(vq);
}
} else {