Tetsuya Mukawa [Thu, 16 Jun 2016 02:33:10 +0000 (11:33 +0900)]
pci: fix resource release when unmapping
This patch fixes wrong resource release of pci_uio_unmap().
The 'path' member of mapped_pci_resource structure is allocated by
primary process, but currently it will be freed by both primary
and secondary process.
The patch fixes to be freed by only primary process.
Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp> Acked-by: David Marchand <david.marchand@6wind.com>
Tetsuya Mukawa [Thu, 16 Jun 2016 02:33:11 +0000 (11:33 +0900)]
pci: fix resource leak when secondary process mapping fails
This patch fixes resource leak of pci_uio_map_secondary().
If pci_map_resource() succeeds but mapped address is different from an
address primary process mapped, this should be error.
Then the addresses secondary process mapped should be freed.
Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp> Acked-by: David Marchand <david.marchand@6wind.com>
Thomas Monjalon [Sun, 19 Jun 2016 21:03:52 +0000 (23:03 +0200)]
eal/linux: fix build with glibc < 2.12
The function rte_thread_setname needs glibc 2.12,
otherwise it returns -1 without using any parameter.
The macro RTE_SET_USED avoids an "unused parameter" warning.
Fixes: 3901ed99c2f8 ("eal: fix thread naming on FreeBSD") Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Thomas Monjalon [Fri, 17 Jun 2016 12:48:16 +0000 (14:48 +0200)]
eal: fix thread naming on FreeBSD
rte_thread_setname was a macro defined only for Linux.
The function rte_thread_setname() can now be used on FreeBSD
as well on Linux.
It is required to build librte_pdump.
The macro was 0 for old glibc. The function is now returning -1.
The related logs are decreased from error to debug level because
it is not an important failure, just a debug inconvenience.
Fixes: 278f945402c5 ("pdump: add new library for packet capture") Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: David Marchand <david.marchand@6wind.com>
Jan Viktorin [Fri, 17 Jun 2016 12:52:47 +0000 (14:52 +0200)]
app/test: fix resource creation with objcopy on FreeBSD
Using of the /dev/stdin generates a warning when compiling on FreeBSD:
objcopy: Warning: '/dev/stdin' is not an ordinary file
app/test/Makefile:78: recipe for target 'test_resource_c.res.o' failed
# ls -l /dev/stdin
lrwxr-xr-x 1 root wheel 4 Jun 17 12:24 /dev/stdin -> fd/0
Replace /dev/stdin by a temporary file.
Reported-by: Thomas Monjalon <thomas.monjalon@6wind.com> Signed-off-by: Jan Viktorin <viktorin@rehivetech.com> Tested-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Thomas Monjalon [Thu, 16 Jun 2016 21:56:37 +0000 (23:56 +0200)]
mk: mute build of test resources
The objcopy and tar commands were printed even in quiet mode.
They are now replaced by a simple line and still visible in verbose mode.
Fixes: ab64f5df8004 ("app/test: support resources externally linked") Fixes: 66819e6c11d8 ("app/test: support resources archived by tar") Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reshma Pattan [Wed, 15 Jun 2016 14:06:23 +0000 (15:06 +0100)]
app/pdump: add tool for packet capturing
The new pdump tool is added for packet capturing on dpdk.
This tool runs as secondary process by default.
Tool facilitates the command line options like
port, device_id, queue which user should pass on
to the tool to request the packet capture on those devices.
Tool creates the rte ring, mempool and pcap vdev and
calls the enable API of the pdump library with port/device_id,
queue, ring and mempool as arguments to enable the packet
capture on specific devices and gets the packets from the
primary process over the ring. Once the packets are
received, those packets will be send to the pcap vdev.
Tool can be terminated by using ctrl+c(SIGINT) upon which tool
calls the disable API of the pdump library to disable the packet capture
and dequeues the rest of the packets from the ring and sends them on
to the pcap vdev, then after releases all allocated resources.
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Reshma Pattan [Wed, 15 Jun 2016 14:06:22 +0000 (15:06 +0100)]
pdump: add new library for packet capture
The librte_pdump library provides a framework for
packet capturing in dpdk. The library provides set of
APIs to initialize the packet capture framework, to
enable or disable the packet capture, and to uninitialize
it.
The librte_pdump library works on a client/server model.
The server is responsible for enabling or disabling the
packet capture and the clients are responsible
for requesting the enabling or disabling of the packet
capture.
Enabling APIs are supported with port, queue, ring and
mempool parameters. Applications should pass on this information
to get the packets from the dpdk ports.
For enabling requests from applications, library creates the client
request containing the mempool, ring, port and queue information and
sends the request to the server. After receiving the request, server
registers the Rx and Tx callbacks for all the port and queues.
After the callbacks registration, registered callbacks will get the
Rx and Tx packets. Packets then will be copied to the new mbufs that
are allocated from the user passed mempool. These new mbufs then will
be enqueued to the application passed ring. Applications need to dequeue
the mbufs from the rings and direct them to the devices like
pcap vdev for viewing the packets outside of the dpdk
using the packet capture tools.
For disabling requests, library creates the client request containing
the port and queue information and sends the request to the server.
After receiving the request, server removes the Rx and Tx callback
for all the port and queues.
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Reshma Pattan [Wed, 15 Jun 2016 14:06:21 +0000 (15:06 +0100)]
ethdev: get port by name
Converted rte_eth_dev_get_port_by_name to a public API.
Converted rte_eth_dev_get_name_by_port to a public API.
The librte_pdump library provides the APIs to enable or disable the
packet capture either using the port id or pci address or device name.
So pdump library need to do a mapping from name to port and port to name
internally to validate the device name and register the Rx and Tx
callbacks for the mapped ports. So these APIs are made public for the
pdump library for doing the mentioned mappings.
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Reshma Pattan [Wed, 15 Jun 2016 14:06:20 +0000 (15:06 +0100)]
ethdev: get queues numbers
The new fields nb_rx_queues and nb_tx_queues are added to the
rte_eth_dev_info structure.
Changes to API rte_eth_dev_info_get() are done to update these new fields
to the rte_eth_dev_info object.
Release notes is updated with the changes.
The librte_pdump library needs to register Rx and Tx callbacks for all
the nb_rx_queues and nb_tx_queues, when application wants to capture the
packets on all the software configured number of Rx and Tx queues of the
device. So far there is no support to get nb_rx_queues and nb_tx_queues
information from the ethdev library. Hence these changes are introduced.
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Reshma Pattan [Wed, 15 Jun 2016 14:06:19 +0000 (15:06 +0100)]
ethdev: insert Rx callback as head of list
Added new public api rte_eth_add_first_rx_callback to add given
callback as head of the list.
The librte_pdump library should display Rx packets of the
NIC even before they are being processed by other callbacks
of the application (because other callbacks of the application
may change the packet data as part of the processing).
So packet capturing framework should register a callback at the
head of the Rx callback list so that callback always gets called
first before any other callbacks of the applications. Hence this API
is introduced.
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Remy Horton [Wed, 15 Jun 2016 15:25:49 +0000 (16:25 +0100)]
keepalive: export states
Changes the keepalive state from an anonymous enum to a declared one
which is externally visible, so that keepalive enum values can be
used by applications.
Remy Horton [Wed, 15 Jun 2016 15:25:33 +0000 (16:25 +0100)]
ethdev: remove name from extended statistic fetch
The current extended ethernet statistics fetching involve doing several
string operations, which causes performance issues if there are lots of
statistics and/or network interfaces. This patch changes the test-pmd
and proc_info applications to use the new xstats API, and removes
deprecated code associated with the old API.
Remy Horton [Wed, 15 Jun 2016 15:25:32 +0000 (16:25 +0100)]
net/virtio: fetch extended statistics with integer ids
The current extended ethernet statistics fetching involve doing several
string operations, which causes performance issues if there are lots of
statistics and/or network interfaces. This patch changes the virtio driver
to use the new API that seperates name string and value queries.
Remy Horton [Wed, 15 Jun 2016 15:25:31 +0000 (16:25 +0100)]
net/i40e: fetch extended statistics with integer ids
The current extended ethernet statistics fetching involve doing several
string operations, which causes performance issues if there are lots of
statistics and/or network interfaces. This patch changes the i40e driver
to use the new API that seperates name string and value queries.
Remy Horton [Wed, 15 Jun 2016 15:25:30 +0000 (16:25 +0100)]
net/fm10k: fetch extended statistics with integer ids
The current extended ethernet statistics fetching involve doing several
string operations, which causes performance issues if there are lots of
statistics and/or network interfaces. This patch changes the fm10k driver
to use the new API that seperates name string and value queries.
Remy Horton [Wed, 15 Jun 2016 15:25:29 +0000 (16:25 +0100)]
net/igb: fetch extended statistics with integer ids
The current extended ethernet statistics fetching involve doing several
string operations, which causes performance issues if there are lots of
statistics and/or network interfaces. This patch changes the e1000 driver
to use the new API that seperates name string and value queries.
Remy Horton [Wed, 15 Jun 2016 15:25:28 +0000 (16:25 +0100)]
net/ixgbe: fetch extended statistics with integer ids
The current extended ethernet statistics fetching involve doing several
string operations, which causes performance issues if there are lots of
statistics and/or network interfaces. This patch changes the ixgbe driver
to use the new API that seperates name string and value queries.
Remy Horton [Wed, 15 Jun 2016 15:25:27 +0000 (16:25 +0100)]
ethdev: fetch extended statistics with integer ids
The current extended ethernet statistics fetching involve doing several
string operations, which causes performance issues if there are lots of
statistics and/or network interfaces. This patch changes the xstats
functions to instead use a numeric identifier rather than a string, and
adds the ability to retrieve identifier-to-string mappings.
Zhihong Wang [Tue, 14 Jun 2016 23:08:05 +0000 (19:08 -0400)]
app/testpmd: handle all Rx queues in RSS setup
This patch removes constraints in rxq handling when multiqueue is enabled
to handle all the rxqs.
Current testpmd forces a dedicated core for each rxq, some rxqs may be
ignored when core number is less than rxq number, and that causes confusion
and inconvenience.
One example: an engineer was doing multiqueue test, there're 2
ports in guest each with 4 queues, and testpmd was used as the forwarding
engine in guest, as usual he used 1 core for forwarding, as a results he
only saw traffic from port 0 queue 0 to port 1 queue 0, then a lot of
emails and quite some time are spent to root cause it, and of course it's
caused by this unreasonable testpmd behavior.
Moreover, even if we understand this behavior, if we want to test the
above case, we still need 8 cores for a single guest to poll all the
rxqs, obviously this is too expensive.
We met quite a lot cases like this, one recent example:
http://openvswitch.org/pipermail/dev/2016-June/072110.html
Signed-off-by: Zhihong Wang <zhihong.wang@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Zhihong Wang [Tue, 14 Jun 2016 23:08:03 +0000 (19:08 -0400)]
app/testpmd: add tx_first burst number option
This patch enables configurable tx_first burst number.
Use "start tx_first (burst_num)" to specify how many bursts of packets to
be sent before forwarding start, or "start tx_first" like before for the
default 1 burst send.
Signed-off-by: Zhihong Wang <zhihong.wang@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Zhihong Wang [Tue, 14 Jun 2016 23:08:02 +0000 (19:08 -0400)]
app/testpmd: add retry option
This patch adds retry option in testpmd to prevent most packet losses.
It can be enabled by "set fwd <mode> retry". All modes except rxonly
support this option.
Adding retry mechanism expands test case coverage to support scenarios
where packet loss affects test results.
Signed-off-by: Zhihong Wang <zhihong.wang@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Stop forwarding on exit whether all ports are started or not.
Fixes: ce8d561418d4 ("app/testpmd: add port configuration settings") Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Fixes: b6ea6408fbc7 ("ethdev: store numa_node per device") Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
app/testpmd: separate forward config setup from display
Add call to fwd_config_setup to init_config.
Add call to fwd_config_setup for corelist, coremask and nbcore setup.
Add call to fwd_config_setup for portlist, portmask and nbport setup.
Add call to fwd_config_setup for rxq, txq, rxd and txd setup.
Remove fwd_config_setup from fwd_config_display.
Call the pkt_fwd_config_display function directly,
and remove the fwd_config_display wrapper function.
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Do not update forwarding configuration when attaching or detaching a port
Remove checks on test_done variable.
Remove code to update forwarding configuration.
Fixes: edab33b1c01d ("app/testpmd: support port hotplug") Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Olivier Matz [Wed, 18 May 2016 16:27:30 +0000 (18:27 +0200)]
pci: mmap ioports on non-x86 Linux
On PPC64, the ioports are mapped in memory. Implement the missing part
of ioport API for PPC64 when using uio. This may also work on other
architectures but it has not been tested.
Signed-off-by: David Marchand <david.marchand@6wind.com> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Olivier Matz [Tue, 17 May 2016 09:59:48 +0000 (11:59 +0200)]
pci: remove invalid comment
In a previous commit, the file used to map the PCI resources changed
from "/dev/uio<x>" to "/sys/bus/pci/devices/<busaddr>/resource", making
the comment wrong. Remove it.
Olivier Matz [Tue, 17 May 2016 09:59:47 +0000 (11:59 +0200)]
eal/linux: only call iopl on x86
From iopl(2) man page: "This call is mostly for the x86 architecture. On
many other architectures it does not exist or will always return an
error".
This patch removes the call to iopl() in rte_eal_iopl_init() for
architectures other than x86, and always return 0 (success). This was
already done for ARM in
commit 0291476ae364 ("eal/linux: never check iopl for arm")
Next patches will introduce the support of memory mapped IO resources
for architectures != x86.
On BSD, there is nothing to do as open("/dev/io") already does the
proper thing. See man IO(4).
Olivier Matz [Wed, 15 Jun 2016 11:48:07 +0000 (13:48 +0200)]
mbuf: add new Rx flags for stripped VLAN
The behavior of PKT_RX_VLAN_PKT was not very well defined, resulting in
PMDs not advertising the same flags in similar conditions.
Following discussion in [1], introduce 2 new flags PKT_RX_VLAN_STRIPPED
and PKT_RX_QINQ_STRIPPED that are better defined:
PKT_RX_VLAN_STRIPPED: a vlan has been stripped by the hardware and its
tci is saved in mbuf->vlan_tci. This can only happen if vlan stripping
is enabled in the RX configuration of the PMD.
For now, the old flag PKT_RX_VLAN_PKT is kept but marked as deprecated.
It should be removed from applications and PMDs in a future revision.
This patch also updates the drivers. For PKT_RX_VLAN_PKT:
- e1000, enic, i40e, mlx5, nfp, vmxnet3: done, PKT_RX_VLAN_PKT already
had the same meaning than PKT_RX_VLAN_STRIPPED, minor update is
required.
- fm10k: done, PKT_RX_VLAN_PKT already had the same meaning than
PKT_RX_VLAN_STRIPPED, and vlan stripping is always enabled on fm10k.
- ixgbe: modification done (vector and normal), the old flag was set
when a vlan was recognized, even if vlan stripping was disabled.
- the other drivers do not support vlan stripping.
For PKT_RX_QINQ_PKT, it was only supported on i40e, and the behavior was
already correct, so we can reuse the same bit value for
PKT_RX_QINQ_STRIPPED.
Olivier Matz [Mon, 13 Jun 2016 13:45:28 +0000 (15:45 +0200)]
ethdev: clarify the origin of mbufs
Following the discussion on dpdk-users [1], enhance the API
documentation of rte_eth_tx_burst() to specify that the mbufs have to be
allocated from a pool.
Olivier Matz [Mon, 13 Jun 2016 09:43:03 +0000 (11:43 +0200)]
examples: fix duplicated lpm6 name
When starting the ip_fragmentation or ip_reassembly example
on several sockets, it fails.
The name of the lpm6 table is the same on every socket,
resulting in a table creation failure (-EEXIST). The failure
appeared after:
commit f82f705b635d ("lpm: fix allocation of an existing object")
Indeed, before this commit the returned value when the existing
table, which was probably a bug in that case: one table for 2
sockets for lpm6, and one per socket for lpm.
Zhihong Wang [Wed, 25 May 2016 01:23:03 +0000 (21:23 -0400)]
eal/x86: improve memcpy performance
This patch fixes rte_memcpy performance in Haswell and Broadwell for
vhost when copy size larger than 256 bytes.
It is observed that for large copies like 1024/1518 ones, rte_memcpy
suffers high ratio of store buffer full issue which causes pipeline
to stall in scenarios like vhost enqueue. This can be alleviated by
adjusting instruction layout. Note that this issue may not be visible
in micro test.
How to reproduce?
PHY-VM-PHY using vhost/virtio or vhost/virtio loop back, with large
packets like 1024/1518 bytes ones. Make sure packet generation rate
is not the bottleneck if PHY-VM-PHY is used.
Test report: http://dpdk.org/ml/archives/dev/2016-May/039716.html
Signed-off-by: Zhihong Wang <zhihong.wang@intel.com> Tested-by: Qian Xu <qian.q.xu@intel.com>
The mempool local cache was not initialized properly leading to
undefined behavior in cases where the allocated memory was used
previously and left with data.
Fixes: 213af31e0960 ("mempool: reduce structure size if no cache needed") Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
Jan Viktorin [Tue, 14 Jun 2016 13:46:21 +0000 (15:46 +0200)]
app/test: remove real PCI ids
There are 2 new fake devices for testing PCI infra. All the fake devices
are now identified by non-existing vendor and device IDs so there is no
real driver to bind to them. The testing drivers match those IDs.
Suggested-by: Thomas Monjalon <thomas.monjalon@6wind.com> Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
This script parses the application configuration file and detects all the
pipelines specified therein, and then, it generates all the possible mappings
of those pipelines on the specified CPU core-list.
As a result, each of the possible pipeline-to-core mappings is saved as
separate output configuration file. For example- if input file is
edge_router_downstream.cfg with 3 pipeline (excluding pipeline 0) and
core-list is “1, 2”, following combinations will be generated-
This script will help users to analyse the performance of application by
evaluating all the generated configuration files with different
pipelines-to-core mappings and obtaining the application configuration file
with best performance.
Some optional arguments are as follows:
-h, --help show this help message and exit
-ht {ON,OFF}, --hyper-thread {ON,OFF}
enable/disable hyper threading. default is ON
-nO, --no-output-file
disable output config file generation. Output file
generation is enabled by default
Jasvinder Singh [Sun, 12 Jun 2016 12:42:47 +0000 (13:42 +0100)]
examples/ip_pipeline: fix false cacheline sharing among threads
In ip_pipeline app, the structure app_thread_data needs to be aligned to
the cache line boundary as threads on different cpu cores are accessing
fields of the app->thread_data and having this structure not aligned on
cacheline boundary leads to false cacheline sharing.
Alex Wang [Sat, 21 May 2016 07:58:36 +0000 (00:58 -0700)]
kni: describe mempool capacity requirement
Function like 'rte_kni_rx_burst()' keeps
allocating 'MAX_MBUF_BURST_NUM' mbufs to
kni fifo queue unless the queue's capacity
('KNI_FIFO_COUNT_MAX') is reached. So, if
the mempool is under-provisioned, user may
run into "Out of Memory" logs from KNI code.
This commit documents the need to provision
mempool capacity of more than
"2 x KNI_FIFO_COUNT_MAX" for each KNI interface.
Signed-off-by: Alex Wang <alex@awakenetworks.com> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com> Acked-by: John McNamara <john.mcnamara@intel.com>
Ziye Yang [Tue, 24 May 2016 12:50:36 +0000 (20:50 +0800)]
pci: support class id probing
This patch is used to add the class_id (class_code,
subclass_code, programming_interface) support for
pci_device probe. With this patch, it will be
flexible for users to probe a class of devices
by class_id.
Thomas Monjalon [Tue, 14 Jun 2016 08:51:39 +0000 (10:51 +0200)]
config: make libarchive optional
The commit 66819e6 has introduced a dependency on libarchive to be able
to use some tar resources in the unit tests.
It is now an optional dependency because some systems do not have it
installed.
If CONFIG_RTE_APP_TEST_RESOURCE_TAR is disabled, the PCI test will not
be run. When a "configure" script will be integrated, the libarchive
availability could be checked to automatically enable the option.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Reviewed-by: Jan Viktorin <viktorin@rehivetech.com>
Tomasz Kulasek [Thu, 9 Jun 2016 11:14:32 +0000 (13:14 +0200)]
app/test: fix array overflow warning with gcc 4.5
app/test/test_cryptodev.c:
In function ‘create_snow3g_cipher_operation_oop.clone.15’:
x86_64-native-linuxapp-gcc/include/rte_memcpy.h:796:14
error: array subscript is above array bounds.
In test_cryptodev.c:
2429 rte_memcpy(sym_op->cipher.iv.data, iv, iv_len);
When iv_len is declared as 'unsigned int', rte_memcpy evaluates code for
buffer size bigger than 255, but while 'iv' array is 64 bytes long, it
causes 'above array bounds' warning in gcc 4.5 and breaks compilation.
Using uint8_t as a size of copied block prevents to evaluate in rte_memcpy
code for length bigger than 255, causing the problem.
The root of this issue and solution is the same as for commit 2c007ea10616
("app/test: fix array overflow warning with gcc 4.5")
Tomasz Kantecki [Mon, 13 Jun 2016 10:26:38 +0000 (11:26 +0100)]
app/test: reduce duration of red functional test
'red_autotest' changed to run only functional tests without test #4 which was
taking ~53 seconds. 'red_autotest' takes ~2[s] now.
'red_perf' has been added to run performance tests only).
'red_all' has been added to run all functional tests (including #4) and
perfromance tests. This reflects current 'red_autotest' behavior.
Other changes:
- machine TSC clock frequency detection takes place only once now.
- timeouts and number of iterations in functional tests have been reduced
in order to shorten test duration.
Signed-off-by: Tomasz Kantecki <tomasz.kantecki@intel.com>
Jan Viktorin [Mon, 13 Jun 2016 15:07:44 +0000 (17:07 +0200)]
pci: allow to override sysfs path
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.
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
Jan Viktorin [Mon, 13 Jun 2016 15:07:43 +0000 (17:07 +0200)]
app/test: rename PCI blacklist test case
The current test_pci is just a single test case that tests the
blacklisting of devices. Rename it to test_pci_blacklist and call it
from the test_pci. The setup and cleanup are moved out of the
test_pci_blacklist entirely to cover all other tests.
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
Jan Viktorin [Mon, 13 Jun 2016 15:07:41 +0000 (17:07 +0200)]
app/test: use linked list to store PCI drivers
The test unregisters all drivers before start. The drivers were stored
into a fixed-sized array. This is inflexible. This patch change this to
utilize a linked list for the same purpose.
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
Jan Viktorin [Mon, 13 Jun 2016 15:07:40 +0000 (17:07 +0200)]
app/test: support resources archived by tar
When a more complex resource (a file hierarchy) is needed, packing
every single file as a single resource would be very ineffective. For
that purpose, it is possible to pack the files into a tar archive,
extract it before test from the resource and finally clean up all the
created files.
This patch introduces functions resource_untar and resource_rm_by_tar
to perform those tasks. An example of using those functions is included
as a test.
A new dependency is required to build the app/test: libarchive.
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
Jan Viktorin [Mon, 13 Jun 2016 15:07:39 +0000 (17:07 +0200)]
app/test: create files from resources
A resource can be written into the target filesystem by calling
resource_fwrite or resource_fwrite_file. Such file can be created
before a test is started and removed after the test finishes.
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
Jan Viktorin [Mon, 13 Jun 2016 15:07:38 +0000 (17:07 +0200)]
app/test: support resources externally linked
To include resources from other source that the C source code we
can take advantage of the objcopy behaviour, i.e. packing of an
arbitrary file as an object file that is linked to the target program.
A linked object file is always accessible as a pair
Jan Viktorin [Mon, 13 Jun 2016 15:07:36 +0000 (17:07 +0200)]
app/test: introduce resources for tests
Certain internal mechanisms of DPDK access different file system
structures (e.g. /sys/bus/pci/devices). It is difficult to test
those cases automatically by a unit test when such path is not
hard-coded and there is no simple way how to distribute fake ones
with the current testing environment.
This patch adds a possibility to declare a resource embedded in
the test binary itself. The structure resource cover the generic
situation - it provides a name for lookup and pointers to the
embedded data blob. A resource is registered in a constructor by
the macro REGISTER_RESOURCE.
Some initial tests of simple resources is included and added into
the group_1.
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
Jan Viktorin [Mon, 13 Jun 2016 15:07:37 +0000 (17:07 +0200)]
mk: define objcopy-specific target and arch
The program objcopy uses non-standard conventions to name the
target and arch. Define the values for supported architectures
(tile and ppc_64 are missing).
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
Ferruh Yigit [Fri, 10 Jun 2016 13:19:09 +0000 (15:19 +0200)]
mk: reduce scope of whole-archive static linking
The --whole-archive argument is only required for plugins (drivers)
and libraries used by these plugins.
Currently it covers all libraries.
Reducing the scope of this argument slightly reduce final application size
when statically linked.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Ferruh Yigit [Fri, 10 Jun 2016 13:19:07 +0000 (15:19 +0200)]
mk: prevent overlinking in applications
Replace --no-as-needed linker flag with --as-needed flag, which will
only link libraries directly called by application.
It can be achieved now that the libraries dependencies are handled
properly.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Thomas Monjalon [Fri, 10 Jun 2016 13:19:06 +0000 (15:19 +0200)]
mk: remove library grouping during application linking
>From "man ld":
Using this option has a significant performance cost.
It is best to use it only when there are unavoidable
circular references between two or more archives.
Remove the option since it does not seem necessary.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Thomas Monjalon [Fri, 10 Jun 2016 13:19:05 +0000 (15:19 +0200)]
mk: fix driver dependencies order for static application
On a linker command line, the dependencies must be declared after
the libraries using them.
It will avoid some issues when building an application with static
libraries and --as-needed option.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Panu Matilainen [Mon, 23 May 2016 05:53:33 +0000 (08:53 +0300)]
mk: fix install with tar 1.29
--exclude became a positional option in tar 1.29, breaking the
test app filtering in "make install", causing .map files and all test
apps to get installed in bindir. Adjust the tar arguments accordingly,
this is compatible with older versions too since they do not care about
the order.
Thomas Monjalon [Thu, 9 Jun 2016 13:49:48 +0000 (15:49 +0200)]
log: deprecate history dump
The log history uses rte_mempool. In order to remove the mempool
dependency in EAL (and improve the build), this feature is deprecated.
The ABI is kept but the behaviour is now voided because it seems this
function was not used. The history can be read from syslog.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: David Marchand <david.marchand@6wind.com>
Panu Matilainen [Tue, 7 Jun 2016 10:01:54 +0000 (13:01 +0300)]
mk: generate internal library dependencies
Up to now dependencies between DPDK internal libraries have been
untracked at shared library level, requiring applications to know
about library internal dependencies and often consequently overlinking.
Since the dependencies are already recorded for build ordering in the
makefiles with DEPDIRS-y we can use that information to generate LDLIBS
entries for internal libraries automatically.
Also revert commit 8180554d82b3 ("vhost: fix linkage of driver with
library") which is made redundant by this change.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com> Acked-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
A previous patch modified the CLIs witout updating the examples.
Fixes: 53b2bb9b7ea7 ("app/testpmd: new flow director commands") Signed-off-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it> Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Piotr Azarewicz [Mon, 23 May 2016 12:19:56 +0000 (14:19 +0200)]
examples/quota_watermark: fix memory overflow
qw app at its init stage reserve 2*sizeof(int) memory space for quota
and low_watermark shared variables, but both apps (qw and qwctl) assign
wrong address for low_watermark pointer (out of reserved memzone space)
due to wrong pointer arithmetic.
CID 30709 : Extra sizeof expression (SIZEOF_MISMATCH)
suspicious_pointer_arithmetic: Adding 4UL /* sizeof (int) */ to pointer
(unsigned int *)(*qw_memzone).addr of type unsigned int * is suspicious
because adding an integral value to this pointer automatically scales
that value by the size, 4 bytes, of the pointed-to type, unsigned int.
Most likely, sizeof (int) is extraneous and should be replaced with 1.