dpdk.git
8 years agonet/mlx5: fix support for newer link speeds
Nélio Laranjeiro [Wed, 26 Oct 2016 09:44:02 +0000 (11:44 +0200)]
net/mlx5: fix support for newer link speeds

Not all speed capabilities can be reported properly before Linux 4.8 (25G,
50G and 100G speeds are missing), moreover the API to retrieve them only
exists since Linux 4.5, this commit thus implements compatibility code for
all versions.

Fixes: e274f5732225 ("ethdev: add speed capabilities")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
8 years agonet/mlx5: fix link speed capability information
Nélio Laranjeiro [Wed, 26 Oct 2016 09:44:01 +0000 (11:44 +0200)]
net/mlx5: fix link speed capability information

Make hard-coded values dynamic to return correct link speed capabilities
(not all ConnectX-4 NICs support everything).

Fixes: e274f5732225 ("ethdev: add speed capabilities")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
8 years agonet/i40e: fix hash filter on X722
Jeff Guo [Tue, 25 Oct 2016 02:42:36 +0000 (22:42 -0400)]
net/i40e: fix hash filter on X722

When verifying the Hash filtering on X722, we found a problem that
the hash value in descriptor is incorrect. The root cause is that X722
uses different way of hash key word selection compared with X710/XL710.
This patch fixes it by setting X722 specific key selection.

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

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
8 years agonet/i40e: fix flow director on X710
Jeff Guo [Tue, 25 Oct 2016 02:25:41 +0000 (22:25 -0400)]
net/i40e: fix flow director on X710

Because some registers are only supported by X722, for example,
I40E_GLQF_FD_PCTYPES, the driver needs to use the mac type to distinguish
the behavior of X722 from X710 and other NICs, or it would result in
errors on X710.

Fixes: 8c5cb3c11513 ("net/i40e: add packet type translation for X722")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
8 years agonet/ixgbe: fix VF VLAN insert API
E. Scott Daniels [Wed, 19 Oct 2016 14:47:33 +0000 (15:47 +0100)]
net/ixgbe: fix VF VLAN insert API

The final parameter to rte_pmd_ixgbe_set_vf_vlan_insert is uint8_t
and treated as a binary flag when it needs to be a uint16_t
and treated as a VLAN id.  The data sheet (sect 8.2.3.27.13) describes
the right most 16 bits as the VLAN id that is to be inserted; the
16.11  code is accepting only a 1 or 0 thus effectively only
allowing the VLAN id 1 to be inserted (0 disables the insertion
setting).

This patch changes the final parm name to represent the data that
is being accepted (vlan_id), changes the type to permit all valid
VLAN ids, and validates the parameter based on the range of 0 to
4095. Corresponding changes to prototype and documentation in the
.h file.

Fixes: 49e248223e9f71 ("net/ixgbe: add API for VF management")

Signed-off-by: E. Scott Daniels <daniels@research.att.com>
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agonet/qede: update driver version
Rasesh Mody [Wed, 19 Oct 2016 04:11:46 +0000 (21:11 -0700)]
net/qede: update driver version

This patch updates the qede pmd version to 1.2.0.1.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agodoc: update qede guide
Rasesh Mody [Wed, 19 Oct 2016 04:11:45 +0000 (21:11 -0700)]
doc: update qede guide

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agonet/qede: remove zlib dependency and enable PMD
Rasesh Mody [Wed, 19 Oct 2016 04:11:44 +0000 (21:11 -0700)]
net/qede: remove zlib dependency and enable PMD

The QEDE PMD now uses unzipped firmware file eliminating the dependency
on zlib. Hence remove LDLIBS entry form the Makefile and enable qede
PMD by default.

Fixes: 6adac0bf30b3 ("qede: add missing external dependency and disable by default")

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agonet/qede: add queue statistics
Rasesh Mody [Wed, 19 Oct 2016 04:11:43 +0000 (21:11 -0700)]
net/qede: add queue statistics

This patch adds support for pulling per queue statistics.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agonet/qede: fix status block index for VF queues
Harish Patil [Wed, 19 Oct 2016 04:11:42 +0000 (21:11 -0700)]
net/qede: fix status block index for VF queues

o Fix the fastpath status block index such that each queue pair shares
the same index value.

o Add ecore_vf_get_num_sbs() API that returns the number of status
blocks assigned by PF. Use that to decide how many VF queues can be
advertised. Additionally, restrict maximum number of VF queues to 16
for 100G VF case.

Fixes: 2ea6f76aff40 ("qede: add core driver")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
8 years agonet/qede: fix driver version string
Harish Patil [Wed, 19 Oct 2016 04:11:41 +0000 (21:11 -0700)]
net/qede: fix driver version string

This patch fixes the base driver version display.
The driver version notation is:
<Base-Version_PMD-Version>

Fixes: 2ea6f76aff40 ("qede: add core driver")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
8 years agonet/qede: skip slow path polling for 100G VF device
Harish Patil [Wed, 19 Oct 2016 04:11:40 +0000 (21:11 -0700)]
net/qede: skip slow path polling for 100G VF device

There is no need to poll for slowpath events for VF
device since the ramrod responses are received over
PF-VF backchannel synchronously. So the fix is to
restrict the slowpath polling for PF device only.

Fixes: 2af14ca79c0a ("net/qede: support 100G")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
8 years agonet/qede/base: support to initiate PF FLR
Harish Patil [Wed, 19 Oct 2016 04:11:39 +0000 (21:11 -0700)]
net/qede/base: support to initiate PF FLR

Add support to send PF FLR request to the management firmware to
bringup the device in clean slate. This cleanup is necessary
in some corner cases where the device would be left in a bad
state from its previous operations. The driver will send PF FLR
request before slowpath initialization.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
8 years agonet/qede/base: change queue start
Rasesh Mody [Wed, 19 Oct 2016 04:11:38 +0000 (21:11 -0700)]
net/qede/base: change queue start

Changed q_{rx,tx}_start APIs to use common queue start parameters

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agonet/qede: support scatter gather
Sony Chacko [Wed, 19 Oct 2016 04:11:37 +0000 (21:11 -0700)]
net/qede: support scatter gather

