dpdk.git
8 years agobond: move to drivers/net/
Bruce Richardson [Fri, 15 May 2015 15:56:48 +0000 (16:56 +0100)]
bond: move to drivers/net/

Move bonded ethdev pmd to drivers/net

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoaf_packet: move to drivers/net/
Bruce Richardson [Fri, 15 May 2015 15:56:47 +0000 (16:56 +0100)]
af_packet: move to drivers/net/

move af_packet pmd to drivers/net directory

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agodrivers: create new directory
Bruce Richardson [Fri, 15 May 2015 15:56:46 +0000 (16:56 +0100)]
drivers: create new directory

Add a new top-level "drivers" directory to which all PMDs will be moved
for easier maintenance of both lib folder and drivers themselves. This
new directory is a dependency of all the apps in the app folder, so
the makefiles for each app are updated.
To the new top-level directory add a "net" subdirectory to classify
more specifically our existing PMDs as ethernet drivers

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
[Thomas: fix dependencies and merge several patches]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agomk: use relative rather than absolute pmd paths
Bruce Richardson [Fri, 15 May 2015 15:56:45 +0000 (16:56 +0100)]
mk: use relative rather than absolute pmd paths

In the Makefiles for the PMDs, the paths to the files are often
specified using the full path from $(RTE_SDK) variable. These paths can
be shortened, and make more flexible in case of a future path change by
specifying the paths using $(SRCDIR) instead.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
9 years agomempool: limit cache size
Zoltan Kiss [Mon, 18 May 2015 15:35:14 +0000 (16:35 +0100)]
mempool: limit cache size

Otherwise cache_flushthresh can be bigger than n, and
a consumer can starve others by keeping every element
either in use or in the cache.

Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agolib: fix 32-bit build with debug enabled
Olivier Matz [Mon, 18 May 2015 08:18:00 +0000 (10:18 +0200)]
lib: fix 32-bit build with debug enabled

When debug is enabled for 32 bits targets, it triggers some format
errors that are not visible in 64 bits. Fix them by using the proper
format from inttypes.h or the proper cast.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
9 years agoexamples: add dependencies for timer and vm_power_manager
Olivier Matz [Mon, 18 May 2015 08:18:01 +0000 (10:18 +0200)]
examples: add dependencies for timer and vm_power_manager

Do not compile these examples if the related dpdk option is not
enabled, as it's done for other examples. It allows to build
the examples directory with a reduced dpdk configuration.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
9 years agoexamples/netmap: fix build for x32 ABI
Olivier Matz [Mon, 18 May 2015 08:17:59 +0000 (10:17 +0200)]
examples/netmap: fix build for x32 ABI

Fix a cast issue:
examples/netmap_compat/lib/compat_netmap.c:827:10: error: cast to
  pointer from integer of different size [-Werror=int-to-pointer-cast]

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
9 years agoexamples/bond: fix build with clang
Olivier Matz [Mon, 18 May 2015 08:17:58 +0000 (10:17 +0200)]
examples/bond: fix build with clang

Fix the following compilation error:

examples/bond/main.c:717:1: error: control reaches end of
  non-void function [-Werror,-Wreturn-type]

The prompt() function does not return anything, so fix its prototype
to be void.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
9 years agoexamples/ip_pipeline: fix build with clang 3.6
Thomas Monjalon [Tue, 19 May 2015 09:34:16 +0000 (11:34 +0200)]
examples/ip_pipeline: fix build with clang 3.6

