dpdk.git
9 years agodoc: remove Intel legal info from linux guide
Pablo de Lara [Fri, 19 Dec 2014 15:08:48 +0000 (15:08 +0000)]
doc: remove Intel legal info from linux guide

Removed redundant Intel legal info from linux gsg.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
9 years agodoc: remove Intel references from release notes
Siobhan Butler [Wed, 17 Dec 2014 16:47:35 +0000 (16:47 +0000)]
doc: remove Intel references from release notes

Removed multiple references to Intel(R) DPDK where no longer
relevant.

Signed-off-by: Siobhan Butler <siobhan.a.butler@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
9 years agodoc: remove Intel references from sample apps guide
Siobhan Butler [Thu, 18 Dec 2014 10:51:19 +0000 (10:51 +0000)]
doc: remove Intel references from sample apps guide

Removed redundant references to Intel(R) DPDK in Sample App UG.

Signed-off-by: Siobhan Butler <siobhan.a.butler@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
9 years agodoc: remove Intel references from testpmd guide
Siobhan Butler [Wed, 17 Dec 2014 16:58:38 +0000 (16:58 +0000)]
doc: remove Intel references from testpmd guide

Removed redundant Intel references from TestPMD User Guide.

Signed-off-by: Siobhan Butler <siobhan.a.butler@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
9 years agodoc: remove Intel references from prog guide
Siobhan Butler [Fri, 19 Dec 2014 14:30:42 +0000 (14:30 +0000)]
doc: remove Intel references from prog guide

Removed redundant references to Intel(R) DPDK in Programmers Guide.

Signed-off-by: Siobhan Butler <siobhan.a.butler@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
9 years agodoc: remove Intel references from freebsd guide
Siobhan Butler [Tue, 16 Dec 2014 10:49:56 +0000 (10:49 +0000)]
doc: remove Intel references from freebsd guide

Updated the FreeBSD GSG to remove redundant Intel references.

Signed-off-by: Siobhan Butler <siobhan.a.butler@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
9 years agodoc: remove Intel references from linux guide
Siobhan Butler [Fri, 19 Dec 2014 15:08:47 +0000 (15:08 +0000)]
doc: remove Intel references from linux guide

Removed references to Intel which
are no longer relevant in linux gsg.

Signed-off-by: Siobhan Butler <siobhan.a.butler@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
9 years agoixgbevf: fix link state
Balazs Nemeth [Thu, 18 Dec 2014 17:56:36 +0000 (17:56 +0000)]
ixgbevf: fix link state

This patch fixes checking the link state of a virtual function. If the
state has already been checked, it does not need to be checked
again. Previously, get_link_status in the ixgbe_hw struct was used to
track if the information had already been retrieved, but this field
was always set to false (signifying that the information was
up-to-date). The problem was introduced by commit 8ef32003 which was
part of a patch set to update the ixgbe portion of the PMD. This patch
does not break consistency with the ixgbevf driver. Instead, it fixes
the problem at the level of DPDK.

Applications that rely on the reported link speed could fail without
this patch. The qos_sched example application provided with DPDK did
not run when virtual functions were used. The output for this example
application is shown below:

EAL: Error - exiting with code: 1
  Cause: Unable to config sched subport 0, err=-2

The problem and the effect of the patch can been seen by running the
l2fwd example application using the following command:

sudo ./build/l2fwd -c 0x3 -n 4 -- -p 0x3 -T 0

Before the patch has been applied (with both links up):
...
Checking link statusdone
Port 0 Link Up - speed 100 Mbps - half-duplex

Port 1 Link Up - speed 100 Mbps - half-duplex

L2FWD: entering main loop on lcore 1
...

After the patch has been applied (with both links up):
...
Checking link statusdone
Port 0 Link Up - speed 10000 Mbps - full-duplex
Port 1 Link Up - speed 10000 Mbps - full-duplex
L2FWD: entering main loop on lcore 1
...

Before the patch has been applied (with link 0 down, link 1 up):
...
Checking link statusdone
Port 0 Link Up - speed 100 Mbps - half-duplex

Port 1 Link Up - speed 100 Mbps - half-duplex

L2FWD: entering main loop on lcore 1
...

After the patch has been applied (with link 0 down, link 1 up):
...
Checking link status............................................................
..............................done
Port 0 Link Down
Port 1 Link Up - speed 10000 Mbps - full-duplex
...

Signed-off-by: Balazs Nemeth <balazs.nemeth@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
9 years agoixgbe: fix secondary process start
Michael Qiu [Thu, 18 Dec 2014 10:16:49 +0000 (18:16 +0800)]
ixgbe: fix secondary process start

EAL:   probe driver: 8086:10fb rte_ixgbe_pmd
EAL:   PCI memory mapped at 0x7f18c2a00000
EAL:   PCI memory mapped at 0x7f18c2a80000
Segmentation fault (core dumped)

This is introduced by commit: 46bc9d75
ixgbe: fix multi-process support
When start primary process with command line:
./app/test/test -n 1 -c ffff -m 64
then start the second one:
./app/test/test -n 1 --proc-type=secondary --file-prefix=rte
This segment-fault will occur.

Root cause is test app on primary process only starts device, but
the queue need initialized by manually command line.
So the tx queue is still NULL when secondary process startup.

Reported-by: Yong Liu <yong.liu@intel.com>
Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agoenic: use eal to manage interrupts
Sujith Sankar [Thu, 18 Dec 2014 09:09:40 +0000 (14:39 +0530)]
enic: use eal to manage interrupts

This patch removes the interrupt registration code which was under the flag
VFIO_PRESENT and relies on the rte_lib code for the same.
This also ignores the initial trigger of ISR from the lib.

Signed-off-by: Sujith Sankar <ssujith@cisco.com>
9 years agoaf_packet: fix possible memory leak
Daniel Mrzyglod [Fri, 19 Dec 2014 15:01:36 +0000 (16:01 +0100)]
af_packet: fix possible memory leak

In rte_pmd_init_internals, we are mapping memory but not released
if error occurs it could produce memory leak.
Add unmmap function to release memory.

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
Acked-by: John W. Linville <linville@tuxdriver.com>
9 years agoaf_packet: fix memory allocation checks
Daniel Mrzyglod [Thu, 18 Dec 2014 09:45:05 +0000 (09:45 +0000)]
af_packet: fix memory allocation checks

