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>
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>
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>
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>
* 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.htmlhttp://dpdk.org/ml/archives/dev/2015-January/011800.html
Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>