Add scatter gather support to enable transmit and receive of larger
packets.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
8 years agonet/qede: fix RSS
Harish Patil [Wed, 19 Oct 2016 04:11:36 +0000 (21:11 -0700)]
net/qede: fix RSS

This patch contains few RSS related changes as follows:

o Fix inadvertent initializing of rss_params outside of the
  if block in qed_update_vport() which could cause FW exception.

o Fix disabling of RSS when hash function is 0.

o Rename qede_config_rss() to qede_check_vport_rss_enable()
  for better clarity.

o Avoid code duplication using a helper function
  qede_init_rss_caps().

Fixes: 4c98f2768eef ("net/qede: support RSS hash configuration")
Fixes: 2ea6f76aff40 ("qede: add core driver")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
8 years agonet/qede: enable and disable VLAN filtering
Harish Patil [Wed, 19 Oct 2016 04:11:35 +0000 (21:11 -0700)]
net/qede: enable and disable VLAN filtering

The device doesn't explicitly support enable/disable
of VLAN filtering. However, VLAN filtering takes effect
when a matching VLAN is configured. So in order to
support enable/disable of VLAN filtering, VLAN 0 is
added/removed respectively. A check is added to ensure that
the user removes all the configured VLANs before disabling
VLAN filtering.

Also VLAN offloads shall be enabled by default and
vlan_tci_outer is to set to 0 for Q-in-Q packets.

Fixes: 2ea6f76 ("qede: add core driver")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
8 years agonet/qede: fix VLAN filters
Harish Patil [Wed, 19 Oct 2016 04:11:34 +0000 (21:11 -0700)]
net/qede: fix VLAN filters

 - fix to prevent duplicate VLAN filters

librte_ether does not keep track of VLAN filters
configured, so it becomes driver's responsibility to
keep track of it and prevent duplicate filter
programming. The fix is to use a singly linked
list for tracking the entries and there by prevent
duplicates.

 - fix num vlan filters

Fix num vlan filter when filling Ethernet device information.

Fixes: 2ea6f76aff40 ("qede: add core driver")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
8 years agonet/qede: remove unused code
Harish Patil [Wed, 19 Oct 2016 04:11:33 +0000 (21:11 -0700)]
net/qede: remove unused code

Fixes: 2ea6f76aff40 ("qede: add core driver")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agonet/qede: add 100G link speed capability
Harish Patil [Wed, 19 Oct 2016 04:11:32 +0000 (21:11 -0700)]
net/qede: add 100G link speed capability

This patch fixes the missing 100G link speed advertisement
when the 100G support was initially added.

Fixes: 2af14ca79c0a ("net/qede: support 100G")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
8 years agonet/qede/base: allow MTU change
Harish Patil [Wed, 19 Oct 2016 04:11:31 +0000 (21:11 -0700)]
net/qede/base: allow MTU change

Add support to allow MTU change on a deactivated vport in
the qede/base driver and the core driver shall utilize the same.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
8 years agonet/qede: fix port (re)configuration
Harish Patil [Wed, 19 Oct 2016 04:11:30 +0000 (21:11 -0700)]
net/qede: fix port (re)configuration

Some applications set port configuration params like promisc mode
before calling dev_start(). This config results in a firmware exception
since this operation internally translates to sending of VPORT-UPDATE
before VPORT-START ramrod which is considered illegal from firmware
standpoint. So the fix is to send VPORT-START ramrod sooner
in dev_configure() rather than deferring it to dev_start().
This requires a bit of reshuffling in the code to move sending of
VPORT-START from qede_start_queues() to qede_dev_configure()
and VPORT-STOP from qede_stop_queues() to qede_dev_stop().

This sequence change also exposes a flaw in the port restart
flows where the fastpath resource allocation routine qede_init_fp()
functionalities need to be split, so that appropriate action is taken
based on the current port state. Eg: Do not re-initialize the status
block in a port restart case. This change ensures port start/stop
can be paired.

A new port state QEDE_DEV_CONFIG is added to distinguish between
port started from scratch vs port requiring a reconfig (like MTU).
The function qede_config_rx_mode() is removed since the individual
port config will be replayed anyways on a restart.

Fixes: 2ea6f76aff40 ("qede: add core driver")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
8 years agonet/qede: support unequal number of Rx/Tx queues
Sony Chacko [Wed, 19 Oct 2016 04:11:29 +0000 (21:11 -0700)]
net/qede: support unequal number of Rx/Tx queues

Previous release of the qede PMD had a limitation that the
driver expects the number of tx and rx queues to be the same.
This patch fixes this issue by making appropriate changes in
control and data path.

Fixes: 2ea6f76aff40 ("qede: add core driver")

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
8 years agonet/qede/base: support MFW crash dump
Rasesh Mody [Wed, 19 Oct 2016 04:11:28 +0000 (21:11 -0700)]
net/qede/base: support MFW crash dump

Add support for management firmware(MFW) crash dump collection.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agonet/qede/base: enhance comments
Rasesh Mody [Wed, 19 Oct 2016 04:11:27 +0000 (21:11 -0700)]
net/qede/base: enhance comments

Comment additions and modifications

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agonet/qede/base: rename pmm prefix to eth
Rasesh Mody [Wed, 19 Oct 2016 04:11:26 +0000 (21:11 -0700)]
net/qede/base: rename pmm prefix to eth

Renamed following to match with HSI changes
 - PMM_* to ETH_*
 - pmm_* to eth_*

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agonet/qede/base: update
Rasesh Mody [Wed, 19 Oct 2016 04:11:25 +0000 (21:11 -0700)]
net/qede/base: update

This patch updates the base driver and incorporates necessary changes
required to bring in the new firmware 8.10.9.0.

In addition, it would allow driver to add new functionalities that might
be needed in future.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agonet/qede/base: add selftest and query sensor info
Harish Patil [Wed, 19 Oct 2016 04:11:24 +0000 (21:11 -0700)]
net/qede/base: add selftest and query sensor info

