summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-01-02version: 1.5.1r2v1.5.1r2Thomas Monjalon
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-01-02mem: remove duplicated linesPei Chao
Extra space for future alignment was reserved twice. It was introduced in version 1.3.0 (commit 916e4f4f4e45a1d3cdd473cf9ef). Signed-off-by: Pei Chao <peichao85@gmail.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2013-12-20pci: support 82546EBThomas Monjalon
Intel 82546EB Gigabit ethernet controller is reported to be working with copper. Tested-by: Ognjen Joldzic <ognjen.joldzic@gmail.com> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2013-12-10pcap: fix mbuf allocationRichardson, Bruce
A static list of 64 mbufs was being reused in Rx function. This caused two errors: 1) If more than 64 buffers were requested in a single burst, only the last 64 buffers are returned, the others are lost. 2) Application will free the mbuf being returned, but the receive function will reuse the buffer anyway. If some other allocation is done, there is suddenly multiple writers for the same mbuf. It is fixed by allocating mbuf on demand. In the same time, some length errors are fixed. Reported-by: Mats Liljegren <mats.liljegren@enea.com> Reported-by: Robert Sanford <rsanford@prolexic.com> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2013-12-10pcap: fix build with empty LIBPCAP_CFLAGSRobert Sanford
In rte.sdkbuild.mk with CONFIG_RTE_LIBRTE_PMD_PCAP=y, we error-exit if LIBPCAP_CFLAGS is empty. On some distros (e.g., Centos 6.4), it is normal for "pcap-config --cflags" to output only a newline, because pcap header files reside in /usr/include/. Solution is to remove the line that checks whether LIBPCAP_CFLAGS is empty. Signed-off-by: Robert Sanford <rsanford@prolexic.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2013-12-10igb/ixgbe: fix build with ICCRichardson, Bruce
ICC requires an initializer be given for the static variables, so adding one in cases where one wasn't previously given. This problem was introduced in commit 49c9bc3245f4222b. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2013-11-24version: 1.5.1r1v1.5.1r1Thomas Monjalon
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2013-11-24version: add 4th digit and helper macrosThomas Monjalon
Applications can test versions, for compatibility, this way: #if RTE_VERSION >= RTE_VERSION_NUM(1,2,3,4) RTE_VERSION was already defined for use with rte_config. It is moved in rte_version.h and updated to current version number. Note that the first tag having this helper is 1.2.3r2. Releases r0 have not this patch. Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2013-11-24app/testpmd: fix configuration of pause framesZijie Pan
The entries for the configuration of the reception and of the transmission of pause frames are inverted in the mode conversion array. Signed-off-by: Zijie Pan <zijie.pan@6wind.com> Acked-by: Ivan Boule <ivan.boule@6wind.com>
2013-11-24app/testpmd: fix build without librte_cmdlineThomas Monjalon
Some features are not available if LIBRTE_CMDLINE is disabled: - interactive mode - ethernet address parsing Note: ethernet address parsing could be rewritten without cmdline dependency. Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2013-11-24app/test: fix build without librte_cmdlineThomas Monjalon
Some features are not available if LIBRTE_CMDLINE is disabled: - interactive commands - cmdline tests Remove also cmdline_parse includes which are not needed. Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2013-11-24kni: fix build with kernel < 3.3 with netdev_features_t backportAdrien Mazarguil
The netdev_features_t typedef appeared in Linux 3.3, but checking the kernel version isn't enough with some distributions (such as Debian Wheezy) that backported it into 3.2, causing a compilation failure due to redefinition. Since the presence of a typedef can't be tested at compile time, this commit adds type kni_netdev_features_t, which, depending on the kernel version, translates either to u32 or netdev_features_t. Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2013-11-24kni: fix build with 802.1p kernel supportThomas Monjalon
C90 compilers forbid mixed declaration and code. Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2013-11-24ixgbe: fix offloading bits when Rx bulk alloc is usedBryan Benson
This is a fix for the ixgbe hardware offload flags not being set when bulk alloc RX is used. The issue was caused by masking off the bits that store the hardware offload values in the status_error field to retrieve the done bit for the descriptor. Commit 7431041062b9fd0555bac7ca4abebc99e3379fa5 in DPDK-1.3.0 introduced bulk dequeue, which included the bug. Signed-off-by: Bryan Benson <bmbenson@amazon.com> Acked-by: Ivan Boule <ivan.boule@6wind.com>
2013-11-24ixgbe: query assignment of VF queuesQinglai Xiao
Physical Function assignes Tx/Rx queues to each Virtual Function according to different schemes[1]. By querying through mailbox, VF is able to get number of Tx/Rx queues assigned to it. Note that current Intel ixgbe driver ixgbe-3.18.7 does not fully support mailbox message IXGBE_VF_GET_QUEUES. The service routine for IXGBE_VF_GET_QUEUES must be fixed, otherwise PF always return 1 as Tx/Rx queue number. [1] See section 7.2.1.2.1, 7.1.2.2 and 7.10.2.7.2 of Intel 82599 10 Gbe Controller Datasheet. Signed-off-by: Qinglai Xiao <jigsaw@gmail.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2013-11-24ixgbe: add Tx->Rx loopback mode for 82599Qinglai Xiao
82599 has two loopback operation modes, Tx->Rx and Rx->Tx. For the time being only Tx->Rx is supported. The new field lpbk_mode added in struct rte_eth_conf defines loopback operation mode for certain ethernet controller. By default the value of lpbk_mode is 0, meaning loopback mode disabled. Since each ethernet controller has its own definition of loopback modes, API user has to check both datasheet and implementation of certain driver so as to understand what are valid values to be set, and what are the expected behaviors. Check IXGBE_LPBK_82599_XXX which are defined in ixgbe_ethdev.h for valid values of 82599 loopback mode. Signed-off-by: Qinglai Xiao <jigsaw@gmail.com> Acked-by: Ivan Boule <ivan.boule@6wind.com> Acked-by: Venky Venkatesan <venky.venkatesan@intel.com>
2013-11-24igb/ixgbe: fix index overflow when resetting big queuesThomas Monjalon
Rings are resetted with a loop because memset cannot be used without issuing a warning about volatile casting. The index of the loop was a 16-bit variable which is sufficient for ring entries number but not for the byte size of the whole ring. The overflow happens when rings are configured for 4096 entries (descriptor size is 16 bytes). The result is an endless loop. It is fixed by indexing ring entries and resetting all bytes of the entry with a simple assignment. The descriptor initializer is zeroed thanks to its static declaration. There already was a fix for ixgbe Tx only (commit bcf457f8c0d64a5cb094fd55836b324bddb930b6). It is reverted to use the same fix everywhere (Rx/Tx for igb/ixgbe). Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: Ivan Boule <ivan.boule@6wind.com>
2013-11-24igb/ixgbe: allow RSS with only one Rx queueMaxime Leroy
It should be possible to enable RSS with one Rx queue. RSS hash can be useful independently of the number of Rx queues. Applications can use RSS hash to identify different IP flows. Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com> Acked-by: Ivan Boule <ivan.boule@6wind.com>
2013-11-24igb/ixgbe: ETH_MQ_RX_NONE should disable RSSMaxime Leroy
As explained in rte_ethdev.h, ETH_MQ_RX_NONE allows to not choose RSS, DCB or VMDQ mode. But the igb/ixgbe code always silently select the RSS mode with ETH_MQ_RX_NONE. This patch fixes this incoherence between the API and the implementation. Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com> Acked-by: Ivan Boule <ivan.boule@6wind.com>
2013-11-24igb: restore workaround errata with wthresh on 82576Stephen Hemminger
The 82576 has known issues which require the write threshold to be set to 1. See: http://download.intel.com/design/network/specupdt/82576_SPECUPDATE.pdf If not then single packets will hang in transmit ring until more arrive. Simple tests like ping will fail. The workaround was in the wrong file (commit a30ebfbb8c3a). Move it in igb one to restore original patch (7e9e49feea). Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2013-11-24pcap: fix build when pcap_sendpacket is unavailableDavid Marchand
Before libpcap 1.0.0, pcap_sendpacket was not available on linux targets (unless backported). When using such a library, we won't be able to send packet on the wire, yet we can still dump packets into a pcap file. Signed-off-by: David Marchand <david.marchand@6wind.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2013-11-24pcap: fix build with old libpcapDavid Marchand
For backwards compatibility, pcap.h includes pcap/pcap.h. Hence, to be compatible with older pcap libraries, we must include pcap.h. Signed-off-by: David Marchand <david.marchand@6wind.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2013-11-24pcap: use pcap-config to guess compilation flagsDavid Marchand
Use pcap-config to populate CFLAGS and LDFLAGS. LIBPCAP_CFLAGS and LIBPCAP_LDFLAGS can be used to override this (useful when cross-compiling). Signed-off-by: David Marchand <david.marchand@6wind.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2013-11-24ethdev: fix non-reconfigurable pmd initThomas Monjalon
Some Poll-Mode Drivers (PMD) are not reconfigurable and, thus, do not implement (rx|tx)_queue_release functions. For these drivers, the functions rte_eth_dev_(rx|tx)_queue_config must return an ENOTSUP error only when reconfiguring, but not at initial configuration. Move the FUNC_PTR_OR_ERR_RET check into the case of reconfiguration. Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: Ivan Boule <ivan.boule@6wind.com>
2013-11-24ethdev: add pause frame counters for em/igb/ixgbeIvan Boule
Add into the `rte_eth_stats` data structure 4 (64-bit) counters of XOFF/XON pause frames received and sent on a given port. Update em, igb, and ixgbe drivers to return the value of the 4 XOFF/XON counters through the `rte_eth_stats_get` function exported by the DPDK API. Display the value of the 4 XOFF/XON counters in the `testpmd` application. Signed-off-by: Ivan Boule <ivan.boule@6wind.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2013-11-24ethdev: add support for device offload capabilitiesIvan Boule
1) Make device RX and TX offload capabilities to be returned in the rte_eth_dev_info data structure by the function rte_eth_dev_info_get The following initial set of RX offload capabilities are defined: - VLAN header stripping - IPv4 header checksum check - UDP checksum check - TCP checksum check - TCP large receive offload (LRO) The following initial set of TX offload capabilities are defined: - VLAN header insertion - IPv4 header checksum computation - UDP checksum computation - TCP checksum computation - SCTP checksum computation - TCP segmentation offload (Transmit Segmentation Offload) - UDP segmentation offload 2) Update the eth_dev_infos_get() function of the igb and ixgbe PMDs to return the offload capabilities which are supported by the device and that are effectively managed by the driver. Signed-off-by: Ivan Boule <ivan.boule@6wind.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2013-11-24pci: add flag to force unbind deviceDamien Millescamps
Some devices need to be unbound in order to be used via the PMD without kernel module. Signed-off-by: Damien Millescamps <damien.millescamps@6wind.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2013-11-24pci: use igb_uio mapping only when neededThomas Monjalon
Since DPDK 1.4, if RTE_EAL_UNBIND_PORTS is disabled, igb_uio mapping is done for all devices (commit eee16c964cd), breaking some non-Intel drivers. But pci_uio_map_resource() should only be called for Intel devices (using igb_uio kernel module). The flag RTE_PCI_DRV_NEED_IGB_UIO is set for all those devices, even when RTE_EAL_UNBIND_PORTS is disabled (fixes commit a22f5ce8fcc). Signed-off-by: David Marchand <david.marchand@6wind.com> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: Damien Millescamps <damien.millescamps@6wind.com>
2013-11-24pci: do not check BAR0 mappingDavid Marchand
Since DPDK 1.4, bars mapping is checked and prevent from initializing drivers which do not use igb_uio mapping (see commit eee16c964cd). There is no need to check for bars mapping, especially BAR0 is not required. If bars mapping failed, then pci_uio_map_resource will fail and we won't reach this check. So get rid of BAR0 check. Signed-off-by: David Marchand <david.marchand@6wind.com> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: Damien Millescamps <damien.millescamps@6wind.com>
2013-11-24mem: fix log for --no-hugeThomas Monjalon
In some cases, it is possible to not use hugepages. So a simple malloc is used to initialize DPDK memory. Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: Damien Millescamps <damien.millescamps@6wind.com>
2013-11-24mem: fix mempool for --no-hugeDamien Millescamps
In --no-huge mode, mempool provides objects with their associated header/trailer fitting in a standard page (usually 4KB). This means all non-UIO driver should work correctly in this mode, since UIO drivers allocate ring sizes that cannot fit in a page. Extend rte_mempool_virt2phy to obtain the correct physical address when elements of the pool are not on the same physically contiguous memory region. This is a first step for enhancement PR #29696. Reason for this patch is to be able to run on a kernel < 2.6.37 without the need to patch it, since all kernel below are either bugged or don't have huge page support at all (< 2.6.28). Signed-off-by: Damien Millescamps <damien.millescamps@6wind.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2013-11-24mem: get hugepages configDamien Millescamps
Allow external libraries and applications to know if hugepages are enabled. Signed-off-by: Damien Millescamps <damien.millescamps@6wind.com> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2013-11-24mem: get memzone from any CPU socket when hugepages are disabledAdrien Mazarguil
When huge pages are disabled, memory is allocated for a single, undefined CPU socket using malloc(), causing rte_memzone_reserve_aligned() to fail most of the time. This patch causes that memory to use SOCKET_ID_ANY instead of 0, and allow it to be used in place of any socket ID specified by user. Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> Acked-by: Damien Millescamps <damien.millescamps@6wind.com>
2013-11-24mem: fix rte_malloc(SOCKET_ID_ANY), try to allocate on other nodesOlivier Matz
Before this patch, rte_malloc(SOCKET_ID_ANY) was equivalent to rte_malloc(this_socket). If the user specifies SOCKET_ID_ANY, it means that memory can be allocated on any socket. So fix the behavior of rte_malloc() in order to do that. The current CPU socket is still the default, but if it fails, other sockets are tested. Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2013-11-24mem: remove unneeded logOlivier Matz
Remove an error log in memzone_reserve_aligned_thread_unsafe(). It is up to the caller to log the error, and this is already done in DPDK code (especially in network drivers). Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2013-11-24mem: get physical address of any rte_malloc bufferDidier Pallard
Get physical address of any rte_malloc allocated buffer using function rte_malloc_virt2phy(addr). The rte_memzone pointer is now stored in each allocated memory block header to allow simple computation of physical address of a block using the memzone it comes from. The function rte_malloc_virt2phy has a dependency on rte_memory.h: phys_addr_t must be defined. Signed-off-by: Didier Pallard <didier.pallard@6wind.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2013-11-24mem: more const qualifiers in malloc APIThomas Monjalon
Some functions don't modify their parameter which should be marked as const. Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2013-11-24mem: get physical address of any pointerDamien Millescamps
Extract rte_mem_virt2phy() from find_physaddr(). rte_mem_virt2phy() permits to obtain the physical address of any virtual address mapped to the current process calling this function. Note that this function is very slow and shouldn't be called after initialization to avoid a performance bottleneck. The memory must be locked with mlock(). The function rte_mem_lock_page() is a mlock() helper that lock the whole page. A better name would be rte_mem_virt2phys but rte_mem_virt2phy is more consistent with rte_mempool_virt2phy. Signed-off-by: Damien Millescamps <damien.millescamps@6wind.com> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2013-11-24timer: get TSC frequency from /proc/cpuinfoThomas Monjalon
TSC frequency was guessed by reading CLOCK_MONOTONIC_RAW or sleeping 1 sec. Now, read frequency from cpuinfo first. Keep other methods as fallbacks. Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: Ivan Boule <ivan.boule@6wind.com>
2013-11-24timer: check TSC reliabilityIvan Boule
Read flags from /proc/cpuinfo and warn if constant_tsc or nonstop_tsc is not found. Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: Ivan Boule <ivan.boule@6wind.com>
2013-11-24log: remove app path from syslog idThomas Monjalon
This reverts commit "log: get full path as syslog id" (494a02537f1) and restore the original patch from Stephen Hemminger (04210699eee). Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2013-11-24eal: remove unused macro for blacklistThomas Monjalon
This macro was used for blacklist parsing but is not used anymore since commit 5a55b9ac91face71e9d665eecc716201d28745b0. Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2013-11-24eal: fix recording of detected/enabled logical coresIvan Boule
1) In the EAL initialization phase, invoke the function rte_eal_cpu_init to detect the set of running cores (and enable them by default) before processing the [enabled] core mask option that is performed during the parsing of EAL arguments. 2) In the function rte_eal_cpu_init(): - to parse the set of all running logical cores on the machine, do not use the RTE_LCORE_FOREACH macro that considers the set of already detected cores... Instead, use a standard loop based on the RTE_MAX_LCORE constant. - explicitely set to ROLE_RTE the role of each detected logical core that is recorded in the EAL configuration, as all running cores are enabled by default. 3) In the function eal_parse_coremask(), update the "lcore_count" field of the EAL configuration with the effective number of logical cores that are set in the mask of enabled logical cores. Signed-off-by: Ivan Boule <ivan.boule@6wind.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2013-11-24eal: fix type of pointer arithmetic resultThomas Monjalon
Adding or subtracting a value to a pointer makes a new pointer of unknown type. So typeof() is replaced by (void*) in RTE_PTR_ADD() and RTE_PTR_SUB(). But RTE_PTR_ALIGN_* macros have in their explicit API to return a pointer of the same type. Since RTE_PTR_ALIGN_CEIL is based on RTE_PTR_ADD, a typeof() is added to keep the original behaviour. Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2013-11-24eal: add support for shared object driversDamien Millescamps
Add an option to specify libraries to be loaded before probing the PCI. For instance, testpmd -d librte_pmd_xxx.so can be used to enable xxx driver support on testpmd without any recompilation of testpmd. Plugins are loaded before creating threads because we want the threads to inherit any property that could be set while loading a plugin, such as iopl(). Signed-off-by: Damien Millescamps <damien.millescamps@6wind.com> Signed-off-by: Jean-Mickael Guerin <jean-mickael.guerin@6wind.com> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2013-11-24mk: fix command-line dependency check for quoted stringsAdrien Mazarguil
Before recompiling a file, rte.compile-pre.mk checks whether the command line is different from the previous one. This is done by storing for each object file the entire command line in a kind of dependency file with a .cmd extension (see obj2cmd). If that file exists, the line is retrieved first and compared against $(C_TO_O_STR). The object file gets recompiled if the file doesn't exist or if the line is different. The problem is that sometimes, files are recompiled for no apparent reason. The check doesn't work properly when a command line contains double-quoted strings such as -DFOO='"bar"' because the shell interprets and strips them. This is fixed by protecting C_TO_O_CMD with simple quotes, knowing that such quotes are already escaped in C_TO_O_STR. Moreover, because simple quotes are escaped in C_TO_O_STR, the retrieved command should be compared against C_TO_O instead. Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2013-11-24mk: fix EXTRA_LDFLAGS overrideJulien Courtat
The GCC prefix -Wl was ignored because the command line value has higher priority. It ended in impossibilty for GCC to pass parameters to LD. The prefixed value must override the command line one. Signed-off-by: Julien Courtat <julien.courtat@6wind.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2013-11-24mk: allow to build shared librariesDidier Pallard
Add mk/rte.shared.mk and mk/rte.extshared.mk in framework to allow shared libraries compilation through framework Signed-off-by: Didier Pallard <didier.pallard@6wind.com> Acked-by: Ivan Boule <ivan.boule@6wind.com>
2013-11-24mk: allow to specify DESTDIR in build ruleOlivier Matz
This will install the binary sdk (bin + modules + libs + headers + mk) in the specified directory. This directory can be used as RTE_SDK by external applications. Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2013-11-24mk: in install rule, don't overwrite .config if it already existsOlivier Matz
This allows the user to prepare a configuration with make config before using make install. Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>