dpdk.git
8 years agoeal/arm: fix file descriptor leak when getting CPU features
Jianbo Liu [Fri, 4 Nov 2016 09:46:42 +0000 (15:16 +0530)]
eal/arm: fix file descriptor leak when getting CPU features

Close the file descriptor after finish using it.

Fixes: b94e5c94 ("eal/arm: add CPU flags for ARMv7")
Fixes: 97523f82 ("eal/arm: add CPU flags for ARMv8")

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
Acked-by: Jan Viktorin <viktorin@rehivetech.com>
8 years agoethdev: rename library for consistency
Thomas Monjalon [Sun, 6 Nov 2016 18:18:23 +0000 (19:18 +0100)]
ethdev: rename library for consistency

The library was named libethdev without rte_ prefix.
It is now fixed, the library namespace is consistent.

Note: the ABI version has already been changed in this release cycle.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agolib: fix ABI version after device model rework
Shreyansh Jain [Thu, 27 Oct 2016 11:29:12 +0000 (16:59 +0530)]
lib: fix ABI version after device model rework

rte_device/driver generalization patches [1] were merged without a change
in the LIBABIVER variable. This patches bumps the macro of affected libs:

- libcryptodev and libetherdev have been bumped
- librte_eal version changed in
  d7e61ad3ae36 ("log: remove deprecated history dump")

