drivers: use SPDX tag in NXP dpaa2 files
[dpdk.git] / drivers / bus / fslmc / fslmc_vfio.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2  *
3  *   Copyright (c) 2015-2016 Freescale Semiconductor, Inc. All rights reserved.
4  *   Copyright 2016 NXP
5  *
6  */
7
8 #include <unistd.h>
9 #include <stdio.h>
10 #include <sys/types.h>
11 #include <string.h>
12 #include <stdlib.h>
13 #include <fcntl.h>
14 #include <errno.h>
15 #include <sys/ioctl.h>
16 #include <sys/stat.h>
17 #include <sys/mman.h>
18 #include <sys/vfs.h>
19 #include <libgen.h>
20 #include <dirent.h>
21 #include <sys/eventfd.h>
22
23 #include <eal_filesystem.h>
24 #include <rte_mbuf.h>
25 #include <rte_ethdev.h>
26 #include <rte_malloc.h>
27 #include <rte_memcpy.h>
28 #include <rte_string_fns.h>
29 #include <rte_cycles.h>
30 #include <rte_kvargs.h>
31 #include <rte_dev.h>
32 #include <rte_bus.h>
33
34 #include "rte_fslmc.h"
35 #include "fslmc_vfio.h"
36 #include <mc/fsl_dpmng.h>
37
38 #include "portal/dpaa2_hw_pvt.h"
39 #include "portal/dpaa2_hw_dpio.h"
40
41 #define FSLMC_VFIO_LOG(level, fmt, args...) \
42         RTE_LOG(level, EAL, fmt "\n", ##args)
43
44 /** Pathname of FSL-MC devices directory. */
45 #define SYSFS_FSL_MC_DEVICES "/sys/bus/fsl-mc/devices"
46
47 #define FSLMC_CONTAINER_MAX_LEN 8 /**< Of the format dprc.XX */
48
49 /* Number of VFIO containers & groups with in */
50 static struct fslmc_vfio_group vfio_group;
51 static struct fslmc_vfio_container vfio_container;
52 static int container_device_fd;
53 static char *g_container;
54 static uint32_t *msi_intr_vaddr;
55 void *(*rte_mcp_ptr_list);
56 static int is_dma_done;
57
58 static struct rte_dpaa2_object_list dpaa2_obj_list =
59         TAILQ_HEAD_INITIALIZER(dpaa2_obj_list);
60
61 /*register a fslmc bus based dpaa2 driver */
62 void
63 rte_fslmc_object_register(struct rte_dpaa2_object *object)
64 {
65         RTE_VERIFY(object);
66
67         TAILQ_INSERT_TAIL(&dpaa2_obj_list, object, next);
68 }
69
70 int
71 fslmc_get_container_group(int *groupid)
72 {
73         int ret;
74         char *container;
75
76         if (!g_container) {
77                 container = getenv("DPRC");
78                 if (container == NULL) {
79                         RTE_LOG(WARNING, EAL, "DPAA2: DPRC not available\n");
80                         return -EINVAL;
81                 }
82
83                 if (strlen(container) >= FSLMC_CONTAINER_MAX_LEN) {
84                         FSLMC_VFIO_LOG(ERR, "Invalid container name: %s\n",
85                                        container);
86                         return -1;
87                 }
88
89                 g_container = strdup(container);
90                 if (!g_container) {
91                         FSLMC_VFIO_LOG(ERR, "Out of memory.");
92                         return -ENOMEM;
93                 }
94         }
95
96         /* get group number */
97         ret = vfio_get_group_no(SYSFS_FSL_MC_DEVICES, g_container, groupid);
98         if (ret <= 0) {
99                 FSLMC_VFIO_LOG(ERR, "Unable to find %s IOMMU group",
100                                g_container);
101                 return -1;
102         }
103
104         FSLMC_VFIO_LOG(DEBUG, "Container: %s has VFIO iommu group id = %d",
105                        g_container, *groupid);
106
107         return 0;
108 }
109
110 static int
111 vfio_connect_container(void)
112 {
113         int fd, ret;
114
115         if (vfio_container.used) {
116                 FSLMC_VFIO_LOG(DEBUG, "No container available.");
117                 return -1;
118         }
119
120         /* Try connecting to vfio container if already created */
121         if (!ioctl(vfio_group.fd, VFIO_GROUP_SET_CONTAINER,
122                 &vfio_container.fd)) {
123                 FSLMC_VFIO_LOG(INFO,
124                     "Container pre-exists with FD[0x%x] for this group",
125                     vfio_container.fd);
126                 vfio_group.container = &vfio_container;
127                 return 0;
128         }
129
130         /* Opens main vfio file descriptor which represents the "container" */
131         fd = vfio_get_container_fd();
132         if (fd < 0) {
133                 FSLMC_VFIO_LOG(ERR, "Failed to open VFIO container");
134                 return -errno;
135         }
136
137         /* Check whether support for SMMU type IOMMU present or not */
138         if (ioctl(fd, VFIO_CHECK_EXTENSION, VFIO_TYPE1_IOMMU)) {
139                 /* Connect group to container */
140                 ret = ioctl(vfio_group.fd, VFIO_GROUP_SET_CONTAINER, &fd);
141                 if (ret) {
142                         FSLMC_VFIO_LOG(ERR, "Failed to setup group container");
143                         close(fd);
144                         return -errno;
145                 }
146
147                 ret = ioctl(fd, VFIO_SET_IOMMU, VFIO_TYPE1_IOMMU);
148                 if (ret) {
149                         FSLMC_VFIO_LOG(ERR, "Failed to setup VFIO iommu");
150                         close(fd);
151                         return -errno;
152                 }
153         } else {
154                 FSLMC_VFIO_LOG(ERR, "No supported IOMMU available");
155                 close(fd);
156                 return -EINVAL;
157         }
158
159         vfio_container.used = 1;
160         vfio_container.fd = fd;
161         vfio_container.group = &vfio_group;
162         vfio_group.container = &vfio_container;
163
164         return 0;
165 }
166
167 static int vfio_map_irq_region(struct fslmc_vfio_group *group)
168 {
169         int ret;
170         unsigned long *vaddr = NULL;
171         struct vfio_iommu_type1_dma_map map = {
172                 .argsz = sizeof(map),
173                 .flags = VFIO_DMA_MAP_FLAG_READ | VFIO_DMA_MAP_FLAG_WRITE,
174                 .vaddr = 0x6030000,
175                 .iova = 0x6030000,
176                 .size = 0x1000,
177         };
178
179         vaddr = (unsigned long *)mmap(NULL, 0x1000, PROT_WRITE |
180                 PROT_READ, MAP_SHARED, container_device_fd, 0x6030000);
181         if (vaddr == MAP_FAILED) {
182                 FSLMC_VFIO_LOG(ERR, "Unable to map region (errno = %d)", errno);
183                 return -errno;
184         }
185
186         msi_intr_vaddr = (uint32_t *)((char *)(vaddr) + 64);
187         map.vaddr = (unsigned long)vaddr;
188         ret = ioctl(group->container->fd, VFIO_IOMMU_MAP_DMA, &map);
189         if (ret == 0)
190                 return 0;
191
192         FSLMC_VFIO_LOG(ERR, "VFIO_IOMMU_MAP_DMA fails (errno = %d)", errno);
193         return -errno;
194 }
195
196 int rte_fslmc_vfio_dmamap(void)
197 {
198         int ret;
199         struct fslmc_vfio_group *group;
200         struct vfio_iommu_type1_dma_map dma_map = {
201                 .argsz = sizeof(struct vfio_iommu_type1_dma_map),
202                 .flags = VFIO_DMA_MAP_FLAG_READ | VFIO_DMA_MAP_FLAG_WRITE,
203         };
204
205         int i;
206         const struct rte_memseg *memseg;
207
208         if (is_dma_done)
209                 return 0;
210
211         memseg = rte_eal_get_physmem_layout();
212         if (memseg == NULL) {
213                 FSLMC_VFIO_LOG(ERR, "Cannot get physical layout.");
214                 return -ENODEV;
215         }
216
217         for (i = 0; i < RTE_MAX_MEMSEG; i++) {
218                 if (memseg[i].addr == NULL && memseg[i].len == 0) {
219                         FSLMC_VFIO_LOG(DEBUG, "Total %d segments found.", i);
220                         break;
221                 }
222
223                 dma_map.size = memseg[i].len;
224                 dma_map.vaddr = memseg[i].addr_64;
225 #ifdef RTE_LIBRTE_DPAA2_USE_PHYS_IOVA
226                 dma_map.iova = memseg[i].phys_addr;
227 #else
228                 dma_map.iova = dma_map.vaddr;
229 #endif
230
231                 /* SET DMA MAP for IOMMU */
232                 group = &vfio_group;
233
234                 if (!group->container) {
235                         FSLMC_VFIO_LOG(ERR, "Container is not connected ");
236                         return -1;
237                 }
238
239                 FSLMC_VFIO_LOG(DEBUG, "-->Initial SHM Virtual ADDR %llX",
240                              dma_map.vaddr);
241                 FSLMC_VFIO_LOG(DEBUG, "-----> DMA size 0x%llX", dma_map.size);
242                 ret = ioctl(group->container->fd, VFIO_IOMMU_MAP_DMA,
243                             &dma_map);
244                 if (ret) {
245                         FSLMC_VFIO_LOG(ERR, "VFIO_IOMMU_MAP_DMA API(errno = %d)",
246                                        errno);
247                         return ret;
248                 }
249         }
250
251         /* Verifying that at least single segment is available */
252         if (i <= 0) {
253                 FSLMC_VFIO_LOG(ERR, "No Segments found for VFIO Mapping");
254                 return -1;
255         }
256
257         /* TODO - This is a W.A. as VFIO currently does not add the mapping of
258          * the interrupt region to SMMU. This should be removed once the
259          * support is added in the Kernel.
260          */
261         vfio_map_irq_region(group);
262
263         is_dma_done = 1;
264
265         return 0;
266 }
267
268 static int64_t vfio_map_mcp_obj(struct fslmc_vfio_group *group, char *mcp_obj)
269 {
270         int64_t v_addr = (int64_t)MAP_FAILED;
271         int32_t ret, mc_fd;
272
273         struct vfio_device_info d_info = { .argsz = sizeof(d_info) };
274         struct vfio_region_info reg_info = { .argsz = sizeof(reg_info) };
275
276         /* getting the mcp object's fd*/
277         mc_fd = ioctl(group->fd, VFIO_GROUP_GET_DEVICE_FD, mcp_obj);
278         if (mc_fd < 0) {
279                 FSLMC_VFIO_LOG(ERR, "error in VFIO get dev %s fd from group %d",
280                                mcp_obj, group->fd);
281                 return v_addr;
282         }
283
284         /* getting device info*/
285         ret = ioctl(mc_fd, VFIO_DEVICE_GET_INFO, &d_info);
286         if (ret < 0) {
287                 FSLMC_VFIO_LOG(ERR, "error in VFIO getting DEVICE_INFO");
288                 goto MC_FAILURE;
289         }
290
291         /* getting device region info*/
292         ret = ioctl(mc_fd, VFIO_DEVICE_GET_REGION_INFO, &reg_info);
293         if (ret < 0) {
294                 FSLMC_VFIO_LOG(ERR, "error in VFIO getting REGION_INFO");
295                 goto MC_FAILURE;
296         }
297
298         FSLMC_VFIO_LOG(DEBUG, "region offset = %llx  , region size = %llx",
299                        reg_info.offset, reg_info.size);
300
301         v_addr = (uint64_t)mmap(NULL, reg_info.size,
302                 PROT_WRITE | PROT_READ, MAP_SHARED,
303                 mc_fd, reg_info.offset);
304
305 MC_FAILURE:
306         close(mc_fd);
307
308         return v_addr;
309 }
310
311 #define IRQ_SET_BUF_LEN  (sizeof(struct vfio_irq_set) + sizeof(int))
312
313 int rte_dpaa2_intr_enable(struct rte_intr_handle *intr_handle, int index)
314 {
315         int len, ret;
316         char irq_set_buf[IRQ_SET_BUF_LEN];
317         struct vfio_irq_set *irq_set;
318         int *fd_ptr;
319
320         len = sizeof(irq_set_buf);
321
322         irq_set = (struct vfio_irq_set *)irq_set_buf;
323         irq_set->argsz = len;
324         irq_set->count = 1;
325         irq_set->flags =
326                 VFIO_IRQ_SET_DATA_EVENTFD | VFIO_IRQ_SET_ACTION_TRIGGER;
327         irq_set->index = index;
328         irq_set->start = 0;
329         fd_ptr = (int *)&irq_set->data;
330         *fd_ptr = intr_handle->fd;
331
332         ret = ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
333         if (ret) {
334                 RTE_LOG(ERR, EAL, "Error:dpaa2 SET IRQs fd=%d, err = %d(%s)\n",
335                         intr_handle->fd, errno, strerror(errno));
336                 return ret;
337         }
338
339         return ret;
340 }
341
342 int rte_dpaa2_intr_disable(struct rte_intr_handle *intr_handle, int index)
343 {
344         struct vfio_irq_set *irq_set;
345         char irq_set_buf[IRQ_SET_BUF_LEN];
346         int len, ret;
347
348         len = sizeof(struct vfio_irq_set);
349
350         irq_set = (struct vfio_irq_set *)irq_set_buf;
351         irq_set->argsz = len;
352         irq_set->flags = VFIO_IRQ_SET_DATA_NONE | VFIO_IRQ_SET_ACTION_TRIGGER;
353         irq_set->index = index;
354         irq_set->start = 0;
355         irq_set->count = 0;
356
357         ret = ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
358         if (ret)
359                 RTE_LOG(ERR, EAL,
360                         "Error disabling dpaa2 interrupts for fd %d\n",
361                         intr_handle->fd);
362
363         return ret;
364 }
365
366 /* set up interrupt support (but not enable interrupts) */
367 int
368 rte_dpaa2_vfio_setup_intr(struct rte_intr_handle *intr_handle,
369                           int vfio_dev_fd,
370                           int num_irqs)
371 {
372         int i, ret;
373
374         /* start from MSI-X interrupt type */
375         for (i = 0; i < num_irqs; i++) {
376                 struct vfio_irq_info irq_info = { .argsz = sizeof(irq_info) };
377                 int fd = -1;
378
379                 irq_info.index = i;
380
381                 ret = ioctl(vfio_dev_fd, VFIO_DEVICE_GET_IRQ_INFO, &irq_info);
382                 if (ret < 0) {
383                         FSLMC_VFIO_LOG(ERR,
384                                        "cannot get IRQ(%d) info, error %i (%s)",
385                                        i, errno, strerror(errno));
386                         return -1;
387                 }
388
389                 /* if this vector cannot be used with eventfd,
390                  * fail if we explicitly
391                  * specified interrupt type, otherwise continue
392                  */
393                 if ((irq_info.flags & VFIO_IRQ_INFO_EVENTFD) == 0)
394                         continue;
395
396                 /* set up an eventfd for interrupts */
397                 fd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
398                 if (fd < 0) {
399                         FSLMC_VFIO_LOG(ERR,
400                                        "cannot set up eventfd, error %i (%s)\n",
401                                        errno, strerror(errno));
402                         return -1;
403                 }
404
405                 intr_handle->fd = fd;
406                 intr_handle->type = RTE_INTR_HANDLE_VFIO_MSI;
407                 intr_handle->vfio_dev_fd = vfio_dev_fd;
408
409                 return 0;
410         }
411
412         /* if we're here, we haven't found a suitable interrupt vector */
413         return -1;
414 }
415
416 /*
417  * fslmc_process_iodevices for processing only IO (ETH, CRYPTO, and possibly
418  * EVENT) devices.
419  */
420 static int
421 fslmc_process_iodevices(struct rte_dpaa2_device *dev)
422 {
423         int dev_fd;
424         struct vfio_device_info device_info = { .argsz = sizeof(device_info) };
425         struct rte_dpaa2_object *object = NULL;
426
427         dev_fd = ioctl(vfio_group.fd, VFIO_GROUP_GET_DEVICE_FD,
428                        dev->device.name);
429         if (dev_fd <= 0) {
430                 FSLMC_VFIO_LOG(ERR, "Unable to obtain device FD for device:%s",
431                                dev->device.name);
432                 return -1;
433         }
434
435         if (ioctl(dev_fd, VFIO_DEVICE_GET_INFO, &device_info)) {
436                 FSLMC_VFIO_LOG(ERR, "DPAA2 VFIO_DEVICE_GET_INFO fail");
437                 return -1;
438         }
439
440         switch (dev->dev_type) {
441         case DPAA2_ETH:
442                 rte_dpaa2_vfio_setup_intr(&dev->intr_handle, dev_fd,
443                                           device_info.num_irqs);
444                 break;
445         case DPAA2_CON:
446         case DPAA2_IO:
447         case DPAA2_CI:
448         case DPAA2_BPOOL:
449                 TAILQ_FOREACH(object, &dpaa2_obj_list, next) {
450                         if (dev->dev_type == object->dev_type)
451                                 object->create(dev_fd, &device_info,
452                                                dev->object_id);
453                         else
454                                 continue;
455                 }
456                 break;
457         default:
458                 break;
459         }
460
461         FSLMC_VFIO_LOG(DEBUG, "Device (%s) abstracted from VFIO",
462                        dev->device.name);
463         return 0;
464 }
465
466 static int
467 fslmc_process_mcp(struct rte_dpaa2_device *dev)
468 {
469         int64_t v_addr;
470         char *dev_name;
471         struct fsl_mc_io dpmng  = {0};
472         struct mc_version mc_ver_info = {0};
473
474         rte_mcp_ptr_list = malloc(sizeof(void *) * 1);
475         if (!rte_mcp_ptr_list) {
476                 FSLMC_VFIO_LOG(ERR, "Out of memory");
477                 return -ENOMEM;
478         }
479
480         dev_name = strdup(dev->device.name);
481         if (!dev_name) {
482                 FSLMC_VFIO_LOG(ERR, "Out of memory.");
483                 free(rte_mcp_ptr_list);
484                 rte_mcp_ptr_list = NULL;
485                 return -ENOMEM;
486         }
487
488         v_addr = vfio_map_mcp_obj(&vfio_group, dev_name);
489         if (v_addr == (int64_t)MAP_FAILED) {
490                 FSLMC_VFIO_LOG(ERR, "Error mapping region  (errno = %d)",
491                                errno);
492                 free(rte_mcp_ptr_list);
493                 rte_mcp_ptr_list = NULL;
494                 return -1;
495         }
496
497         /* check the MC version compatibility */
498         dpmng.regs = (void *)v_addr;
499         if (mc_get_version(&dpmng, CMD_PRI_LOW, &mc_ver_info))
500                 RTE_LOG(WARNING, PMD, "\tmc_get_version failed\n");
501
502         if ((mc_ver_info.major != MC_VER_MAJOR) ||
503             (mc_ver_info.minor < MC_VER_MINOR)) {
504                 RTE_LOG(ERR, PMD, "DPAA2 MC version not compatible!"
505                         " Expected %d.%d.x, Detected %d.%d.%d\n",
506                         MC_VER_MAJOR, MC_VER_MINOR,
507                         mc_ver_info.major, mc_ver_info.minor,
508                         mc_ver_info.revision);
509                 free(rte_mcp_ptr_list);
510                 rte_mcp_ptr_list = NULL;
511                 return -1;
512         }
513         rte_mcp_ptr_list[0] = (void *)v_addr;
514
515         return 0;
516 }
517
518 int
519 fslmc_vfio_process_group(void)
520 {
521         int ret;
522         int found_mportal = 0;
523         struct rte_dpaa2_device *dev, *dev_temp;
524
525         /* Search the MCP as that should be initialized first. */
526         TAILQ_FOREACH_SAFE(dev, &rte_fslmc_bus.device_list, next, dev_temp) {
527                 if (dev->dev_type == DPAA2_MPORTAL) {
528                         ret = fslmc_process_mcp(dev);
529                         if (ret) {
530                                 FSLMC_VFIO_LOG(DEBUG, "Unable to map Portal.");
531                                 return -1;
532                         }
533                         if (!found_mportal)
534                                 found_mportal = 1;
535
536                         TAILQ_REMOVE(&rte_fslmc_bus.device_list, dev, next);
537                         free(dev);
538                         dev = NULL;
539                         /* Ideally there is only a single dpmcp, but in case
540                          * multiple exists, looping on remaining devices.
541                          */
542                 }
543         }
544
545         /* Cannot continue if there is not even a single mportal */
546         if (!found_mportal) {
547                 FSLMC_VFIO_LOG(DEBUG,
548                                "No MC Portal device found. Not continuing.");
549                 return -1;
550         }
551
552         TAILQ_FOREACH_SAFE(dev, &rte_fslmc_bus.device_list, next, dev_temp) {
553                 if (!dev)
554                         break;
555
556                 switch (dev->dev_type) {
557                 case DPAA2_ETH:
558                 case DPAA2_CRYPTO:
559                         ret = fslmc_process_iodevices(dev);
560                         if (ret) {
561                                 FSLMC_VFIO_LOG(DEBUG,
562                                                "Dev (%s) init failed.",
563                                                dev->device.name);
564                                 return ret;
565                         }
566                         break;
567                 case DPAA2_CON:
568                 case DPAA2_IO:
569                 case DPAA2_CI:
570                 case DPAA2_BPOOL:
571                         /* Call the object creation routine and remove the
572                          * device entry from device list
573                          */
574                         ret = fslmc_process_iodevices(dev);
575                         if (ret) {
576                                 FSLMC_VFIO_LOG(DEBUG,
577                                                "Dev (%s) init failed.",
578                                                dev->device.name);
579                                 return -1;
580                         }
581
582                         /* This device is not required to be in the DPDK
583                          * exposed device list.
584                          */
585                         TAILQ_REMOVE(&rte_fslmc_bus.device_list, dev, next);
586                         free(dev);
587                         dev = NULL;
588                         break;
589                 case DPAA2_UNKNOWN:
590                 default:
591                         /* Unknown - ignore */
592                         FSLMC_VFIO_LOG(DEBUG, "Found unknown device (%s).",
593                                        dev->device.name);
594                         TAILQ_REMOVE(&rte_fslmc_bus.device_list, dev, next);
595                         free(dev);
596                         dev = NULL;
597                 }
598         }
599
600         return 0;
601 }
602
603 int
604 fslmc_vfio_setup_group(void)
605 {
606         int groupid;
607         int ret;
608         struct vfio_group_status status = { .argsz = sizeof(status) };
609
610         /* if already done once */
611         if (container_device_fd)
612                 return 0;
613
614         ret = fslmc_get_container_group(&groupid);
615         if (ret)
616                 return ret;
617
618         /* In case this group was already opened, continue without any
619          * processing.
620          */
621         if (vfio_group.groupid == groupid) {
622                 FSLMC_VFIO_LOG(ERR, "groupid already exists %d", groupid);
623                 return 0;
624         }
625
626         /* Get the actual group fd */
627         ret = vfio_get_group_fd(groupid);
628         if (ret < 0)
629                 return ret;
630         vfio_group.fd = ret;
631
632         /* Check group viability */
633         ret = ioctl(vfio_group.fd, VFIO_GROUP_GET_STATUS, &status);
634         if (ret) {
635                 FSLMC_VFIO_LOG(ERR, "VFIO error getting group status");
636                 close(vfio_group.fd);
637                 return ret;
638         }
639
640         if (!(status.flags & VFIO_GROUP_FLAGS_VIABLE)) {
641                 FSLMC_VFIO_LOG(ERR, "VFIO group not viable");
642                 close(vfio_group.fd);
643                 return -EPERM;
644         }
645         /* Since Group is VIABLE, Store the groupid */
646         vfio_group.groupid = groupid;
647
648         /* check if group does not have a container yet */
649         if (!(status.flags & VFIO_GROUP_FLAGS_CONTAINER_SET)) {
650                 /* Now connect this IOMMU group to given container */
651                 ret = vfio_connect_container();
652                 if (ret) {
653                         FSLMC_VFIO_LOG(ERR,
654                                 "Error connecting container with groupid %d",
655                                 groupid);
656                         close(vfio_group.fd);
657                         return ret;
658                 }
659         }
660
661         /* Get Device information */
662         ret = ioctl(vfio_group.fd, VFIO_GROUP_GET_DEVICE_FD, g_container);
663         if (ret < 0) {
664                 FSLMC_VFIO_LOG(ERR, "Error getting device %s fd from group %d",
665                                g_container, vfio_group.groupid);
666                 close(vfio_group.fd);
667                 return ret;
668         }
669         container_device_fd = ret;
670         FSLMC_VFIO_LOG(DEBUG, "VFIO Container FD is [0x%X]",
671                        container_device_fd);
672
673         return 0;
674 }