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/hns3: add imissed packet stats
[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
cbc846d
..
4028300
100644
(file)
--- a/
drivers/net/virtio/virtio_rxtx.c
+++ b/
drivers/net/virtio/virtio_rxtx.c
@@
-27,7
+27,7
@@
#include "virtio_logs.h"
#include "virtio_ethdev.h"
#include "virtio_logs.h"
#include "virtio_ethdev.h"
-#include "virtio
_pci
.h"
+#include "virtio.h"
#include "virtqueue.h"
#include "virtio_rxtx.h"
#include "virtio_rxtx_simple.h"
#include "virtqueue.h"
#include "virtio_rxtx.h"
#include "virtio_rxtx_simple.h"
@@
-628,9
+628,9
@@
virtio_dev_rx_queue_setup(struct rte_eth_dev *dev,
const struct rte_eth_rxconf *rx_conf,
struct rte_mempool *mp)
{
const struct rte_eth_rxconf *rx_conf,
struct rte_mempool *mp)
{
- uint16_t v
tpci_queue
_idx = 2 * queue_idx + VTNET_SQ_RQ_QUEUE_IDX;
+ uint16_t v
q
_idx = 2 * queue_idx + VTNET_SQ_RQ_QUEUE_IDX;
struct virtio_hw *hw = dev->data->dev_private;
struct virtio_hw *hw = dev->data->dev_private;
- struct virtqueue *vq = hw->vqs[v
tpci_queue
_idx];
+ struct virtqueue *vq = hw->vqs[v
q
_idx];
struct virtnet_rx *rxvq;
uint16_t rx_free_thresh;
struct virtnet_rx *rxvq;
uint16_t rx_free_thresh;
@@
-678,21
+678,21
@@
virtio_dev_rx_queue_setup(struct rte_eth_dev *dev,
int
virtio_dev_rx_queue_setup_finish(struct rte_eth_dev *dev, uint16_t queue_idx)
{
int
virtio_dev_rx_queue_setup_finish(struct rte_eth_dev *dev, uint16_t queue_idx)
{
- uint16_t v
tpci_queue
_idx = 2 * queue_idx + VTNET_SQ_RQ_QUEUE_IDX;
+ uint16_t v
q
_idx = 2 * queue_idx + VTNET_SQ_RQ_QUEUE_IDX;
struct virtio_hw *hw = dev->data->dev_private;
struct virtio_hw *hw = dev->data->dev_private;
- struct virtqueue *vq = hw->vqs[v
tpci_queue
_idx];
+ struct virtqueue *vq = hw->vqs[v
q
_idx];
struct virtnet_rx *rxvq = &vq->rxq;
struct rte_mbuf *m;
uint16_t desc_idx;
int error, nbufs, i;
struct virtnet_rx *rxvq = &vq->rxq;
struct rte_mbuf *m;
uint16_t desc_idx;
int error, nbufs, i;
- bool in_order = v
tpci
_with_feature(hw, VIRTIO_F_IN_ORDER);
+ bool in_order = v
irtio
_with_feature(hw, VIRTIO_F_IN_ORDER);
PMD_INIT_FUNC_TRACE();
/* Allocate blank mbufs for the each rx descriptor */
nbufs = 0;
PMD_INIT_FUNC_TRACE();
/* Allocate blank mbufs for the each rx descriptor */
nbufs = 0;
- if (hw->use_vec_rx && !v
tpci
_packed_queue(hw)) {
+ if (hw->use_vec_rx && !v
irtio_with
_packed_queue(hw)) {
for (desc_idx = 0; desc_idx < vq->vq_nentries;
desc_idx++) {
vq->vq_split.ring.avail->ring[desc_idx] = desc_idx;
for (desc_idx = 0; desc_idx < vq->vq_nentries;
desc_idx++) {
vq->vq_split.ring.avail->ring[desc_idx] = desc_idx;
@@
-710,12
+710,12
@@
virtio_dev_rx_queue_setup_finish(struct rte_eth_dev *dev, uint16_t queue_idx)
&rxvq->fake_mbuf;
}
&rxvq->fake_mbuf;
}
- if (hw->use_vec_rx && !v
tpci
_packed_queue(hw)) {
+ if (hw->use_vec_rx && !v
irtio_with
_packed_queue(hw)) {
while (vq->vq_free_cnt >= RTE_VIRTIO_VPMD_RX_REARM_THRESH) {
virtio_rxq_rearm_vec(rxvq);
nbufs += RTE_VIRTIO_VPMD_RX_REARM_THRESH;
}
while (vq->vq_free_cnt >= RTE_VIRTIO_VPMD_RX_REARM_THRESH) {
virtio_rxq_rearm_vec(rxvq);
nbufs += RTE_VIRTIO_VPMD_RX_REARM_THRESH;
}
- } else if (!v
tpci
_packed_queue(vq->hw) && in_order) {
+ } else if (!v
irtio_with
_packed_queue(vq->hw) && in_order) {
if ((!virtqueue_full(vq))) {
uint16_t free_cnt = vq->vq_free_cnt;
struct rte_mbuf *pkts[free_cnt];
if ((!virtqueue_full(vq))) {
uint16_t free_cnt = vq->vq_free_cnt;
struct rte_mbuf *pkts[free_cnt];
@@
-741,7
+741,7
@@
virtio_dev_rx_queue_setup_finish(struct rte_eth_dev *dev, uint16_t queue_idx)
break;
/* Enqueue allocated buffers */
break;
/* Enqueue allocated buffers */
- if (v
tpci
_packed_queue(vq->hw))
+ if (v
irtio_with
_packed_queue(vq->hw))
error = virtqueue_enqueue_recv_refill_packed(vq,
&m, 1);
else
error = virtqueue_enqueue_recv_refill_packed(vq,
&m, 1);
else
@@
-754,7
+754,7
@@
virtio_dev_rx_queue_setup_finish(struct rte_eth_dev *dev, uint16_t queue_idx)
nbufs++;
}
nbufs++;
}
- if (!v
tpci
_packed_queue(vq->hw))
+ if (!v
irtio_with
_packed_queue(vq->hw))
vq_update_avail_idx(vq);
}
vq_update_avail_idx(vq);
}
@@
-779,9
+779,9
@@
virtio_dev_tx_queue_setup(struct rte_eth_dev *dev,
unsigned int socket_id __rte_unused,
const struct rte_eth_txconf *tx_conf)
{
unsigned int socket_id __rte_unused,
const struct rte_eth_txconf *tx_conf)
{
- uint8_t v
tpci_queue
_idx = 2 * queue_idx + VTNET_SQ_TQ_QUEUE_IDX;
+ uint8_t v
q
_idx = 2 * queue_idx + VTNET_SQ_TQ_QUEUE_IDX;
struct virtio_hw *hw = dev->data->dev_private;
struct virtio_hw *hw = dev->data->dev_private;
- struct virtqueue *vq = hw->vqs[v
tpci_queue
_idx];
+ struct virtqueue *vq = hw->vqs[v
q
_idx];
struct virtnet_tx *txvq;
uint16_t tx_free_thresh;
struct virtnet_tx *txvq;
uint16_t tx_free_thresh;
@@
-823,14
+823,14
@@
int
virtio_dev_tx_queue_setup_finish(struct rte_eth_dev *dev,
uint16_t queue_idx)
{
virtio_dev_tx_queue_setup_finish(struct rte_eth_dev *dev,
uint16_t queue_idx)
{
- uint8_t v
tpci_queue
_idx = 2 * queue_idx + VTNET_SQ_TQ_QUEUE_IDX;
+ uint8_t v
q
_idx = 2 * queue_idx + VTNET_SQ_TQ_QUEUE_IDX;
struct virtio_hw *hw = dev->data->dev_private;
struct virtio_hw *hw = dev->data->dev_private;
- struct virtqueue *vq = hw->vqs[v
tpci_queue
_idx];
+ struct virtqueue *vq = hw->vqs[v
q
_idx];
PMD_INIT_FUNC_TRACE();
PMD_INIT_FUNC_TRACE();
- if (!v
tpci
_packed_queue(hw)) {
- if (v
tpci
_with_feature(hw, VIRTIO_F_IN_ORDER))
+ if (!v
irtio_with
_packed_queue(hw)) {
+ if (v
irtio
_with_feature(hw, VIRTIO_F_IN_ORDER))
vq->vq_split.ring.desc[vq->vq_nentries - 1].next = 0;
}
vq->vq_split.ring.desc[vq->vq_nentries - 1].next = 0;
}
@@
-847,7
+847,7
@@
virtio_discard_rxbuf(struct virtqueue *vq, struct rte_mbuf *m)
* Requeue the discarded mbuf. This should always be
* successful since it was just dequeued.
*/
* Requeue the discarded mbuf. This should always be
* successful since it was just dequeued.
*/
- if (v
tpci
_packed_queue(vq->hw))
+ if (v
irtio_with
_packed_queue(vq->hw))
error = virtqueue_enqueue_recv_refill_packed(vq, &m, 1);
else
error = virtqueue_enqueue_recv_refill(vq, &m, 1);
error = virtqueue_enqueue_recv_refill_packed(vq, &m, 1);
else
error = virtqueue_enqueue_recv_refill(vq, &m, 1);
@@
-1209,7
+1209,7
@@
virtio_recv_pkts_inorder(void *rx_queue,
((char *)rxm->buf_addr + RTE_PKTMBUF_HEADROOM
- hdr_size);
((char *)rxm->buf_addr + RTE_PKTMBUF_HEADROOM
- hdr_size);
- if (v
tpci
_with_feature(hw, VIRTIO_NET_F_MRG_RXBUF)) {
+ if (v
irtio
_with_feature(hw, VIRTIO_NET_F_MRG_RXBUF)) {
seg_num = header->num_buffers;
if (seg_num == 0)
seg_num = 1;
seg_num = header->num_buffers;
if (seg_num == 0)
seg_num = 1;
@@
-1735,7
+1735,7
@@
virtio_xmit_pkts_packed(void *tx_queue, struct rte_mbuf **tx_pkts,
struct virtio_hw *hw = vq->hw;
uint16_t hdr_size = hw->vtnet_hdr_size;
uint16_t nb_tx = 0;
struct virtio_hw *hw = vq->hw;
uint16_t hdr_size = hw->vtnet_hdr_size;
uint16_t nb_tx = 0;
- bool in_order = v
tpci
_with_feature(hw, VIRTIO_F_IN_ORDER);
+ bool in_order = v
irtio
_with_feature(hw, VIRTIO_F_IN_ORDER);
if (unlikely(hw->started == 0 && tx_pkts != hw->inject_pkts))
return nb_tx;
if (unlikely(hw->started == 0 && tx_pkts != hw->inject_pkts))
return nb_tx;
@@
-1754,8
+1754,8
@@
virtio_xmit_pkts_packed(void *tx_queue, struct rte_mbuf **tx_pkts,
int can_push = 0, use_indirect = 0, slots, need;
/* optimize ring usage */
int can_push = 0, use_indirect = 0, slots, need;
/* optimize ring usage */
- if ((v
tpci
_with_feature(hw, VIRTIO_F_ANY_LAYOUT) ||
- v
tpci
_with_feature(hw, VIRTIO_F_VERSION_1)) &&
+ if ((v
irtio
_with_feature(hw, VIRTIO_F_ANY_LAYOUT) ||
+ v
irtio
_with_feature(hw, VIRTIO_F_VERSION_1)) &&
rte_mbuf_refcnt_read(txm) == 1 &&
RTE_MBUF_DIRECT(txm) &&
txm->nb_segs == 1 &&
rte_mbuf_refcnt_read(txm) == 1 &&
RTE_MBUF_DIRECT(txm) &&
txm->nb_segs == 1 &&
@@
-1763,7
+1763,7
@@
virtio_xmit_pkts_packed(void *tx_queue, struct rte_mbuf **tx_pkts,
rte_is_aligned(rte_pktmbuf_mtod(txm, char *),
__alignof__(struct virtio_net_hdr_mrg_rxbuf)))
can_push = 1;
rte_is_aligned(rte_pktmbuf_mtod(txm, char *),
__alignof__(struct virtio_net_hdr_mrg_rxbuf)))
can_push = 1;
- else if (v
tpci
_with_feature(hw, VIRTIO_RING_F_INDIRECT_DESC) &&
+ else if (v
irtio
_with_feature(hw, VIRTIO_RING_F_INDIRECT_DESC) &&
txm->nb_segs < VIRTIO_MAX_TX_INDIRECT)
use_indirect = 1;
/* How many main ring entries are needed to this Tx?
txm->nb_segs < VIRTIO_MAX_TX_INDIRECT)
use_indirect = 1;
/* How many main ring entries are needed to this Tx?
@@
-1835,8
+1835,8
@@
virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
int can_push = 0, use_indirect = 0, slots, need;
/* optimize ring usage */
int can_push = 0, use_indirect = 0, slots, need;
/* optimize ring usage */
- if ((v
tpci
_with_feature(hw, VIRTIO_F_ANY_LAYOUT) ||
- v
tpci
_with_feature(hw, VIRTIO_F_VERSION_1)) &&
+ if ((v
irtio
_with_feature(hw, VIRTIO_F_ANY_LAYOUT) ||
+ v
irtio
_with_feature(hw, VIRTIO_F_VERSION_1)) &&
rte_mbuf_refcnt_read(txm) == 1 &&
RTE_MBUF_DIRECT(txm) &&
txm->nb_segs == 1 &&
rte_mbuf_refcnt_read(txm) == 1 &&
RTE_MBUF_DIRECT(txm) &&
txm->nb_segs == 1 &&
@@
-1844,7
+1844,7
@@
virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
rte_is_aligned(rte_pktmbuf_mtod(txm, char *),
__alignof__(struct virtio_net_hdr_mrg_rxbuf)))
can_push = 1;
rte_is_aligned(rte_pktmbuf_mtod(txm, char *),
__alignof__(struct virtio_net_hdr_mrg_rxbuf)))
can_push = 1;
- else if (v
tpci
_with_feature(hw, VIRTIO_RING_F_INDIRECT_DESC) &&
+ else if (v
irtio
_with_feature(hw, VIRTIO_RING_F_INDIRECT_DESC) &&
txm->nb_segs < VIRTIO_MAX_TX_INDIRECT)
use_indirect = 1;
txm->nb_segs < VIRTIO_MAX_TX_INDIRECT)
use_indirect = 1;
@@
-1937,8
+1937,8
@@
virtio_xmit_pkts_inorder(void *tx_queue,
int slots;
/* optimize ring usage */
int slots;
/* optimize ring usage */
- if ((v
tpci
_with_feature(hw, VIRTIO_F_ANY_LAYOUT) ||
- v
tpci
_with_feature(hw, VIRTIO_F_VERSION_1)) &&
+ if ((v
irtio
_with_feature(hw, VIRTIO_F_ANY_LAYOUT) ||
+ v
irtio
_with_feature(hw, VIRTIO_F_VERSION_1)) &&
rte_mbuf_refcnt_read(txm) == 1 &&
RTE_MBUF_DIRECT(txm) &&
txm->nb_segs == 1 &&
rte_mbuf_refcnt_read(txm) == 1 &&
RTE_MBUF_DIRECT(txm) &&
txm->nb_segs == 1 &&