In rte_eth_af_packet.c we are we are missing NULL pointer
checks after calls to allocate memory for queues.
Add checking NULL pointer and error handling.

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agoxenvirt: fix build break on ethernet address parsing
Neil Horman [Thu, 18 Dec 2014 11:31:56 +0000 (06:31 -0500)]
xenvirt: fix build break on ethernet address parsing

Back in commit aaa662e75c23c61 ("cmdline: fix overflow on bsd"),
the author failed to fixup a call to cmdline_parse_etheraddr in xenvirt.
This patch makes the needed correction to avoid a build break.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agovhost: add interface name for virtio
Ciara Loftus [Thu, 18 Dec 2014 18:07:07 +0000 (18:07 +0000)]
vhost: add interface name for virtio

This patch fixes the issue whereby when using userspace vhost ports
in the context of vSwitching, the name provided to the hypervisor/QEMU
of the vhost tap device needs to be exposed in the library, in order
for the vSwitch to be able to direct packets to the correct device.
This patch introduces an 'ifname' member to the virtio-net structure
which is populated with the tap device name when QEMU is brought up
with a vhost device.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Signed-off-by: Anthony Fee <anthonyx.fee@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agokni: fix build on CentOS 6.6
Jincheng Miao [Thu, 18 Dec 2014 06:50:29 +0000 (14:50 +0800)]
kni: fix build on CentOS 6.6

From CentOS 6.6, function skb_set_hash is introduced, this breaks
the previous assumption. So modify RHEL_RELEASE_VERSION from 7.0
to 6.6 to fix build for rte_kni.ko.

Related mail from Barak Enat:
http://dpdk.org/ml/archives/dev/2014-December/010124.html

building error likes:
  CC [M]  lib/librte_eal/linuxapp/kni/e1000_82575.o
In file included from lib/librte_eal/linuxapp/kni/ethtool/igb/e1000_osdep.h:41,
                 from lib/librte_eal/linuxapp/kni/ethtool/igb/e1000_hw.h:31,
                 from lib/librte_eal/linuxapp/kni/ethtool/igb/e1000_api.h:31,
                 from lib/librte_eal/linuxapp/kni/e1000_82575.c:38:
lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h:3870: error: conflicting types for ‘skb_set_hash’
include/linux/skbuff.h:620: note: previous definition of ‘skb_set_hash’ was here

Reported-by: Barak Enat <barak@saguna.net>
Signed-off-by: Jincheng Miao <jincheng.miao@gmail.com>
9 years agoversion: 1.8.0-rc6
Thomas Monjalon [Wed, 17 Dec 2014 23:33:19 +0000 (00:33 +0100)]
version: 1.8.0-rc6

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoexamples/vhost: fix vlan offload
Ouyang Changchun [Fri, 12 Dec 2014 04:15:26 +0000 (12:15 +0800)]
examples/vhost: fix vlan offload

The following commit break vm2vm hard mode test cases:
commit db4014f2b65cb31bf ("use factorized default Rx/Tx configuration")

Investigation show that it needs enabling vlan offload since it is turn off
by default in some drivers, and Tx need it, especially when vm2vm is in hard mode.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Tested-by: Jingguo Fu <jingguox.fu@intel.com>
9 years agoexamples/vm_power: fix initialization of cmdline token
Olivier Matz [Wed, 17 Dec 2014 12:55:25 +0000 (13:55 +0100)]
examples/vm_power: fix initialization of cmdline token

Fix a typo: cmdline_parse_token_string_t was used in place of
cmdline_parse_num_string_t.

Seen with clang-3.5.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
9 years agoexamples/vm_power: fix split of compiler and linker options
Olivier Matz [Wed, 17 Dec 2014 12:55:24 +0000 (13:55 +0100)]
examples/vm_power: fix split of compiler and linker options

The argument -lvirt is a linker parameter, not a CFLAG.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
9 years agoexamples/netmap_compat: fix overflow in ioctl operation
Olivier Matz [Wed, 17 Dec 2014 12:55:23 +0000 (13:55 +0100)]
examples/netmap_compat: fix overflow in ioctl operation

Compiling the netmap example with clang-3.5 triggered the following
warning:

  compat_netmap.c:783:11: error: overflow converting case value to
    switch condition type (3225184658 to 18446744072639768978)
    [-Werror,-Wswitch]
              case NIOCREGIF:
                 ^
Indeed, an ioctl value should be an unsigned 32 bits, not an int.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
9 years agoexamples/l3fwd: fix compilation with clang 3.5
Olivier Matz [Wed, 17 Dec 2014 12:55:22 +0000 (13:55 +0100)]
examples/l3fwd: fix compilation with clang 3.5

Fix the following error:
  error: unused function 'l3fwd_simple_forward'

The l3fwd_simple_forward() is maybe unused, due to compilation options
(APP_LOOKUP_METHOD, ENABLE_MULTI_BUFFER_OPTIMIZE). As the combinatorial
is quite big, it looks simpler to add the __attribute__((unused)) on
this function, so that the compiler does not complain.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
9 years agoapp/test: fix misplaced braces in strncmp
Olivier Matz [Wed, 17 Dec 2014 12:55:21 +0000 (13:55 +0100)]
app/test: fix misplaced braces in strncmp

One occurrence call to strncmp had the closing brace in the wrong
place. Changing this form:
if (strncmp(X, Y, sizeof(X) != 0))
which does a comparison of length 1, to
if (strncmp(X, Y, sizeof(X)) != 0)
which does the correct length comparison and then compares the result
to zero in the "if" part.

Seen with clang-3.5:
  "error: size argument in 'strncmp' call is a comparison"

This patch is similar to 261386248 but it looks that one occurrence
was forgotten.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
9 years agoapp/test: fix assert macro
Bruce Richardson [Wed, 17 Dec 2014 17:06:53 +0000 (17:06 +0000)]
app/test: fix assert macro

One of the test assertion macros was missing the "do" part of the
do-while. This issue was picked up by clang reporting an empty while
loop body for the closing while of the do-while pair.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agobond: check null before use
Declan Doherty [Wed, 17 Dec 2014 11:46:59 +0000 (11:46 +0000)]
bond: check null before use

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
9 years agobond: fix pci table allocation check
Declan Doherty [Wed, 17 Dec 2014 11:46:58 +0000 (11:46 +0000)]
bond: fix pci table allocation check

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
9 years agobond: check bounds before assigning active slave count
Declan Doherty [Wed, 17 Dec 2014 11:46:57 +0000 (11:46 +0000)]
bond: check bounds before assigning active slave count

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
9 years agoi40e: fix build with some toolchains
Helin Zhang [Wed, 17 Dec 2014 05:40:59 +0000 (13:40 +0800)]
i40e: fix build with some toolchains

