MCPcopy Create free account
hub / github.com/F-Stack/f-stack / drain_virtio_tx

Function drain_virtio_tx

dpdk/examples/vhost/main.c:1443–1461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1441}
1442
1443static __rte_always_inline void
1444drain_virtio_tx(struct vhost_dev *vdev)
1445{
1446 struct rte_mbuf *pkts[MAX_PKT_BURST];
1447 uint16_t count;
1448 uint16_t i;
1449
1450 count = vdev_queue_ops[vdev->vid].dequeue_pkt_burst(vdev,
1451 VIRTIO_TXQ, mbuf_pool, pkts, MAX_PKT_BURST);
1452
1453 /* setup VMDq for the first packet */
1454 if (unlikely(vdev->ready == DEVICE_MAC_LEARNING) && count) {
1455 if (vdev->remove || link_vmdq(vdev, pkts[0]) == -1)
1456 free_pkts(pkts, count);
1457 }
1458
1459 for (i = 0; i < count; ++i)
1460 virtio_tx_route(vdev, pkts[i], vlan_tags[vdev->vid]);
1461}
1462
1463/*
1464 * Main function of vhost-switch. It basically does:

Callers 1

switch_workerFunction · 0.85

Calls 3

link_vmdqFunction · 0.85
virtio_tx_routeFunction · 0.85
free_pktsFunction · 0.70

Tested by

no test coverage detected