This patch adds API support for NIC selftests (BIST) and APIs to retrieve
GPIO info, sensor data like temperature, MBA versions, ECC events etc.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
8 years agonet/qede/base: serialize access to MFW mbox
Harish Patil [Wed, 19 Oct 2016 04:11:23 +0000 (21:11 -0700)]
net/qede/base: serialize access to MFW mbox

Add ecore_mcp_mb_lock() and ecore_mcp_mb_unlock() APIs to ensure
a single thread is accessing MFW mailbox.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
8 years agonet/qede/base: change signature of MCP command
Harish Patil [Wed, 19 Oct 2016 04:11:22 +0000 (21:11 -0700)]
net/qede/base: change signature of MCP command

Change ecore_mcp_cmd_and_union() to accept pointer to a structure rather
than accepting multiple arguments. A new struct ecore_mcp_mb_params is
added for that purpose. Also make this function static. This change is
mostly keeping in mind the future requests which needs additional
arguments.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
8 years agonet/qede/base: fix 32-bit build
Rasesh Mody [Wed, 19 Oct 2016 04:11:21 +0000 (21:11 -0700)]
net/qede/base: fix 32-bit build

Fix 32 bit compilation for gcc version 4.3.4.

Fixes: ec94dbc57362 ("qede: add base driver")

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agonet/qede/base: update formatting and comments
Rasesh Mody [Wed, 19 Oct 2016 04:11:20 +0000 (21:11 -0700)]
net/qede/base: update formatting and comments

Change details:
 - adds new comments
 - modifies some of the existing comments
 - abstract code into macros
 - split long lines

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agonet/qede/base: add attention formatting string
Rasesh Mody [Wed, 19 Oct 2016 04:11:19 +0000 (21:11 -0700)]
net/qede/base: add attention formatting string

In case of attention from a signal that's represented by multiple bits
in misc AEU, add the format string which is populated with proper index
and resulting prints will show string as a prefix.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agonet/qede/base: add HSI changes and register defines
Rasesh Mody [Wed, 19 Oct 2016 04:11:18 +0000 (21:11 -0700)]
net/qede/base: add HSI changes and register defines

- add the hardware software interface(HSI) changes
- add register definitions

These will be required for 8.10.9.0 FW upgrade.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agonet/qede: use firmware config macros as needed
Rasesh Mody [Wed, 19 Oct 2016 04:11:17 +0000 (21:11 -0700)]
net/qede: use firmware config macros as needed

Replaced CONFIG_QED_BINARY_FW with CONFIG_ECORE_BINARY_FW.
Use CONFIG_ECORE_BINARY_FW and CONFIG_ECORE_ZIPPED_FW defines as
required.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agonet/qede/base: formatting changes
Rasesh Mody [Wed, 19 Oct 2016 04:11:16 +0000 (21:11 -0700)]
net/qede/base: formatting changes

Fixes white spaces and tabs.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agonet/qede/base: add new files and rearrange the code
Rasesh Mody [Wed, 19 Oct 2016 04:11:15 +0000 (21:11 -0700)]
net/qede/base: add new files and rearrange the code

Added ecore_hsi_debug_tools.h, ecore_hsi_init_func.h,
ecore_hsi_init_tool.h files. Rearranged code from ecore_hsi_common.h and
ecore_hsi_tools.h to the new files. Removed unused code.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agonet/mlx5: fix initialization in secondary process
Olivier Gournet [Mon, 17 Oct 2016 12:56:33 +0000 (14:56 +0200)]
net/mlx5: fix initialization in secondary process

The changes introduced by previous commits (ones in fixes lines) made
secondaries attempt to reinitialize the Tx queue structures of the primary
instead of their own, for which they also do not allocate enough memory,
leading to crashes.

Fixes: 1d88ba171942 ("net/mlx5: refactor Tx data path")
Fixes: 21c8bb4928c9 ("net/mlx5: split Tx queue structure")

Signed-off-by: Olivier Gournet <ogournet@corp.free.fr>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agonet/fm10k: fix VF Tx queue initialization
Xiao Wang [Wed, 19 Oct 2016 01:30:14 +0000 (09:30 +0800)]
net/fm10k: fix VF Tx queue initialization

The SGLORT (Source Global Resource Tag) of the VF queues should be
assigned by PF driver, VF driver should not set these registers.

Fixes: 3b845bf6bcd9 ("fm10k: fix switch manager high CPU usage")

Reported-by: Sarath Somasekharan <sarathx.somasekharan@intel.com>
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
8 years agonet/mlx5: fix link status report
Olga Shern [Mon, 17 Oct 2016 11:10:48 +0000 (13:10 +0200)]
net/mlx5: fix link status report

This commit fixes link status report on device start up when
lcs callback is configured.

Fixes: 62072098b54e ("mlx5: support setting link up or down")

Signed-off-by: Olga Shern <olgas@mellanox.com>
8 years agonet/fm10k: fix out of order Rx read
Qi Zhang [Mon, 17 Oct 2016 18:29:42 +0000 (02:29 +0800)]
net/fm10k: fix out of order Rx read

In vPMD, when we load Rx desc with _mm_loadu_si128, the volatile
modifier will be cast away, allowing the compiler to reorder the
load instructions.

The Rx recv function's correctness is relying on these load
instructions following a strict sequence, reading the descriptors
in reverse order, so we add compiler barrier to prevent compiler
reorder.

Fixes: 7092be8437bd ("fm10k: add vector Rx")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agonet/ixgbe: fix out of order Rx read
Qi Zhang [Mon, 17 Oct 2016 18:29:41 +0000 (02:29 +0800)]
net/ixgbe: fix out of order Rx read

In vPMD, when we load Rx desc with _mm_loadu_si128, the volatile
modifier will be cast away, allowing the compiler to reorder the
load instructions.

The Rx recv function's correctness is relying on these load
instructions following a strict sequence, reading the descriptors
in reverse order, so we add compiler barrier to prevent compiler
reorder.

Fixes: c95584dc2b18 ("ixgbe: new vectorized functions for Rx/Tx")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agonet/i40e: fix out of order Rx read
Qi Zhang [Mon, 17 Oct 2016 18:29:40 +0000 (02:29 +0800)]
net/i40e: fix out of order Rx read