Compile warning which is treated as error occurs on Oracle Linux
(kernel 2.6.39, gcc 4.4.7) as below, or RHEL, CentOS. Aliasing
'struct i40e_aqc_debug_reg_read_write' should be avoided. Use the
elements inside that structure directly can fix the issue.

lib/librte_pmd_i40e/i40e_ethdev.c: In function 'eth_i40e_dev_init':
lib/librte_pmd_i40e/i40e_ethdev.c:5318: error: dereferencing pointer
  'cmd' does break strict-aliasing rules
lib/librte_pmd_i40e/i40e_ethdev.c:5314: note: initialized from here

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
9 years agokni: fix build with kernel < 2.6.35 and vhost debug enabled
Jincheng Miao [Thu, 11 Dec 2014 05:27:07 +0000 (13:27 +0800)]
kni: fix build with kernel < 2.6.35 and vhost debug enabled

Seen on RHEL-6.5:
lib/librte_eal/linuxapp/kni/kni_vhost.c:222:
error: ‘struct socket’ has no member named ‘wq’
lib/librte_eal/linuxapp/kni/kni_vhost.c:313:
error: implicit declaration of function ‘sk_sleep’
lib/librte_eal/linuxapp/kni/kni_vhost.c:313:
error: passing argument 1 of ‘__wake_up’ makes pointer from integer without a cast
include/linux/wait.h:146: note: expected ‘struct wait_queue_head_t *’
but argument is of type ‘int’
lib/librte_eal/linuxapp/kni/kni_vhost.c:580:
error: assignment makes pointer from integer without a cast

RHEL6.5 kernel is based on 2.6.32. But there are two changing
from 2.6.35:
1. socket struct is changed
It wrappered previous wait_queue_head_t of socket to
struct socket_wq. So for the kernel older than 2.6.35, we should
directly use socket->wait instead.

2. new function sk_sleep()
This function is implemented from 2.6.35 to obtain wait queue
from struct sock. This patch adds a macro in kni/compat.h
to be compatible with older kernels.

Patch is tested in RHEL6.5 and RHEL7.0 with:
CONFIG_RTE_LIBRTE_KNI=y
CONFIG_RTE_KNI_KO_DEBUG=y
CONFIG_RTE_KNI_VHOST=y
CONFIG_RTE_KNI_VHOST_MAX_CACHE_SIZE=1024
CONFIG_RTE_KNI_VHOST_VNET_HDR_EN=y
CONFIG_RTE_KNI_VHOST_DEBUG_RX=y
CONFIG_RTE_KNI_VHOST_DEBUG_TX=y

Signed-off-by: Jincheng Miao <jmiao@redhat.com>
9 years agoethdev: fix mtu comment
Stephen Hemminger [Wed, 17 Dec 2014 05:47:17 +0000 (21:47 -0800)]
ethdev: fix mtu comment

In commit 59d0ecdbf0e1d6350 ("MTU accessors"),
max_frame_size was replaced with mtu.
Default size is ETHER_MTU = 1500.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agomk: fix link with CC
Thomas Monjalon [Wed, 17 Dec 2014 17:07:17 +0000 (18:07 +0100)]
mk: fix link with CC

It appeared in commit 21cdc2e77a4ca999 ("fix 32-bit link with gcc")
that linker options must be prefixed by -Wl, when using CC.
So CPU_LDFLAGS is prefixed in rte.lib.mk.
Then commit 815cfb7925bb6de ("fix link of combined shared library using CC")
introduced another prefixing of CPU_LDFLAGS in rte.sharelib.mk,
included in lib/Makefile.
Because CPU_LDFLAGS is an exported variable, the prefixing is done twice.
Initial patch of commit 815cfb7925bb6de had a workaround but it hasn't
been applied in favor of this proper fix.

Now variables are not overriden when prefixing.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agomk: forbid multiple definitions
Thomas Monjalon [Wed, 17 Dec 2014 17:24:52 +0000 (18:24 +0100)]
mk: forbid multiple definitions

The option "-z muldefs" was set only if not using ld directly.
By the way, this option seems to be a useless hack introduced
with shared and combined libraries support (e25e4d7ef16b8aa84de).
The clean approach is to remove it.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agomk: fix link examples to combined library
Thomas Monjalon [Wed, 17 Dec 2014 18:38:21 +0000 (19:38 +0100)]
mk: fix link examples to combined library

RTE_LIBNAME was defined only if BUILDING_RTE_SDK.
So external applications like examples were trying to link with -l
without any library name.

This bug appeared after fixing link to combined library (removing
link to separate libraries).

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agomk: fix link to not combined libraries
Yong Liu [Wed, 17 Dec 2014 09:20:44 +0000 (17:20 +0800)]
mk: fix link to not combined libraries

Commit 944088c2abbe ("fix link to combined library") introduced
a check with a wrong configuration option name.
So link is broken in the case combined library is not enabled.

main.o: In function `rte_pktmbuf_free':
main.c:(.text+0x9c): undefined reference to `per_lcore__lcore_id'

Signed-off-by: Yong Liu <yong.liu@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
[Thomas: fix option name in comments]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoversion: 1.8.0-rc5
Thomas Monjalon [Tue, 16 Dec 2014 23:31:34 +0000 (00:31 +0100)]
version: 1.8.0-rc5

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agodoc: precise title for linux guide
Thomas Monjalon [Fri, 31 Oct 2014 21:05:34 +0000 (22:05 +0100)]
doc: precise title for linux guide

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agodoc: fix typos in ring lib
Pablo de Lara [Tue, 9 Dec 2014 12:27:32 +0000 (12:27 +0000)]
doc: fix typos in ring lib

Ring library section in PG had a couple of typos,
in the text and in one of the images

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
9 years agodoc: add vm power mgmt app
Pablo de Lara [Tue, 9 Dec 2014 12:02:08 +0000 (12:02 +0000)]
doc: add vm power mgmt app

Added new section in sample app UG for
the new VM power management app.

Signed-off-by: Alan Carew <alan.carew@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
9 years agodoc: add vm power mgmt request sequence svg
Pablo de Lara [Tue, 9 Dec 2014 12:02:07 +0000 (12:02 +0000)]
doc: add vm power mgmt request sequence svg

