[dpdk-dev] [PATCH v2] VFIO: Avoid to enable vfio while the module not loaded

2014-12-09 Thread Burakov, Anatoly
Hi Michael, > > Yes, you are right, strncmp() will check 30 bytes if use sizeof(buffer). > > But any issue of strcmp() ? This rountin cares about exactly match. I think no > need to convert to strncmp() if it does have other issue. > > > fscanf with fgets would be better too, to make sure we ne

[dpdk-dev] [PATCH v2] VFIO: Avoid to enable vfio while the module not loaded

2014-12-09 Thread Qiu, Michael
On 12/9/2014 2:47 AM, Burakov, Anatoly wrote: > Hi Michael > >> I don't think so, if we check module "vfio", but if given module name is >> "vfio_xx", it will also correct if use strncmp. > Sorry I missed this the last time. I don't think that is the case. If you do > strncmp on sizeof(buffer), s

[dpdk-dev] [PATCH v2] VFIO: Avoid to enable vfio while the module not loaded

2014-12-08 Thread Burakov, Anatoly
Hi Michael > I don't think so, if we check module "vfio", but if given module name is > "vfio_xx", it will also correct if use strncmp. Sorry I missed this the last time. I don't think that is the case. If you do strncmp on sizeof(buffer), strncmp will always check 30 bytes. That way if you ch

[dpdk-dev] [PATCH v2] VFIO: Avoid to enable vfio while the module not loaded

2014-12-08 Thread Qiu, Michael
On 12/5/2014 6:00 PM, Burakov, Anatoly wrote: > Hi Michael, > > Few nitpicks :-) (wording of the log message I guess is up to Thomas, I won't > comment on that) > >> lib/librte_eal/common/eal_private.h| 36 >> ++ >> lib/librte_eal/linuxapp/eal/eal_pci_vfio.c |

[dpdk-dev] [PATCH v2] VFIO: Avoid to enable vfio while the module not loaded

2014-12-05 Thread Burakov, Anatoly
Hi Michael, Few nitpicks :-) (wording of the log message I guess is up to Thomas, I won't comment on that) > lib/librte_eal/common/eal_private.h| 36 > ++ > lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 24 +--- > 2 files changed, 57 insertions

[dpdk-dev] [PATCH v2] VFIO: Avoid to enable vfio while the module not loaded

2014-12-04 Thread Michael Qiu
When vfio module is not loaded when kernel support vfio feature, the routine still try to open the container to get file description. This action is not safe, and of cause got error messages: EAL: Detected 40 lcore(s) EAL: unsupported IOMMU type! EAL: VFIO support could not be initialized EAL: