summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2016-07-22version: 16.07-rc4v16.07-rc4Thomas Monjalon
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-07-22unify tools namingThomas Monjalon
The following tools may be installed system-wide. It may be cleaner and more convenient to find them with the same dpdk- prefix (especially for autocompletion). Moreover, the script dpdk_nic_bind.py deserves a new name because it is not restricted to NICs and can be used for e.g. crypto. These files are renamed: pmdinfogen -> dpdk-pmdinfogen pmdinfo.py -> dpdk-pmdinfo.py dpdk_pdump -> dpdk-pdump dpdk_proc_info -> dpdk-procinfo dpdk_nic_bind.py -> dpdk-devbind.py setup.sh -> dpdk-setup.sh The tools pmdinfogen, pmdinfo.py and dpdk_pdump are new in 16.07. The scripts dpdk_nic_bind.py and setup.sh may have been used with previous releases by end users. That's why a symbolic link still provide the old name in the installed tools directory. Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-07-22eal: add tailq safe iterator macroPablo de Lara
Removing/freeing elements elements within a TAILQ_FOREACH loop is not safe. FreeBSD defines TAILQ_FOREACH_SAFE macro, which permits these operations safely. This patch defines this macro for Linux systems, where it is not defined. Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-07-22mem: fix check of physical address retrievalMichal Jastrzebski
In rte_mem_virt2phy: Value returned from a function and indicating the number of bytes was ignored. This could cause a wrong pfn (page frame number) mask read from pagemap file. When read returns less than the number of sizeof(uint64_t) bytes, function rte_mem_virt2phy returns error. Coverity issue: 13212 Fixes: 40b966a211ab ("ivshmem: library changes for mmaping using ivshmem") Signed-off-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
2016-07-22cryptodev: fix memory leak in parameter parsingPablo de Lara
When parsing the parameters for virtual device initialization, rte_kvargs structure was being freed only if there was an error, not when parsing was successful. Coverity issue: 124568 Fixes: f3e764fa2fb7 ("cryptodev: uninline parameter parsing") Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com>
2016-07-22vhost: fix unregistering in client modeIlya Maximets
Currently while calling of 'rte_vhost_driver_unregister()' connection to QEMU will not be closed. This leads to inability to register driver again and reconnect to same virtual machine. This scenario is reproducible with OVS. While executing of the following command vhost port will be re-created (will be executed 'rte_vhost_driver_register()' followed by 'rte_vhost_driver_unregister()') network will be broken and QEMU possibly will crash: ovs-vsctl set Interface vhost1 ofport_request=15 Fix this by closing all established connections on driver unregister and removing of pending connections from reconnection list. Fixes: 64ab701c3d1e ("vhost: add vhost-user client mode") Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-07-22vhost: fix connect hang in client modeIlya Maximets
If something abnormal happened to QEMU, 'connect()' can block calling thread (e.g. main thread of OVS) forever or for a really long time. This can break whole application or block the reconnection thread. Example with OVS: ovs_rcu(urcu2)|WARN|blocked 512000 ms waiting for main to quiesce (gdb) bt #0 connect () from /lib64/libpthread.so.0 #1 vhost_user_create_client (vsocket=0xa816e0) #2 rte_vhost_driver_register #3 netdev_dpdk_vhost_user_construct #4 netdev_open (name=0xa664b0 "vhost1") [...] #11 main Fix that by setting non-blocking mode for client sockets for connection. Fixes: 64ab701c3d1e ("vhost: add vhost-user client mode") Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-07-22ethdev: fix overwriting driver-specific statsRemy Horton
After doing a driver callout to fill in the driver specific parts of struct rte_eth_stats, rte_eth_stats_get() overwrites the rx_nombuf member regardless of whether the driver itself has assigned a value. Any driver-assigned value should take priority. Fixes: af75078fece3 ("first public release") Signed-off-by: Remy Horton <remy.horton@intel.com>
2016-07-21ring: guarantee dequeue ordering before tail updateJuhamatti Kuusisaari
Consumer queue dequeuing must be guaranteed to be done fully before the tail is updated. This is not guaranteed with a read barrier, changed to a write barrier just before tail update which in practice guarantees correct order of reads and writes. Signed-off-by: Juhamatti Kuusisaari <juhamatti.kuusisaari@coriant.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-07-21mempool: fix missing registration of free functionZoltan Kiss
The new mempool handler interface forgets to register the free() function of the ops. Introduced in this patch: Fixes: 449c49b93a6b ("mempool: support handler operations") Signed-off-by: Zoltan Kiss <zoltan.kiss@schaman.hu> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2016-07-21mempool: adjust name size in related data typesZoltan Kiss
A recent patch brought up an issue about the size of the 'name' fields: 85cf0079 mem: avoid memzone/mempool/ring name truncation These relations should be observed: 1. Each ring creates a memzone with a prefixed name: RTE_RING_NAMESIZE <= RTE_MEMZONE_NAMESIZE - strlen(RTE_RING_MZ_PREFIX) 2. There are some mempool handlers which create a ring with a prefixed name: RTE_MEMPOOL_NAMESIZE <= RTE_RING_NAMESIZE - strlen(RTE_MEMPOOL_MZ_PREFIX) 3. A mempool can create up to RTE_MAX_MEMZONE pre and postfixed memzones: sprintf(postfix, "_%d", RTE_MAX_MEMZONE) RTE_MEMPOOL_NAMESIZE <= RTE_MEMZONE_NAMESIZE - strlen(RTE_MEMPOOL_MZ_PREFIX) - strlen(postfix) Setting all of them to 32 hides this restriction from the application. This patch decreases the mempool and ring string size to accommodate for these prefixes, but it doesn't apply the 3rd constraint. Applications relying on these constants need to be recompiled, otherwise they'll run into ENAMETOOLONG issues. The size of the arrays are kept 32 for ABI compatibility, it can be decreased next time the ABI changes. Signed-off-by: Zoltan Kiss <zoltan.kiss@schaman.hu> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2016-07-21mem: allow full length nameZoltan Kiss
(strlen(name) == sizeof(mz->name) - 1) is a valid case, change the condition to reflect that. Move it earlier to avoid lookup with invalid name. Change errno to ENAMETOOLONG. Fixes: 85cf0079 ("mem: avoid memzone/mempool/ring name truncation") Signed-off-by: Zoltan Kiss <zoltan.kiss@schaman.hu> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2016-07-21eal/ppc: fix memory barrier for IBM POWERChao Zhu
On weak memory order architecture like POWER, rte_smp_wmb/rte_smp_rmb need to use CPU instructions, not compiler barrier. This patch fixes this. Also, to improve performance on PPC64, use light weight sync instruction instead of sync instruction. Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
2016-07-16version: 16.07-rc3v16.07-rc3Thomas Monjalon
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-07-16pdump: fix error handlingsReshma Pattan
The changes include 1)If mkdir fails for user passed socket paths log error and return. 2)At some places return value was set to errno and that non-negative number was returned, but the intention was to return negative value. So now rte_errno was set to errno and returning the actual negative value that the APIs has returned. Fixes: 278f945402c5 ("pdump: add new library for packet capture") Signed-off-by: Reshma Pattan <reshma.pattan@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-07-16ip_frag: fix doxygen formattingHiroyuki Mikita
This commit fixes some functions missing in API documentation. Signed-off-by: Hiroyuki Mikita <h.mikita89@gmail.com>
2016-07-15vhost: fix crash when exceeding file descriptorsPatrik Andersson
Protect against DPDK crash when allocation of listen fd >= 1023. For events on fd:s >1023, the current implementation will trigger an abort due to access outside of allocated bit mask. Corrections would include: * Match fdset_add() signature in fd_man.c to fd_man.h * Handling of return codes from fdset_add() * Addition of check of fd number in fdset_add_fd() The rationale behind the suggested code change is that, fdset_event_dispatch() could attempt access outside of the FD_SET bitmask if there is an event on a file descriptor that in turn looks up a virtio file descriptor with a value > 1023. Such an attempt will lead to an abort() and a restart of any vswitch using DPDK. A discussion topic exist in the ovs-discuss mailing list that can provide a little more background: http://openvswitch.org/pipermail/discuss/2016-February/020243.html Fixes: 8f972312 ("vhost: support vhost-user") Signed-off-by: Patrik Andersson <patrik.r.andersson@ericsson.com> Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com> Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-07-15vhost: check ring descriptor addressIlya Maximets
In current implementation vhost will crash with segmentation fault if malicious or buggy virtio application breaks addresses of descriptors. Before commit 0823c1cb0a73 ("vhost: workaround stale vring base") this crash was reproducible even with normal DPDK application that tries to change number of virtqueues dynamically inside VM. Fix that by checking addresses of descriptors before using. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-07-15vhost: fix used descriptors number of mergeable enqueueIlya Maximets
Return value on error changed from '-1' to '0' because it returns unsigned value and it means number of used descriptors. Also fixed updating of 'last_used_idx' by using actual number of used descriptors. Fixes: 623bc47054d0 ("vhost: do sanity check for ring descriptor length") Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-07-15vfio: fix coding styleYong Wang
Signed-off-by: Yong Wang <yongwang@vmware.com>
2016-07-15vfio: fix PCI resource mappingYong Wang
The offset of the 2nd mmap() when mapping the region after msix_bar needs to take region address into consideration as mmap() takes address that is resource-relative instead of bar-relative. This is exposed when binding vmxnet3 to vfio-pci. Fixes: 90a1633b2347 ("eal/linux: allow to map BARs with MSI-X tables") Signed-off-by: Yong Wang <yongwang@vmware.com> Signed-off-by: Ronghua Zhang <rzhang@vmware.com> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2016-07-15mempool: fix empty structure definitionAdrien Mazarguil
This commit addresses the following warning reported by clang, which happens by default, as long as CONFIG_RTE_LIBRTE_MEMPOOL_DEBUG is disabled: warning: empty struct has size 0 in C, size 1 in C++ C and C++ must use the same size for objects to avoid corruption during run time. Fixes: 97e7e685bfcd ("mempool: add structure for object trailers") Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2016-07-15spinlock: move constructor out of x86 header fileDamjan Marion
Having constructor function in the header file is generally a bad idea, as it will eventually be implanted to 3rd party library. In this case it causes linking issues with 3rd party libraries when an application is not linked to dpdk, due to missing symbol called by constructor. Fixes: ba7468997ea6 ("spinlock: add HTM lock elision for x86") Signed-off-by: Damjan Marion <damarion@cisco.com> Reviewed-by: Jan Viktorin <viktorin@rehivetech.com> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-07-11version: 16.07-rc2v16.07-rc2Thomas Monjalon
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-07-11mempool: fix creation with Xen dom0Olivier Matz
Restore the use of 2M hugepages when using Xen Dom0 that was dropped during mempool rework. Fixes: c042ba20674a ("mempool: rework support of Xen dom0") Reported-by: Huilong Xu <huilongx.xu@intel.com> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2016-07-11mbuf: set errno on pool creation errorOlivier Matz
In rte_pktmbuf_pool_create(), the rte_errno variable was not always set on failure. Fixes: 152ca517900b ("mbuf: use default mempool handler from config") Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2016-07-11xen: fix retrieval of physical addressOlivier Matz
When using Xen Dom0, it looks that /proc/self/pagemap returns 0. This breaks the creation of mbufs pool. We can workaround this in rte_mem_virt2phy() by browsing the dpdk memory segments. This only works for dpdk memory, but it's enough to fix the mempool creation. Fixes: c042ba20674a ("mempool: rework support of Xen dom0") Fixes: 3097de6e6bfb ("mem: get physical address of any pointer") Reported-by: Huilong Xu <huilongx.xu@intel.com> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2016-07-11xen: fix build as shared libraryThomas Monjalon
When building as shared library, the compiler complains for undefined reference to `rte_xen_mem_phy2mch' The symbol rte_xen_mem_phy2mch was introduced in DPDK 2.2 and has been called in mempool recently via rte_mem_phy2mch. Fixes: c042ba20674a ("mempool: rework support of Xen dom0") Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-07-11xen: fix buildOlivier Matz
Fix the compilation with CONFIG_RTE_LIBRTE_XEN_DOM0=y, by correcting the typo in variable names. Fixes: 8dab48370129 ("xen: return machine address without knowing memseg id") Reported-by: Huilong Xu <huilongx.xu@intel.com> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2016-07-11net/bnxt: move PCI device ids to the driverDavid Marchand
Moved defines since the driver had no such information. Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff. Signed-off-by: David Marchand <david.marchand@6wind.com>
2016-07-11net/bnx2x: move PCI device ids to the driverDavid Marchand
Reused defines from the driver and moved broadcom vendor id macro. Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff. Signed-off-by: David Marchand <david.marchand@6wind.com>
2016-07-11net/enic: move PCI device ids to the driverDavid Marchand
Moved cisco vendor id since the driver had no such information. Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff. Signed-off-by: David Marchand <david.marchand@6wind.com>
2016-07-11net/vmxnet3: move PCI device ids to the driverDavid Marchand
Moved vmware device ids macro since the driver had no such information. Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff. Signed-off-by: David Marchand <david.marchand@6wind.com>
2016-07-11net/virtio: move PCI device ids to the driverDavid Marchand
Reused defines from the driver. Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff. Signed-off-by: David Marchand <david.marchand@6wind.com> Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-07-11net/fm10k: move PCI device ids to the driverDavid Marchand
Reused defines from the driver. Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff. Signed-off-by: David Marchand <david.marchand@6wind.com>
2016-07-11net/i40e: move PCI device ids to the driverDavid Marchand
Reused defines from the driver. Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff. Signed-off-by: David Marchand <david.marchand@6wind.com>
2016-07-11net/e1000: move em PCI device ids to the driverDavid Marchand
Reused defines from the driver and added a Intel vendor id macro for use by igb later. Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff. igb/igbvf is left as is, waiting for kni/ethtool cleanup. Signed-off-by: David Marchand <david.marchand@6wind.com>
2016-07-11eal: remove PCI device ids header from doxygenDavid Marchand
This file is going to disappear, remove the doxygen parts that reference various drivers and remove it from the doxygen index. Signed-off-by: David Marchand <david.marchand@6wind.com>
2016-07-11examples/vm_power_manager: remove dependency on internal headerMarvin Liu
Macro CHANNEL_CMDS_MAX_CPUS stand for the maximum number of cores controlled by virtual channels. This macro only be used in the example, so remove it from library to example header file. Signed-off-by: Marvin Liu <yong.liu@intel.com>
2016-07-11vfio: rework initialization to be extendableJan Viktorin
We can now just OR the vfio_enabled sequentially and so adding new VFIO subsystems (vfio_platform) is possible. Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
2016-07-11vfio: initialize out of the PCI subsystemJan Viktorin
The VFIO does not depend on the PCI anymore so it can be initialized out of the PCI subsystem. Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
2016-07-11vfio: generalize process synchronizationJan Viktorin
The module eal_pci_vfio_mp_sync is quite generic so it shouldn't contain the "pci" string in its name. The internal functions don't need the pci_* prefix. Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
2016-07-11vfio: make mode types privateJan Viktorin
There is no more reason to expose those definitions as nobody uses them. Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
2016-07-11vfio: fix typo in doc for device setupJan Viktorin
Suggested-by: Anatoly Burakov <anatoly.burakov@intel.com> Signed-off-by: Jan Viktorin <viktorin@rehivetech.com> Acked-by: John McNamara <john.mcnamara@intel.com>
2016-07-11vfio: move global config out of PCI filesJan Viktorin
The vfio_cfg is a module-global variable and so together with this variable, it is necessary to move functions: * pci_vfio_get_group_fd - renamed to vfio_get_group_fd - pci_* version removed (no other call in EAL) * pci_vfio_setup_device - renamed as vfio_setup_device * pci_vfio_enable - renamed as vfio_enable - generalized to check for a specific vfio driver presence - pci_* specialization preserved as a wrapper * pci_vfio_is_enabled - renamed as vfio_is_enabled - generalized to check for a specific vfio driver presence to preserve the semantics of VFIO + PCI - pci_* specialization preserved as a wrapper * clear_current_group - private function, just moved To stop GCC complaining about "defined but not used", the private function pci_vfio_get_group_no has been removed entirely. Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
2016-07-11vfio: extract setup logic out of resource mappingJan Viktorin
The setup logic access the global vfio_cfg variable that will be moved in the following commits. We need to separate all accesses to this variable to a general code. Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
2016-07-11vfio: generalize non PCI-specific functionsJan Viktorin
The pci_vfio_set_iommu_type is not PCI-specific and it is a private function of the eal_pci_vfio.c. We just rename the function and make it available even for non-PCI devices. The pci_vfio_has_supported_extensions is not PCI-specific and it is a private function of the eal_pci_vfio.c. We just rename the function and make it available even for non-PCI devices. The pci_vfio_get_container_fd is not PCI-specific. Move the implementation to the eal_vfio.c as vfio_get_container_fd. No other code seems to call this function. Generalize the pci_vfio_get_group_no to not be PCI-specific. Move the general implementation to the eal_vfio.c as vfio_get_group_no and leave the original pci_vfio_get_group_no being a wrapper around this to preserve compilation issues. The pci_vfio_get_group_no function will be removed later. Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
2016-07-11vfio: move common code out of PCI fileJan Viktorin
We make the iommu_types public temporarily here until the depending stuff is refactored. The iommu_types and dma_map functions will be changed to be private inside the eal_vfio module later. Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
2016-07-11vfio: move definitions from PCI to VFIO headerJan Viktorin
The common VFIO definitions should be separated from the PCI-specific parts. Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
2016-07-11vfio: fix private include to be localJan Viktorin
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>