dev->data->port_id, queue_idx);
vq = rte_zmalloc(vq_name, sizeof(struct virtqueue) +
vq_size * sizeof(struct vq_desc_extra), CACHE_LINE_SIZE);
- strncpy(vq->vq_name, vq_name, sizeof(vq->vq_name));
+ memcpy(vq->vq_name, vq_name, sizeof(vq->vq_name));
} else if(queue_type == VTNET_TQ) {
rte_snprintf(vq_name, sizeof(vq_name), "port%d_tvq%d",
dev->data->port_id, queue_idx);
vq = rte_zmalloc(vq_name, sizeof(struct virtqueue) +
vq_size * sizeof(struct vq_desc_extra), CACHE_LINE_SIZE);
- strncpy(vq->vq_name, vq_name, sizeof(vq->vq_name));
+ memcpy(vq->vq_name, vq_name, sizeof(vq->vq_name));
} else if(queue_type == VTNET_CQ) {
rte_snprintf(vq_name, sizeof(vq_name), "port%d_cvq",
dev->data->port_id);
vq = rte_zmalloc(vq_name, sizeof(struct virtqueue),
CACHE_LINE_SIZE);
- strncpy(vq->vq_name, vq_name, sizeof(vq->vq_name));
+ memcpy(vq->vq_name, vq_name, sizeof(vq->vq_name));
}
if (vq == NULL) {
PMD_INIT_LOG(ERR, "%s: Can not allocate virtqueue\n", __func__);
}
-static void virtio_negotiate_features(struct virtio_hw *hw)
+static void
+virtio_negotiate_features(struct virtio_hw *hw)
{
- uint64_t guest_features, mask;
+ uint32_t guest_features, mask;
mask = VIRTIO_NET_F_CTRL_VQ | VIRTIO_NET_F_CTRL_RX | VIRTIO_NET_F_CTRL_VLAN;
mask |= VIRTIO_NET_F_CSUM | VIRTIO_NET_F_GUEST_CSUM ;
outl_p((unsigned int)(value), (VIRTIO_PCI_REG_ADDR((hw), (reg))))
static inline int
-vtpci_with_feature(struct virtio_hw *hw, uint64_t feature)
+vtpci_with_feature(struct virtio_hw *hw, uint32_t feature)
{
return ((hw->guest_features & feature) != 0);
}
void vtpci_set_status(struct virtio_hw *, uint8_t);
-int vtpci_with_feature(struct virtio_hw *, uint64_t);
-
-uint64_t vtpci_negotiate_features(struct virtio_hw *, uint64_t);
+uint32_t vtpci_negotiate_features(struct virtio_hw *, uint32_t);
void vtpci_write_dev_config(struct virtio_hw *, uint64_t, void *, int);