[dpdk-dev] [PATCH v3 04/17] dma/idxd: add bus device probing
Conor Walsh
conor.walsh at intel.com
Wed Sep 8 18:47:45 CEST 2021
<snip>
> +static void *
> +idxd_vdev_mmap_wq(struct rte_dsa_device *dev)
Some inconsistent naming between vdev and bus in some of these functions
the above should be idxd_bus_mmap_wq for example.
> +{
> + void *addr;
> + char path[PATH_MAX];
> + int fd;
> +
> + snprintf(path, sizeof(path), "%s/%s", dsa_get_dev_path(), dev->wq_name);
> + fd = open(path, O_RDWR);
> + if (fd < 0) {
> + IDXD_PMD_ERR("Failed to open device path: %s", path);
> + return NULL;
> + }
> +
> + addr = mmap(NULL, 0x1000, PROT_WRITE, MAP_SHARED, fd, 0);
> + close(fd);
> + if (addr == MAP_FAILED) {
> + IDXD_PMD_ERR("Failed to mmap device %s", path);
> + return NULL;
> + }
> +
> + return addr;
> +}
Reviewed-by: Conor Walsh <conor.walsh at intel.com>
More information about the dev
mailing list