summaryrefslogtreecommitdiff
path: root/lib/librte_pmd_virtio
diff options
context:
space:
mode:
authorIntel <intel.com>2013-11-08 03:00:00 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2013-11-24 01:31:33 +0100
commitf72751f2c70a787787f499694d8c7a66247e5737 (patch)
tree4d1205d863de75860e1e4d457512f7f6480cc97c /lib/librte_pmd_virtio
parentde9fa911b1c4f5e8e59dfab1e5330cff08380a2a (diff)
downloaddpdk-f72751f2c70a787787f499694d8c7a66247e5737.zip
dpdk-f72751f2c70a787787f499694d8c7a66247e5737.tar.gz
dpdk-f72751f2c70a787787f499694d8c7a66247e5737.tar.xz
virtio: minor changes
Signed-off-by: Intel
Diffstat (limited to 'lib/librte_pmd_virtio')
-rw-r--r--lib/librte_pmd_virtio/virtio_ethdev.c11
-rw-r--r--lib/librte_pmd_virtio/virtio_pci.c4
-rw-r--r--lib/librte_pmd_virtio/virtio_pci.h6
3 files changed, 10 insertions, 11 deletions
diff --git a/lib/librte_pmd_virtio/virtio_ethdev.c b/lib/librte_pmd_virtio/virtio_ethdev.c
index b5b9d01..fe06a13 100644
--- a/lib/librte_pmd_virtio/virtio_ethdev.c
+++ b/lib/librte_pmd_virtio/virtio_ethdev.c
@@ -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 ;
diff --git a/lib/librte_pmd_virtio/virtio_pci.c b/lib/librte_pmd_virtio/virtio_pci.c
index a462779..6bf89d9 100644
--- a/lib/librte_pmd_virtio/virtio_pci.c
+++ b/lib/librte_pmd_virtio/virtio_pci.c
@@ -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;
/*
diff --git a/lib/librte_pmd_virtio/virtio_pci.h b/lib/librte_pmd_virtio/virtio_pci.h
index 04fc156..da43513 100644
--- a/lib/librte_pmd_virtio/virtio_pci.h
+++ b/lib/librte_pmd_virtio/virtio_pci.h
@@ -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);