Details of ABI/API changes:
- EAL [version already bumped in: d7e61ad3ae36]
  |- type field was removed from rte_driver
  |- rte_pci_device now embeds rte_device
  |- rte_pci_resource renamed to rte_mem_resource
  |- numa_node and devargs of rte_pci_driver is moved to rte_driver
  |- APIs for device hotplug (attach/detach) moved into EAL
  |- API rte_eal_pci_device_name added for PCI device naming
  |- vdev registration API introduced (rte_eal_vdrv_register,
  |  rte_eal_vdrv_unregister

- librte_crypto (v 1=>2)
  |- removed rte_cryptodev_create_unique_device_name API
  |- moved device naming to EAL

- librte_ethdev (v 4=>5)
  |- rte_eth_dev_type is removed
  |- removed dev_type from rte_eth_dev_allocate API
  |- removed API rte_eth_dev_get_device_type
  |- removed API rte_eth_dev_get_addr_by_port
  |- removed API rte_eth_dev_get_port_by_addr
  |- removed rte_cryptodev_create_unique_device_name API
  |- moved device naming to EAL

Also, deprecation notice from 16.07 has been removed and release notes for
16.11 added.

[1] http://dpdk.org/ml/archives/dev/2016-September/047087.html

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
8 years agomk: fix install-doc without html
Thomas Monjalon [Sun, 6 Nov 2016 16:42:12 +0000 (17:42 +0100)]
mk: fix install-doc without html

When trying to install PDF, man pages or examples without having built
neither HTML API nor HTML guides, there was an error:

% make install-doc
tar: html: Cannot stat: No such file or directory

The fix is to check the html directory before installing HTML files.

Fixes: e4552b9cc603 ("mk: install doc")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoscripts: remove zlib dependency to test qede build
Thomas Monjalon [Sun, 6 Nov 2016 18:36:04 +0000 (19:36 +0100)]
scripts: remove zlib dependency to test qede build

The driver qede does not depend on zlib anymore.

Fixes: 7d178e9ef614 ("net/qede: remove zlib dependency and enable PMD")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Harish Patil <harish.patil@qlogic.com>
8 years agoscripts: ignore const struct checks
Thomas Monjalon [Fri, 4 Nov 2016 15:27:38 +0000 (16:27 +0100)]
scripts: ignore const struct checks

checkpatch raise some false positives when run outside of the kernel tree.

The script checkpatch.pl from the kernel checks a list
of structs known to be const.
It is obviously not relevant as DPDK has not such list.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoscripts: show full headline with checkpatch
Thomas Monjalon [Thu, 3 Nov 2016 08:12:33 +0000 (09:12 +0100)]
scripts: show full headline with checkpatch

The Subject in an email can be split on two lines.
In such case, the second line (starting with a space) can be
joined to the first one.

It is handled differently when parsing stdin or a file.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoscripts: add standard input to checkpatch
Thomas Monjalon [Wed, 2 Nov 2016 14:39:45 +0000 (15:39 +0100)]
scripts: add standard input to checkpatch

It is now possible to check a patch by providing an email
through stdin.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoscripts: fix quiet checkpatch
Thomas Monjalon [Wed, 2 Nov 2016 14:22:30 +0000 (15:22 +0100)]
scripts: fix quiet checkpatch

The commit e13fbc065c7f ("scripts: improve quiet checkpatch")
removed the line "total: 1 errors, 0 warnings, 7 lines checked"
from the quiet report.
Later, commit e7c38f471384 ("scripts: remove useless checkpatch notes")
removed few lines before "total:.*lines checked", so it was not working
well for quiet reporting.

Better to keep the "total:" line in quiet mode and remove the other ones.
That's why the checkpatch.pl option --no-summary is not used anymore
by reverting the commit e13fbc065c7f.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoscripts: show fixes with release version of bug
Thomas Monjalon [Fri, 30 Sep 2016 14:18:42 +0000 (16:18 +0200)]
scripts: show fixes with release version of bug

This script can help to find commits to backport in stable branches.

Fixes are found if there is the word "fix" in the headline or
if there is a tag Fixes: or Reverts: in the message.
Chained fixes of fixes are explored to find the oldest origin.
Fixes of not released bugs are ignored.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
8 years agoversion: 16.11-rc2
Thomas Monjalon [Wed, 26 Oct 2016 21:51:42 +0000 (23:51 +0200)]
version: 16.11-rc2

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoscripts: add more git log checks
Ferruh Yigit [Fri, 23 Sep 2016 12:47:27 +0000 (13:47 +0100)]
scripts: add more git log checks

Alphabetically sorted items to check and
added git log capitalization checks for LRO, NIC and PMD

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
8 years agodoc: add basic guide for devbind
Christian Ehrhardt [Wed, 31 Aug 2016 07:50:12 +0000 (09:50 +0200)]
doc: add basic guide for devbind

This summarizes the "how to call dpdk-devbind" in one place to be
picked up by html/pdf/man-page docs.

That knowledge was available before but spread in various docs along
examples (which are great and have to be kept) as well as in the
--usage/--help option of the tool itself.

As a root only program in sbin it should belong to section 8
"8   System administration commands (usually only for root)"

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Acked-by: Luca Boccassi <lboccass@brocade.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agodoc: add basic guide for pmdinfo
Christian Ehrhardt [Wed, 31 Aug 2016 07:50:11 +0000 (09:50 +0200)]
doc: add basic guide for pmdinfo

This summarizes the "how to call dpdk-pmdinfo" in one place to be picked
up by html/pdf/man-page docs.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Acked-by: Luca Boccassi <lboccass@brocade.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agodoc: render and install man pages
Christian Ehrhardt [Wed, 31 Aug 2016 07:50:10 +0000 (09:50 +0200)]
doc: render and install man pages

This enables the rendering of rst into man pages as well as installing
them (if built) along the binaries. To do so there is a new make target
"doc-guides-man" which will render the rst files into man format.

Currently these three tools had docs that were compatible "enough" to
make up for a reasonable manpage.
- testpmd
- dpdk-pdump
- dpdk-procinfo

Since a man page should be installed along the binary they are not
installed in install-doc but install-runtime insteade. If not explicitly
built by the "doc-guides-man" target before calling install-runtime
there is no change to the old behaviour.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Acked-by: Luca Boccassi <lboccass@brocade.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agodoc: move tool guides in their own subdirectory
Christian Ehrhardt [Wed, 31 Aug 2016 07:50:09 +0000 (09:50 +0200)]
doc: move tool guides in their own subdirectory

This is to clarify the scope of these documents that are more tools than
sample applications.
Also this is a preparation step to add more tools and generate man pages
off of their rst files.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Acked-by: Luca Boccassi <lboccass@brocade.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agodoc: add pdump limitation note
Reshma Pattan [Thu, 13 Oct 2016 15:09:02 +0000 (16:09 +0100)]
doc: add pdump limitation note

The note i.e. "The dpdk-pdump tool can only be used in
conjunction with a primary process which has the packet
capture framework initialized already" is added to
doc/guides/sample_app_ug/pdump.rst to facilitate
easy understanding on the usage of the tool.

Suggested-by: Jianfeng Tan <jianfeng.tan@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
8 years agopdump: revert PCI device name conversion
Reshma Pattan [Tue, 25 Oct 2016 16:31:38 +0000 (17:31 +0100)]
pdump: revert PCI device name conversion

Earlier ethdev library created the device names in the
"bus:device.func" format hence pdump library implemented
its own conversion method for changing the user passed
device name format "domain:bus:device.func" to "bus:device.func"
for finding the port id using device name using ethdev library
calls. Now after ethdev and eal rework
http://dpdk.org/dev/patchwork/patch/15855/,
the device names are created in the format "domain:bus:device.func",
so pdump library conversion is not needed any more, hence removed
the corresponding code.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
8 years agoapp/test: use correct offsets in AES performance test
Fiona Trahe [Mon, 24 Oct 2016 12:00:00 +0000 (13:00 +0100)]
app/test: use correct offsets in AES performance test

offsets for digest and data need to be adjusted
to take prepended IV into account

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
8 years agocrypto/qat: rework request builder for performance
Fiona Trahe [Mon, 24 Oct 2016 11:59:59 +0000 (12:59 +0100)]
crypto/qat: rework request builder for performance

QAT PMD adjusts the buffer start address and offsets passed
to the device so that the DMAs in and out of the device are
64-byte aligned.
This gives more consistent throughput, which had been
variable depending on how the application set up the mbuf.
The message builder code had to be considerably re-factored
to do this efficiently.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
8 years agocrypto/openssl: rename libcrypto to openssl
Slawomir Mrozowicz [Tue, 18 Oct 2016 11:36:13 +0000 (13:36 +0200)]
crypto/openssl: rename libcrypto to openssl

This patch replaces name "libcrypto" to "openssl" from file directories,
symbol prefixes and sub-names connected with old name.
Renamed poll mode driver files, test files, and documentations.
It is done to better name association with library because
the cryptography operations are using Openssl library crypto API.

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

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
8 years agoapp/test: add crypto continual performance tests
Arek Kusztal [Thu, 13 Oct 2016 12:17:41 +0000 (13:17 +0100)]
app/test: add crypto continual performance tests

This commit adds continual performace tests to Intel(R) QuickAssist
Technology tests suite. Performance tests are run continually with
some number of repeating loops.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
8 years agoapp/test: add corrupted data for qat
Arek Kusztal [Thu, 13 Oct 2016 10:03:46 +0000 (11:03 +0100)]
app/test: add corrupted data for qat

This commit adds tests with corrupted data to the Intel QuickAssist
Technology tests suite in test_cryptodev.c

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
8 years agonet/i40e: fix Rx hang when disable LLDP
Qi Zhang [Wed, 19 Oct 2016 20:40:13 +0000 (04:40 +0800)]
net/i40e: fix Rx hang when disable LLDP

Remove stopping LLDP as a workaround for a known
errata which can cause Rx hang.

Ref: Item #70 from
http://www.intel.com/content/www/us/en/embedded/products/networking/xl710-10-40-controller-spec-update.html

Fixes: 4861cde46116 ("i40e: new poll mode driver")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
8 years agonet/ixgbe: support multiqueue mode VMDq DCB with SRIOV
Bernard Iremonger [Wed, 26 Oct 2016 15:28:40 +0000 (16:28 +0100)]
net/ixgbe: support multiqueue mode VMDq DCB with SRIOV

Allow Data Center Bridge (DCB) configuration when SRIOV is enabled.

Signed-off-by: Rahul R Shah <rahul.r.shah@intel.com>
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
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>