Commit Graph

1964 Commits

Author SHA1 Message Date
David Marchand
f6b4f6c9c1 tailq: use a single cast macro
No need to cast everywhere, define a common macro for this, plus it can be used
in future commits.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2015-03-10 11:49:26 +01:00
David Marchand
ff708facfc tailq: remove unneeded inclusions
Only keep inclusion where really needed.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2015-03-10 11:47:46 +01:00
David Marchand
b8320b9824 pci: use lookup tailq api
There is no reason why we should use the "reserve" tailq api, since the pci
entry is already statically reserved.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2015-03-10 11:40:21 +01:00
David Marchand
47cb11c9bf eal: remove remaining reference to pm
Hopefully, this is the last reference to pm.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2015-03-09 18:14:29 +01:00
Thomas Monjalon
1f693b8f37 ethdev: remove useless parameter in init functions
The pointer to struct eth_driver is not used and is already set
in struct rte_eth_dev.

It's a small cleanup in PMD API which probably needs more
attention to make clear what is a driver, a PCI driver, an
ethernet driver, etc.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-03-09 18:07:44 +01:00
Michael Qiu
4d2c67be57 app/test: fix printf format
test_hash.c: In function ‘test_crc32_hash_alg_equiv’:
error: format ‘%lu’ expects argument of type ‘long unsigned int’,
but argument 2 has type ‘size_t’ [-Werror=format]

