dpdk.git
8 years agoexamples/ip_pipeline: fix buffer overrun
Fan Zhang [Fri, 11 Dec 2015 11:29:10 +0000 (11:29 +0000)]
examples/ip_pipeline: fix buffer overrun

Coverity issue: 107127
Fixes: 7f64b9c004aa ("examples/ip_pipeline: rework config file syntax")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agoexamples/ip_pipeline: fix logically dead node
Fan Zhang [Fri, 11 Dec 2015 11:29:09 +0000 (11:29 +0000)]
examples/ip_pipeline: fix logically dead node

Coverity issue: 107109
Fixes: 7122d30131ad ("examples/ip_pipeline: rework flow classification pipeline")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agoexamples/ip_pipeline: fix copy-paste error
Fan Zhang [Fri, 11 Dec 2015 11:29:08 +0000 (11:29 +0000)]
examples/ip_pipeline: fix copy-paste error

Coverity issue: 107104
Fixes: 7f64b9c004aa ("examples/ip_pipeline: rework config file syntax")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agoexamples/ip_pipeline: fix buffer copy size
Fan Zhang [Fri, 11 Dec 2015 17:19:16 +0000 (17:19 +0000)]
examples/ip_pipeline: fix buffer copy size

Coverity issue: 107133
Fixes: eb32fe7c5574 ("examples/ip_pipeline: rework initialization parameters")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agoexamples/ip_pipeline: fix buffer size warning
Fan Zhang [Fri, 11 Dec 2015 11:29:06 +0000 (11:29 +0000)]
examples/ip_pipeline: fix buffer size warning

Coverity issue: 107102
Fixes: 7f64b9c004aa ("examples/ip_pipeline: rework config file syntax")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agovhost: fix logically dead code
Huawei Xie [Thu, 10 Dec 2015 17:57:20 +0000 (01:57 +0800)]
vhost: fix logically dead code