In vPMD, when we load Rx desc with _mm_loadu_si128, the volatile
modifier will be cast away, allowing the compiler to reorder the
load instructions.

The Rx recv function's correctness is relying on these load
instructions following a strict sequence, reading the descriptors
in reverse order, so we add compiler barrier to prevent compiler
reorder.

Fixes: 9ed94e5bb04e ("i40e: add vector Rx")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agonet/enic: fix UDP port in flow director
John Daley [Tue, 18 Oct 2016 05:17:08 +0000 (22:17 -0700)]
net/enic: fix UDP port in flow director

This fixes issue found by Coverity where a typo caused the flow director
UDP IPv4 source port mask to be assigned the destination port mask
supplied by the caller.

Coverity issue: 137860
Fixes: dfbd6a9cb504 ("net/enic: extend flow director support for 1300 series")

Signed-off-by: John Daley <johndale@cisco.com>
8 years agonet/enic: fix multi-queue Rx performance
John Daley [Wed, 12 Oct 2016 21:22:29 +0000 (14:22 -0700)]
net/enic: fix multi-queue Rx performance

The rx_free_thresh was not being initialized and left at 0
on 1/2 of the RQs which could lead to poor multi-queue
performance.

Fixes: 856d7ba7ed22 ("net/enic: support scattered Rx")

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
8 years agonet/enic: rename functions for queue index conversion
John Daley [Wed, 12 Oct 2016 21:12:03 +0000 (14:12 -0700)]
net/enic: rename functions for queue index conversion

The function names for converting between RQ indexes known to
the RTE code and internal RQ indexes for primary Start of Packet
(SOP) queues and spill-over (Data) queues was unclear and
confusing.

Clarify with more explicit function names.

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
8 years agonet/enic: fix crash on MTU update or Rx queue reconfigure
John Daley [Wed, 12 Oct 2016 21:12:02 +0000 (14:12 -0700)]
net/enic: fix crash on MTU update or Rx queue reconfigure

The incorrect completion queue corresponding to an RQ would be
freed if multiple Rx queues are in use and the MTU is changed,
or an Rx queue is released. This could lead to a segmentation fault
when the device is disabled or even in the Rx or Tx paths.

The index of the completion queue corresponding to a RQ needed
to be adjusted after Rx scatter was introduced.

Fixes: 856d7ba7ed22 ("net/enic: support scattered Rx")

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
8 years agonet/enic: revert truncated packets counter fix
Nelson Escobar [Wed, 12 Oct 2016 20:11:29 +0000 (13:11 -0700)]
net/enic: revert truncated packets counter fix

The reason this commit was needed was because of a misconfiguration of
the receive queue when not using Rx scatter.  This patch is
unnecessary if the receive queue is configured correctly.

Fixes: d142e1ac1089 ("net/enic: fix calculation of truncated packets")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
8 years agonet/enic: fix Rx queue index when not using Rx scatter
Nelson Escobar [Wed, 12 Oct 2016 20:11:28 +0000 (13:11 -0700)]
net/enic: fix Rx queue index when not using Rx scatter

The Rx scatter patch was accidentally setting the index of the
secondary receive queue in the primary receive queue's initialization
when the secondary receive queue wasn't needed and was disabled.  This
caused some misleading hardware counters in some situations.

Fixes: 856d7ba7ed22 ("net/enic: support scattered Rx")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
8 years agoapp/testpmd: fix flow director endianness
Wenzhuo Lu [Wed, 19 Oct 2016 01:23:00 +0000 (09:23 +0800)]
app/testpmd: fix flow director endianness

The vlan mask and tunnel id mask of flow director are defined as big
endian. So they should be converted.
When the mask is printed, the parameters are not converted either.
This patch converts the mask parameters.

Fixes: 7c554b4f0484 ("app/testpmd: update display of flow director information")
Fixes: 53b2bb9b7ea7 ("app/testpmd: new flow director commands")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agoapp/testpmd: fix flow director mask
Wenzhuo Lu [Wed, 19 Oct 2016 01:22:59 +0000 (09:22 +0800)]
app/testpmd: fix flow director mask

In mac-vlan mode, MAC address mask is not supported by HW.
The MAC address mask should not be set in mac-vlan mode.
Remove this parameter from the CLI. Remove MAC address
from mask print too.

Fixes: 53b2bb9b7ea7 ("app/testpmd: new flow director commands")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agonet/ixgbe: fix flow director mask
Wenzhuo Lu [Wed, 19 Oct 2016 01:22:58 +0000 (09:22 +0800)]
net/ixgbe: fix flow director mask

In mac-vlan mode, MAC address mask is not supported by HW.
The MAC address mask should not be set in mac-vlan mode.
Instead, only set it in tunnel mode.

Fixes: 82fb702077f6 ("ixgbe: support new flow director modes for X550")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agonet/mlx5: fix hash key size retrieval
Nélio Laranjeiro [Fri, 14 Oct 2016 07:30:14 +0000 (09:30 +0200)]
net/mlx5: fix hash key size retrieval

Return RSS key size in struct rte_eth_dev_info.

Fixes: 0f6f219e7919 ("app/testpmd: fix RSS hash key size")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agonet/bnx2x: fix build with icc
Ferruh Yigit [Fri, 30 Sep 2016 14:14:13 +0000 (15:14 +0100)]
net/bnx2x: fix build with icc

When bnx2x debug config enabled, icc (ICC) 17.0.0 20160721
gives the following compilation error:

