There is no need for ioport access for applications that won't use virtio pmds.
Make rte_eal_iopl_init() non-static so that it is called from pmds that need it.
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
From man(4) io:
"The initial implementation simply raised the IOPL of the current thread
when open(2) was called on the device. This behaviour is retained in the
current implementation as legacy support for both i386 and amd64."
http://www.freebsd.org/cgi/man.cgi?query=io&sektion=4
Nothing prevents from closing it just after.
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
KNI applies only to linux, so there should be no need for any kni files to
be present in the bsdapp eal folder.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Identify all options through the getopt_long return value.
This way, we only need a big switch/case.
Indentation is broken to ease commit review (fixed in next commit).
Suggested-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
All common options are now in a single file.
Common usage() has been moved as well.
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
We can handle both short and long options for those in the same case.
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Following commit cac6d08c8b and 4bf3fe634a
(replace --use-device option by --pci-whitelist and --vdev),
this option is not available anymore.
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Add a --log-level option to set the default eal log level.
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Clean both linux and bsd implementations from unused macros.
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
No need for that 'x bit' on source files.
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Remove useless include that broke compilation and
allow to use it with nic_uio in FreeBSD.
Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
The FreeBSD nic_uio driver was missing the #defines to include the device ids
for devices using the i40e driver. This change adds in the missing defines.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
When adding link bonding to EAL initialization (a155d43011),
an include was missing for BSD.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Tested-by: Zhaochen Zhan <zhaochen.zhan@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Updating functionality in EAL to support adding link bonding
devices via –vdev option. Link bonding devices will be
initialized after all physical devices have been probed and
initialized.
Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
The function rte_snprintf serves no useful purpose. It is the
same as snprintf() for all valid inputs. Deprecate it and
replace all uses in current code.
Leave the tests for the deprecated function in place.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Rename the RTE_PCI_DRV_NEED_IGB_UIO to be more generic.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Currently, EAL does not distinguish between actual failures and expected
initialization errors. E.g. sometimes the driver fails to initialize
because it was not supposed to be initialized in the first place, such
as device not being managed by said driver.
This patch makes EAL fail on actual initialization errors while still
skipping over expected initialization errors.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Waterman Cao <waterman.cao@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
This commit removes trailing whitespace from lines in files. Almost all
files are affected, as the BSD license copyright header had trailing
whitespace on 4 lines in it [hence the number of files reporting 8 lines
changed in the diffstat].
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
[Thomas: remove spaces before tabs in libs]
[Thomas: remove more trailing spaces in non-C files]
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Add __rte_unused to
pci_unbind_kernel_driver(struct rte_pci_device *dev)
Signed-off-by: Alan Carew <alan.carew@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Currently, physical device pmds use a separate initalization path
(rte_pmd_init_all) while virtual devices use a constructor registration and
rte_eal_dev_init. Theres no reason to have them be separate. This patch
removes the vdev specific nomenclature from the vdev init path and makes it more
generic for use with all pmds. This is the first step in converting the
physical device pmds to using the same constructor based registration path that
the virtual devices use.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
It makes no sense to inline string functions, in fact snprintf
can't be inlined because the function supports variable number of
arguments.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
[Thomas: update includes]
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
A fd leak happens in pci_map_resource when multiple bars are mapped.
Fix this by closing fd unconditionnally in this function and open the
intr_handle fd in pci_uio_map_resource instead.
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
virtio-uio does not need eal to map bars from uio device, so remove flag
RTE_PCI_DRV_NEED_IGB_UIO.
Then, move virtio-uio workaround out of generic eal_pci.c for linux
implementation.
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
bsd implementation lacks check on driver flags, fix this.
Besides, check on BAR0 is not needed and could cause trouble for devices that
have no BAR0.
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Print the maximum lcore(s) as configured, and the number of lcore(s) detected
on eal cpu init as debug info besides the not separate detected/not-detected
lcore info.
Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
[Thomas: add BSD part]
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Increasing maximum number of lcores gives a huge place to undetected
lcores in output traces. Moreover, this output does not give any
interesting information, since list of undetected lcores can be deduced
from list of detected ones.
So remove output related to undetected cores.
Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
There is no need for a 'magic' field in struct rte_config, as this part of the
structure is local to each process. All threads of a process are synchronised
because of the run_once atomic.
So remove this field, as it is only adding confusion when reading code that
references 'magic' field from struct rte_mem_config.
Besides, there is no reference about the 'version' field, so remove it as well.
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
A line was forgotten when removing blacklist option in commit
"use devargs for vdev and PCI lists with bsd" (cd25fb0863).
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Compiling the DPDK under FreeBSD gives the following error due to a
missing include <sys/rwlock.h>.
In file included from nic_uio.c:52:
@/vm/vm_pager.h:126:2: error: implicit declaration of function 'rw_assert' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
VM_OBJECT_ASSERT_WLOCKED(object);
^
@/vm/vm_object.h:226:2: note: expanded from macro 'VM_OBJECT_ASSERT_WLOCKED'
rw_assert(&(object)->lock, RA_WLOCKED)
^
In file included from nic_uio.c:52:
@/vm/vm_pager.h:126:2: error: use of undeclared identifier 'RA_WLOCKED'
@/vm/vm_object.h:226:29: note: expanded from macro 'VM_OBJECT_ASSERT_WLOCKED'
rw_assert(&(object)->lock, RA_WLOCKED)
^
In file included from nic_uio.c:52:
@/vm/vm_pager.h:143:2: error: use of undeclared identifier 'RA_WLOCKED'
VM_OBJECT_ASSERT_WLOCKED(object);
^
@/vm/vm_object.h:226:29: note: expanded from macro 'VM_OBJECT_ASSERT_WLOCKED'
rw_assert(&(object)->lock, RA_WLOCKED)
^
In file included from nic_uio.c:52:
@/vm/vm_pager.h:167:2: error: use of undeclared identifier 'RA_WLOCKED'
VM_OBJECT_ASSERT_WLOCKED(object);
^
@/vm/vm_object.h:226:29: note: expanded from macro 'VM_OBJECT_ASSERT_WLOCKED'
rw_assert(&(object)->lock, RA_WLOCKED)
^
In file included from nic_uio.c:52:
@/vm/vm_pager.h:190:2: error: use of undeclared identifier 'RA_WLOCKED'
VM_OBJECT_ASSERT_WLOCKED(m->object);
^
@/vm/vm_object.h:226:29: note: expanded from macro 'VM_OBJECT_ASSERT_WLOCKED'
rw_assert(&(object)->lock, RA_WLOCKED)
^
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
The bsdapp part was missing in commit 8e245de6ca.
Add the ability to pass some specific initialization arguments to PCI
devices at start-up.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
The bsdapp part was missing in commit cac6d08c8b.
This commit splits the "--use-device" option in two new options:
- "--pci-whitelist or -w": add a PCI device in the white list
- "--vdev": instanciate a new virtual device
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
The bsdapp part was missing in commit a8b97e3a1d.
This commit changes the API of --use-device command line argument.
It changes the separators from ';' to ','.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
The bsdapp part was missing in commit 1220458951.
This patch removes old whitelist code and use the newly introduced
rte_devargs to get the PCI white list, the PCI black list and the list
of virtual devices.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
The bsd part was missing in commit bf6dea0e04.
This commit introduces a new API for storing device arguments given by
the user. It only adds the framework and the test.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
The bsdapp part was missing in commit 5b1f4a67dd.
To avoid confusion with virtual devices, rename device_list as
pci_device_list and driver_list as pci_driver_list.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
The bsdapp part was missing in commit 57c24af85d.
This commit adds a dummy rte_mem_virt2phy() to fix the compilation of
DPDK under BSD. This function is only used when the debug option
"--no-huge" is given, to get the physical address of mempools in memory.
As a result, it seems acceptable for now to implement a dummy function
to fix the compilation as the usual case (using contigmem module) works
properly.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
The bsdapp part was missing in c5e9eeca5a.
This commit allows external libraries and applications to know if
hugepages are enabled.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
The name "nonpci_devs" for virtual devices is ambiguous as a physical
device can also be non-PCI (ex: usb, sata, ...). A better name for this
file is "vdev" as it only deals with virtual devices.
This patch doesn't introduce any change except renaming.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Changes to allow compilation and use on FreeBSD. Includes:
* contigmem and nic_uio driver for FreeBSD
* new EAL instance
* new "bsdapp" compilation target
* various compilation fixes due to differences between linux and freebsd
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>