virtio: minor changes
Signed-off-by: Intel
This commit is contained in:
parent
de9fa911b1
commit
f72751f2c7
@ -133,19 +133,19 @@ int virtio_dev_queue_setup(struct rte_eth_dev *dev,
|
||||
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__);
|
||||
@ -352,9 +352,10 @@ virtio_get_hwaddr(struct virtio_hw *hw)
|
||||
}
|
||||
|
||||
|
||||
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 ;
|
||||
|
||||
|
@ -81,8 +81,8 @@ vtpci_write_dev_config(struct virtio_hw *hw, uint64_t offset,
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t
|
||||
vtpci_negotiate_features(struct virtio_hw *hw, uint64_t guest_features)
|
||||
uint32_t
|
||||
vtpci_negotiate_features(struct virtio_hw *hw, uint32_t guest_features)
|
||||
{
|
||||
uint32_t features;
|
||||
/*
|
||||
|
@ -223,7 +223,7 @@ struct virtio_net_config {
|
||||
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);
|
||||
}
|
||||
@ -239,9 +239,7 @@ uint8_t vtpci_get_status(struct virtio_hw *);
|
||||
|
||||
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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user