CID 107107 (#1 of 1): Logically dead code
Fixes: af4f2c5feb2e ("vhost: fix code style")

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agovhost: fix missed unlock
Huawei Xie [Thu, 10 Dec 2015 17:57:19 +0000 (01:57 +0800)]
vhost: fix missed unlock

CID 107113 (#1 of 1): Missing unlock (LOCK)5. missing_unlock: Returning
without unlocking pfdset->fd_mutex.
Fixes: fbf7e07ca142 ("vhost: add select based event driven processing")

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agovhost: fix missed break in switch
Huawei Xie [Thu, 10 Dec 2015 17:57:18 +0000 (01:57 +0800)]
vhost: fix missed break in switch

CID 107114 (#1 of 1): Missing break in switch
Fixes: 8f972312b8f4 ("vhost: support vhost-user")

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agovhost: fix out-of-bounds read
Huawei Xie [Thu, 10 Dec 2015 17:57:16 +0000 (01:57 +0800)]
vhost: fix out-of-bounds read

CID 107126 (#1 OF 1): Out-of-bounds read
Fixes: 8f972312b8f4 ("vhost: support vhost-user")

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agobnx2x: add maintainers
Rasesh Mody [Fri, 11 Dec 2015 06:36:41 +0000 (22:36 -0800)]
bnx2x: add maintainers

Add maintainers for BNX2X PMD.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agobnx2x: add version
Rasesh Mody [Fri, 11 Dec 2015 06:36:42 +0000 (22:36 -0800)]
bnx2x: add version

Add BNX2X PMD version, print it as part of adapter info.
Adjusted print adapter info output formatting.

This patch versions BNX2X PMD at 1.0.0.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agobnx2x: fix 32-bit build
Rasesh Mody [Fri, 11 Dec 2015 06:36:40 +0000 (22:36 -0800)]
bnx2x: fix 32-bit build

Compile tested.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agobnx2x: fix build on FreeBSD
Rasesh Mody [Fri, 11 Dec 2015 06:36:39 +0000 (22:36 -0800)]
bnx2x: fix build on FreeBSD

Compile tested.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agobnx2x: add license file
Rasesh Mody [Fri, 11 Dec 2015 06:36:38 +0000 (22:36 -0800)]
bnx2x: add license file

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agobnx2x: add guide
Rasesh Mody [Fri, 11 Dec 2015 06:36:37 +0000 (22:36 -0800)]
bnx2x: add guide

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agobnx2x: add periodic debug option
Harish Patil [Fri, 11 Dec 2015 06:36:36 +0000 (22:36 -0800)]
bnx2x: add periodic debug option

The periodic debug option is used to collect periodic
events like statistics, register access etc and won't
interfere with user-level messages.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agobnx2x: fix build with clang
Harish Patil [Fri, 11 Dec 2015 06:36:35 +0000 (22:36 -0800)]
bnx2x: fix build with clang

Fix for the following clang build error:
drivers/net/bnx2x/elink.c:10384:41: error: shifting a
      negative signed value is undefined [-Werror,-Wshift-negative-value]
                vars->eee_status &= ~SHMEM_EEE_1G_ADV <<
                                    ~~~~~~~~~~~~~~~~~ ^

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
8 years agobnx2x: update VF to support newer PF drivers
Harish Patil [Fri, 11 Dec 2015 06:36:34 +0000 (22:36 -0800)]
bnx2x: update VF to support newer PF drivers

SR-IOV is supported using bnx2x poll mode driver running as VF driver and
native linux driver running as PF (in host/hypervisor). There is no issue
while running with the PF driver which is at the base version as that of
PMD. However, there is a compatibility issue between newer out-of-box PF
drivers with older VF driver. So the newer VFs would also need to send
BNX2X_VF_TLV_PHYS_PORT_ID (among other TLVs) to differentiate between
newer and older VFs.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
8 years agobnx2x: skip Rx producer refresh when no packet
Rasesh Mody [Fri, 11 Dec 2015 18:31:54 +0000 (10:31 -0800)]
bnx2x: skip Rx producer refresh when no packet

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agobnx2x: fix Tx error check
Rasesh Mody [Fri, 11 Dec 2015 18:31:53 +0000 (10:31 -0800)]
bnx2x: fix Tx error check

Correct the error check in PMD transmit routine.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agobnx2x: fix restart
Chas Williams [Wed, 9 Dec 2015 22:11:04 +0000 (17:11 -0500)]
bnx2x: fix restart

If you stop and start the driver, the rx queue will have the previous
index values when programming the adapter.  Therefore, we should always
reset the queue indices when the rx ring is setup.  Note:  We need to
clear (write) the status block's completion queue index since it is
possibly in a read cache.

Tidy some init code to make it clearer what the defaults are.

Signed-off-by: Chas Williams <3chas3@gmail.com>
8 years agocxgbe: fix Rx queue setup error management
Rahul Lakkireddy [Fri, 11 Dec 2015 08:25:30 +0000 (13:55 +0530)]
cxgbe: fix Rx queue setup error management

When refilling freelists for the first time and if it fails, the rxq
is freed and returns ENOMEM. There is a check while freeing hardware rxq
to pass freelist context id if the freelist exists or 0xffff otherwise.
The error path is only reached if freelist exists. So, fix is to remove
the useless check for freelist existence.

Coverity issue: 107108
Fixes: 92c8a63223e5 ("cxgbe: add device configuration and Rx support")

Reported-by: John McNamara <john.mcnamara@intel.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agoxenvirt: fix build for 32-bit platform
Huawei Xie [Thu, 10 Dec 2015 15:15:58 +0000 (23:15 +0800)]
xenvirt: fix build for 32-bit platform

Reported-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
8 years agoeal/linux: fix Rx interrupt read error management
Cunming Liang [Fri, 11 Dec 2015 01:48:57 +0000 (09:48 +0800)]
eal/linux: fix Rx interrupt read error management

In eal_intr_proc_rxtx_intr, negative value may be used as argument to
a function expecting a positive value. If 'read' returns EAGAIN as
example, the bytes_read updates to a negative value which continue
be passed as argument for the next 'read'.

Coverity issue: 107115

Function read(fd, &buf, bytes_read) returns a negative number.
Assigning: signed variable bytes_read = read.
CID 107115 (#1 of 1): Argument cannot be negative
(NEGATIVE_RETURNS) bytes_read is passed to a parameter
that cannot be negative.
    bytes_read = read(fd, &buf, bytes_read);

Fixes: c9f3ec1a0f3f ("eal/linux: add Rx interrupt control function")

Signed-off-by: Cunming Liang <cunming.liang@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: David Marchand <david.marchand@6wind.com>
8 years agoexamples/netmap_compat: fix build on Suse 11
Michael Qiu [Fri, 11 Dec 2015 06:36:33 +0000 (14:36 +0800)]
examples/netmap_compat: fix build on Suse 11

 examples/netmap_compat/bridge/../lib/compat_netmap.c:880:41:
 error: ‘POLLRDNORM’ undeclared (first use in this function)

The root casue is POLLRDNORM is more-or-less nonstandard, and it
depends on macro "__USE_XOPEN".

In suse11 sp3, POLLRDNORM will not be defined because "__USE_XOPEN"
issue.

This patch add check if it is not defined, define it.

Fixes: 06371afe394d (examples/netmap_compat: import netmap compatibility example)

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
8 years agoexamples/performance-thread: fix return sign
Ian Betts [Sat, 12 Dec 2015 08:12:08 +0000 (08:12 +0000)]
examples/performance-thread: fix return sign

The patch fixes an inverted return value in the
cond_destroy and cond_init APIs of the pthread shim
example.

These APIs are now demonstrated in the sample app by
having the mutexes and condition variables
explicitly destroyed before the appplication terminates.

Fixes: 433ba6228f9a77a9b5f4 ("add pthread_shim app")

Signed-off-by: Ian Betts <ian.betts@intel.com>
8 years agoscripts: fix relpath.sh output when $prefix is set in environment
Panu Matilainen [Fri, 11 Dec 2015 12:44:23 +0000 (14:44 +0200)]
scripts: fix relpath.sh output when $prefix is set in environment

When relpath.sh is called from install target with prefix set, eg
"make install DESTDIR=/tmp/dpdk-root prefix=/usr", the prefix
from the environment leaks to relpath.sh internal helper variable and
causes incorrect symlinks to be generated in sdk $(targetdir):

   include -> /usr../../../include/dpdk
   lib -> /usr../../../lib

Initialize the local variable to empty to avoid side-effects from
environment.

Fixes: 6b62a72a70d0 ("mk: install a standard cutomizable tree")

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
8 years agombuf_offload: mark experimental state
Thomas Monjalon [Fri, 11 Dec 2015 23:26:24 +0000 (00:26 +0100)]
mbuf_offload: mark experimental state

Cryptodev was marked experimental and mbuf_offload depends on it.
The mbuf_offload library is one of the crypto area which requires
some discussions before having a stable API.

The experimental mark is also added to rte_cryptodev_configure()
to be sure one cannot miss it.

Fixes: 66874e55f550 ("cryptodev: mark experimental state")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoexamples/performance-thread: mark as experimental
Ian Betts [Thu, 10 Dec 2015 12:24:58 +0000 (12:24 +0000)]
examples/performance-thread: mark as experimental

This commit removes the performance thread example from
examples/Makefile, and marks the example as "experimental"
in the release note, and it its API headers files.

Signed-off-by: Ian Betts <ian.betts@intel.com>
8 years agoexamples/performance-thread: add pthread_shim app
Ian Betts [Tue, 8 Dec 2015 06:05:17 +0000 (06:05 +0000)]
examples/performance-thread: add pthread_shim app

This commit adds an example that illustrates how to implement
a pthread shim with the lthread subsystem included in the
performance thread example application.

Signed-off-by: Ian Betts <ian.betts@intel.com>
Acked-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
8 years agoexamples/performance-thread: add l3fwd-thread app
Ian Betts [Tue, 8 Dec 2015 06:05:16 +0000 (06:05 +0000)]
examples/performance-thread: add l3fwd-thread app

This commit adds an L3 forwarding application to the performace-thread
example.

Signed-off-by: Ian Betts <ian.betts@intel.com>
Acked-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
8 years agoexamples/performance-thread: add lthread subsystem
Ian Betts [Tue, 8 Dec 2015 06:05:15 +0000 (06:05 +0000)]
examples/performance-thread: add lthread subsystem

This commit adds the lightweight thread subsystem used by the
performance-thread sample applications.

Signed-off-by: Ian Betts <ian.betts@intel.com>
Acked-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
8 years agodoc: add guide for performance-thread example
Ian Betts [Tue, 8 Dec 2015 06:05:14 +0000 (06:05 +0000)]
doc: add guide for performance-thread example

This commit adds the sample application user guide for the
performance thread sample application.

Signed-off-by: Ian Betts <ian.betts@intel.com>
Acked-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
8 years agoexamples/vhost: reduce number of hugepages needed
Bernard Iremonger [Thu, 10 Dec 2015 15:49:17 +0000 (15:49 +0000)]
examples/vhost: reduce number of hugepages needed

Add #ifndef MAX_QUEUES to change MAX_QUEUES at compile time if needed.
Change MAX_QUEUES from 512 to 128 to reduce the number of hugepages
required by the vhost-switch program.

To change MAX_QUEUES add '-D MAX_QUEUES=512' to the EXTRA_CFLAGS variable,
before building the application.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoexample/ip_pipeline: fix config file parsing defect
Fan Zhang [Thu, 10 Dec 2015 12:19:19 +0000 (12:19 +0000)]
example/ip_pipeline: fix config file parsing defect

Coverity issue: 120143

Fixes: 7f64b9c004aa ("examples/ip_pipeline: rework config file syntax")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agoexamples/l2fwd-keepalive: fix integer overflow
Remy Horton [Thu, 10 Dec 2015 09:50:07 +0000 (09:50 +0000)]
examples/l2fwd-keepalive: fix integer overflow

Fix Coverity warning with potential 32-bit integer multiplication overflow
where final result is expected to be 64-bit.

>>> CID 120144 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)

Fixes: e64833f2273a ("examples/l2fwd-keepalive: add sample application")

Signed-off-by: Remy Horton <remy.horton@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agoexamples/ethtool: fix uninitialised variable
Remy Horton [Thu, 10 Dec 2015 09:50:06 +0000 (09:50 +0000)]
examples/ethtool: fix uninitialised variable

Fix Coverity warning with uninitialised field in structure being used.
Zero out all the other unused ones.

>>> CID 120413 (#1 of 1): Uninitialized scalar variable (UNINIT)

Fixes: bda68ab9d1e7 ("examples/ethtool: add user-space ethtool sample application")

Signed-off-by: Remy Horton <remy.horton@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agoapp/testpmd: swap MAC in IEEE1588 forwarding
Pablo de Lara [Thu, 10 Dec 2015 09:28:27 +0000 (09:28 +0000)]
app/testpmd: swap MAC in IEEE1588 forwarding

IEEE1588 forwarding mode uses same port to receive and transmit packets.
In this mode, the MAC address in the packets are not touched,
and therefore, packets could be sent with the same destination
MAC address as the MAC address of the port that is transmitting,
which causes the packet to be dropped in some NICs.

In order to avoid this scenario, MAC addresses are swapped
before packet is sent out.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agoaf_packet: set input port in mbuf
Pavel Krauz [Thu, 10 Dec 2015 10:25:05 +0000 (11:25 +0100)]
af_packet: set input port in mbuf

Fixes port number in mbuf structure when using with eth_af_packet

Signed-off-by: Pavel Krauz <pavel.krauz@anritsu.com>
8 years agoi40e: fix filtering with vlan input
Helin Zhang [Thu, 10 Dec 2015 10:44:22 +0000 (18:44 +0800)]
i40e: fix filtering with vlan input

It corrects the input set values to be set for vlan or
double vlan.

Fixes: 98f055707685 ("i40e: configure input fields for RSS or flow director")

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
8 years agovfio: support iommu group zero
Stephen Hemminger [Wed, 9 Dec 2015 17:55:56 +0000 (09:55 -0800)]
vfio: support iommu group zero

The current implementation of VFIO will not with the new no-IOMMU mode
in 4.4 kernel. The original code assumed that IOMMU group zero would
never be used. Group numbers are assigned starting at zero, and up
until now the group numbers came from the hardware which is likely
to use group 0 for system devices that are not used with DPDK.

The fix is to allow 0 as a valid group and rearrange code
to split the return value from the group value.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
8 years agoexamples/vhost: fix strict aliasing
Pablo de Lara [Wed, 9 Dec 2015 14:26:49 +0000 (14:26 +0000)]
examples/vhost: fix strict aliasing

Fixes following error on gcc 4.4.7:

examples/vhost/main.c: In function ‘new_device’:
rte_ring.h:740: error:
    dereferencing pointer ‘mbuf.486’ does break strict-aliasing rules
examples/vhost/main.c:1503: note: initialized from here
...
rte_ring.h:740: error:
    dereferencing pointer ‘({anonymous})’ does break strict-aliasing rules
examples/vhost/main.c:1804: note: initialized from here

Fixes: d19533e8 ("examples/vhost: copy old vhost example")

Reported-by: Qian Xu <qian.q.xu@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
8 years agoexamples/ip_pipeline: fix strict-aliasing
Michael Qiu [Wed, 9 Dec 2015 08:44:26 +0000 (16:44 +0800)]
examples/ip_pipeline: fix strict-aliasing

Compile ip_pipeline in CentOS 6.5 with kernel 2.6.32-431
GCC 4.4.7, will lead below error:

    pipeline_routing_be.c: In function ‘pipeline_routing_msg_req_arp_add_handler’:
    pipeline_routing_be.c:1817: error: dereferencing pointer ‘({anonymous})’
does break strict-aliasing rules

This because the code break strict-aliasing rule.
The patch solve this issue.

Fixes: 0ae7275810f1 (examples/ip_pipeline: add more functions to routing pipeline)

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
8 years agoexamples/ip_pipeline: fix build in old environments
Jasvinder Singh [Wed, 9 Dec 2015 11:12:53 +0000 (11:12 +0000)]
examples/ip_pipeline: fix build in old environments

This patch fixes build errors on linux kernels such as
SuSE 11-SP2/3(64 bits), etc.

Error Log:
error: implicit declaration of function 'WIFEXITED'
error: implicit declaration of function 'WEXITSTATUS'

Fixes: ed0b2d020159 ("examples/ip_pipeline: add more ports")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agoexamples/ip_pipeline: fix coverity warnings
Piotr Azarewicz [Wed, 9 Dec 2015 09:33:50 +0000 (10:33 +0100)]
examples/ip_pipeline: fix coverity warnings

The source and destination both are the arrays of cmdline_parse_ctx_t.
So the goal is to copy elements size of cmdline_parse_ctx_t not
cmdline_parse_ctx_t*.

CID 120412:  Code maintainability issues  (SIZEOF_MISMATCH)
Passing argument "&app->cmds[app->n_cmds]" of type "cmdline_parse_ctx_t *"
and argument "n_cmds * 8UL /* sizeof (cmdline_parse_ctx_t *) */"
to function "memcpy" is suspicious.
In this case, "sizeof (cmdline_parse_ctx_t *)" is equal to
"sizeof (cmdline_parse_ctx_t)", but this is not a portable assumption.

Coverity issue: 120412
Fixes: b4aee0fb9c6d ("examples/ip_pipeline: reconfigure thread binding dynamically")
Fixes: ea0908c4ab89 ("examples/ip_pipeline: add master pipeline")
Fixes: eb32fe7c5574 ("examples/ip_pipeline: rework initialization parameters")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agoexamples/ethtool: remove dead code
Stephen Hemminger [Tue, 8 Dec 2015 16:51:09 +0000 (08:51 -0800)]
examples/ethtool: remove dead code

Remove dead code, and print better return for other errors.

>>>     CID 120411:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach this statement: "return;".

Fixes: bda68ab9d1e7 ("examples/ethtool: add user-space ethtool sample application")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Remy Horton <remy.horton@intel.com>
8 years agovhost: do not stall if guest is slow
Stephen Hemminger [Tue, 8 Dec 2015 00:50:21 +0000 (16:50 -0800)]
vhost: do not stall if guest is slow

When guest is booting (or any othertime guest is busy) it is possible
for the small receive ring (256) to get full. If this happens the
vhost library should just return normally. It's current behavior
of logging just creates massive log spew/overflow which could even
act as a DoS attack against host.

Reported-by: Nathan Law <nlaw@brocade.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
8 years agovirtio: fix wrong queue index
Yuanhan Liu [Tue, 8 Dec 2015 03:05:12 +0000 (11:05 +0800)]
virtio: fix wrong queue index

We should provide VIRTIO_PCI_QUEUE_SEL with vq->vq_queue_idx,
but not vq->queue_id.

vq->queue_id is the queue id from rte_eth_rx/tx_queue_setup(),
which always starts from 0 no matter which queue it is. However,
for virtio, even number is for RX queue, and odd number is for
TX queue.

Fixes: 5382b188fb8a ("virtio: add queue release")

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
8 years agobnx2x: fix double init check
Chas Williams [Tue, 8 Dec 2015 14:48:24 +0000 (09:48 -0500)]
bnx2x: fix double init check

Check sc->state to prevent double init.
If the link is up, then the driver cannot be stopped and started
successfully.  Instead of checking the link status, use the driver's
state.

Signed-off-by: Chas Williams <3chas3@gmail.com>
8 years agohash: fix build on IBM POWER and ARM
Chao Zhu [Wed, 9 Dec 2015 04:11:47 +0000 (12:11 +0800)]
hash: fix build on IBM POWER and ARM

This patch fixes the compile errors caused by lacking of "size_t"
definition in rte_hash.h.
The compile error exists on IBM POWER and ARM.

The errors are like:
In file included from app/test/test_hash_scaling.c:35:0:
rte_hash.h:70:70: error: unknown type name ‘size_t’

Fixes: 95da2f8e9c61 ("hash: customize compare function")

Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
8 years agomk: fix install with minimal shell
Thomas Monjalon [Wed, 9 Dec 2015 07:58:11 +0000 (08:58 +0100)]
mk: fix install with minimal shell

Some shells like dash do not support the syntax {}:
{mk,scripts}: No such file or directory

Reported-by: Thiago Martins <thiagocmartinsc@gmail.com>
Reported-by: Piotr Bartosiewicz <piotr.bartosiewicz@atendesoftware.pl>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoversion: 2.2.0-rc3
Thomas Monjalon [Tue, 8 Dec 2015 01:44:21 +0000 (02:44 +0100)]
version: 2.2.0-rc3

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agovhost: reserve some space in structures
Yuanhan Liu [Thu, 3 Dec 2015 02:27:02 +0000 (10:27 +0800)]
vhost: reserve some space in structures

So that we will not break ABI in future extension by adding few more
fields.

Struct vhost_virtqueue is reserved with 16 qwords (the later vhost-live
migration support would at least consume 3 of them), and struct virtio_net
is reserved with a bit more, 64 qwords, as there is only one instance for
a virtio nic instance.

Note that both reservation are not placed at the end of the struct, but
instead before the last field, since both the last field at the two struct
take a lot spaces. Putting the reservation after it would divide those
reserved fields to another cacheline. (we might need fix them in future, btw)

Suggested-by: Panu Matilainen <pmatilai@redhat.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
8 years agokni: fix build on RHEL 7.2
Lee Roberts [Mon, 7 Dec 2015 14:59:59 +0000 (07:59 -0700)]
kni: fix build on RHEL 7.2

RHEL 7.2 contains additional backports from newer upstream kernels.
Add RHEL_RELEASE_CODE logic for RHEL_RELEASE_VERSION(7,2) to pick up
the changes to kernel functions.

Signed-off-by: Lee Roberts <lee.roberts@hpe.com>
8 years agonfp: add guide
Alejandro Lucero [Mon, 30 Nov 2015 10:25:42 +0000 (10:25 +0000)]
nfp: add guide

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@netronome.com>
8 years agonfp: add link status interrupt
Alejandro Lucero [Mon, 30 Nov 2015 10:25:41 +0000 (10:25 +0000)]
nfp: add link status interrupt

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@netronome.com>
8 years agonfp: add basic features
Alejandro Lucero [Mon, 30 Nov 2015 10:25:40 +0000 (10:25 +0000)]
nfp: add basic features

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@netronome.com>
8 years agonfp: add link status update
Alejandro Lucero [Mon, 30 Nov 2015 10:25:39 +0000 (10:25 +0000)]
nfp: add link status update

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@netronome.com>
8 years agonfp: add statistics
Alejandro Lucero [Mon, 30 Nov 2015 10:25:38 +0000 (10:25 +0000)]
nfp: add statistics

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@netronome.com>
8 years agonfp: add RSS
Alejandro Lucero [Mon, 30 Nov 2015 10:25:37 +0000 (10:25 +0000)]
nfp: add RSS

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@netronome.com>
8 years agonfp: add Rx and Tx
Alejandro Lucero [Mon, 30 Nov 2015 10:25:36 +0000 (10:25 +0000)]
nfp: add Rx and Tx

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@netronome.com>
8 years agonfp: introduce driver initialization
Alejandro Lucero [Mon, 30 Nov 2015 10:25:35 +0000 (10:25 +0000)]
nfp: introduce driver initialization

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@netronome.com>
8 years agomaintainers: claim responsibility for ARMv7 and ARMv8
Jianbo Liu [Thu, 3 Dec 2015 15:02:56 +0000 (23:02 +0800)]
maintainers: claim responsibility for ARMv7 and ARMv8

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
8 years agoacl/arm: enable acl for ARMv7
Jianbo Liu [Thu, 3 Dec 2015 15:02:55 +0000 (23:02 +0800)]
acl/arm: enable acl for ARMv7

Implement vqtbl1q_u8 intrinsic function, which is not supported in armv7-a.

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
8 years agoeal/arm: fix timer read from PMU
Jianbo Liu [Thu, 3 Dec 2015 15:02:54 +0000 (23:02 +0800)]
eal/arm: fix timer read from PMU

CONFIG_* from config files can not be used in code.

Fixes: 12f45fa7e29b ("eal/arm: read timer from PMU if enabled")

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
Acked-by: Jan Viktorin <viktorin@rehivetech.com>
8 years agoexamples/ethtool: add user-space ethtool sample application
Remy Horton [Mon, 7 Dec 2015 13:48:59 +0000 (13:48 +0000)]
examples/ethtool: add user-space ethtool sample application

Further enhancements to the userspace ethtool implementation that was
submitted in 2.1 and packaged as a self-contained sample application.
Implements an rte_ethtool shim layer based on rte_ethdev API, along
with a command prompt driven demonstration application.

Signed-off-by: Remy Horton <remy.horton@intel.com>
8 years agomk: fix external library build when combine is enabled
Thomas Monjalon [Tue, 8 Dec 2015 00:50:17 +0000 (01:50 +0100)]
mk: fix external library build when combine is enabled

The object files are copied to prepare the internal combined library.
It must be disabled when building an external library.

It has been seen because the directory was missing:
examples/ethtool/lib/x86_64-native-linuxapp-gcc/build/lib:
No such file or directory

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agomk: remove ABI versioning for external library
Andrew G. Harvey [Mon, 7 Dec 2015 13:48:57 +0000 (13:48 +0000)]
mk: remove ABI versioning for external library

Signed-off-by: Andrew G. Harvey <agh@cisco.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agomk: fix warnings when adding extra warning flags
Panu Matilainen [Mon, 7 Dec 2015 12:56:43 +0000 (14:56 +0200)]
mk: fix warnings when adding extra warning flags

Starting with commit 9aa2053c6e81493b23346ff4e387903560de5c81
EXTRA_CFLAGS is sometimes being passed to the compiler without
WERROR_FLAGS which can cause spurious warnings by the dozen,
for example with when compiling with EXTRA_CFLAGS="-Wformat-security":

cc1: warning: -Wformat-security ignored without -Wformat [-Wformat-security]

Passing WERROR_FLAGS to AUTO_CPU helper makes the warning flag usage
consistent throughout the codebase, silencing the warnings.

Fixes: 9aa2053c6e81 ("mk: influence CPU flags with user input")

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
8 years agomk: fix external shared library dependencies of drivers
Panu Matilainen [Mon, 7 Dec 2015 10:45:36 +0000 (12:45 +0200)]
mk: fix external shared library dependencies of drivers

Similar to commit 5f9115e58cc6f304ff4ade694cf5823d32887d1a, but
for qat and mpipe drivers. The former did not exist when the
previous patch was sent and latter I just missed.

Fixes: 5f9115e58cc6 ("mk: fix shared library dependencies of drivers")

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
8 years agoscripts: support any git revisions as ABI validation range
Panu Matilainen [Thu, 3 Dec 2015 14:05:26 +0000 (16:05 +0200)]
scripts: support any git revisions as ABI validation range

In addition to git tags, support validating abi between any legal
gitrevisions(7) syntaxes, such as "validate-abi.sh -1 . <target>"
"validate-abi.sh master mybranch <target>" etc in addition to
validating between tags. Makes it easier to run the validator
for in-development work.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
8 years agoexamples/vm_power_manager: fix build with libvirt < 1.0
Yong Liu [Mon, 7 Dec 2015 07:24:17 +0000 (15:24 +0800)]
examples/vm_power_manager: fix build with libvirt < 1.0

virNodeGetCPUMap introduced in libvirt 1.0. In some linux distributions
like Ubuntu12/14 and Fedora18, libvirt version is older than 1.0. So this
sample will not build pass.

Replace "virNodeGetCPUMap" with another libvirt API "virNodeGetInfo".

Signed-off-by: Marvin Liu <yong.liu@intel.com>
8 years agoexamples/ip_pipeline: add missing files of flow actions pipeline
Fan Zhang [Mon, 7 Dec 2015 11:51:50 +0000 (12:51 +0100)]
examples/ip_pipeline: add missing files of flow actions pipeline

When first adding flow actions pipeline, some files were not pushed
to the repository by mistake. The original commit message is below.

Fixes: 9ef2593651f9 ("examples/ip_pipeline: add flow actions pipeline")

Flow actions pipeline is an extension of flow-classification pipeline.
Some of the operations of flow classification pipeline such as traffic
metering/marking(for e.g. Single Rate Three Color Marker (srTCM), Two
Rate Three Color Marker trTCM)), policer can be performed separately in
flow action pipeline to avoid excessive computational burden on the CPU
core running the flow-classification pipeline. The Flow action pipeline
implements various function such as traffic metering, policer, stats.
Traffic mettering can configured as per the required context, for
examples- per user, per traffic class or both. These contexts can be
applied by specifying parameters in configuration file as shown below;

[PIPELINE1]
type = FLOW_ACTIONS
core = 1
pktq_in = RXQ0.0 RXQ1.0 RXQ2.0 RXQ3.0
pktq_out = TXQ0.0 TXQ1.0 TXQ2.0 TXQ3.0
n_flows = 65536
n_meters_per_flow = 1
flow_id_offset = 158
ip_hdr_offset = 142
color_offset = 64

The entries of flow and dscp tables of flow actions pipeline can be
modified through command-line interface. The commands to add or delete
entries to the flow table, DSCP(differentiated services code point)
table and for statistics collection, etc have been included. The key
functions such as Traffic Metering/marking and policer functions have
been implemented as flow-table action handler.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agodoc: fix make help
Thomas Monjalon [Thu, 3 Dec 2015 02:52:10 +0000 (03:52 +0100)]
doc: fix make help

Fix some errors and remove an unrelated paragraph.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agodoc: fix examples in netmap compatibility guide
John McNamara [Fri, 13 Nov 2015 11:45:12 +0000 (11:45 +0000)]
doc: fix examples in netmap compatibility guide

Fix the examples in the netmap compatibility sample application
docs which referred to the packet_reordering application.

Also fix some minor rst formatting issues.

Reported-by: Qian Xu <qian.q.xu@intel.com>
Signed-off-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agodoc: fix repeated typo in sample app guides
John McNamara [Mon, 16 Nov 2015 09:26:53 +0000 (09:26 +0000)]
doc: fix repeated typo in sample app guides

Fix repeated typo in the "Compiling the Application" section of
almost all of the sample app docs.

This generally gets copied into new sample app guides.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agodoc: fix missing blank line before code block
Tetsuya Mukawa [Tue, 20 Oct 2015 02:41:45 +0000 (11:41 +0900)]
doc: fix missing blank line before code block

The patch adds missing new line to "Managing ABI updates" section.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agoreplace bzero with memset
Stephen Hemminger [Wed, 2 Dec 2015 03:24:10 +0000 (19:24 -0800)]
replace bzero with memset

The standard for DPDK is to use memset() not bzero which
is a leftover BSD-ism.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agoremove blank lines at end-of-file
Stephen Hemminger [Wed, 2 Dec 2015 20:06:12 +0000 (12:06 -0800)]
remove blank lines at end-of-file

This is one of those trivial things git and other tools complain
about.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agoremove double semicolons
Stephen Hemminger [Wed, 2 Dec 2015 21:02:32 +0000 (13:02 -0800)]
remove double semicolons

Trivial cleanup

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agopower: remove duplicate definition
Aaron Conole [Fri, 23 Oct 2015 20:03:57 +0000 (16:03 -0400)]
power: remove duplicate definition

The CHANNEL_CMDS_MAX_VM_CHANNELS is duplicated in the channel_commands
header file. This commit removes that duplication.

Fixes: 210c383e247b ("power: packet format for vm power management")

Signed-off-by: Aaron Conole <aconole@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agoethdev: fix reset of Rx mbuf allocation failures
Igor Ryzhov [Fri, 27 Nov 2015 10:31:06 +0000 (13:31 +0300)]
ethdev: fix reset of Rx mbuf allocation failures

The rx_mbuf_alloc_failed counter was only cleared by virtio driver.
Now it is cleared by common rte_eth_stats_reset function for all
drivers at once.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoapp/testpmd: add description of queue info command
Konstantin Ananyev [Mon, 2 Nov 2015 13:49:05 +0000 (13:49 +0000)]
app/testpmd: add description of queue info command

Fixes: ab3257e13dc4 ("app/testpmd: add command to display queue info")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agodoc: fix ring based driver guide
Bernard Iremonger [Sat, 28 Nov 2015 11:01:54 +0000 (11:01 +0000)]
doc: fix ring based driver guide

Correct the sample code in the pcap_ring.rst file to match the latest
rte_eth_ring.c code.

The parameters to the rte_eth_from_rings() function have changed since
the documentation was written.
The API change occurred before DPDK 1.8 when the rst files were added.
The original documentation on which the pcap_ring.rst file was based was
not correct.

Fixes: fc1f2750a3ec ("doc: programmers guide")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agoapp/test: fix ring unit test
Bernard Iremonger [Sat, 28 Nov 2015 11:01:53 +0000 (11:01 +0000)]
app/test: fix ring unit test

If eth_ring vdevs are created from the command line with the --vdev option,
they create their own rings which are not shared by other vdevs.
Some of tests in this suite require that the vdevs share rings, so some
of the tests fail.

For vdevs to share rings they must be created in the test code with the
rte_eth_from_rings() function using rings created with the rte_ring_create()
function.

Use the command line option --vdev=eth_ring0 to create port 0.
This option is not mandatory for the tests to pass. It allows some additional
functional tests on cmd-line created rings to be executed.

Create two rings and five ethdevs in test_pmd_ring.c for ports 1 to 5,
and then use these to run the unit tests on the pmd ring functionality.

Improve test output by adding the port number to printf statements,
and adding a printf describing each test.

Fixes: 572eb3cd834c ("ring: simplify unit tests")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agoapp/test: fix kni success code
Helin Zhang [Thu, 3 Dec 2015 03:22:59 +0000 (11:22 +0800)]
app/test: fix kni success code

In the KNI unit test, if all test cases passed, it should
return with 0. This patch fixes the issue of returning
wrong value.

Fixes: fc27caaafd4b ("kni: remove deprecated functions")

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
8 years agoapp/test: rename acl function to lowercase
Maciej Gajdzica [Thu, 13 Aug 2015 10:33:29 +0000 (12:33 +0200)]
app/test: rename acl function to lowercase

Renamed function name to comply with coding standard.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agoapp/test: fix integer overflow in memory unit test
Sergio Gonzalez Monroy [Tue, 17 Nov 2015 15:39:16 +0000 (15:39 +0000)]
app/test: fix integer overflow in memory unit test

memory_autotest loops infinitely when at least one the memsegs
is bigger than 4GB.

The issue is the result of an integer overflow/wraparound of
the offset variable.

Fix it by using the correct type (size_t).

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agoapp/test: fix crash in performance test
David Hunt [Mon, 23 Nov 2015 11:45:48 +0000 (11:45 +0000)]
app/test: fix crash in performance test

Fix crash in pmd_perf_test autotest (div by 0) when no packets received
Also fixes the fact that the test passes even if exec_burst fails

To repeat the issue:
  The system must be incorrectly set up so that all packets will be lost,
  i.e. no loopback cable, etc. This is an edge case, but still the test
  should not crash or pass when failing.
  run the test app
  RTE>> set_rxtx_sc poll_before_xmit
  RTE>> pmd_perf_autotest
  --snip--
  > Generate 4096 packets @socket 1
  > start to receive total expect 4096
  > 4096 packets lost, IDLE 10000 times
  > Floating point exception (core dumped)

Signed-off-by: David Hunt <david.hunt@intel.com>
8 years agoexamples/l3fwd: fix crash with unaligned L2 header
Harish Patil [Sun, 8 Nov 2015 19:39:56 +0000 (11:39 -0800)]
examples/l3fwd: fix crash with unaligned L2 header

l3fwd app expects PMDs to return packets whose L2 header is
16-byte aligned due to usage of _mm_load_si128()/_mm_store_si128()
intrinsics in the app. However, most of the protocol stacks expects
packets such that its IP/L3 header be aligned on a 16-byte boundary.

Based on the recommendations received on dpdk-dev, we are changing
the l3fwd app to use _mm_loadu_si128()/_mm_loadu_si128() so that the
address need not be 16-byte aligned and thereby preventing crash.
We have tested that there is no performance impact due to this
change.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoexamples/l3fwd: fix crash with IPv6
Pablo de Lara [Tue, 3 Nov 2015 20:13:48 +0000 (20:13 +0000)]
examples/l3fwd: fix crash with IPv6

Lookup burst size was changed for exact match
from 4 to 8, for both ipv4 and ipv6, but actually only
4 keys were being looked up for ipv6, instead of 8,
causing random segmentation faults.

Fixes: 80fcb4d4 ("examples/l3fwd: increase lookup burst size to 8")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
8 years agoexamples/l3fwd: fix option parsing
John McNamara [Mon, 2 Nov 2015 17:45:51 +0000 (17:45 +0000)]
examples/l3fwd: fix option parsing

Fix minor, and non critical, copy and paste error in strncmp() of eth-dest
commandline argument.

Fixes: bd785f6f6791 ("examples/l3fwd: make destination mac address configurable")

Signed-off-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Andrey Chilikin <andrey.chilikin@intel.com>
8 years agoexamples/l2fwd-crypto: fix option -t
Declan Doherty [Wed, 2 Dec 2015 17:16:44 +0000 (17:16 +0000)]
examples/l2fwd-crypto: fix option -t

passing -t 0 as a command line argument causes the application
to exit with an "invalid refresh period specified" error  which is
contrary to applications help text.

This patch removes the unnecessary option "--no-stats" and fixes the
behaviour of the -t parameter.

Fixes: 387259bd6c67 ("examples/l2fwd-crypto: add sample application")

Reported-by: Min Cao <min.cao@intel.com>
Signed-off-by: Declan Doherty <declan.doherty@intel.com>
8 years agoexamples/vhost_xen: fix build
Bernard Iremonger [Sun, 1 Nov 2015 15:58:57 +0000 (15:58 +0000)]
examples/vhost_xen: fix build

examples/vhost_xen/main.c:659:61: error: has no member named data
 rte_memcpy((void *)(uintptr_t)buff_addr, (const void*)buff->data, rte_pktmbuf_data_len(buff));
                                                             ^

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoexamples/vhost: fix statistics
Jianfeng Tan [Wed, 2 Dec 2015 23:20:26 +0000 (07:20 +0800)]
examples/vhost: fix statistics

This issue was discovered under the case of software vm2vm
fowarding. When pkts are received from virtio device 0 and
tx_route to virtio device 1, tx of device 0 is not updated.

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Tested-by: Qian Xu <qian.q.xu@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
8 years agoexamples/vmdq: fix crash when using too many pools
Xutao Sun [Tue, 27 Oct 2015 08:58:33 +0000 (16:58 +0800)]
examples/vmdq: fix crash when using too many pools

Macro MAX_QUEUES was defined to 128, only allow 16 vmdq_pools in theory.
When running vmdq_app with more than 34 vmdq_pools, it will cause the
core_dump issue.
Change MAX_QUEUES to 1024 will solve this issue.

Signed-off-by: Xutao Sun <xutao.sun@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
8 years agoexamples/bond: fix FreeBSD build
Daniel Mrzyglod [Wed, 25 Nov 2015 18:03:57 +0000 (19:03 +0100)]
examples/bond: fix FreeBSD build

Error:
examples/bond/main.c:431:24: error: use of undeclared identifier 'AF_INET'

AF_INET defined in sys/socket.h

This header included for Linux:
. /<snip>/include/rte_ip.h
.. /usr/include/netinet/in.h
... /usr/include/sys/socket.h

But not for FreeBSD:
. /<snip>/include/rte_ip.h
.. /usr/include/netinet/in.h
... /usr/include/machine/endian.h
... /usr/include/netinet6/in6.h
. /<snip>/include/rte_tcp.h

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
8 years agoexamples/ip_pipeline: add flow actions pipeline
Fan Zhang [Wed, 18 Nov 2015 17:09:23 +0000 (17:09 +0000)]
examples/ip_pipeline: add flow actions pipeline

Flow actions pipeline is an extension of flow-classification pipeline.
Some of the operations of flow classification pipeline such as traffic
metering/marking(for e.g. Single Rate Three Color Marker (srTCM), Two
Rate Three Color Marker trTCM)), policer can be performed separately in
flow action pipeline to avoid excessive computational burden on the CPU
core running the flow-classification pipeline. The Flow action pipeline
implements various function such as traffic metering, policer, stats.
Traffic mettering can configured as per the required context, for
examples- per user, per traffic class or both. These contexts can be
applied by specifying parameters in configuration file as shown below;

[PIPELINE1]
type = FLOW_ACTIONS
core = 1
pktq_in = RXQ0.0 RXQ1.0 RXQ2.0 RXQ3.0
pktq_out = TXQ0.0 TXQ1.0 TXQ2.0 TXQ3.0
n_flows = 65536
n_meters_per_flow = 1
flow_id_offset = 158
ip_hdr_offset = 142
color_offset = 64

The entries of flow and dscp tables of flow actions pipeline can be
modified through command-line interface. The commands to add or delete
entries to the flow table, DSCP(differentiated services code point)
table and for statistics collection, etc have been included. The key
functions such as Traffic Metering/marking and policer functions have
been implemented as flow-table action handler.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agoexamples/ip_pipeline: check pipeline type
Maciej Gajdzica [Thu, 17 Sep 2015 12:58:33 +0000 (14:58 +0200)]
examples/ip_pipeline: check pipeline type

This commit add to CLI command check for pipeline type. It prevents
running CLI commands on not supported pipeline types.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agoexamples/ip_pipeline: reconfigure thread binding dynamically
Piotr Azarewicz [Thu, 29 Oct 2015 15:36:53 +0000 (16:36 +0100)]
examples/ip_pipeline: reconfigure thread binding dynamically

Up till now pipeline was bound to thread selected in the initial config.
This patch allows binding pipeline to other threads at runtime using CLI
commands.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>