[dpdk-dev] [PATCH v2 09/11] eal/pci: replace SYSFS_PCI_DEVICES with pci_get_sysfs_path()
Jan Viktorin
viktorin at rehivetech.com
Thu May 12 17:46:36 CEST 2016
On Thu, 12 May 2016 17:41:22 +0200
Thomas Monjalon <thomas.monjalon at 6wind.com> wrote:
> 2016-05-10 20:13, Jan Viktorin:
> > The SYSFS_PCI_DEVICES is a constant that makes the PCI testing difficult as
> > it points to an absolute path. We remove using this constant and introducing
> > a function pci_get_sysfs_path that gives the same value. However, the user can
> > pass a SYSFS_PCI_DEVICES env variable to override the path. It is now possible
> > to create a fake sysfs hierarchy for testing.
>
> Yeah!
:)
>
> > + orig = pci_get_sysfs_path();
> > + ret = setenv("SYSFS_PCI_DEVICES", "My Documents", 1);
>
> Oh no!
Not sure about your reaction...
>
> > + TEST_ASSERT_SUCCESS(ret, "Failed setenv to My Documents");
> > +
> > + path = pci_get_sysfs_path();
> > + TEST_ASSERT(strcmp(orig, path),
> > + "orig must be different from path: "
>
> I missed something here. Why different?
Because I've set it to "My Documents" and want to be sure that the
pci_get_sysfs_path() returns the new path instead of the default
one.
Perhaps, !strcmp(path, "My Documents") would be better here...
>
> > +DPDK_16.07 {
> > + global:
> > +
> > + pci_get_sysfs_path;
> > +} DPDK_16.04;
>
> I don't know why but we are used to put a blank line after the last symbol.
Will fix.
>
--
Jan Viktorin E-mail: Viktorin at RehiveTech.com
System Architect Web: www.RehiveTech.com
RehiveTech
Brno, Czech Republic
More information about the dev
mailing list