Added second of the two figures in the VM power management app UG
VM power management request sequence

Signed-off-by: Alan Carew <alan.carew@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
9 years agodoc: add vm power mgmt overview svg
Pablo de Lara [Tue, 9 Dec 2014 12:02:06 +0000 (12:02 +0000)]
doc: add vm power mgmt overview svg

Added first of the two figures in the VM power management app UG:
VM power mangament highlevel overview

Signed-off-by: Alan Carew <alan.carew@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
9 years agodoc: add bsd license to exception path svg
Bernard Iremonger [Mon, 8 Dec 2014 17:18:43 +0000 (17:18 +0000)]
doc: add bsd license to exception path svg

The bsd license was missing from the  exception path svg file.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agodoc: add bsd license to link bonding svgs
Declan Doherty [Mon, 8 Dec 2014 11:21:35 +0000 (11:21 +0000)]
doc: add bsd license to link bonding svgs

The bsd license was missing from the link bonding svg files.

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
9 years agodoc: fix typos in distributor application
Reshma Pattan [Fri, 5 Dec 2014 16:08:19 +0000 (16:08 +0000)]
doc: fix typos in distributor application

corrected couple of typos in distributor application

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
9 years agoexamples/vm_power: fix check for null
Bruce Richardson [Tue, 16 Dec 2014 15:03:52 +0000 (15:03 +0000)]
examples/vm_power: fix check for null

The check for NULL is in the wrong position in the "if" error leg. The
pointer should be checked for NULL before checking what the value of
what the pointer points to is.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoexamples/vm_power: fix max length of unix socket path
Bruce Richardson [Tue, 16 Dec 2014 15:03:51 +0000 (15:03 +0000)]
examples/vm_power: fix max length of unix socket path

The length of the path to a unix socket is not PATH_MAX but instead is
UNIX_PATH_MAX which is generally just over 100 bytes in size. It's not
actually defined in sys/un.h on linux - despite the man page referencing
it, so calculate the size in the case where it's not defined.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoexamples/ip_pipeline: fix memory allocation check
Bruce Richardson [Fri, 12 Dec 2014 12:24:04 +0000 (12:24 +0000)]
examples/ip_pipeline: fix memory allocation check

Static analysis shows that once instance of rte_zmalloc is missing
a return value check in the code. This is fixed by adding a return
value check. The malloc call itself is moved to earlier in the function
so that no work is done unless all memory allocation requests have
succeeded - thereby removing the need for rollback on error.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agoexamples/l3fwd-acl: fix possible memory leak
Konstantin Ananyev [Tue, 16 Dec 2014 17:05:08 +0000 (17:05 +0000)]
examples/l3fwd-acl: fix possible memory leak

At error app_acl_init() can return without freeing dynamically allocated memory.
Not really a big problem, as if app_acl_init() fails,
then application would terminate immediately anyway.
Though it is a good coding practise to make a function to cleanup after itself.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoapp/test: check for mbuf allocation failure
Bruce Richardson [Tue, 16 Dec 2014 15:03:50 +0000 (15:03 +0000)]
app/test: check for mbuf allocation failure

If mbuf allocation failed for whatever reason, we would get a NULL
pointer exception in test_table_acl.c:test_pipeline_single_filter test
case.
We fix this by causing an early break out of the application loop. If we
quit the test immediately we would leak any existing allocated mbufs,
but by breaking instead, we allow the test to continue and clean up the
mbufs already in the pipeline, while still having a test failure as the
mbuf counts should not match.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoapp/test: fix crash after null check
Bruce Richardson [Tue, 16 Dec 2014 15:03:49 +0000 (15:03 +0000)]
app/test: fix crash after null check

In the kvargs test cases, we were checking for errors by checking if the
returned pointer value was NULL. In the error handling, we then tried to
free back the NULL pointer, which would cause a crash.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoapp/test: fix multi-process when device is bound to uio
Pablo de Lara [Thu, 11 Dec 2014 13:50:35 +0000 (13:50 +0000)]
app/test: fix multi-process when device is bound to uio

Since commit a155d4301 "support link bonding device initialization",
EAL probes drivers to the PCI devices in rte_eal_init,
then PCI resources are mapped if a device
is bound to igb_uio driver, for instance.
Therefore, test app probes all the devices and multiprocess unit test
tries to map resources twice in the secondary processes, and test fails,
caused by RTE_PCI_DRV_NEEDED_MAPPING flag in dummy pci driver my_driver2.

Test is fixed by setting the driver flags to 0.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agoapp/testpmd: limit port mask bits to configured maximum
Bruce Richardson [Tue, 16 Dec 2014 14:39:44 +0000 (14:39 +0000)]
app/testpmd: limit port mask bits to configured maximum

The port mask parsing in testpmd allowed up to 64 bits to be processed,
even if RTE_MAX_ETHPORTS is set to a max of 32. Fix this by only
processing up to min(RTE_MAX_ETHPORTS,64) bits of the mask.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agoaf_packet: fix crash on initialization failure
Bruce Richardson [Tue, 16 Dec 2014 16:30:22 +0000 (16:30 +0000)]
af_packet: fix crash on initialization failure

The cleanup code on error checks for *internals being NULL only after
using the pointer to perform other cleanup. Fix this by moving the
clean-up based on the pointer inside the check for NULL.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agovmxnet3: fix default Tx configuration
Pablo de Lara [Thu, 11 Dec 2014 21:18:40 +0000 (21:18 +0000)]
vmxnet3: fix default Tx configuration

Since commit fbde27f19ab8f "get default Rx/Tx configuration from dev info",
a default RX/TX configuration can be used for all PMDs.
In case of vmxnet3, the whole structure was zeroed and not filled out.
The PMD does not support multi segments or offload functions,
so txq_flags should have those flags set.

Test report: http://dpdk.org/ml/archives/dev/2014-December/009933.html

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Tested-by: Xiaonan Zhang <xiaonanx.zhang@intel.com>
9 years agoi40e: workaround for X710 performance
Helin Zhang [Tue, 16 Dec 2014 08:23:20 +0000 (16:23 +0800)]
i40e: workaround for X710 performance

On X710, performance number is far from the expectation on recent
firmware versions. The fix for this issue may not be integrated in
the following firmware version. So the workaround in software driver
is needed. It needs to modify the initial values of 3 internal only
registers. Note that the workaround can be removed when it is fixed
in firmware in the future.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
9 years agoixgbe: support X540 VF
Stephen Hemminger [Tue, 9 Dec 2014 16:37:24 +0000 (08:37 -0800)]
ixgbe: support X540 VF

