/* Learn MAC address of guest device from packet */
pkt_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
- if (find_vhost_dev(&pkt_hdr->s_addr)) {
+ if (find_vhost_dev(&pkt_hdr->src_addr)) {
RTE_LOG(ERR, VHOST_DATA,
"(%d) device is using a registered MAC!\n",
vdev->vid);
}
for (i = 0; i < RTE_ETHER_ADDR_LEN; i++)
- vdev->mac_address.addr_bytes[i] = pkt_hdr->s_addr.addr_bytes[i];
+ vdev->mac_address.addr_bytes[i] =
+ pkt_hdr->src_addr.addr_bytes[i];
/* vlan_tag currently uses the device_id. */
vdev->vlan_tag = vlan_tags[vdev->vid];
if (builtin_net_driver) {
ret = vs_enqueue_pkts(vdev, VIRTIO_RXQ, m, nr_xmit);
} else if (async_vhost_driver) {
- uint32_t cpu_cpl_nr = 0;
uint16_t enqueue_fail = 0;
- struct rte_mbuf *m_cpu_cpl[nr_xmit];
complete_async_pkts(vdev);
- ret = rte_vhost_submit_enqueue_burst(vdev->vid, VIRTIO_RXQ,
- m, nr_xmit, m_cpu_cpl, &cpu_cpl_nr);
- __atomic_add_fetch(&vdev->pkts_inflight, ret - cpu_cpl_nr, __ATOMIC_SEQ_CST);
-
- if (cpu_cpl_nr)
- free_pkts(m_cpu_cpl, cpu_cpl_nr);
+ ret = rte_vhost_submit_enqueue_burst(vdev->vid, VIRTIO_RXQ, m, nr_xmit);
+ __atomic_add_fetch(&vdev->pkts_inflight, ret, __ATOMIC_SEQ_CST);
enqueue_fail = nr_xmit - ret;
if (enqueue_fail)
uint16_t lcore_id = rte_lcore_id();
pkt_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
- dst_vdev = find_vhost_dev(&pkt_hdr->d_addr);
+ dst_vdev = find_vhost_dev(&pkt_hdr->dst_addr);
if (!dst_vdev)
return -1;
struct rte_ether_hdr *pkt_hdr =
rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
- dst_vdev = find_vhost_dev(&pkt_hdr->d_addr);
+ dst_vdev = find_vhost_dev(&pkt_hdr->dst_addr);
if (!dst_vdev)
return 0;
nh = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
- if (unlikely(rte_is_broadcast_ether_addr(&nh->d_addr))) {
+ if (unlikely(rte_is_broadcast_ether_addr(&nh->dst_addr))) {
struct vhost_dev *vdev2;
TAILQ_FOREACH(vdev2, &vhost_dev_list, global_vdev_entry) {
enqueue_count = vs_enqueue_pkts(vdev, VIRTIO_RXQ,
pkts, rx_count);
} else if (async_vhost_driver) {
- uint32_t cpu_cpl_nr = 0;
uint16_t enqueue_fail = 0;
- struct rte_mbuf *m_cpu_cpl[MAX_PKT_BURST];
complete_async_pkts(vdev);
enqueue_count = rte_vhost_submit_enqueue_burst(vdev->vid,
- VIRTIO_RXQ, pkts, rx_count,
- m_cpu_cpl, &cpu_cpl_nr);
- __atomic_add_fetch(&vdev->pkts_inflight, enqueue_count - cpu_cpl_nr,
- __ATOMIC_SEQ_CST);
-
- if (cpu_cpl_nr)
- free_pkts(m_cpu_cpl, cpu_cpl_nr);
+ VIRTIO_RXQ, pkts, rx_count);
+ __atomic_add_fetch(&vdev->pkts_inflight, enqueue_count, __ATOMIC_SEQ_CST);
enqueue_fail = rx_count - enqueue_count;
if (enqueue_fail)
ioat_check_completed_copies_cb;
config.features = RTE_VHOST_ASYNC_INORDER;
- config.async_threshold = 256;
return rte_vhost_async_channel_register(vid, VIRTIO_RXQ,
config, &channel_ops);