According to C99, for size_t type should use format "%zu"

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-03-09 18:07:43 +01:00
Michael Qiu
12fa4a0078 hash: fix unsupported crc instruction in i686 platform
Error: unsupported instruction `crc32'

The root cause is that i686 platform does not support 'crc32q'
Need make it only available in x86_64 platform.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Yerden Zhumabekov <yerden.zhumabekov@sts.kz>
2015-03-09 18:07:43 +01:00
Michael Qiu
2eca94d521 eal/x86: fix redeclaration of registers
include/rte_cpuflags.h:154:2: error: redeclaration of enumerator ‘REG_EAX’

In i686, from REG_EAX to REG_EDX are all defined in
	/usr/include/sys/ucontext.h

Rename to RTE_REG_EAX to avoid this issue.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: David Marchand <david.marchand@6wind.com>
2015-03-09 18:07:43 +01:00
Konstantin Ananyev
2a0911ec8b eal: fix C++11 compilation
When compiling C++11-code or above (--std=c++11), the build fails with
lots of

  rte_eth_ctrl.h:517:3: note: in expansion of macro RTE_ALIGN
    (RTE_ALIGN(RTE_ETH_FLOW_MAX, UINT32_BIT)/UINT32_BIT)
    ^

When reading the GCC info pages, I get the feeling that __typeof__ is
a better choice, and that indeed works when including the headers in
C++ files (--std=c++11).

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-03-09 17:38:41 +01:00
Ouyang Changchun
f2552cd5ef doc: more vlan offload commands in testpmd
Update the testpmd doc as there are new HW VLAN commands/options.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Siobhan Butler <siobhan.a.butler@intel.com>
2015-03-09 12:47:26 +01:00
Ouyang Changchun
c9dd4aad4f app/testpmd: more vlan offload commands
This patch enables testpmd user can config port hw_vlan with more fine granularity:
hw vlan filter, hw vlan strip, and hw vlan extend.

Don't remove the original command(hw-vlan) considering that some user still want to use
only one command to switch on/off all 3 options.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2015-03-09 12:47:26 +01:00
Michal Jastrzebski
64b01ee0b2 app/testpmd: check vlan filter configuration
This patch modifies testpmd behavior when setting:
rx_vlan add all vf_port (enabling all vlanids
to be passed thru rx filter on VF).
Rx_vlan_all_filter_set() function,
checks if the next vlanid can be enabled by the driver.
Number of vlanids is limited by the NIC and thus the NIC
do not allow to enable more vlanids than it can allocate
in VFTA table.

Signed-off-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2015-03-09 12:47:26 +01:00
Michal Jastrzebski
a7dde4ff0d doc: warn about limited number of vlan ids
This patch adds information to testpmd_funcs.rst file,
about limited number of vlan_ids possible to be enabled
in a filter. This is limited to the maximum number of entries
possible in the VFTA table.

Signed-off-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2015-03-09 12:47:25 +01:00
Michal Jastrzebski
7143d8fd4a app/testpmd: fix bond port creation
When invoking creation of bonded device using:
create bonded device mode socket in testpmd the bonded port was not
enabled at the end of cmd_create_bonded_device_parsed function.
This caused commands 'show port info' and 'show port stats' not working
properly with bonding device. This patch fixed it.

Signed-off-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2015-03-09 12:47:25 +01:00
Michael Qiu
4468635fdd app/testpmd: forbid actions on invalid port
Currently, if try to start/stop/close one invalid port,
no error shows in testpmd.
This is a bug, need check the port number.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Tetsuya Mukawa <mukawa@igel.co.jp>
2015-03-09 12:47:25 +01:00
Michael Qiu
92d2703e2c app/testpmd: fix log with no bound device
As hotplug has been enabled, start the testpmd with no nic binded
will show one error log "Please stop the ports first":

Interactive-mode selected
Please stop the ports first
Done
testpmd>

This issue is cause by the logic of check link status.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2015-03-09 12:46:46 +01:00
Takuya Asada
cff90bb7ec virtio: add default Tx configuration
When I tried to launch test-pmd on KVM guest of Fedora21, I got following error:

Configuring Port 0 (socket 0)
Fail to configure port 0 tx queues
EAL: Error - exiting with code: 1
  Cause: Start ports failed

I found that the error caused here, and actual error message was
"TX checksum offload not supported".

This patch adds default_txconf on virtio pmd, to avoid the error.

Signed-off-by: Takuya Asada <syuu@cloudius-systems.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2015-03-09 12:46:46 +01:00
Huawei Xie
4d16fff496 vhost: check file descriptor before closing
This avoids closing -1 in our case.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Tetsuya Mukawa <mukawa@igel.co.jp>
2015-03-09 12:46:46 +01:00
Huawei Xie
64ab971791 vhost: fix file descriptors naming
Previous vhost implementation wrongly name kickfd as callfd and callfd as kickfd.
It is functional correct, but causes confusion.
Exchange kickfd and callfd to avoid confusion.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Tetsuya Mukawa <mukawa@igel.co.jp>
2015-03-09 12:46:46 +01:00
Huawei Xie
aee87dd706 vhost: use loop instead of goto
This patch reorder the code a bit to use loop instead of goto.
Besides, remove abudant check 'fd != -1'.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-03-09 12:46:46 +01:00
Huawei Xie
31ff0c6a45 vhost: combine select with sleep
combine sleep into select when there is no file descriptors to be monitored.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-03-09 12:46:46 +01:00
Ouyang Changchun
db566f5930 ixgbe: fix VF Tx for X550
X550 should use the correct macro to set the VFTDT and VFRDT register address.
This patch fixes the VF TX issue for Sageville.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
2015-03-09 12:46:46 +01:00
Michael Qiu
7eb689794a eal/x86: fix integer cast in memcpy
./i686-native-linuxapp-gcc/include/rte_memcpy.h:592:23: error:
cast from pointer to integer of different size
[-Werror=pointer-to-int-cast]

  dstofss = 16 - (int)((long long)(void *)dst & 0x0F) + 16;

Type 'long long' is 64-bit in i686 platform while 'void *'
is 32-bit.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
2015-03-09 12:46:46 +01:00
Zhihong Wang
76746eb13f eal/x86: fix strict aliasing rules
Fixed strict-aliasing rules breaking errors for some GCC version.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
2015-03-09 12:46:46 +01:00
Keith Wiles
0cd854eef5 mk: move internal file
Move the rte.extvars.mk to an internal directory and
update rte.vars.mk to find the file in the new location.

Signed-off-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2015-03-09 12:46:46 +01:00
Huawei Xie
391b5f425c vhost: fix crash by removing device when requested
This patch fixes the segfault issue in the case vhost receives
new VHOST_SET_MEM_TABLE message without VHOST_VRING_GET_VRING_BASE
(which we uses as the stop message).

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Tommy Long <thomas.long@intel.com>
2015-03-05 22:08:27 +01:00
Panu Matilainen
5e62bdde85 ethdev: add missing symbol export for port release
Fixes: 36ec8585b2 ("ethdev: release port")

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-03-05 21:58:07 +01:00
Ouyang Changchun
92ff8cf229 tools: fix binding to unsupported driver
The dpdk_nic_bind script will not allow ports to be bound or unbound if none of the
kernel modules supported by DPDK is loaded. This patch relaxes this restriction by
checking if a DPDK module is actually requested. The example below illustrates this
problem:

In virtio test, on the guest
1. Bind virtio port to igb_uio driver;
2. Remove igb_uio module;
3. Bind virtio port to virtio-pci driver, it fails and reports:
   "Error - no supported modules are loaded"

The script should check the to-be-bound driver flag, if it is dpdk driver(igb_uio, vfio etc),
and the corresponding module is not loaded, then exit, otherwise, just report a warning,
and continue to bind the non-dpdk driver(like virtio-pci) to dev.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Tested-by: Qian Xu <qian.q.xu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
2015-03-05 21:33:53 +01:00
Keith Wiles
d8b8517893 ethdev: fix hotplug check for Rx and Tx callbacks
Some checks with rte_eth_dev_is_valid_port() were missed when merging
hotplug and callbacks features.

Fixes: c282abd2a6 ("ethdev: remove assumption that port will not be detached")

Signed-off-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2015-03-05 21:30:47 +01:00
Cunming Liang
352078e8e1 ixgbe: check rxd number to avoid mbuf leak
The mbuf leak happens when the assigned number of rx descriptor is not
power of 2 in vector mode.
As it's presumed on vpmd rx (for rx_tail wrap), adding condition check
to prevent it.
The root cause reference code in *_recv_raw_pkts_vec* as below.
"rxq->rx_tail = (uint16_t)(rxq->rx_tail & (rxq->nb_rx_desc - 1));".

Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-03-05 20:06:06 +01:00
Tetsuya Mukawa
64702e5f6f mk: fix config build on freebsd
The '-fdirectives-only' flag doesn't exist in cpp of FreeBSD.
To remove expanding macros when parsing the config files won't
add any issue.

Suggested-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-03-05 20:06:06 +01:00
Stephen Hemminger
f2cae314c3 app/test: remove unneeded casts
The malloc family returns void * and therefore cast is unnecessary.
Use calloc rather than zmalloc with multiply for array.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-03-04 21:51:01 +01:00
Stephen Hemminger
435eb142bb examples: remove unneeded casts
*alloc() routines return void * and therefore cast is not needed.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
[Thomas: reverse num and size parameters in vhost calloc]
2015-03-04 21:50:42 +01:00
Stephen Hemminger
490a1f0a25 enic: remove useless cast
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-03-04 21:50:42 +01:00
Stephen Hemminger
d886477be7 eal/linux: remove useless memset
The path variable is set via snprintf, and does not need to
memset before that.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-03-04 21:50:42 +01:00
Stephen Hemminger
944127d1ed eal/bsd: remove useless assignments
If variable is set in the next line, it doesn't need to be
initialized.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2015-03-04 21:50:42 +01:00
Pawel Wodkowski
03b2f7716b cmdline: fix parameter type
Fix warning reported during static analysis about size_t to int cast
when passing parameters to parse_set_list().

This patch fix code formating errors that give checkpatch.pl errors
after generating patch.

Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2015-03-04 11:19:37 +01:00
Pawel Wodkowski
460a165075 ring: fix memory leak
Free kvlist on function exit to avoid memory leak during devinit.

Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2015-03-04 11:19:37 +01:00
Pawel Wodkowski
c34af7424e kvargs: fix freeing behaviour for null
By convention free() functions should ignore NULL parameter. This patch
add this behaviour for rte_kvargs_free().

Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2015-03-04 11:19:37 +01:00
Pawel Wodkowski
5663c25dcc timer: fix callback declaration inconsistency
This patch remove inconsistency between declaration of type
rte_timer_cb_t, field f in struct rte_timer and function
__rte_timer_reset().

Although compiler treat both of them the same, the static analysis tool
like complain about that.

Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2015-03-04 11:19:37 +01:00
Thomas Monjalon
4b1b380213 bond: remove debug function to fix link with shared lib
The function print_client_stats was used in the example without being
clearly exported in the map file. So it breaks linking with shared library
when debug is enabled.
It's better to remove this function as it probably could be implemented
with statistics API.

Fixes: cc7e8ae84f ("add example application for link bonding mode 6")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2015-03-04 11:19:25 +01:00
Thomas Monjalon
a91d686358 mlx4: mute auto config in quiet mode
If verbose is off, auto-config-h.sh script should be quiet.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2015-03-04 11:19:21 +01:00
Thomas Monjalon
9d740b97f2 mlx4: fix build with mempool debug enabled
The mempool header forces error on -Wcast-qual and makes verbs.h failing.
Let's include verbs before as a system header.

Fixes: 7fae69eeff ("mlx4: new poll mode driver")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2015-03-04 11:19:07 +01:00
Thomas Monjalon
80edfef4a8 virtio: fix build with debug enabled
With CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_INIT=y:
	error: ‘devname’ undeclared (first use in this function)

Fixes: da978dfdc4 ("virtio: use port IO to get PCI resource")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
2015-03-04 11:18:53 +01:00
Thomas Monjalon
459132bc2c virtio: fix build with mempool debug enabled
The mempool header forces error on -Wcast-qual:
	error: cast discards ‘const’ qualifier from pointer target type

Let's fix it by removing const qualifier of pci driver from commit
	5e9f6d1340 ("pci: reference driver structure for each device")
It's needed because the driver flags are changed depending on using uio or not.
Actually these driver flags should be directly attached to each device.

Fixes: da978dfdc4 ("virtio: use port IO to get PCI resource")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
2015-03-04 11:18:36 +01:00
Thomas Monjalon
ae6ad6b0c4 fm10k: fix build with debug enabled
error: implicit declaration of function ‘RTE_LOG’

Fixes: a6061d9e70 ("fm10k: register PF driver")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-03-04 11:18:36 +01:00
Thomas Monjalon
22e34d1211 mempool: fix build with debug enabled
error: format ‘%p’ expects argument of type ‘void *’,
but argument 5 has type ‘const struct rte_mempool *’ [-Werror=format=]

mp type is (const struct rte_mempool *) and must be casted into a simpler
type to be printed.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2015-03-04 11:18:27 +01:00
Thomas Monjalon
8cf61ec829 eal/linux: fix build
Compilation fails in some distributions because of missing unistd.h
needed for pread/pwrite (seen with Suse):
	lib/librte_eal/linuxapp/eal/eal_pci_uio.c:62:2:
	error: implicit declaration of function ‘pread’

Fixes: 4a499c6495 ("eal/linux: enable uio_pci_generic support")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: David Marchand <david.marchand@6wind.com>
2015-03-03 23:21:33 +01:00
Pawel Wodkowski
a001589ec1 devargs: fix null dereferencing on failure
On failure devargs->args should not be accessed if devargs is NULL.

Fixes: c07691ae10 ("devargs: remove limit on parameters length")

Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Acked-by: David Marchand <david.marchand@6wind.com>
2015-03-02 19:40:54 +01:00
Neil Horman
c3615e4a80 eal: clean up export of socket id variable
Theres no need to export this variable.  Its set and queried from an API call
that doesn't exist in the hot path.  Instead just export the rte_socket_id
symbol and make the variable private to protect it from type changes.  We should
do this with the other exported variables too, but I think its too late in the
release cycle to do that.

tested using distributor_autotest (which uses rte_socket_id), successfully.
Only tested on linux, as I don't currently have a bsd system spun up, but the
changes are symmetric, and should be fine

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
Acked-by: David Marchand <david.marchand@6wind.com>
2015-03-02 19:40:20 +01:00