git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ethdev: remove legacy Rx descriptor done API
[dpdk.git]
/
drivers
/
net
/
virtio
/
virtio_user_ethdev.c
diff --git
a/drivers/net/virtio/virtio_user_ethdev.c
b/drivers/net/virtio/virtio_user_ethdev.c
index
79bd31e
..
0271098
100644
(file)
--- a/
drivers/net/virtio/virtio_user_ethdev.c
+++ b/
drivers/net/virtio/virtio_user_ethdev.c
@@
-60,12
+60,15
@@
virtio_user_write_dev_config(struct virtio_hw *hw, size_t offset,
struct virtio_user_dev *dev = virtio_user_get_dev(hw);
if ((offset == offsetof(struct virtio_net_config, mac)) &&
struct virtio_user_dev *dev = virtio_user_get_dev(hw);
if ((offset == offsetof(struct virtio_net_config, mac)) &&
- (length == RTE_ETHER_ADDR_LEN))
+ (length == RTE_ETHER_ADDR_LEN))
{
for (i = 0; i < RTE_ETHER_ADDR_LEN; ++i)
dev->mac_addr[i] = ((const uint8_t *)src)[i];
for (i = 0; i < RTE_ETHER_ADDR_LEN; ++i)
dev->mac_addr[i] = ((const uint8_t *)src)[i];
- else
+ virtio_user_dev_set_mac(dev);
+ virtio_user_dev_get_mac(dev);
+ } else {
PMD_DRV_LOG(ERR, "not supported offset=%zu, len=%d",
offset, length);
PMD_DRV_LOG(ERR, "not supported offset=%zu, len=%d",
offset, length);
+ }
}
static void
}
static void
@@
-110,7
+113,8
@@
virtio_user_get_features(struct virtio_hw *hw)
struct virtio_user_dev *dev = virtio_user_get_dev(hw);
/* unmask feature bits defined in vhost user protocol */
struct virtio_user_dev *dev = virtio_user_get_dev(hw);
/* unmask feature bits defined in vhost user protocol */
- return dev->device_features & VIRTIO_PMD_SUPPORTED_GUEST_FEATURES;
+ return (dev->device_features | dev->frontend_features) &
+ VIRTIO_PMD_SUPPORTED_GUEST_FEATURES;
}
static void
}
static void
@@
-118,7
+122,7
@@
virtio_user_set_features(struct virtio_hw *hw, uint64_t features)
{
struct virtio_user_dev *dev = virtio_user_get_dev(hw);
{
struct virtio_user_dev *dev = virtio_user_get_dev(hw);
- dev->features = features &
dev->device_features
;
+ dev->features = features &
(dev->device_features | dev->frontend_features)
;
}
static int
}
static int
@@
-360,7
+364,7
@@
vdpa_dynamic_major_num(void)
{
FILE *fp;
char *line = NULL;
{
FILE *fp;
char *line = NULL;
- size_t size;
+ size_t size
= 0
;
char name[11];
bool found = false;
uint32_t num;
char name[11];
bool found = false;
uint32_t num;
@@
-380,6
+384,7
@@
vdpa_dynamic_major_num(void)
break;
}
}
break;
}
}
+ free(line);
fclose(fp);
return found ? num : UNNAMED_MAJOR;
}
fclose(fp);
return found ? num : UNNAMED_MAJOR;
}
@@
-393,7
+398,7
@@
virtio_user_backend_type(const char *path)
if (errno == ENOENT)
return VIRTIO_USER_BACKEND_VHOST_USER;
if (errno == ENOENT)
return VIRTIO_USER_BACKEND_VHOST_USER;
- PMD_INIT_LOG(ERR, "Stat fails: %s (%s)
\n
", path,
+ PMD_INIT_LOG(ERR, "Stat fails: %s (%s)", path,
strerror(errno));
return VIRTIO_USER_BACKEND_UNKNOWN;
}
strerror(errno));
return VIRTIO_USER_BACKEND_UNKNOWN;
}
@@
-652,6
+657,12
@@
virtio_user_pmd_probe(struct rte_vdev_device *vdev)
goto end;
}
goto end;
}
+ /*
+ * Virtio-user requires using virtual addresses for the descriptors
+ * buffers, whatever other devices require
+ */
+ hw->use_va = true;
+
/* previously called by pci probing for physical dev */
if (eth_virtio_dev_init(eth_dev) < 0) {
PMD_INIT_LOG(ERR, "eth_virtio_dev_init fails");
/* previously called by pci probing for physical dev */
if (eth_virtio_dev_init(eth_dev) < 0) {
PMD_INIT_LOG(ERR, "eth_virtio_dev_init fails");
@@
-764,7
+775,6
@@
static struct rte_vdev_driver virtio_user_driver = {
.remove = virtio_user_pmd_remove,
.dma_map = virtio_user_pmd_dma_map,
.dma_unmap = virtio_user_pmd_dma_unmap,
.remove = virtio_user_pmd_remove,
.dma_map = virtio_user_pmd_dma_map,
.dma_unmap = virtio_user_pmd_dma_unmap,
- .drv_flags = RTE_VDEV_DRV_NEED_IOVA_AS_VA,
};
RTE_PMD_REGISTER_VDEV(net_virtio_user, virtio_user_driver);
};
RTE_PMD_REGISTER_VDEV(net_virtio_user, virtio_user_driver);