.../drivers/net/bnx2x/elink.c(6682):
error #3656: variable "fw_ver1" may be used before its value is set
PMD_DRV_LOG(DEBUG,
^

According logic in the code, this error is a false positive,
but since this is not in the fast path, fixing compiler error by
assigning initial value to variable.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Rasesh Mody <rasesh.mody@qlogic.com>
8 years agonet/i40e: make vector driver filenames consistent
Jianbo Liu [Fri, 14 Oct 2016 04:00:03 +0000 (09:30 +0530)]
net/i40e: make vector driver filenames consistent

To be consistent with the naming for ARM NEON implementation,
i40e_rxtx_vec.c is renamed to i40e_rxtx_vec_sse.c.

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agonet/i40e: implement vector PMD for ARM
Jianbo Liu [Fri, 14 Oct 2016 04:00:01 +0000 (09:30 +0530)]
net/i40e: implement vector PMD for ARM

Use ARM NEON intrinsic to implement i40e vPMD

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agonet/i40e: extract non-x86 specific code from vector driver
Jianbo Liu [Fri, 14 Oct 2016 04:00:00 +0000 (09:30 +0530)]
net/i40e: extract non-x86 specific code from vector driver

move scalar code which does not use x86 intrinsic functions to new file
"i40e_rxtx_vec_common.h", while keeping x86 code in i40e_rxtx_vec.c.
This allows the scalar code to to be shared among vector drivers for
different platforms.

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agovhost: support indirect descriptor in non-mergeable Rx
Maxime Coquelin [Tue, 18 Oct 2016 15:35:39 +0000 (17:35 +0200)]
vhost: support indirect descriptor in non-mergeable Rx

Linux virtio-net kernel driver uses indirect descriptors when
mergeable buffers are not used.

This patch adds its support, fixing the use of indirect
descriptors with these guests.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
8 years agovhost: support indirect descriptor in mergeable Rx
Maxime Coquelin [Tue, 18 Oct 2016 15:35:38 +0000 (17:35 +0200)]
vhost: support indirect descriptor in mergeable Rx

Windows virtio-net driver uses indirect descriptors with
mergeable buffers.

This patch adds its support, fixing the use of indirect
descriptors with these guests.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
8 years agovhost: fix use after free
Yuanhan Liu [Tue, 18 Oct 2016 14:38:06 +0000 (22:38 +0800)]
vhost: fix use after free

Fix the coverity USE_AFTER_FREE issue.

Coverity issue: 137884
Fixes: a277c7159876 ("vhost: refactor code structure")

Reported-by: John McNamara <john.mcnamara@intel.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
8 years agovhost: retrieve available head once
Yuanhan Liu [Fri, 14 Oct 2016 09:34:38 +0000 (17:34 +0800)]
vhost: retrieve available head once

There is no need to retrieve the latest avail head every time we enqueue
a packet in the mereable Rx path by

    avail_idx = *((volatile uint16_t *)&vq->avail->idx);

Instead, we could just retrieve it once at the beginning of the enqueue
path. This could diminish the cache penalty slightly, because the virtio
driver could be updating it while vhost is reading it (for each packet).

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Reviewed-by: Jianbo Liu <jianbo.liu@linaro.org>
Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
8 years agovhost: prefetch available ring
Yuanhan Liu [Fri, 14 Oct 2016 09:34:37 +0000 (17:34 +0800)]
vhost: prefetch available ring

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Reviewed-by: Jianbo Liu <jianbo.liu@linaro.org>
Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
8 years agovhost: shadow used ring update
Zhihong Wang [Fri, 14 Oct 2016 09:34:36 +0000 (17:34 +0800)]
vhost: shadow used ring update

The basic idea is to shadow the used ring update: update them into a
local buffer first, and then flush them all to the virtio used vring
at once in the end.

And since we do avail ring reservation before enqueuing data, we would
know which and how many descs will be used. Which means we could update
the shadow used ring at the reservation time. It also introduce another
slight advantage: we don't need access the desc->flag any more inside
copy_mbuf_to_desc_mergeable().

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Jianbo Liu <jianbo.liu@linaro.org>
Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
8 years agovhost: use last available index for ring reservation
Yuanhan Liu [Fri, 14 Oct 2016 09:34:35 +0000 (17:34 +0800)]
vhost: use last available index for ring reservation

shadow_used_ring will be introduced later. Since then last avail
idx will not be updated together with last used idx.

So, here we use last_avail_idx for avail ring reservation.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Reviewed-by: Jianbo Liu <jianbo.liu@linaro.org>
Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
8 years agovhost: simplify mergeable Rx vring reservation
Yuanhan Liu [Fri, 14 Oct 2016 09:34:34 +0000 (17:34 +0800)]
vhost: simplify mergeable Rx vring reservation

Let it return "num_buffers" we reserved, so that we could re-use it
with copy_mbuf_to_desc_mergeable() directly, instead of calculating
it again there.

Meanwhile, the return type of copy_mbuf_to_desc_mergeable is changed
to "int". -1 will be return on error.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Reviewed-by: Jianbo Liu <jianbo.liu@linaro.org>
Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
8 years agovhost: optimize cache access
Zhihong Wang [Fri, 14 Oct 2016 09:34:33 +0000 (17:34 +0800)]
vhost: optimize cache access

This patch reorders the code to delay virtio header write to improve
cache access efficiency for cases where the mrg_rxbuf feature is turned
on. CPU pipeline stall cycles can be significantly reduced.

Virtio header write and mbuf data copy are all remote store operations
which takes a long time to finish. It's a good idea to put them together
to remove bubbles in between, to let as many remote store instructions
as possible go into store buffer at the same time to hide latency, and
to let the H/W prefetcher goes to work as early as possible.

On a Haswell machine, about 100 cycles can be saved per packet by this
patch alone. Taking 64B packets traffic for example, this means about 60%
efficiency improvement for the enqueue operation.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Jianbo Liu <jianbo.liu@linaro.org>
Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
8 years agovhost: remove useless volatile
Zhihong Wang [Fri, 14 Oct 2016 09:34:32 +0000 (17:34 +0800)]
vhost: remove useless volatile

last_used_idx is a local var, there is no need to decorate it
by "volatile".

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Reviewed-by: Jianbo Liu <jianbo.liu@linaro.org>
Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
8 years agovhost: access header only if offloading is supported
Maxime Coquelin [Fri, 14 Oct 2016 08:07:07 +0000 (10:07 +0200)]
vhost: access header only if offloading is supported

If offloading features are not negotiated, parsing the virtio header
is not needed.

Micro-benchmark with testpmd shows that the gain is +4% with indirect
descriptors, +1% when using direct descriptors.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
8 years agoethdev: prevent duplicate event callback
E. Scott Daniels [Thu, 20 Oct 2016 13:34:41 +0000 (09:34 -0400)]
ethdev: prevent duplicate event callback

This change prevents the attempt to add a structure which is
already on the callback list. If a struct with matching
parameters is found on the list, then no action is taken.

Fixes: ac2f69c ("ethdev: fix crash if malloc of user callback fails")

Signed-off-by: E. Scott Daniels <daniels@research.att.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agomempool: fix search of maximum contiguous pages
Wei Dai [Tue, 25 Oct 2016 15:01:11 +0000 (17:01 +0200)]
mempool: fix search of maximum contiguous pages

paddr[i] + pg_sz always points to the start physical address of the
2nd page after pddr[i], so only up to 2 pages can be combinded to
be used. With this revision, more than 2 pages can be used.

Fixes: 84121f197187 ("mempool: store memory chunks in a list")

Signed-off-by: Wei Dai <wei.dai@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agoapp/testpmd: fix PF/VF check of flow director
Wenzhuo Lu [Wed, 19 Oct 2016 01:12:15 +0000 (09:12 +0800)]
app/testpmd: fix PF/VF check of flow director

Parameters pf & vf are added into most of flow director
filter CLIs.
But mac-vlan and tunnel filters don't have these parameters,
the parameters should not be checked for mac-vlan and tunnel
filters.

Fixes: e6a68c013353 ("app/testpmd: extend commands for flow director in VF")

Reported-by: Frederico Cadete <frederico.cadete-ext@oneaccess-net.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agocrypto: register aliases for renamed vdev drivers
Jan Blunck [Mon, 24 Oct 2016 16:22:23 +0000 (12:22 -0400)]
crypto: register aliases for renamed vdev drivers

This registers the legacy names of the driver being renamed in
commit 2f45703c17ac ("drivers: make driver names consistent").

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Tested-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
8 years agonet: register aliases for renamed vdev drivers
Jan Blunck [Mon, 24 Oct 2016 16:22:22 +0000 (12:22 -0400)]
net: register aliases for renamed vdev drivers

This registers the legacy names of the driver being renamed in
commit 2f45703c17ac ("drivers: make driver names consistent").

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
8 years agoeal: add driver name alias
Jan Blunck [Mon, 24 Oct 2016 16:22:21 +0000 (12:22 -0400)]
eal: add driver name alias

This adds infrastructure for drivers to allow being requested by an alias
so that a renamed driver can still get loaded by its legacy name.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
8 years agoexamples/l3fwd: use accelerated CRC on ARM
Hemant Agrawal [Fri, 14 Oct 2016 11:10:56 +0000 (16:40 +0530)]
examples/l3fwd: use accelerated CRC on ARM

if machine level CRC extension are available, offload the
hash to machine provide functions e.g. armv8-a CRC extensions
support it

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
8 years agoexamples/tep_term: fix packet length with multi-segments
Michael Qiu [Tue, 18 Oct 2016 05:49:07 +0000 (13:49 +0800)]
examples/tep_term: fix packet length with multi-segments

For multi-seg mbuf, ip->total_length should be pkt_len subtract
ether len.

Fixes: 4abe471ed6fc ("examples/tep_term: implement VXLAN processing")

Signed-off-by: Michael Qiu <qiudayu@chinac.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
8 years agoexamples/tep_term: fix L4 length
Michael Qiu [Tue, 18 Oct 2016 05:49:06 +0000 (13:49 +0800)]
examples/tep_term: fix L4 length

l4_len is not fixed, althrough mostly it is a fixed value,
but when guest using iperf to do some tests, the l4_len
will have another 12 bytes optional fields.

Fixes: 2bb43bd4350a ("examples/tep_term: add TSO offload configuration")

Signed-off-by: Michael Qiu <qiudayu@chinac.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
8 years agoexamples/ip_pipeline: fix build with gcc 6
Jasvinder Singh [Mon, 17 Oct 2016 10:51:16 +0000 (11:51 +0100)]
examples/ip_pipeline: fix build with gcc 6

This patch fixes the misleading indentation error on compiling
ip_pipeline app with gcc v6.2.1.

Fixes: 3f2c9f3bb6c6 ("examples/ip_pipeline: add TAP port")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agoexamples/ip_pipeline: fix build on BSD
Jasvinder Singh [Mon, 17 Oct 2016 15:48:57 +0000 (16:48 +0100)]
examples/ip_pipeline: fix build on BSD

Error log:
 CC init.o
 examples/ip_pipeline/init.c:38:22: fatal error: linux/if.h: No such file or directory
 #include <linux/if.h>

Fixes: 3f2c9f3bb6c6 ("examples/ip_pipeline: add TAP port")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agokni: fix build with kernel 4.9
Ferruh Yigit [Mon, 17 Oct 2016 10:23:14 +0000 (11:23 +0100)]
kni: fix build with kernel 4.9

compile error:
  CC [M]  .../lib/librte_eal/linuxapp/kni/igb_main.o
.../lib/librte_eal/linuxapp/kni/igb_main.c:2317:21:
error: initialization from incompatible pointer type
[-Werror=incompatible-pointer-types]
  .ndo_set_vf_vlan = igb_ndo_set_vf_vlan,
                     ^~~~~~~~~~~~~~~~~~~

Linux kernel 4.9 updates API for ndo_set_vf_vlan:
Linux: 79aab093a0b5 ("net: Update API for VF vlan protocol 802.1ad support")

Use new API for Linux kernels >= 4.9

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agokni: fix build with kernel < 3.1
Ferruh Yigit [Fri, 14 Oct 2016 16:41:54 +0000 (17:41 +0100)]
kni: fix build with kernel < 3.1

compile error:
  CC [M]  .../lib/librte_eal/linuxapp/kni/kni_misc.o
cc1: warnings being treated as errors
.../lib/librte_eal/linuxapp/kni/kni_misc.c: In function ‘kni_exit_net’:
.../lib/librte_eal/linuxapp/kni/kni_misc.c:113:18:
error: unused variable ‘knet’

For kernel versions < v3.1 mutex_destroy() is a macro and does nothing,
this cause an unused variable warning for knet which used in the
mutex_destroy()

mutex_destroy() converted into static inline function with commit:
Linux: 4582c0a4866e ("mutex: Make mutex_destroy() an inline function")

To fix the warning unused attribute added to the knet variable.

Fixes: 93a298b34e1b ("kni: support core id parameter in single threaded mode")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
8 years agoversion: 16.11-rc1
Thomas Monjalon [Fri, 14 Oct 2016 00:34:11 +0000 (02:34 +0200)]
version: 16.11-rc1

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agodoc: fix libcrypto guide title
Pablo de Lara [Thu, 13 Oct 2016 19:25:29 +0000 (20:25 +0100)]
doc: fix libcrypto guide title

Libcrypto documentation was missing the equal signs ("="),
in its title, so it was not present in the documentation
generated.

Fixes: d61f70b4c918 ("crypto/libcrypto: add driver for OpenSSL library")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agodoc: how to build KASUMI as shared library
Pablo de Lara [Thu, 13 Oct 2016 19:21:53 +0000 (20:21 +0100)]
doc: how to build KASUMI as shared library

Libsso KASUMI library has to be built with specific
parameters to make the KASUMI PMD be built as
a shared library, so a note has been added in
its documentation.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agodoc: add ZUC shared library limitation
Pablo de Lara [Thu, 13 Oct 2016 18:48:15 +0000 (19:48 +0100)]
doc: add ZUC shared library limitation

ZUC PMD cannot be built as a shared library, due to
the fact that some assembly code in the underlying libsso
library is not relocatable.
This will be fixed in the future, but for the moment,
it is added as a limitationof the PMD.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agocrypto/libcrypto: fix init function names
Pablo de Lara [Tue, 11 Oct 2016 01:15:05 +0000 (02:15 +0100)]
crypto/libcrypto: fix init function names

All init/uninit function names in the virtual devices have been renamed,
so they finish with probe or remove, so to keep consistency,
same thing should be done in this PMD.

Fixes: d61f70b4c918 ("crypto/libcrypto: add driver for OpenSSL library")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
8 years agocrypto/zuc: fix init function names
Pablo de Lara [Tue, 11 Oct 2016 01:14:52 +0000 (02:14 +0100)]
crypto/zuc: fix init function names

All init/uninit function names in the virtual devices have been renamed,
so they finish with probe or remove, so to keep consistency,
same thing should be done in this PMD.

Fixes: cf7685d68f00 ("crypto/zuc: add driver for ZUC library")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
8 years agoapp/test: store digest/IV at a DMA able address
Akhil Goyal [Wed, 12 Oct 2016 11:16:29 +0000 (16:46 +0530)]
app/test: store digest/IV at a DMA able address

For physical crypto devices, IV and digest are processed by the crypto
device which needs the contents to be written on some DMA able address.

So in order to do that, IV and digest are accomodated in the packet.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
8 years agoapp/test: fix crypto mbuf pool size
Piotr Azarewicz [Tue, 11 Oct 2016 10:06:53 +0000 (12:06 +0200)]
app/test: fix crypto mbuf pool size

The created pool for crypto mbufs may be too big in some
environments.
To avoid this issue, mbuf pool is reverted to its previous size.
Moreover, here is added additional small pool with one large mbuf,
that is needed in large data test scenarios.

Fixes: ffbe3be0d4b5 ("app/test: add libcrypto")

Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
8 years agoexamples/l2fwd-crypto: fix verify with decrypt in chain
Piotr Azarewicz [Wed, 12 Oct 2016 08:58:44 +0000 (10:58 +0200)]
examples/l2fwd-crypto: fix verify with decrypt in chain

This patch fixes crypto operation data parameters setting
in l2fwd-crypto application, making decryption in chain
with auth verification work.

How to reproduce the issue:

1. Run l2fwd_crypto with command:
-c 0x3 -n 4 --vdev "crypto_aesni_mb" \
--vdev "crypto_aesni_mb" \
-- -p 0x3 --chain CIPHER_HASH \
--cipher_op ENCRYPT --cipher_algo AES_CBC \
--cipher_key 00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:0f \
--iv 00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:ff \
--auth_op GENERATE --auth_algo SHA1_HMAC \
--auth_key
11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:
11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:
11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11

2. Send packet with payload and capture forwarded packet.
Payload in forwarded packet is encrypted, what is good.

3. Run l2fwd_crypto with command:
-c 0x3 -n 4 --vdev "crypto_aesni_mb" \
--vdev "crypto_aesni_mb" \
-- -p 0x3 --chain HASH_CIPHER \
--cipher_op DECRYPT --cipher_algo AES_CBC \
--cipher_key 00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:0f \
--iv 00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:ff \
--auth_op VERIFY --auth_algo SHA1_HMAC \
--auth_key
11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:
11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:
11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11

4. Send earlier captured packet and capture forwarded packet.
Payload in newly captured packet is not decrypted, what is wrong.

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

Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
8 years agoapp/test: reduce libcrypto operations number
Marcin Kerlin [Mon, 10 Oct 2016 08:07:50 +0000 (10:07 +0200)]
app/test: reduce libcrypto operations number

This patch reduce the number of total operations from 1M to 10K,
because test is taking too long time now.

Fixes: ffbe3be0d4b5 ("app/test: add libcrypto")

Signed-off-by: Marcin Kerlin <marcinx.kerlin@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agonet/ixgbe: add application callback on VF to PF messsage
Bernard Iremonger [Mon, 10 Oct 2016 14:34:15 +0000 (15:34 +0100)]
net/ixgbe: add application callback on VF to PF messsage

call _rte_eth_dev_callback_process from ixgbe_rcv_msg_from_vf function.

The callback asks the user application if it is allowed to perform
the function.

If the cb_param.retval is RTE_PMD_IXGBE_MB_EVENT_PROCEED then continue,
if 0, do nothing and send ACK to VF
if > 1, do nothing and send NAK to VF.

Signed-off-by: Alex Zelezniak <alexz@att.com>
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
8 years agoethdev: add an argument to internal callback function
Bernard Iremonger [Mon, 10 Oct 2016 14:34:14 +0000 (15:34 +0100)]
ethdev: add an argument to internal callback function

add cb_arg parameter to the _rte_eth_dev_callback_process function.

Adding a parameter to this function allows passing information
to the application when an eth device event occurs such as
a VF to PF message.
This allows the application to decide if a particular function
is permitted.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Signed-off-by: Alex Zelezniak <alexz@att.com>
8 years agodrivers: rename register macro prefix
Shreyansh Jain [Mon, 10 Oct 2016 05:43:15 +0000 (11:13 +0530)]
drivers: rename register macro prefix

All macros related to driver registeration renamed from DRIVER_*
to RTE_PMD_*

This includes:

 DRIVER_REGISTER_PCI -> RTE_PMD_REGISTER_PCI
 DRIVER_REGISTER_PCI_TABLE -> RTE_PMD_REGISTER_PCI_TABLE
 DRIVER_REGISTER_VDEV -> RTE_PMD_REGISTER_VDEV
 DRIVER_REGISTER_PARAM_STRING -> RTE_PMD_REGISTER_PARAM_STRING
 DRIVER_EXPORT_* -> RTE_PMD_EXPORT_*

Fix PMDINFOGEN tool to look for matches of RTE_PMD_REGISTER_*.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agonet/i40e: implement new Rx checksum flag
Xiao Wang [Tue, 6 Sep 2016 01:27:32 +0000 (09:27 +0800)]
net/i40e: implement new Rx checksum flag

Add CKSUM_GOOD flag to distinguish a good checksum from an unknown one.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
8 years agonet/ixgbe: implement new Rx checksum flag
Xiao Wang [Tue, 6 Sep 2016 01:27:31 +0000 (09:27 +0800)]
net/ixgbe: implement new Rx checksum flag

Add CKSUM_GOOD flag to distinguish a good checksum from an unknown one.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
8 years agonet/e1000: implement new Rx checksum flag
Xiao Wang [Tue, 6 Sep 2016 01:27:30 +0000 (09:27 +0800)]
net/e1000: implement new Rx checksum flag

Add CKSUM_GOOD flag to distinguish a good checksum from an unknown one.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
8 years agonet/fm10k: implement new Rx checksum flag
Xiao Wang [Tue, 6 Sep 2016 01:27:29 +0000 (09:27 +0800)]
net/fm10k: implement new Rx checksum flag

Add CKSUM_GOOD flag to distinguish a good checksum from an unknown one.
Since vector Rx supports checksum offload, this patch removes the
hw_ip_checksum check in fm10k_rx_vec_condition_check().

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
8 years agonet/fm10k: fix Rx checksum flags
Xiao Wang [Tue, 6 Sep 2016 01:27:28 +0000 (09:27 +0800)]
net/fm10k: fix Rx checksum flags

A previous patch removed some necessary lines about Rx checksum offload
by mistake, this patch adds them back.

Fixes: 6046898f5097 ("net/mbuf: remove unused Rx error flags")

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
8 years agonet/ixgbe: support checksum flags in SSE vector Rx
Olivier Matz [Thu, 7 Jul 2016 12:19:02 +0000 (14:19 +0200)]
net/ixgbe: support checksum flags in SSE vector Rx

Update desc_to_olflags_v() to set PKT_RX_IP_CKSUM_BAD and
PKT_RX_L4_CKSUM_BAD in the ol_fags of the mbuf.

The Rx vector function can now be used with hw_ip_checksum
enabled.

Tested with:

  cd dpdk.org/
  make config T=x86_64-native-linuxapp-gcc
  make -j32
  mkdir -p /mnt/huge
  mount -t hugetlbfs nodev /mnt/huge
  echo 256 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
  modprobe uio_pci_generic
  python tools/dpdk_nic_bind.py -b uio_pci_generic 0000:04:00.0
  ./build/app/testpmd -l 2,4 -- --total-num-mbufs=65536 -i --port-topology=chained --enable-rx-cksum --disable-hw-vlan-filter --disable-hw-vlan-strip
    set fwd rxonly
    set verbose 1
    start

  # send packets to testpmd using scapy
  eh = Ether(src="00:01:02:03:04:05", dst="00:1B:21:AB:8F:10")
  p = Ether()/IP(src="1.1.1.1", dst="1.1.1.2")/UDP()/Raw("x"*50)
  sendp(p, iface="ixgbe2")
  p = Ether()/IP(src="1.1.1.1", dst="1.1.1.2", chksum=42)/UDP()/Raw("x"*50)
  sendp(p, iface="ixgbe2")
  p = Ether()/IP(src="1.1.1.1", dst="1.1.1.2")/UDP(chksum=42)/Raw("x"*50)
  sendp(p, iface="ixgbe2")
  p = Ether()/IP(src="1.1.1.1", dst="1.1.1.2", chksum=45)/UDP(chksum=42)/Raw("x"*50)
  sendp(p, iface="ixgbe2")

  # result
  port 0/queue 0: received 1 packets
    src=00:01:02:03:04:05 - dst=00:1B:21:AB:8F:10 - type=0x0800 - length=92 - nb_segs=1Unknown packet type
   - Receive queue=0x0
  port 0/queue 0: received 1 packets
    src=00:01:02:03:04:05 - dst=00:1B:21:AB:8F:10 - type=0x0800 - length=92 - nb_segs=1Unknown packet type
   - Receive queue=0x0
    PKT_RX_IP_CKSUM_BAD
  port 0/queue 0: received 1 packets
    src=00:01:02:03:04:05 - dst=00:1B:21:AB:8F:10 - type=0x0800 - length=92 - nb_segs=1Unknown packet type
   - Receive queue=0x0
    PKT_RX_L4_CKSUM_BAD
  port 0/queue 0: received 1 packets
    src=00:01:02:03:04:05 - dst=00:1B:21:AB:8F:10 - type=0x0800 - length=92 - nb_segs=1Unknown packet type
   - Receive queue=0x0
    PKT_RX_L4_CKSUM_BAD
    PKT_RX_IP_CKSUM_BAD

Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Remy Horton <remy.horton@intel.com>