Commit Graph

1401 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
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
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
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
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
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
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
Jijiang Liu
ea5c23df30 i40e: advertise TSO capability
Advertise the DEV_TX_OFFLOAD_TCP_TSO flag in the PMD features. It means
that the i40e PMD supports the offload of TSO.

Test report: http://www.dpdk.org/ml/archives/dev/2015-March/014467.html

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
Signed-off-by: Miroslaw Walukiewicz <miroslaw.walukiewicz@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
2015-03-02 07:36:30 +01:00
Jijiang Liu
6fa72b444c i40e: enable TSO support
This patch enables i40e TSO feature for both non-tunneling packet and
tunneling packet.

Test report: http://www.dpdk.org/ml/archives/dev/2015-March/014467.html

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
Signed-off-by: Miroslaw Walukiewicz <miroslaw.walukiewicz@intel.com>
Signed-off-by: Grzegorz Galkowski <grzegorz.galkowski@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
2015-03-02 07:36:13 +01:00
Jijiang Liu
1f02d682d3 i40e: move Tx offloads parameters to separate structure
The structure size is u64 so it could be used with single cpu operation.

Test report: http://www.dpdk.org/ml/archives/dev/2015-March/014467.html

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
Signed-off-by: Miroslaw Walukiewicz <miroslaw.walukiewicz@intel.com>
Signed-off-by: Grzegorz Galkowski <grzegorz.galkowski@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
2015-03-02 07:35:26 +01:00
Tetsuya Mukawa
e34550c8b9 null: fix build with gcc-4.7
This patch fixes following errors with gcc-4.7.
 lib/librte_pmd_null/rte_eth_null.c:302:28:
     error: array subscript is above array bounds

Reported-by: John McNamara <john.mcnamara@intel.com>
Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: John McNamara <john.mcnamara@intel.com>
2015-02-28 00:22:00 +01:00
Tetsuya Mukawa
2929553854 null: fix build with icc
This patch fixes following errors with icc.
 rte_eth_null.c(47): error #83:
     type qualifier specified more than once

Reported-by: John McNamara <john.mcnamara@intel.com>
Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: John McNamara <john.mcnamara@intel.com>
2015-02-28 00:19:46 +01:00
Tetsuya Mukawa
911920812f ethdev: fix build with icc
This patch fixes following errors with icc.
  error #188: enumerated type mixed with another type
    return -1;

Fixes: 92d94d3744 ("ethdev: attach or detach port")

Reported-by: John McNamara <john.mcnamara@intel.com>
Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: John McNamara <john.mcnamara@intel.com>
2015-02-28 00:14:51 +01:00
Changchun Ouyang
a8e3219a92 virtio: fix build on freebsd
This patch fixes the compilation issue on freebsd:
lib/librte_pmd_virtio/virtio_ethdev.c: In function 'virtio_resource_init':
lib/librte_pmd_virtio/virtio_ethdev.c:1071:56: error: unused parameter 'pci_dev' [-Werror=unused-parameter]

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

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
2015-02-28 00:12:37 +01:00
Thomas Monjalon
00c685634b mlx4: fix build
There was a missing change due by hotplug integration.

Fixes: 9f1653e7b7 ("ethdev: add device type")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-02-26 18:02:24 +01:00
Thomas Monjalon
ae438314b1 mlx4: remove old version compatibility
No need to check DPDK version. It just has to work on HEAD.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-02-26 18:02:17 +01:00
Thomas Monjalon
7609e66093 ethdev: fix build without hotplug
After setting CONFIG_RTE_LIBRTE_EAL_HOTPLUG=n, GCC stop compiling:
rte_ethdev.c:430:1: error: ‘rte_eth_dev_get_device_type’ defined but not used
rte_ethdev.c:438:1: error: ‘rte_eth_dev_save’ defined but not used
rte_ethdev.c:450:1: error: ‘rte_eth_dev_get_changed_port’ defined but not used
rte_ethdev.c:464:1: error: ‘rte_eth_dev_get_addr_by_port’ defined but not used
rte_ethdev.c:481:1: error: ‘rte_eth_dev_get_name_by_port’ defined but not used
rte_ethdev.c:503:1: error: ‘rte_eth_dev_is_detachable’ defined but not used

The hotplug option allows to build in environment (BSD) not yet
supported by this new feature.
It should be removed when BSD will be supported.
Waiting this day, let's fix build with hotplug disabled.

Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-02-26 11:55:10 +01:00
Thomas Monjalon
b67578ccdf version: 2.0.0-rc1
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-02-26 00:41:57 +01:00
Tetsuya Mukawa
78d9a89884 null: support port hotplug
This patch adds port hotplug support to Null PMD.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2015-02-26 00:32:31 +01:00