Add missing setup for X540 MAC type when setting up VF.
Additional check exists in Linux driver but not in DPDK.

Signed-off-by: Bill Hong <bhong@brocade.com>
Signed-off-by: Stephen Hemminger <shemming@brocade.com>
9 years agoixgbe: fix multi-process support
Bruce Richardson [Fri, 5 Dec 2014 13:46:22 +0000 (13:46 +0000)]
ixgbe: fix multi-process support

When using multiple processes, the TX function used in all processes
should be the same, otherwise the secondary processes cannot transmit
more than tx-ring-size - 1 packets.
To achieve this, we extract out the code to select the ixgbe TX function
to be used into a separate function inside the ixgbe driver, and call
that from a secondary process when it is attaching to an
already-configured NIC.

Testing with symmetric MP app shows that we are able to RX and TX from
both primary and secondary processes once this patch is applied.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
9 years agoixgbe: fix array overflow in vector Rx
Bruce Richardson [Tue, 16 Dec 2014 16:30:23 +0000 (16:30 +0000)]
ixgbe: fix array overflow in vector Rx

Switch the order of the conditions in a while loop, so we check the
range of "i" against the max, before using it to index into the array.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoigb_uio: fix build with kernel 3.18
Shu Shen [Thu, 11 Dec 2014 19:33:23 +0000 (11:33 -0800)]
igb_uio: fix build with kernel 3.18

This patch fixes build failing with undefined symbol _PAGE_IOMAP with
kernel 3.18.

The Xen-specific _PAGE_IOMAP PTE flag was removed in kernel 3.18 and
could be used for other purpose in future. This patch ensures that
_PAGE_IOMAP flag is only used for kernels before 3.18.

Signed-off-by: Shu Shen <shu.shen@radisys.com>
Acked-by: Jincheng Miao <jmiao@redhat.com>
9 years agoring: fix return type in enqueue and dequeue burst functions
Pablo de Lara [Mon, 15 Dec 2014 13:41:46 +0000 (13:41 +0000)]
ring: fix return type in enqueue and dequeue burst functions

Enqueue and dequeue burst functions always return a positive
value (including 0), so return type should be unsigned,
instead of int.

Fixed also API doc for one of the functions.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agonet: fix IPv6 checksum
Konstantin Ananyev [Thu, 11 Dec 2014 11:49:42 +0000 (11:49 +0000)]
net: fix IPv6 checksum

For rte_ipv6_phdr_cksum() gcc 4.8.* with "-O3" not always generates
correct code.
Sometimes it 'forgets' to put len and proto fields of psd_header on the stack.
To overcome that problem and speedup things a bit, refactored rte_raw_cksum()
by splitting ipv6 pseudo-header csum calculation into 3 phases:
1. calc sum for src & dst addresses
2. add sum for proto & len.
3. finalise sum
That makes gcc to generate valid code and helps to avoid any copying.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agocfgfile: fix read of empty file
Bruce Richardson [Tue, 16 Dec 2014 15:03:53 +0000 (15:03 +0000)]
cfgfile: fix read of empty file

If the file to be read by the cfgfile is empty, i.e. no configuration
data, but possibly comments present, the cfgfile should not mark the
last processed section (curr_section) as having N entries, since there
is no last processed section.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoeal: use safe snprintf to print version
Bruce Richardson [Tue, 16 Dec 2014 16:30:24 +0000 (16:30 +0000)]
eal: use safe snprintf to print version

When printing the version string to a local variable, use snprintf for
safety over sprintf. This is general good practice even if the values
to print are all hard-coded.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoeal: fix unused value warning in memcpy macro
Pawel Wodkowski [Mon, 15 Dec 2014 16:55:02 +0000 (16:55 +0000)]
eal: fix unused value warning in memcpy macro

GCC 4.5.1 from SUSE throws this error:
lib/librte_pmd_enic/enic_main.c:862:2: error: value computed is not used

This change use statements in expressions C extension provided by gcc to avoid
'value computed is not used' warning/error when size is not known at compile
time.

Reported-by: Michael Qiu <michael.qiu@intel.com>
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
[Thomas: apply same fix to ppc_64]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agomk: fix link of combined shared library using CC
Sergio Gonzalez Monroy [Tue, 28 Oct 2014 15:48:49 +0000 (15:48 +0000)]
mk: fix link of combined shared library using CC

