{
struct vhost_virtqueue *virtqueue[VIRTIO_QNUM]; /* Contains all virtqueue information. */
struct virtio_memory *mem; /* QEMU memory and memory region information. */
- struct ether_addr mac_address; /* Device MAC address (Obtained on first TX packet). */
uint64_t features; /* Negotiated feature set. */
uint64_t device_fh; /* device identifier. */
- uint32_t vmdq_rx_q; /* RX VMDQ queue number. */
uint32_t flags; /* Device flags. Only used to check if device is running on data core. */
- uint32_t vlan_tag; /* Vlan tag for device. Currently set to device_id (0-63). */
- uint16_t coreid; /* Data core that the device is added to. */
- volatile uint8_t ready; /* A device is set as ready if the MAC address has been set. */
- volatile uint8_t remove; /* Device is marked for removal from the data core. */
} __rte_cache_aligned;
/*
m->nb_segs = seg_num;
- /*
- * If this is the first received packet we need to learn
- * the MAC and setup VMDQ
- */
- if (dev->ready == DEVICE_MAC_LEARNING) {
- if (dev->remove || (link_vmdq(dev, m) == -1)) {
- /*
- * Discard frame if device is scheduled for
- * removal or a duplicate MAC address is found.
- */
- entry_success = free_entries;
- vq->last_used_idx += entry_success;
- rte_pktmbuf_free(m);
- break;
- }
- }
-
- virtio_tx_route(dev, m, mbuf_pool, (uint16_t)dev->device_fh);
vq->last_used_idx++;
entry_success++;
rte_pktmbuf_free(m);
const char eventfd_cdev[] = "/dev/eventfd-link";
-extern uint32_t num_devices;
-static uint32_t num_cur_devices = 0;
-
/* device ops to add/remove device to data core. */
static struct virtio_net_device_ops const * notify_ops;
/* Root address of the linked list in the configuration core. */
struct virtio_net_config_ll *new_ll_dev;
struct vhost_virtqueue *virtqueue_rx, *virtqueue_tx;
- /*check the number of devices in the system*/
- if (num_cur_devices == num_devices) {
- RTE_LOG(ERR, VHOST_CONFIG, "() Max num devices (%u) exceeded\n", num_devices);
- return -1;
- }
-
/* Setup device and virtqueues. */
new_ll_dev = malloc(sizeof(struct virtio_net_config_ll));
if (new_ll_dev == NULL) {
/* Add entry to device configuration linked list. */
add_config_ll_entry(new_ll_dev);
- /*increment the number of devices in the system*/
- num_cur_devices++;
-
return new_ll_dev->dev.device_fh;
}
ll_dev_cur = ll_dev_cur->next;
}
}
-
- /*decrement the number of devices in the system*/
- num_cur_devices--;
}
/*