Commit Graph

3776 Commits

Author SHA1 Message Date
Dawid Jurczak
16c1814c80 tools: support Python 3 in bind script
This patch fixes syntax errors during binding ethernet device
on systems where Python 3 is default.
Backward compatibility with Python 2 is preserved.

Signed-off-by: Dawid Jurczak <dawid_jurek@vp.pl>
2016-02-09 12:54:09 +01:00
Jeff Shaw
da82ee17e6 tools: fix unbinding failure handling
We should call sys.exit(), not divide sys by exit().

Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2016-02-09 12:54:09 +01:00
Thomas Monjalon
e45ae7065e doc: introduce networking driver matrix
In order to better compare the drivers and check what is missing
for a common baseline, we need to fill a matrix.

A CSS trick is used to fit the HTML page.
The PDF output needs some LaTeX wizardry.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-02-09 12:22:26 +01:00
Antonio Fischetti
9c699fd8e8 doc: add a further example in ACL guide
Add a further ACL example where the elements of the search key
are not entirely fitting into the 4 consecutive bytes of all
input fields.

Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2016-02-09 12:22:26 +01:00
Ferruh Yigit
f02730abde doc: fix multi-process guide
* remove outdated chapter reference to Multi-process support.

* html output converts "--" to "-", this is wrong when explaining the
  command arguments, used fixed width quotes for them.

Fixes: fc1f2750a3 ("doc: programmers guide")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2016-02-09 12:22:26 +01:00
Zhihong Wang
bb62344cb7 eal/x86: fix build with clang for old AVX
When configuring RTE_MACHINE to "default", rte_memcpy implementation
is the default one (old AVX).
In this code, clang raises a warning thanks to -Wsometimes-uninitialized:

rte_memcpy.h:838:6: error:
variable 'srcofs' is used uninitialized whenever 'if' condition is false
        if (dstofss > 0) {
            ^~~~~~~~~~~
rte_memcpy.h:849:6: note: uninitialized use occurs here
        if (srcofs == 0) {
            ^~~~~~

It is fixed by moving srcofs initialization out of the condition.
Also dstofss calculation is corrected.

Fixes: 1ae817f9f8 ("eal/x86: tune memcpy for platforms without AVX512")

Reported-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
2016-02-04 22:36:02 +01:00
Yuanhan Liu
b86af7b1b5 virtio: move ioport macros
virtio_pci.c is the only file references macros VIRTIO_READ/WRITE_REG_X.
Move them there.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Qian Xu <qian.q.xu@intel.com>
Reviewed-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Tested-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Huawei Xie <huawei.xie@intel.com>
2016-02-03 16:07:50 +01:00
Yuanhan Liu
6ba1f63b5a virtio: support specification 1.0
Modern (v1.0) virtio pci device defines several pci capabilities.
Each cap has a configure structure corresponding to it, and the
cap.bar and cap.offset fields tell us where to find it.

Firstly, we map the pci resources by rte_eal_pci_map_device().
We then could easily locate a cfg structure by:

    cfg_addr = dev->mem_resources[cap.bar].addr + cap.offset;

Therefore, the entrance of enabling modern (v1.0) pci device support
is to iterate the pci capability lists, and to locate some configs
we care; and they are:

- common cfg

  For generic virtio and virtqueue configuration, such as setting/getting
  features, enabling a specific queue, and so on.

- nofity cfg

  Combining with `queue_notify_off' from common cfg, we could use it to
  notify a specific virt queue.

- device cfg

  Where virtio_net_config structure is located.

- isr cfg

  Where to read isr (interrupt status).

If any of above cap is not found, we fallback to the legacy virtio
handling.

If succeed, hw->vtpci_ops is assigned to modern_ops, where all
operations are implemented by reading/writing a (or few) specific
configuration space from above 4 cfg structures. And that's basically
how this patch works.

Besides those changes, virtio 1.0 introduces a new status field:
FEATURES_OK, which is set after features negotiation is done.

Last, set the VIRTIO_F_VERSION_1 feature flag.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Qian Xu <qian.q.xu@intel.com>
Reviewed-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Tested-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Huawei Xie <huawei.xie@intel.com>
2016-02-03 16:07:50 +01:00
Yuanhan Liu
962cf902e6 pci: export device mapping functions
Normally we could set RTE_PCI_DRV_NEED_MAPPING flag so that eal will
invoke pci_map_device internally for us. From that point view, there
is no need to export pci_map_device.

However, for virtio pmd driver, which is designed to work without
binding UIO (or something similar first), pci_map_device() will fail,
which ends up with virtio pmd driver being skipped. Therefore, we can
not set RTE_PCI_DRV_NEED_MAPPING blindly at virtio pmd driver.

Therefore, this patch exports pci_map_device, and let virtio pmd call
it when necessary.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Santosh Shukla <sshukla@mvista.com>
Tested-by: Qian Xu <qian.q.xu@intel.com>
Reviewed-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Tested-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: David Marchand <david.marchand@6wind.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
2016-02-03 16:07:50 +01:00
Yuanhan Liu
1905e101dc virtio: retrieve header size from device setting
The mergeable virtio net hdr format has been the standard and the
only virtio net hdr format since virtio 1.0. Therefore, we can
not hardcode hdr_size to "sizeof(struct virtio_net_hdr)" any more
at virtio_recv_pkts(), otherwise, there would be a mismatch of
hdr size from rte_vhost_enqueue_burst() and virtio_recv_pkts(),
leading a packet corruption.

Instead, we should retrieve it from hw->vtnet_hdr_size; we will
do proper settings at eth_virtio_dev_init() in later patches.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Qian Xu <qian.q.xu@intel.com>
Reviewed-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Tested-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Huawei Xie <huawei.xie@intel.com>
2016-02-03 16:07:49 +01:00
Yuanhan Liu
3891f233f7 virtio: switch to 64 bit features
Switch to 64 bit features, which virtio 1.0 supports.

While legacy virtio only supports 32 bit features, it complains aloud
and quit when trying to setting > 32 bit features.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Qian Xu <qian.q.xu@intel.com>
Reviewed-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Tested-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Huawei Xie <huawei.xie@intel.com>
2016-02-03 16:07:49 +01:00
Yuanhan Liu
c52afa68d7 virtio: move left PCI stuff in the right file
virtio_pci.c is a more proper place for pci stuff; virtio_ethdev is not.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Qian Xu <qian.q.xu@intel.com>
Reviewed-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Tested-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Huawei Xie <huawei.xie@intel.com>
2016-02-03 16:07:49 +01:00
Yuanhan Liu
d5bbeefca8 virtio: introduce PCI implementation structure
Introduce struct virtio_pci_ops, to let legacy virtio (v0.95) and
modern virtio (1.0) have different implementation regarding to a
specific pci action, such as read host status.

With that, this patch reimplements all exported pci functions, in
a way like:

	vtpci_foo_bar(struct virtio_hw *hw)
	{
		hw->vtpci_ops->foo_bar(hw);
	}

So that we need pay attention to those pci related functions only
while adding virtio 1.0 support.

This patch introduced a new vtpci function, vtpci_init(), to do
proper virtio pci settings. It's pretty simple so far: just sets
hw->vtpci_ops to legacy_ops as we don't support 1.0 yet.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Qian Xu <qian.q.xu@intel.com>
Reviewed-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Tested-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Huawei Xie <huawei.xie@intel.com>
2016-02-03 16:07:49 +01:00
Yuanhan Liu
4c2277ff45 virtio: define offset as size_t type
offset arg of vtpci_read/write_dev_config is derived from offsetof(),
which is of size_t type, instead of uint64_t. So, define it as size_t
type.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Qian Xu <qian.q.xu@intel.com>
Reviewed-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Tested-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Huawei Xie <huawei.xie@intel.com>
2016-02-03 16:07:49 +01:00
Yuanhan Liu
c47787cfaa virtio: do not set vring address again at queue startup
As we have already set up it at virtio_dev_queue_setup(), and a vq
restart will not reset the settings.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Qian Xu <qian.q.xu@intel.com>
Reviewed-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Tested-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Huawei Xie <huawei.xie@intel.com>
2016-02-03 16:07:49 +01:00
John McNamara
228d0c681c doc: add example text to release notes
Added example text to each of the release notes sections to show
the preferred format.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
2016-02-03 16:07:49 +01:00
Ferruh Yigit
c344eab3ee eal: move cpu flags out of headers
Move cpu_feature_table array from arch specific rte_cpuflags.h files to
new arch specific rte_cpuflags.c files.

Main motivation is to escape from static variable declarations in
header files. cpu_feature_table has many copies in final binary, even
exist in some object files that does not use this variable at all.

And this can be a sample to create architecture specific source files
and move some functions which are not performance sensitive from
architecture header files to source files.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2016-01-29 19:41:48 +01:00
Ferruh Yigit
dd34ff1f0e lib: remove keyword extern for functions
Remove "extern" keywords in header files,
the ones for function prototypes

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2016-01-28 18:40:46 +01:00
Anatoly Burakov
e61512e406 vfio: support no-IOMMU mode
This commit is adding a generic mechanism to support multiple IOMMU
types. For now, it's only type 1 (x86 IOMMU) and no-IOMMU (a special
VFIO mode that doesn't use IOMMU at all), but it's easily extended
by adding necessary definitions to eal_vfio.h, and DMA mapping
functions to eal_pci_vfio.c.

Since type 1 IOMMU module is no longer necessary to have VFIO,
we fix the module check to check for vfio-pci instead. It's not
ideal and triggers VFIO checks more often (and thus produces more
error output, which was the reason behind the module check in the
first place), so we compensate for that by providing more verbose
logging, indicating whether VFIO initialization has succeeded or
failed.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Santosh Shukla <sshukla@mvista.com>
Tested-by: Santosh Shukla <sshukla@mvista.com>
2016-01-28 17:56:05 +01:00
Michael Qiu
2593612db0 eal/x86: fix build with gcc 5.3.1
In fedora 22 with GCC version 5.3.1, when compile,
will result an error:

    include/rte_memcpy.h:309:7: error: "RTE_MACHINE_CPUFLAG_AVX2"
                                is not defined [-Werror=undef]
    #elif RTE_MACHINE_CPUFLAG_AVX2

Fixes: 9484092baa ("eal/x86: optimize memcpy for AVX512 platforms")

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Zhihong Wang <zhihong.wang@intel.com>
2016-01-28 09:33:50 +01:00
Zhihong Wang
48093287c8 app/test: adjust alignment unit for memcpy performance
Decide alignment unit for memcpy perf test based on predefined macros.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
2016-01-27 21:16:07 +01:00
Zhihong Wang
1ae817f9f8 eal/x86: tune memcpy for platforms without AVX512
For prior platforms, add condition for unalignment handling, to keep this
operation from interrupting the batch copy loop for aligned cases.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
2016-01-27 21:14:52 +01:00
Zhihong Wang
9484092baa eal/x86: optimize memcpy for AVX512 platforms
Implement AVX512 memcpy and choose the right implementation based on
predefined macros, to make full utilization of hardware resources and
deliver high performance.

In current DPDK, memcpy holds a large proportion of execution time in
libs like Vhost, especially for large packets, and this patch can bring
considerable benefits for AVX512 platforms.

The implementation is based on the current DPDK memcpy framework, some
background introduction can be found in these threads:
http://dpdk.org/ml/archives/dev/2014-November/008158.html
http://dpdk.org/ml/archives/dev/2015-January/011800.html

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
2016-01-27 21:14:52 +01:00
Zhihong Wang
3934bb7413 eal/x86: identify AVX512 CPU flag
Read CPUID to check if AVX512 is supported by CPU.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
2016-01-27 21:14:52 +01:00
Zhihong Wang
b0c1e0db6d mk: predefine AVX512 macro for compiler
Predefine AVX512 macro if AVX512 is enabled by compiler.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
2016-01-27 21:14:52 +01:00
Zhihong Wang
308df2bfba examples/l3fwd: handle SIGINT and SIGTERM
Handle SIGINT and SIGTERM in l3fwd.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-01-27 17:33:02 +01:00
Zhihong Wang
88908b61da examples/l2fwd: handle SIGINT and SIGTERM
Handle SIGINT and SIGTERM in l2fwd.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-01-27 17:32:37 +01:00
Zhihong Wang
d3a274ce9d app/testpmd: handle SIGINT and SIGTERM
Handle SIGINT and SIGTERM in testpmd.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
2016-01-27 17:06:51 +01:00
David Marchand
86f24d7c4e ethdev: move hotplug checks and logs in a common place
Move these error logs and checks on detach capabilities in a common place.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Reviewed-by: Jan Viktorin <viktorin@rehivetech.com>
2016-01-27 16:09:37 +01:00
David Marchand
b75abd8907 ethdev: remove useless null checks
We are in static functions and those passed arguments can't be NULL.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Reviewed-by: Jan Viktorin <viktorin@rehivetech.com>
2016-01-27 16:09:27 +01:00
David Marchand
c7985de0a7 remove unneeded tests for NULL when freeing
free() already handles NULL pointer.

Signed-off-by: David Marchand <david.marchand@6wind.com>
2016-01-27 15:34:48 +01:00
Zhihong Wang
5ce3ace1de eal: remove unnecessary hugepage zero-filling
The kernel fills new allocated (huge) pages with zeros.
DPDK just has to populate page tables to trigger the allocation.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2016-01-21 15:57:50 +01:00
Zhihong Wang
f459d2320b eal: reduce timer initialization time
Changing from 1/2 second to 1/10 doesn't compromise the precision,
and a 4/10 second is worth saving.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
2016-01-21 15:57:23 +01:00
Christian Ehrhardt
46812756f6 mk: fix examples install
Depending on non-doc targets being built before and the setting of DESTDIR
the copy of the examples dir being part of install-doc could in some cases
fail with a non existent "$(DESTDIR)$(datadir)" target directory.
Add the conditional rte_mkdir for that to avoid the issue.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-01-19 09:18:26 +01:00
John McNamara
ff82e08aa3 doc: fix navigation levels in html sidebar of guides
Fix issue where the navigation levels weren't displayed in the
html sidebar with the new read_the_docs theme.

This was due to the :titlesonly: directive in the high level
index.rst and also due to a stray newline in the parsed version
number.

Reported-by: Matthew Hall <mhall@mhcomputing.net>
Signed-off-by: John McNamara <john.mcnamara@intel.com>
2016-01-16 09:16:56 +01:00
Wenzhuo Lu
ad66a85dce ixgbe/base: new FW values
This patch addes some new defines for FW, and includes some minor change.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
33f4f30afa ixgbe/base: add X550T1 device
Adds a new single-port Sage Pond device X550T1.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
dfc7e1c90a ixgbe/base: support new thermal alarm
This patch adds support for the new thermal sensor alarms indication.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
fd766412ee ixgbe/base: add new X550 iXFI configuration function
This patch should allow native SPI SFP+ to work as we understand it now.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
28ee76db18 ixgbe/base: move X550 MDIO clock speed init
The x550 MDIO clock speed must be configured prior to first MDIO read or
write. The default MDIO clock speed is not valid, therefore the driver
is configuring a valid speed prior to reading the copper PHY device id.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
bd33a76533 ixgbe/base: prevent X550 KR PHY reset in init
This patch removes KR PHY reset from ixgbe_init_phy_ops_X550em. Since
this function is meant to initialize function pointers for detected PHY
type. Internal PHY reset was moved to ixgbe_setup_internal_phy_t_x550em
which will now detect which mode does internal PHY work in, and setup it
as required.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
1a92547a39 ixgbe/base: support KR mode for X550 link
KR auto-neg mode is what we will be using going forward. The SW
interface for this mode is different than what was used for iXFI.

While debugging, it was determined that the ucode diagnostic was
no longer needed. This code has been removed to simplify the init
flow.

A subtle semaphore error in the CS4227 reset flow was fixed.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
796f322dd1 ixgbe/base: remove X550 driver config of KX4 PHY
The KX4 PHY will be configured by the NVM image. The driver
had been overwriting this config.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
4e7466cccd ixgbe/base: avoid needless copper PHY access
Avoid a needless PHY access on copper phys to save the 10ms wait
time for each PHY access. A helper function is introduced to
actually do the register access and process the contents.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
52f20c7fa8 ixgbe/base: check MAC type when setting X550 callbacks
Check mac type when accessing iosf registers and using the PHY token
for PHY access.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
2ecf53223d ixgbe/base: use mac-dependent values
This patch changes code to use registers offsets stored in mvals table
instead of values defined statically.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
2241ce2816 ixgbe/base: add flow director drop queue
This patch adds ixgbe_set_fdir_drop_queue_82599 for enabling and
setting flow director drop queue, and adds sets drop no match in
ixgbe_init_fdir_perfect_82599 for x550.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
9243820b25 ixgbe/base: remove wait and check flow director signature addition
Waiting for FDIRCMD completion is an expensive thing to do in the
transmit hot path. This wait was added to catch problems with perfect
filter rules, and, at least in the Linux driver, there is no error
check anyway, so there is no point to adding the delay. So do not wait
for completion. Change the return of the function to void, since it has
no meaningful return value.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
59acf817b2 ixgbe/base: add flow control ethertype for filtering
This patch adds the flow control ethertype to the defines for the
ETQF filter list. This only adds the define. Each driver
can add this ethertype to the filter. This is needed to prevent
denial of service by malicious VFs sending out flow control
packets.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
b7fbe1a801 ixgbe/base: fix Tx hang in CEE mode
Currently credit_refill and credit_max could be zero for a TC and that
is causing Tx hang for CEE mode configuration, so to fix that have at
min credit assigned to a TC and that is as what IEEE mode already does.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:20 +01:00