If we set EXTRA_CFLAGS=-O0, build fails with following error:
/usr/bin/ld: test: hidden symbol `mknod' in /usr/lib64/libc_nonshared.a(mknod.oS) is referenced by DSO

Fix: link combined shared lib using CC if LINK_USING_CC is enabled.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
[Thomas: remove change to rte.lib.mk]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agomk: fix link to combined library
Hiroshi Shimamoto [Thu, 11 Dec 2014 02:54:32 +0000 (02:54 +0000)]
mk: fix link to combined library

The application should be linked to the single combined library in the
condition that both of CONFIG_RTE_BUILD_COMBINE_LIB and
CONFIG_RTE_BUILD_SHARED_LIB are enabled.

The current makefile generates an application that links to each library.
This patch fixes to link the single library.

Before
$ ldd x86_64-ivshmem-linuxapp-gcc/app/test
linux-vdso.so.1 =>  (0x00007fff232a1000)
librte_distributor.so => not found
librte_kni.so => not found
librte_ivshmem.so => not found
librte_pipeline.so => not found
librte_table.so => not found
librte_port.so => not found
librte_timer.so => not found
librte_hash.so => not found
librte_lpm.so => not found
librte_power.so => not found
librte_acl.so => not found
librte_meter.so => not found
librte_sched.so => not found
libm.so.6 => /lib64/libm.so.6 (0x00007fc638020000)
librt.so.1 => /lib64/librt.so.1 (0x00007fc637e18000)
librte_kvargs.so => not found
librte_mbuf.so => not found
librte_ip_frag.so => not found
libethdev.so => not found
librte_malloc.so => not found
librte_mempool.so => not found
librte_ring.so => not found
librte_eal.so => not found
librte_cmdline.so => not found
librte_cfgfile.so => not found
librte_pmd_bond.so => not found
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fc637bfe000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fc6379fa000)
libintel_dpdk.so => not found
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc6377dd000)
libc.so.6 => /lib64/libc.so.6 (0x00007fc63741c000)
/lib64/ld-linux-x86-64.so.2 (0x00007fc638330000)

After
$ ldd x86_64-ivshmem-linuxapp-gcc/app/test
linux-vdso.so.1 =>  (0x00007fffb79fe000)
librt.so.1 => /lib64/librt.so.1 (0x00007f0d8a971000)
libm.so.6 => /lib64/libm.so.6 (0x00007f0d8a66f000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f0d8a458000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f0d8a254000)
libintel_dpdk.so => not found
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f0d8a037000)
libc.so.6 => /lib64/libc.so.6 (0x00007f0d89c76000)
/lib64/ld-linux-x86-64.so.2 (0x00007f0d8ab82000)

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Reviewed-by: Hayato Momma <h-momma@ce.jp.nec.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agomk: fix build with shared pcap pmd
Thomas Monjalon [Mon, 15 Dec 2014 22:44:49 +0000 (23:44 +0100)]
mk: fix build with shared pcap pmd

Some applications doesn't have the pcap link flag
when shared libraries are enabled.
Indeed in such case, pcap PMD must not be linked but pcap library should.

Actually -lpcap is always needed if pcap PMD is used,
and -lrte_pmd_pcap must be set only with static PMD library.
So the flags -lrte_pmd_pcap and -lpcap are enabled separately.

Workarounds in test-pmd/ and test-pipeline/ can be removed.

Reported-by: Stepan Sojka <stepan.sojka@adaptivemobile.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agoversion: 1.8.0-rc4
Thomas Monjalon [Thu, 11 Dec 2014 00:42:52 +0000 (01:42 +0100)]
version: 1.8.0-rc4

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoapp/test: fix memory needs
Pablo de Lara [Tue, 9 Dec 2014 10:11:12 +0000 (10:11 +0000)]
app/test: fix memory needs

Since commit b91c67e5a693211862aa7dc3b78630b4e856c2af,
maximum number of cores is 128, which has increase
the total memory necessary for a rte_mempool structure,
as the per-lcore local cache has been doubled in size.
Therefore, eal_flags unit test was broken since it needed
to use more hugepages.

Increased memory to 18MB, as that is the actual minimum memory necessary
(depending on the physical memory segments, DPDK may need less memory)

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agoexamples/l3fwd-vf: fix race condition
Daniel Mrzyglod [Tue, 8 Jul 2014 11:16:24 +0000 (12:16 +0100)]
examples/l3fwd-vf: fix race condition

When the routing is through the same queue, the app crashed.

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agoexamples/vhost: fix hard forward of jumbo frames
Ouyang Changchun [Wed, 10 Dec 2014 12:11:47 +0000 (20:11 +0800)]
examples/vhost: fix hard forward of jumbo frames

Search the right segment to increase its data length, rather than
wrongly early return and exit the tx function, which leads to drop all jumbo frame packets
when vm2vm is in hard forward mode.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
9 years agoexamples/vhost: increase maximum queue number
Huawei Xie [Tue, 9 Dec 2014 18:49:44 +0000 (02:49 +0800)]
examples/vhost: increase maximum queue number

Increase MAX_QUEUES from 256 to 512.

In vhost example, MAX_QUEUES macro should be the maximum possible queue number of the port.
Theoretically we should only set up the queues that are used, i.e., first rx queue of each pool, or
at most queues from 0 to MAX_QUEUES. Before we revise the implementation and are certain all NICs support
this well, add a remind message to user.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
9 years agoi40e: fix RSS RETA query
Helin Zhang [Wed, 10 Dec 2014 03:10:16 +0000 (11:10 +0800)]
i40e: fix RSS RETA query

There is a bug in querying reta, of storing the data to the correct entry.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
9 years agoenic: fix build with gcc 4.7.2
Helin Zhang [Tue, 9 Dec 2014 08:56:10 +0000 (16:56 +0800)]
enic: fix build with gcc 4.7.2

Compile warnings/errors was found on gcc 4.7.2 as follows. Variables
was reported of being used but uninitialized. Assigning an initial
value to it is needed.

lib/librte_pmd_enic/vnic/vnic_dev.c: In function vnic_dev_get_mac_addr:
lib/librte_pmd_enic/vnic/vnic_dev.c:393:16: error: a1 may be used uninitialized
in this function [-Werror=uninitialized]
lib/librte_pmd_enic/vnic/vnic_dev.c:629:10: note: a1 was declared here
lib/librte_pmd_enic/vnic/vnic_dev.c: In function vnic_dev_set_mac_addr:
lib/librte_pmd_enic/vnic/vnic_dev.c:393:16: error: a1 may be used uninitialized
in this function [-Werror=uninitialized]
lib/librte_pmd_enic/vnic/vnic_dev.c:980:10: note: a1 was declared here

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agobond: fix mac assignment to slaves
Declan Doherty [Mon, 8 Dec 2014 11:19:32 +0000 (11:19 +0000)]
bond: fix mac assignment to slaves

Adding call to mac_address_slaves_update from the lsc handler when the
first slave become active to propagate any mac changes made while
devices are inactive

Changed removing slave logic to use memmove instead of memcpy to move
data within the same array, as this was corrupting the slave array.

Adding unit test to cover failing assignment scenarios

Test report: http://dpdk.org/ml/archives/dev/2014-December/009623.html

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Tested-by: SunX Jiajia <sunx.jiajia@intel.com>
9 years agoxen: fix build with kernel 3.18
Jincheng Miao [Wed, 10 Dec 2014 13:04:53 +0000 (21:04 +0800)]
xen: fix build with kernel 3.18

From upstream kernel commit 3db2e9cd, strict_strto* serial functions
are removed. So that we should directly used kstrtoul instead.

Add xen_dom0/compat.h to be compatible with older kernel.

Signed-off-by: Jincheng Miao <jmiao@redhat.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agokni: fix build with kernel 3.18
Jincheng Miao [Wed, 10 Dec 2014 03:33:02 +0000 (11:33 +0800)]
kni: fix build with kernel 3.18

From upstream kernel commit 3db2e9cd, strict_strto* serial functions
are removed. So that we should directly used kstrtoul instead.

Add kni/compat.h to be compatible with older kernel.

Signed-off-by: Jincheng Miao <jmiao@redhat.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoigb_uio: fix build with kernel 3.18
Jincheng Miao [Wed, 10 Dec 2014 03:33:01 +0000 (11:33 +0800)]
igb_uio: fix build with kernel 3.18

From upstream kernel commit 3db2e9cd, strict_strto* serial functions
are removed. So that we should directly used kstrtoul instead.

kstrtoul exists from RHEL6.4, so for compatibility with old kernel and RHEL,
add some logic to igb_uio/compat.h.

Signed-off-by: Jincheng Miao <jmiao@redhat.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoigb_uio: fix build with long term kernel and RHEL
Jincheng Miao [Wed, 10 Dec 2014 03:33:00 +0000 (11:33 +0800)]
igb_uio: fix build with long term kernel and RHEL

Function pci_num_vf() is introduced from upstream linux-2.6.34. So
this patch make compatible with longterm kernel linux-2.6.32.63.

For RHEL, function pci_num_vf() begins from RHEL5 update9. And
it is stub-defined when CONFIG_PCI_IOV is not enabled.

So dropped the CONFIG_PCI_IOV checking of commit 11ba0426.

For other distro like RHEL behaved to pci_num_vf(), we could simply
append following condition macro:
(!(defined(OTHER_RELEASE_CODE) && \
 OTHER_RELEASE_CODE >= OTHER_RELEASE_VERSION(X, Y)))

Signed-off-by: Jincheng Miao <jmiao@redhat.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoethdev: fix build with libc ip6 header
Mark Kavanagh [Tue, 9 Dec 2014 17:32:08 +0000 (17:32 +0000)]
ethdev: fix build with libc ip6 header

The name of the rte_eth_fdir_flow's rte_eth_ipv6_flow attribute,
'ip6_flow', clashes with a macro defined in
/usr/include/netinet/ip6.h, such that when DPDK is linked with an
application that uses the afforementioned header, the macro is
expanded within the DPDK struct, causing a compilation error.

Rename the relevant attribute in DPDK to resolve this.

Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agonet: fix build with gcc 4.4.7 and strict aliasing
Michael Qiu [Thu, 4 Dec 2014 04:16:04 +0000 (12:16 +0800)]
net: fix build with gcc 4.4.7 and strict aliasing

include/rte_ip.h:161: error: dereferencing pointer ‘u16’
        does break strict-aliasing rules
include/rte_ip.h:157: note: initialized from here
        ...

The root cause is that, compile enable strict aliasing by default,
while in function rte_raw_cksum() try to convert 'const char *'
to 'const uint16_t *'.

This workaround is to solve the compile issue of GCC strict-aliasing (two
different type pointers should not be point to the same memory address).

For GCC 4.4.7 it will definitely occurs if  flags "-fstrict-aliasing"
and "-Wall" used.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
[Thomas: add workaround comment]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoeal: fix build with icc
Michael Qiu [Wed, 10 Dec 2014 10:46:42 +0000 (18:46 +0800)]
eal: fix build with icc

lib/librte_eal/linuxapp/eal/eal.c(461): error #2259: non-pointer
conversion from "long long" to "void *" may lose significant bits
   RTE_PTR_ALIGN_CEIL((uintptr_t)addr, RTE_PGSIZE_16M);

The root cause is that "RTE_PGSIZE_16M" is defined as unsigned long long.
But in i686 platform "void *" is 32-bit.
It is safe to cast to size_t and make it works in both 32 & 64-bit
platform.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoeal: fix build for 32-bit system
Michael Qiu [Wed, 10 Dec 2014 10:46:41 +0000 (18:46 +0800)]
eal: fix build for 32-bit system

lib/librte_eal/linuxapp/eal/eal_memory.c:324:4: error: comparison
is always false due to limited range of data type [-Werror=type-limits]
    || (hugepage_sz == RTE_PGSIZE_16G)) {
    ^

This was introuduced by commit b77b5639:
        mem: add huge page sizes for IBM Power

The root cause is that size_t is 32-bit in i686 platform,
but RTE_PGSIZE_16M and RTE_PGSIZE_16G are always 64-bit.

Force hugepage_sz to always 64-bit to avoid this issue.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Suggested-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agolib: fix cache alignment of structures
Jia Yu [Fri, 7 Nov 2014 17:28:09 +0000 (09:28 -0800)]
lib: fix cache alignment of structures

Include rte_memory.h for lib files that use __rte_cache_aligned
attribute.

Consider the following code:

struct per_core_foo {
...
} __rte_cache_aligned;

struct global_foo {
struct per_core_foo foo[RTE_MAX_CORE];
};

If __rte_cache_aligned is not defined (rte_memory.h is not included),
the code compiles but the structure is not aligned... it defines the
structure and creates a global variable called __rte_cache_aligned.
And this can lead to really bad things if this code is in a .h that
is included by files that may or may not include rte_memory.h

Signed-off-by: Jia Yu <jyu@vmware.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agomk: fix build 32-bits shared libraries with 64-bits system
Sergio Gonzalez Monroy [Wed, 22 Oct 2014 16:36:22 +0000 (17:36 +0100)]
mk: fix build 32-bits shared libraries with 64-bits system

Incompatible libraries error when building shared libraries for 32bits on
a 64bits system.
Fix issue by passing CPU_CFLAGS to CC when LINK_USING_CC is enabled.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agomk: fix build shared libraries
Hiroshi Shimamoto [Wed, 3 Dec 2014 23:33:54 +0000 (23:33 +0000)]
mk: fix build shared libraries

Only CPU_LDFLAGS is used in mk/rte.sharelib.mk.
It should be LDFLAGS to build the library with correct linkage options.

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Reviewed-by: Hayato Momma <h-momma@ce.jp.nec.com>
9 years agoversion: 1.8.0-rc3
Thomas Monjalon [Sat, 6 Dec 2014 10:24:04 +0000 (11:24 +0100)]
version: 1.8.0-rc3

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoexamples/vhost: use factorized default Rx/Tx configuration
Huawei Xie [Wed, 12 Nov 2014 22:34:07 +0000 (06:34 +0800)]
examples/vhost: use factorized default Rx/Tx configuration

Refer to Pablo's commit (81f7ecd934372fc):
    "use factorized default Rx/Tx configuration

    For apps that were using default rte_eth_rxconf and rte_eth_txconf
    structures, these have been removed and now they are obtained by
    calling rte_eth_dev_info_get, just before setting up RX/TX queues."

Move zero copy's deferred start set up ahead.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
9 years agoexamples/vhost: support new VMDQ API for i40e
Huawei Xie [Wed, 12 Nov 2014 22:34:06 +0000 (06:34 +0800)]
examples/vhost: support new VMDQ API for i40e

In Niantic, if VMDQ mode is set, all queues are allocated to VMDQ in DPDK.
In I40E, only configured part of continous queues are allocated to VMDQ.
The rte_eth_dev_info structure is extended to provide VMDQ queue base,
queue number, and VMDQ pool base information.
This patch support the new VMDQ API in vhost example.

FIXME in PMD:
 * added mac address will be flushed at rte_eth_dev_start.
 * we don't support selectively setting up queues well.

Test report: http://dpdk.org/ml/archives/dev/2014-December/009427.html

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Tested-by: Jingguo Fu <jingguox.fu@intel.com>
9 years agoi40e: use macros for vlan filtering registers
Huawei Xie [Tue, 2 Dec 2014 09:02:06 +0000 (17:02 +0800)]
i40e: use macros for vlan filtering registers

Add two macros I40E_VFTA_IDX and I40E_VFTA_BIT for vlan filter search and set.
Add vlan_id check in vlan filter search and set function.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
9 years agoi40e: fix vlan filtering
Huawei Xie [Tue, 2 Dec 2014 09:02:05 +0000 (17:02 +0800)]
i40e: fix vlan filtering

">> 5" rather than ">> 4"

vlan id is a 12 bit value.
VFTA is 128 x 32 bit array (128 double word array) which could store 2^12 vlan bits.
Each bit represents whether corresponding vlan tag is set in the VSI.
Use high 7 bits as the index for the double word array.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
9 years agoixgbe: do not override buffer length
Konstantin Ananyev [Fri, 5 Dec 2014 15:20:34 +0000 (15:20 +0000)]
ixgbe: do not override buffer length

The template mbuf_initializer is hard coded with a buflen which
might have been set differently by the application at the time of
mbuf pool creation.

- move buf_len fields out of rearm_data marker.
- make ixgbe_recv_pkts_vec() not touch buf_len field at all
(as all other RX functions behave).

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Jean-Mickael Guerin <jean-mickael.guerin@6wind.com>
9 years agoixgbe: fix setup of mbuf initializer template
Jean-Mickael Guerin [Thu, 4 Dec 2014 14:26:20 +0000 (15:26 +0100)]
ixgbe: fix setup of mbuf initializer template

Add a compiler barrier to make sure all fields covered by
the marker rearm_data are assigned before the read.

Fixes: 0ff3324da2 ("ixgbe: rework vector pmd following mbuf changes")

Signed-off-by: Jean-Mickael Guerin <jean-mickael.guerin@6wind.com>
Acked-by: David Marchand <david.marchand@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoenic: fix uninitialized variable
Bruce Richardson [Fri, 5 Dec 2014 15:57:12 +0000 (15:57 +0000)]
enic: fix uninitialized variable

The variable notify_pa is only initialized inside one branch of
an if statement, triggering a compiler error with clang 3.3 on FreeBSD.

  CC vnic/vnic_dev.o
lib/librte_pmd_enic/vnic/vnic_dev.c:777:6: fatal error: variable 'notify_pa'
      is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
        if (!vnic_dev_in_reset(vdev)) {

Fix this issue by adding "= 0" to the variable definition.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoenic: fix initialization error with clang
Bruce Richardson [Fri, 5 Dec 2014 15:57:11 +0000 (15:57 +0000)]
enic: fix initialization error with clang

This patch fixes the following compiler error raised by clang 3.3
on FreeBSD 10:

  CC enic_clsf.o
lib/librte_pmd_enic/enic_clsf.c:99:25: fatal error: missing field 'u' initializer [-Wmissing-field-initializers]
        struct filter fltr = {0};

It fixes it by changing the initializer to set a named field to zero,
thereby automatically setting the rest of the unnamed fields also to
zero.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoaf_packet: add compile-time checks for kernel-specific options
John W. Linville [Thu, 4 Dec 2014 21:42:05 +0000 (16:42 -0500)]
af_packet: add compile-time checks for kernel-specific options

This allows the PMD to compile with kernels that don't support the
options in question.  The "#if defined(...)" lines are a bit ugly,
but I don't know of any better way to accomplish the task.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agodoc: add freebsd ports
Bruce Richardson [Mon, 24 Nov 2014 15:50:39 +0000 (15:50 +0000)]
doc: add freebsd ports

Since the DPDK is now part of the BSD ports collection, we should
recommend installing from ports as the best way to get it up and
running.
In order to achieve this, while still keeping the document readable, the
chapter on system requirements has been moved to instead be a section
within the chapter on compiling the DPDK outside of the ports
collection. This move is necessary, since it covered a lot of detail on
installing other ports required to build DPDK. These steps are not
needed when installing DPDK itself from ports.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
9 years agodoc: adjust line lengths in freebsd guide
Bruce Richardson [Mon, 24 Nov 2014 15:48:56 +0000 (15:48 +0000)]
doc: adjust line lengths in freebsd guide

The FreeBSD GSG rst files had very inconsistent line lengths for text
within paragraph blocks. Sometimes a line would be very short, while often
lines would be quite long.
This patch adjusts the formatting of the rst files so that lines break
at approx the 80-character mark, as is standard in the DPDK source code.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
9 years agodoc: auto-generate date in guides
Bruce Richardson [Mon, 24 Nov 2014 14:23:52 +0000 (14:23 +0000)]
doc: auto-generate date in guides

The index.html file for each of the "guide" docs had a hard-coded
date value in them of June 2014. Rather than update each of these
for each revision, just use the |today| directive to insert the date
at which the document was generated.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
9 years agodoc: fix testpmd guide
Pablo de Lara [Mon, 1 Dec 2014 11:40:48 +0000 (11:40 +0000)]
doc: fix testpmd guide

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
9 years agodoc: reorder testpmd commands
Pablo de Lara [Mon, 1 Dec 2014 11:40:47 +0000 (11:40 +0000)]
doc: reorder testpmd commands

Moved commands in testpmd UG to set queue rates
to match order in testpmd command help.

Created new section "Filters" to match that
same section in testpmd UG, and moved all
commands related to it there.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
9 years agodoc: fix testpmd commands
Pablo de Lara [Mon, 1 Dec 2014 11:40:46 +0000 (11:40 +0000)]
doc: fix testpmd commands

tx_checksum set function does not use bitmask anymore, but strings

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>