This error is detected:
    examples/ip_pipeline/cmdline.c:272:15: error: address of array
          'params->file_path' will always evaluate to 'true'
            if (!params->file_path) {
                ~~~~~~~~~^~~~~~~~~

file_path is an array in a structure so it's unneeded to check it.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agoi40e/base: fix build with clang
Helin Zhang [Mon, 18 May 2015 15:40:56 +0000 (23:40 +0800)]
i40e/base: fix build with clang

When compiling with clang, it detects that a variable used for debug
is unused (debug_mask is never set):
    lib/librte_pmd_i40e/i40e/i40e_nvm.c:708:20: error: unused variable
          'i40e_nvm_update_state_str' [-Werror,-Wunused-variable]
    STATIC const char *i40e_nvm_update_state_str[] = {
                       ^
As we are not supposed to modify the base driver (except for update
synchronization from Intel), it was ignored with GCC thanks to the
option -Wno-unused-variable but clang was forgotten.

Fixes: 6b5aaf47d571 ("i40e/base: replace NVM debug logs")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Tetsuya Mukawa <mukawa@igel.co.jp>
9 years agoi40e/base: fix build with icc
Helin Zhang [Mon, 18 May 2015 15:40:55 +0000 (23:40 +0800)]
i40e/base: fix build with icc

Below compile error can be found on ICC 13.0.0, which is a warning
treated as error. Forcedly disabling the warning can fix it.

Error log:
lib/librte_pmd_i40e/i40e/i40e_nvm.c(1022): error #188: enumerated
type mixed with another type
hw->aq.asq_last_status = old_asq_status;
                       ^

Fixes: 3b7271f3958a ("i40e/base: catch NVM write semaphore timeout and retry")

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Tetsuya Mukawa <mukawa@igel.co.jp>
9 years agocmdline: add polling mode
Pawel Wodkowski [Wed, 13 May 2015 12:00:01 +0000 (14:00 +0200)]
cmdline: add polling mode

This patch adds the ability to process console input in the same thread
as packet processing by using poll() function.

Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agocmdline: fix missing includes
Pawel Wodkowski [Wed, 13 May 2015 12:00:00 +0000 (14:00 +0200)]
cmdline: fix missing includes

When including only some of library headers some definitions
are missing and build fails.

Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agoport: add IPv6 reassembly port
Maciej Gajdzica [Thu, 30 Apr 2015 12:02:34 +0000 (14:02 +0200)]
port: add IPv6 reassembly port

Added new port type - IPv6 reassembly port.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agoport: add IPv6 fragmentation port
Maciej Gajdzica [Thu, 30 Apr 2015 12:02:33 +0000 (14:02 +0200)]
port: add IPv6 fragmentation port

Added new port type - IPv6 Fragmentation port

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agoport: remove constant default MTU
Maciej Gajdzica [Thu, 30 Apr 2015 12:02:32 +0000 (14:02 +0200)]
port: remove constant default MTU

p->mtu field should be used instead.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agoi40e/base: update adminq commands
Helin Zhang [Thu, 30 Apr 2015 15:03:39 +0000 (23:03 +0800)]
i40e/base: update adminq commands

Miscellaneous modifications are added as follows for future use.
- Admin queue command opcodes
- struct i40e_aqc_arp_proxy_data
- struct i40e_aq_set_phy_config
- struct i40e_aqc_nvm_config_data_immediate_field
- struct i40e_aqc_oem_param_change
- struct i40e_aqc_opc_oem_ocsd_initialize
- struct i40e_aqc_opc_oem_ocbb_initialize
In addition, sturcture and command length check at compile time
are added for each admin queue opcodes in order to report any
potential issues as early as possible.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: rework structures and macros
Helin Zhang [Thu, 30 Apr 2015 15:03:38 +0000 (23:03 +0800)]
i40e/base: rework structures and macros

Several structures as follows were modified for future use.
- struct i40e_link_status
- struct i40e_nvm_info
- struct i40e_veb_tc_stats
In addition, shadow RAM macros and enum were modified for future
use as well.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: future proof some sizeof calls
Helin Zhang [Thu, 30 Apr 2015 15:03:36 +0000 (23:03 +0800)]
i40e/base: future proof some sizeof calls

Make sure the sizeof() calls are taking the size of the actual
struct that we care about. By using the pointer variable, it will
always get the right struct size, even if the variable type
changes sometime in the future.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: add new interfaces
Helin Zhang [Thu, 30 Apr 2015 15:03:27 +0000 (23:03 +0800)]
i40e/base: add new interfaces

Four new interfaces are added for future use, as follows, together
with their relevant strucure and macro definitions.
- i40e_aq_read_nvm_config()
- i40e_aq_write_nvm_config()
- i40e_aq_set_lldp_mib()
- i40e_read_pba_string()
In addition, removed i40e_read_nvm_srrd() as needed.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: add more virtual channel operations
Helin Zhang [Thu, 30 Apr 2015 15:03:37 +0000 (23:03 +0800)]
i40e/base: add more virtual channel operations

Virtual channel operations of I40E_VIRTCHNL_OP_EVENT and
I40E_VIRTCHNL_OP_CONFIG_RSS are added for future use.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: add iSCSI capability
Helin Zhang [Thu, 30 Apr 2015 15:03:34 +0000 (23:03 +0800)]
i40e/base: add iSCSI capability

Add parsing and reporting of iSCSI capability for a given device
or function.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: add AOC PHY types
Helin Zhang [Thu, 30 Apr 2015 15:03:33 +0000 (23:03 +0800)]
i40e/base: add AOC PHY types

Add the 10G and 40G AOC phy types to the case statement in
get_media_type so that the correct information gets reported back
to the user.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: workaround for PHY type with firmware < 4.4
Helin Zhang [Thu, 30 Apr 2015 15:03:32 +0000 (23:03 +0800)]
i40e/base: workaround for PHY type with firmware < 4.4

The FW for SW3E is incorrectly reporting a breakout cable as PHY
type 0x3 when it should be 0x16 (I40E_PHY_TYPE_10GBASE_SFPP_CU).
As this is supposed to be fixed in the next FW version
(FW versions >= 4.4), if we get this value back from FW and the
version is < 4.4, reassign it to I40E_PHY_TYPE_10GBASE_SFPP_CU.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: find partition id in NPAR mode and disable FCoE
Helin Zhang [Thu, 30 Apr 2015 15:03:31 +0000 (23:03 +0800)]
i40e/base: find partition id in NPAR mode and disable FCoE

In NPAR mode the driver instance might be controlling the base
partition or one of the other "fake" PFs. There are some things
that can only be done by the base partition, aka partition_id 1.
This code does a bit of work to find how many partitions are there
in per port and what is the current partition_id. In addition,
FCOE is disabled by default, as it was pushed out from the firmware.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: fix hardware port number for pass-thru
Helin Zhang [Thu, 30 Apr 2015 15:03:30 +0000 (23:03 +0800)]
i40e/base: fix hardware port number for pass-thru

Getting the pf_id from the function number was a good place to
start, but when the PF was setup in pass-thru mode, the PCI
bus/device/function was virtualized and the number in the VM is
different from the number in the bare metal. This caused HW
configuration issues when the wrong pf_id was used to set up the
HMC and other structures. The PF_FUNC_RID register has the real
bus/device/function information as configured by the BIOS, so use
that for a better number.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: update LED blinking
Helin Zhang [Thu, 30 Apr 2015 15:03:28 +0000 (23:03 +0800)]
i40e/base: update LED blinking

As it is requried to blink the LEDs only, it should ignore the
activity LEDs. Also a fix is added to clear the GPIO blink field
specifically.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: remove useless wrapper for link info
Helin Zhang [Thu, 30 Apr 2015 15:03:26 +0000 (23:03 +0800)]
i40e/base: remove useless wrapper for link info

As i40e_update_link_info() is just a simple wrapper of AQ command
interface of i40e_aq_get_link_info(), the AQ command interface
should be used directly.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: clean adminq debug
Helin Zhang [Thu, 30 Apr 2015 15:03:29 +0000 (23:03 +0800)]
i40e/base: clean adminq debug

A sparse complaint in i40e_debug_aq in a funky buffer write goes
away by straightening out the code out to something less convoluted.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: enhance adminq init and ASQ send
Helin Zhang [Thu, 30 Apr 2015 15:03:25 +0000 (23:03 +0800)]
i40e/base: enhance adminq init and ASQ send

The timeout of ASQ command is enlarged from 100 ms to 250 ms to
wait longer time for the response. nvm_busy is not needed anymore.
Also nvm_release_on_done and nvmupd_state will be set during
adminq init.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: use FLAG_RD when sending driver version to firmware
Helin Zhang [Thu, 30 Apr 2015 15:03:35 +0000 (23:03 +0800)]
i40e/base: use FLAG_RD when sending driver version to firmware

When sending driver version to FW, FLAG_SI is not needed as it is
done as part of i40e_fill_default_descriptor function call, and it
should be replaced by FLAG_BUF and FLAG_RD.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: grab NVM devstarter version instead of image version
Helin Zhang [Thu, 30 Apr 2015 15:03:24 +0000 (23:03 +0800)]
i40e/base: grab NVM devstarter version instead of image version

The NVM image version has useful data but it is a per image version,
and every image can have a different one. While for the dev starter
version, all the images for release will have the same version. So
it would be better to use dev starter version number.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: store firmware version
Helin Zhang [Thu, 30 Apr 2015 15:03:22 +0000 (23:03 +0800)]
i40e/base: store firmware version

Since the FW build number is available in the AQ response, save it
off for future use.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: enhance NVM checksum calculation
Helin Zhang [Thu, 30 Apr 2015 15:03:20 +0000 (23:03 +0800)]
i40e/base: enhance NVM checksum calculation

The data buffer for i40e_calc_nvm_checksum() is too big, so move
it off and allocate separately. In addition, use
i40e_read_nvm_buffer() to get the whole shadow RAM, together with
minor enhancements.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: enhance polling of NVM semaphore
Helin Zhang [Thu, 30 Apr 2015 15:03:19 +0000 (23:03 +0800)]
i40e/base: enhance polling of NVM semaphore

Only poll on the NVM semaphore if there's time left on a previous
reservation.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: fix error handling of NVM state update
Helin Zhang [Thu, 30 Apr 2015 15:03:18 +0000 (23:03 +0800)]
i40e/base: fix error handling of NVM state update

The state transitions after an error were not managed well, so
these changes get us back to the INIT state or don't transit
out of the INIT state after most errors.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: replace NVM debug logs
Helin Zhang [Thu, 30 Apr 2015 15:03:21 +0000 (23:03 +0800)]
i40e/base: replace NVM debug logs

To support better debug information printing, all DEBUGOUT() are
replaced by i40e_debug(). In addition, the NVM update state strings
are added in debug information.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: check for AQ timeout
Helin Zhang [Thu, 30 Apr 2015 15:03:17 +0000 (23:03 +0800)]
i40e/base: check for AQ timeout

Decoding the AQ return code is great except when the AQ send timed
out and there's no return code set. This changes the handy decoder
interface to help catch and properly report the condition as an
useful error number rather than returning a misleading '0'.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: catch NVM write semaphore timeout and retry
Helin Zhang [Thu, 30 Apr 2015 15:03:16 +0000 (23:03 +0800)]
i40e/base: catch NVM write semaphore timeout and retry

In some circumstances, a multi-write transaction takes longer than
the default 3 minutes timeout on the write semaphore. If the write
failed with an EBUSY status, this is likely the problem. So here
it tries to reacquire the semaphore and then retry the write.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: update shadow RAM read/write
Helin Zhang [Thu, 30 Apr 2015 15:03:15 +0000 (23:03 +0800)]
i40e/base: update shadow RAM read/write

To support different hardware, shadow RAM read should be done via
SRCTL register or AQ command, and shadow RAM write should be done
via AQ command only.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: rework virtual address retrieval for lan queue
Helin Zhang [Thu, 30 Apr 2015 15:03:14 +0000 (23:03 +0800)]
i40e/base: rework virtual address retrieval for lan queue

To simplify the usage of invoking 'i40e_hmc_get_object_va', input
parameters of it were reworked. In addition, minor code style fixes
were added as well.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: move register debug function
Helin Zhang [Thu, 30 Apr 2015 15:03:13 +0000 (23:03 +0800)]
i40e/base: move register debug function

As base driver provides 'i40e_aq_debug_read_register()', the same
functional interface of 'i40e_debug_read_register()' can be replaced.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: support CEE DCBX
Helin Zhang [Thu, 30 Apr 2015 15:03:12 +0000 (23:03 +0800)]
i40e/base: support CEE DCBX

Recent firmware versions support CEE DCBX, while old firmware
versions support IEEE DCBX only. So firmware version needs to be
checked during getting DCB configurations. To support CEE DCBX,
AQ commands of 'i40e_aq_get_cee_dcb_config' and
'i40e_aq_start_stop_dcbx' were implemented.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: skip some hardware init for VF
Helin Zhang [Thu, 30 Apr 2015 15:03:23 +0000 (23:03 +0800)]
i40e/base: skip some hardware init for VF

This patch is useful for future expansion when new VF MAC types get
added. It also helps with cleaning up VF driver flow.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: support building both PF and VF driver together
Helin Zhang [Thu, 30 Apr 2015 15:03:11 +0000 (23:03 +0800)]
i40e/base: support building both PF and VF driver together

Macros of PF_DRIVER, VF_DRIVER and INTEGRATED_VF were defined to
support building both PF and VF driver together. PF_DRIVER needs
to be defined if a build is for PF only, while VF_DRIVER for VF
only. PF_DRIVER, VF_DRIVER and INTEGRATED_VF are all needed for
building both PF and VF driver together.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: rename err to perrno
Helin Zhang [Thu, 30 Apr 2015 15:03:10 +0000 (23:03 +0800)]
i40e/base: rename err to perrno

To be consistent with the original base driver, the variable name
of 'err' should be renamed to 'perrno'.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e/base: adjust register definitions and relevant
Helin Zhang [Thu, 30 Apr 2015 15:03:09 +0000 (23:03 +0800)]
i40e/base: adjust register definitions and relevant

Some macros of register definitions or relevant are added, modified
or deleted. In detail, they are as follows.
- I40E_PRTDCB_RUPTQ
- I40E_GLGEN_GPIO_CTL
- I40E_GLGEN_MDIO_CTRL
- I40E_GLGEN_RSTENA_EMP
- I40E_GLPCI_LATCT
- I40E_GLTPH_CTRL
- I40E_GLPRT_BPRCH
- I40E_GLPRT_TDPC
- I40E_GLSCD_QUANTA
Also reading the register of I40E_GLPRT_TDPC is deleted as its
definition is deleted.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e: update copyright
Helin Zhang [Thu, 30 Apr 2015 15:03:07 +0000 (23:03 +0800)]
i40e: update copyright

Copyright is updated.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
9 years agoi40e: disable setting of PHY configuration
Helin Zhang [Thu, 30 Apr 2015 15:03:08 +0000 (23:03 +0800)]
i40e: disable setting of PHY configuration

There was a known link issue on 40G ports on NVM version (FVL3E),
when setting phy configuration. As a workaround, setting of phy
configuration should be disabled. The impact is that the link cannot
be forcedly configured, which doesn't affect any feature functions.
The workaround can be removed when a formal fix is ready later.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agomk: introduce EXTRA_LDLIBS variable
Keith Wiles [Thu, 14 May 2015 14:21:32 +0000 (09:21 -0500)]
mk: introduce EXTRA_LDLIBS variable

Signed-off-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agomk: simplify conditions for libs to link
Keith Wiles [Thu, 14 May 2015 14:21:31 +0000 (09:21 -0500)]
mk: simplify conditions for libs to link

Simplify the ifdefs in rte.app.mk to make the code more
readable and maintainable by introducing a internal
_LDLIBS-y variable to build up the LDLIBS variable.

The new internal variable _LDLIBS-y should not be
used outside of the rte.app.mk file.

Signed-off-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agomaintainers: claim responsibility for docs
John McNamara [Wed, 13 May 2015 13:08:28 +0000 (14:08 +0100)]
maintainers: claim responsibility for docs

Signed-off-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agovhost: fix virtio freeze due to missed interrupt
Huawei Xie [Wed, 29 Apr 2015 11:11:24 +0000 (19:11 +0800)]
vhost: fix virtio freeze due to missed interrupt

Update of used->idx and read of avail->flags could be reordered.
Memory fence should be used to ensure the order, otherwise guest could see
a stale used->idx value after it toggles the interrupt suppression flag.
After guest sets the interrupt suppression flag, it will check if there
is more buffer to process through used->idx. If it sees a stale value,
it will exit the processing while host won't send interrupt to guest.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Reviewed-by: Luke Gorrie <luke@snabb.co>
9 years agoeal/linux: fix irq handling with igb_uio
Stephen Hemminger [Tue, 28 Apr 2015 16:36:38 +0000 (09:36 -0700)]
eal/linux: fix irq handling with igb_uio

The introduction of uio_pci_generic broke interrupt handling with
igb_uio. The igb_uio device uses the kernel read/write method to
enable disable IRQ's; the uio_pci_generic has to use PCI intx
config read/write to enable disable interrupts.

Since igb_uio uses MSI-X the PCI intx config read/write won't
work.

Fixes: c112df6875a5 ("eal/linux: toggle interrupt for uio_pci_generic")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agomk: remove NO_AUTOLIBS option
Keith Wiles [Fri, 1 May 2015 14:29:47 +0000 (09:29 -0500)]
mk: remove NO_AUTOLIBS option

NO_AUTOLIBS is not required as it was not used or defined in the config files.

Signed-off-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoscripts: fix build in a symlinked directory
Olivier Matz [Tue, 5 May 2015 09:00:09 +0000 (11:00 +0200)]
scripts: fix build in a symlinked directory

The script relpath.sh returns the relative path of the first directory
from the second directory. It is used to generate relative symlinks,
which can be useful if the build directory is embedded in the dpdk
directory: the whole dpdk can be moved without breaking the links,
which is helpful for an installation.

In case the build directory is a symlink, the script was not generating
the proper relative path. Fix this by calling "readlink -f" on the
arguments.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Tested-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
9 years agopcap: fix storage of name and type in queues
Konstantin Ananyev [Thu, 23 Apr 2015 14:32:48 +0000 (15:32 +0100)]
pcap: fix storage of name and type in queues

pcap_rx_queue/pcap_tx_queue should store it's own copy of name/type values,
not the pointer to temporary allocated space.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: John Mcnamara <john.mcnamara@intel.com>
9 years agoexamples/vhost: fix build with debug enabled
Ouyang Changchun [Mon, 4 May 2015 07:15:19 +0000 (15:15 +0800)]
examples/vhost: fix build with debug enabled

Minor fix for the referring of a pointer when debug and dump is enabled.

Fixes: 72ec8d77ac68 ("examples/vhost: rework duplicated code")

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
9 years agovfio: set eventfd non-blocking and not inherited
Stephen Hemminger [Wed, 29 Apr 2015 15:15:45 +0000 (08:15 -0700)]
vfio: set eventfd non-blocking and not inherited

Set internal event file descriptor to be non-block and not
inherited across exec.  This prevents accidental hangs and
passing in another thread.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
9 years agoapps: fix default mbuf size
Konstantin Ananyev [Wed, 29 Apr 2015 23:31:51 +0000 (00:31 +0100)]
apps: fix default mbuf size

Latest mbuf changes (priv_size addition and related fixes)
exposed small problem with testpmd and few other sample apps:
when mbuf size is exaclty 2KB or less, that causes
ixgbe PMD to select scattered RX even for configs with 'normal'
max packet length (max_rx_pkt_len == ETHER_MAX_LEN).
To overcome that problem and unify the code, new macro was created
to represent recommended minimal buffer length for mbuf.
When appropriate, samples are updated to use that macro.

Fixes: dfb03bbe2b ("app/testpmd: use standard functions to initialize
mbufs and mbuf pool")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agoeal/bsd: fix build on FreeBSD
Bruce Richardson [Tue, 5 May 2015 12:47:34 +0000 (13:47 +0100)]
eal/bsd: fix build on FreeBSD

Compilation on FreeBSD with clang was broken, giving the error message:

lib/librte_eal/bsdapp/eal/eal_pci.c:438:16: fatal error: assigning to
  'struct rte_pci_id *' from 'const struct rte_pci_id *' discards qualifiers
  [-Wincompatible-pointer-types-discards-qualifiers]
    for (id_table = dr->id_table ; id_table->vendor_id != 0; id_table++) {
                  ^ ~~~~~~~~~~~~

This patch fixes the issue by adding "const" to the type of id_table.

Fixes: 6065355a03fc ("pci: make device id tables const")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agokni: remove inclusion of mbuf header
Bruce Richardson [Thu, 23 Apr 2015 13:03:52 +0000 (14:03 +0100)]
kni: remove inclusion of mbuf header

The kni header file includes the mbuf header file, but it does not
need to do so as it only uses pointers to the struct rte_mbuf type, and
does not use any of the mbuf internals, nor any of the mbuf functions or
macros. Therefore the inclusion is unnecessary, and can be replaced by a
forward declaration of the mbuf type.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agopipeline: remove inclusion of mbuf header
Bruce Richardson [Thu, 23 Apr 2015 13:03:54 +0000 (14:03 +0100)]
pipeline: remove inclusion of mbuf header

The pipeline header file includes the mbuf header file, but it does not
need to do so as it only uses pointers to the struct rte_mbuf type, and
does not use any of the mbuf internals, nor any of the mbuf functions or
macros. Therefore the inclusion is unnecessary, and can be replaced by a
forward declaration of the mbuf type.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agotable: remove inclusion of mbuf header
Bruce Richardson [Thu, 23 Apr 2015 13:03:56 +0000 (14:03 +0100)]
table: remove inclusion of mbuf header

The rte_table header file includes the mbuf header file, but it does not
need to do so as it only uses pointers to the struct rte_mbuf type, and
does not use any of the mbuf internals, nor any of the mbuf functions or
macros. Therefore the inclusion is unnecessary, and can be replaced by a
forward declaration of the mbuf type.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agodistributor: remove inclusion of mbuf header
Bruce Richardson [Thu, 23 Apr 2015 13:03:50 +0000 (14:03 +0100)]
distributor: remove inclusion of mbuf header

The distributor header file includes the mbuf header file, but it does not
need to do so as it only uses pointers to the struct rte_mbuf type, and
does not use any of the mbuf internals, nor any of the mbuf functions or
macros. Therefore the inclusion is unnecessary, and can be replaced by a
forward declaration of the mbuf type.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agoip_frag: remove inclusion of mbuf header
Bruce Richardson [Thu, 23 Apr 2015 13:03:53 +0000 (14:03 +0100)]
ip_frag: remove inclusion of mbuf header

The ip_frag header file includes the mbuf header file, but it does not
need to do so as it only uses pointers to the struct rte_mbuf type, and
does not use any of the mbuf internals, nor any of the mbuf functions or
macros. Therefore the inclusion is unnecessary, and can be replaced by a
forward declaration of the mbuf type.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agovhost: remove inclusion of mbuf header
Bruce Richardson [Thu, 23 Apr 2015 13:03:57 +0000 (14:03 +0100)]
vhost: remove inclusion of mbuf header

The virtio_net header file includes the mbuf header file, but it does not
need to do so as it only uses pointers to the struct rte_mbuf type, and
does not use any of the mbuf internals, nor any of the mbuf functions or
macros. Therefore the inclusion is unnecessary, and can be replaced by a
forward declaration of the mbuf type.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agovirtio: remove inclusion of mbuf header
Bruce Richardson [Thu, 23 Apr 2015 13:03:55 +0000 (14:03 +0100)]
virtio: remove inclusion of mbuf header

The virtqueue header files include the mbuf header file, but they do not
need to do so as they only use pointers to the struct rte_mbuf type, and
do not use any of the mbuf internals, nor any of the mbuf functions or
macros. Therefore the inclusion is unnecessary, and can be replaced by a
forward declaration of the mbuf type.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agoethdev: remove inclusion of mbuf header
Bruce Richardson [Thu, 23 Apr 2015 13:03:51 +0000 (14:03 +0100)]
ethdev: remove inclusion of mbuf header

The ethdev header file includes the mbuf header file, but it does not
need to do so as it only uses pointers to the struct rte_mbuf type, and
does not use any of the mbuf internals, nor any of the mbuf functions or
macros. Therefore the inclusion is unnecessary, and can be replaced by a
forward declaration of the mbuf type.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agoenic: add device ids
Sujith Sankar [Thu, 7 May 2015 03:49:09 +0000 (09:19 +0530)]
enic: add device ids

This patch adds support for enic in the nic_uio driver so that enic
could be used on FreeBSD.

Signed-off-by: Sujith Sankar <ssujith@cisco.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agokni: fix vhost build with kernels 3.19 and 4.0
Pablo de Lara [Tue, 5 May 2015 14:08:00 +0000 (15:08 +0100)]
kni: fix vhost build with kernels 3.19 and 4.0

Due to commit c0371da6 in kernel 3.19, which removed msg_iov
and msg_iovlen from struct msghdr, DPDK would not build.
Also, functions memcpy_toiovecend and memcpy_fromiovecend
were removed in commits ba7438ae and 57dd8a07, being substituted by
copy_from_iter and copy_to_iter.

This patch makes use of struct iov_iter, which has references
to msg_iov and msg_iovln, and makes use of copy_from_iter
and copy_to_iter.

Reported-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agokni: fix build with kernel 4.0
Pablo de Lara [Tue, 28 Apr 2015 17:37:42 +0000 (18:37 +0100)]
kni: fix build with kernel 4.0

Due to API changes in function pointer ndo_bridge_setlink
(commit ad41faa8) and the rename of functions vlan_tx_*
(commit df8a39de) in kernel 4.0, DPDK would not build.

This patch adds the properly checks to fix the compilation.

Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agoixgbe: use scattered Rx with bulk allocation
Vlad Zolotarov [Wed, 29 Apr 2015 08:38:17 +0000 (11:38 +0300)]
ixgbe: use scattered Rx with bulk allocation

Simply initialze rx_pkt_burst callback to ixgbe_recv_pkts_lro_bulk_alloc()
if the conditions are right.

This is possible because work against HW in LRO and scattered cases is
exactly the same and LRO callback already supports the bulk allocation.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoixgbe: remove simple scalar scattered Rx method
Vlad Zolotarov [Wed, 29 Apr 2015 08:38:16 +0000 (11:38 +0300)]
ixgbe: remove simple scalar scattered Rx method

Kill ixgbe_recv_scattered_pkts() - use ixgbe_recv_pkts_lro_single_alloc()
instead.

Work against HW queues in LRO and scattered Rx cases is exactly the same.
Therefore we may drop the inferior callback.

This patch also changes the sw_rsc_ring allocation in the
ixgbe_dev_rx_queue_setup() to always allocate sw_rsc_ring instead of
explicitly allocating it in all possible cases when it may be needed:
LRO and/or scattered Rx.

This will only impose sizeof(void*) * IXGBE_MAX_RING_DESC = 32KB overhead
per Rx queue as a price for a much simpler code, which seems reasonable.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoixgbe: rename rsc to sc/scattered_rx
Vlad Zolotarov [Wed, 29 Apr 2015 08:38:15 +0000 (11:38 +0300)]
ixgbe: rename rsc to sc/scattered_rx

   - ixgbe_rsc_entry -> ixgbe_scattered_rx_entry
   - sw_rsc_ring -> sw_sc_ring
   - ixgbe_free_rsc_cluster() -> ixgbe_free_sc_cluster()
   - In local variables: xx_rsc_yy -> xx_sc_yy

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoixgbe: remove unused field for RSC
Vlad Zolotarov [Wed, 29 Apr 2015 08:38:14 +0000 (11:38 +0300)]
ixgbe: remove unused field for RSC

Fixes: 8eecb3295aed ("ixgbe: add LRO support")

Reported-by: Shiweixian <shiweixian@huawei.com>
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoixgbe: move PMD specific fields out of base driver
Vlad Zolotarov [Wed, 29 Apr 2015 08:38:13 +0000 (11:38 +0300)]
ixgbe: move PMD specific fields out of base driver

Move rx_bulk_alloc_allowed and rx_vec_allowed from ixgbe_hw to ixgbe_adapter.

Fixes: 01fa1d6215fa ("ixgbe: unify Rx setup")

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agodoc: link doxygen api to source code
John McNamara [Wed, 22 Apr 2015 16:10:02 +0000 (17:10 +0100)]
doc: link doxygen api to source code

Enabled Doxygen option to add links to the source code
in documented entities.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Siobhan Butler <siobhan.a.butler@intel.com>
9 years agodoc: disable doxygen member sorting
John McNamara [Wed, 29 Apr 2015 10:47:47 +0000 (11:47 +0100)]
doc: disable doxygen member sorting

Disabled the doxygen option to sort member data so that functions
and struct memebers are listed in order of definition in the
brief and main sections.

Previously they were sorted in the brief section and were in
definition order in the main section.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Siobhan Butler <siobhan.a.butler@intel.com>
9 years agodoc: fix spellings and typos
John McNamara [Fri, 24 Apr 2015 12:58:11 +0000 (13:58 +0100)]
doc: fix spellings and typos

Fixed several typos and spelling errors in guide docs.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
9 years agoigb: handle VF LPE mailbox message
Sergio Gonzalez Monroy [Wed, 18 Mar 2015 12:01:31 +0000 (12:01 +0000)]
igb: handle VF LPE mailbox message

This patch adds the handle function for the LPE mailbox message (VF to
PF) to set maximum packet size, which can be used to enable jumbo
frame support.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoeal/bsd: fix virtio on FreeBSD
Raz Amir [Thu, 16 Apr 2015 11:52:07 +0000 (14:52 +0300)]
eal/bsd: fix virtio on FreeBSD

Closing /dev/io fd causes SIGBUS in inb/outb instructions
as the process loses the IOPL privileges once the fd is closed:
(gdb) bt
0  0x0000000000492f2c in outb (port=49170, data=0 '\000')
at /usr/include/machine/cpufunc.h:244
1  0x0000000000492f7a in outb_p (data=0 '\000', port=49170)
at /dpdk/dpdk-2.0.0/lib/librte_pmd_virtio/virtio_pci.h:211
2  0x000000000049328d in vtpci_set_status (hw=0x80331f380, status=0 '\000')
at /dpdk/dpdk-2.0.0/lib/librte_pmd_virtio/virtio_pci.c:130
3  0x00000000004931fe in vtpci_reset (hw=0x80331f380)
at /dpdk/dpdk-2.0.0/lib/librte_pmd_virtio/virtio_pci.c:108
4  0x00000000004a175e in eth_virtio_dev_init (eth_dev=0x831b80 <rte_eth_devices>)
at /dpdk/dpdk-2.0.0/lib/librte_pmd_virtio/virtio_ethdev.c:1150
5  0x0000000000462c09 in rte_eth_dev_init (pci_drv=0x79d1a0 <rte_virtio_pmd>,
pci_dev=0x802417560) at /dpdk/dpdk-2.0.0/lib/librte_ether/rte_ethdev.c:326
6  0x000000000046f03f in rte_eal_pci_probe_one_driver (dr=0x79d1a0 <rte_virtio_pmd>,
dev=0x802417560) at /dpdk/dpdk-2.0.0/lib/librte_eal/bsdapp/eal/eal_pci.c:487
7  0x0000000000475b06 in pci_probe_all_drivers (dev=0x802417560)
at /dpdk/dpdk-2.0.0/lib/librte_eal/common/eal_common_pci.c:116
8  0x0000000000475bb9 in rte_eal_pci_probe ()
at /dpdk/dpdk-2.0.0/lib/librte_eal/common/eal_common_pci.c:246
9  0x000000000046cd63 in rte_eal_init (argc=5, argv=0x7fffffffeaf0)
at /dpdk/dpdk-2.0.0/lib/librte_eal/bsdapp/eal/eal.c:554
10 0x0000000000404544 in main ()

Fixes: 8a312224bcde ("eal/bsd: fix fd leak")

Signed-off-by: Raz Amir <razamir22@gmail.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agolog: fix log level check
Jean Dao [Mon, 6 Apr 2015 19:14:20 +0000 (21:14 +0200)]
log: fix log level check

According to the api, rte_log() / rte_vlog() are supposed to check the log level
and type but they were not doing so. This check was only done in the RTE_LOG
macro while this macro is only there to remove log messages at build time.

rte_log() always calls rte_vlog(), so do the check in rte_vlog() only.

Signed-off-by: Jean Dao <jean.dao@6wind.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
9 years agoenic: remove use of old flow director struct
Sujith Sankar [Tue, 21 Apr 2015 05:51:28 +0000 (11:21 +0530)]
enic: remove use of old flow director struct

This patch removes the use of rte_fdir_filter from enic_clsf.
This also takes care of modifying the version and copyright string.

Signed-off-by: Sujith Sankar <ssujith@cisco.com>
9 years agoacl: use setjmp/longjmp to handle alloc failures at build phase
Konstantin Ananyev [Thu, 19 Feb 2015 17:44:19 +0000 (17:44 +0000)]
acl: use setjmp/longjmp to handle alloc failures at build phase

During build phase ACL doing quite a lot of memory allocations
for relatively small temporary structures.
In theory each of such allocation can fail, so we need to handle
all these possible failures.
That adds a lot of extra checks and makes the code harder to read and follow.
To simplify the process, made changes to handle all such failures
in one place.
Note, that all that memory for temporary structures
is freed at one go at the end of build phase.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoapp/test: check cloning with different priv sizes
Olivier Matz [Wed, 22 Apr 2015 09:57:30 +0000 (11:57 +0200)]
app/test: check cloning with different priv sizes

Verify that we can attach a mbuf to another one that does not have
the same data room size and priv_size.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoapp/test: check cloning a clone
Olivier Matz [Wed, 22 Apr 2015 09:57:29 +0000 (11:57 +0200)]
app/test: check cloning a clone

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoapp/test: enhance mbuf refcnt check
Olivier Matz [Wed, 22 Apr 2015 09:57:28 +0000 (11:57 +0200)]
app/test: enhance mbuf refcnt check

Check that the data in the cloned mbuf is the same than in the
reference mbuf.
Check that the reference counter is incremented for each segment.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoapp/test: rename mbuf variable
Olivier Matz [Wed, 22 Apr 2015 09:57:27 +0000 (11:57 +0200)]
app/test: rename mbuf variable

It's better to name the mbuf 'm' instead of 'mc' as it's not a clone.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agombuf: allow to clone an indirect mbuf
Olivier Matz [Wed, 22 Apr 2015 09:57:26 +0000 (11:57 +0200)]
mbuf: allow to clone an indirect mbuf

Remove one limitation of rte_pktmbuf_attach(): "mbuf we're attaching to
must be direct".

Now, when we attach to an indirect mbuf:
- copy the all relevant fields (addr, len, offload, ...) as before
- get the pointer to the mbuf that embeds the data buffer (direct mbuf),
  and increase the reference counter of this one.

When detaching the mbuf, we can retrieve this direct mbuf as the pointer
is determined from the buffer address.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agombuf: fix cloning with private mbuf data
Olivier Matz [Wed, 22 Apr 2015 09:57:25 +0000 (11:57 +0200)]
mbuf: fix cloning with private mbuf data

Add a new priv_size field in mbuf structure that should
be initialized at mbuf pool creation. This field contains the
size of the application private data in mbufs.

Introduce new static inline functions rte_mbuf_from_indirect()
and rte_mbuf_to_baddr() to replace the existing macros, which
take the private size in account when attaching and detaching
mbufs.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Zoltan Kiss <zoltan.kiss@linaro.org>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoapps: use helper to create mbuf pools
Olivier Matz [Wed, 22 Apr 2015 09:57:24 +0000 (11:57 +0200)]
apps: use helper to create mbuf pools

When it's possible, use the new helper to create the mbuf pools.
Most of the patch is trivial, except for the following files that
have some specifics (indirect mbufs):
- ip_fragmentation
- ip_pipeline
- ipv4_multicast
- vhost

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agombuf: introduce a new helper to create a pool
Olivier Matz [Wed, 22 Apr 2015 09:57:23 +0000 (11:57 +0200)]
mbuf: introduce a new helper to create a pool

Add a new wrapper to rte_mempool_create() to simplify the creation
of a packet mbuf pool.

This wrapper can be used if there is no specific mempool flags, and
no specific mbuf or pool constructor function, which is most of the
use cases.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoapp/testpmd: use standard functions to initialize mbufs and mbuf pool
Olivier Matz [Wed, 22 Apr 2015 09:57:22 +0000 (11:57 +0200)]
app/testpmd: use standard functions to initialize mbufs and mbuf pool

The rte_pktmbuf_pool_init() and rte_pktmbuf_init() functions now
support to have a non-hardcoded buffer length. We can remove the
specific functions used in testpmd and replace them by the standard
ones.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agombuf: fix init when private size is not zero
Olivier Matz [Wed, 22 Apr 2015 09:57:21 +0000 (11:57 +0200)]
mbuf: fix init when private size is not zero

Allow the user to use the default rte_pktmbuf_init() function even
if the mbuf private size is not 0.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agombuf: add accessors for data room and private size
Olivier Matz [Wed, 22 Apr 2015 09:57:20 +0000 (11:57 +0200)]
mbuf: add accessors for data room and private size

This code retrieving the pool private area is duplicated in many
places, we can use of function for it.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoexamples: always initialize mbuf pool private area
Olivier Matz [Wed, 22 Apr 2015 09:57:19 +0000 (11:57 +0200)]
examples: always initialize mbuf pool private area

The mbuf pool private area must always be populated in a mbuf pool.
The applications or drivers may expect that for a mbuf pool, the mbuf
pool private area (mbuf_data_room_size and mbuf_priv_size) are
properly filled.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agombuf: fix data room size calculation in pool init
Olivier Matz [Wed, 22 Apr 2015 09:57:18 +0000 (11:57 +0200)]
mbuf: fix data room size calculation in pool init

Deduct the mbuf data room size from mempool->elt_size and priv_size,
instead of using an hardcoded value that is not related to the real
buffer size.

To use rte_pktmbuf_pool_init(), the user can either:
- give a NULL parameter to rte_pktmbuf_pool_init(): in this case, the
  private size is assumed to be 0, and the room size is
  mp->elt_size - sizeof(struct rte_mbuf).
- give the rte_pktmbuf_pool_private filled with appropriate
  data_room_size and priv_size values.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoixgbe/base: update readme
Ouyang Changchun [Thu, 26 Feb 2015 02:08:47 +0000 (10:08 +0800)]
ixgbe/base: update readme

Update the share code version into cid-10g-shared-code.2015.02.03.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>