The statistics tables and null mac address should be immutable.
Fix up get_addr routines to accept const args.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
There is no reason to inline functions that are not in the critical
path.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
This patch helps enic migrate to the new flow-director API.
It takes care of the following.
1. The change in fdir_filter structure and stats structure
2. DPDK interface functions in enic_ethdev.c
3. ENIC driver functions that deal with the VIC adapter
Thomas Monjalon [Wed, 15 Apr 2015 17:09:28 +0000 (19:09 +0200)]
use simple zero initializers
To initialize a structure with zeros, one field was explicitly set
to avoid "missing initializer" bug with old GCC (e.g. 4.4).
This warning is now disabled (commit <insertlater>) for old versions of GCC,
so the workarounds may be removed.
These initializers should not be needed for static variables but they
are still used to workaround an ICC bug (see commit b2595c4aa92d).
There is one remaining exception where {0} initializer doesn't work cleanly,
even with recent GCC:
lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c:735:9:
error: missing braces around initializer [-Werror=missing-braces]
struct rte_mbuf mb_def = {0}; /* zeroed mbuf */
Tested with gcc-4.4.7 (CentOS), gcc-4.7.2 (Debian), gcc-4.9.2 (Arch),
clang-3.6.0 and icc-13.1.1.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Tested-by: Thomas Monjalon <thomas.monjalon@6wind.com> Tested-by: John McNamara <john.mcnamara@intel.com> Acked-by: John McNamara <john.mcnamara@intel.com> Acked-by: Vlad Zolotarov <vladz@cloudius-systems.com>
Thomas Monjalon [Tue, 14 Apr 2015 09:23:36 +0000 (11:23 +0200)]
mk: fix build with gcc 4.4 and clang
With GCC 4.4.7 from CentOS 6.5, the following errors arise:
lib/librte_pmd_ixgbe/ixgbe_rxtx.c: In function 'ixgbe_dev_rx_queue_setup':
lib/librte_pmd_ixgbe/ixgbe_rxtx.c:2509: error: missing initializer
lib/librte_pmd_ixgbe/ixgbe_rxtx.c:2509: error: (near initialization for 'dev_info.driver_name')
lib/librte_pmd_ixgbe/ixgbe_rxtx.c: In function 'ixgbe_set_rsc':
lib/librte_pmd_ixgbe/ixgbe_rxtx.c:4072: error: missing initializer
lib/librte_pmd_ixgbe/ixgbe_rxtx.c:4072: error: (near initialization for 'dev_info.driver_name')
lib/librte_pmd_ixgbe/ixgbe_rxtx.c: In function 'ixgbe_recv_pkts_lro_single_alloc':
lib/librte_pmd_ixgbe/ixgbe_rxtx.c:1479: error: 'next_rsc_entry' may be used uninitialized in this function
lib/librte_pmd_ixgbe/ixgbe_rxtx.c:1480: error: 'next_rxe' may be used uninitialized in this function
The "missing initializer" warning is a GCC bug which seems fixed in 4.7.
The same warning is thrown by clang.
The "may be used uninitialized" warning is another GCC bug which seems fixed in 4.7.
Fixes: 8eecb3295aed ("ixgbe: add LRO support") Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: John McNamara <john.mcnamara@intel.com> Acked-by: Vlad Zolotarov <vladz@cloudius-systems.com>
Igor Ryzhov [Wed, 8 Apr 2015 16:31:07 +0000 (19:31 +0300)]
doc: fix vhost guide
Guide says that a configure parameter to choose between vhost cuse
and vhost user will be introduced in the future, but it’s already
added by commit 28a1ccca41bf.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com> Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
Vlad Zolotarov [Mon, 30 Mar 2015 19:21:11 +0000 (22:21 +0300)]
ixgbe: add LRO support
- Only x540 and 82599 devices support LRO.
- Add the appropriate HW configuration.
- Add RSC aware rx_pkt_burst() handlers:
- Implemented bulk allocation and non-bulk allocation versions.
- Add LRO-specific fields to rte_eth_rxmode, to rte_eth_dev_data
and to ixgbe_rx_queue.
- Use the appropriate handler when LRO is requested.
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Vlad Zolotarov [Mon, 30 Mar 2015 19:21:10 +0000 (22:21 +0300)]
ixgbe: code refactoring
- ixgbe_rx_alloc_bufs():
- Reset the rte_mbuf fields only when requested.
- Take the RDT update out of the function.
- Add the stub when RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC is not defined.
- ixgbe_recv_scattered_pkts():
- Take the code that updates the fields of the cluster's HEAD buffer into
the inline function.
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
The test PMD uses a special type of eth_dev_ops to test features.
Rather allocating this separately, just put in the private data area.
This allows for next change to make dev_ops const.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Neil Horman <nhorman@tuxdriver.com>
Thomas Monjalon [Thu, 9 Apr 2015 17:03:14 +0000 (19:03 +0200)]
scripts: test null forwarding
This script ease testing of basic initializations and Rx/Tx bursts.
It may help to check obvious regressions.
In order to run it on a standard development machine, it doesn't use
neither hugepages nor real interfaces.
The optional parameters are:
- build directory (default: build)
- coremask (default: 3 i.e. cores 0 and 1)
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Thomas Monjalon [Thu, 9 Apr 2015 17:23:45 +0000 (19:23 +0200)]
mk: remove uio suffix from virtio pmd
The virtio pmd is not restricted to uio anymore.
Fixes: da978dfdc43b ("virtio: use port IO to get PCI resource") Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
Thomas Monjalon [Thu, 2 Apr 2015 10:49:34 +0000 (12:49 +0200)]
pkg: update RPM
Enable vhost-user and build PDF doc.
Inkscape and TeXLive are required to convert .svg and .rst to .pdf.
Temporary sphinx files .* (.doctrees/ and .buildinfo) are cleaned.
Tested on Fedora 20.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Thomas Monjalon [Tue, 31 Mar 2015 12:45:06 +0000 (14:45 +0200)]
mbuf: clean old refcnt option
CONFIG_RTE_MBUF_SCATTER_GATHER was renamed into CONFIG_RTE_MBUF_REFCNT
by commit 62814bc2e923 and removed by commit 4769bc5a27cc.
Some traces remain because of delayed patches.
It can also be removed from doxygen config.
It is now poisoned in rte_mbuf.h to warn any misuse.
- libmlx4 and libibverbs dependencies distributed with Mellanox OFED are now
also available on DPDK.org to make installation easier.
- Document Mellanox OFED and firmware versions to use.
- Add links to Mellanox and its community websites.
- Add kernel modules parameters section.
Added notes for i40e firmware version. As base driver to support the
latest version of firmware (FVL3E) hasn't been integrated, currently
the validated version of firmware is 4.2.6.
API *rte_eth_link_get* expect to call a wait to complete link_update.
That's the difference between *rte_eth_link_get_nowait*.
The patch fixes the issue that i40e link_update ignores the wait_to_complete flag.
The issue impacts those applications calling rte_eth_link_get to get wrong intermediate link status.
Jingjing Wu [Thu, 12 Feb 2015 11:22:23 +0000 (19:22 +0800)]
i40e: fix out of bound read
Klocwork reports array 'src_offset' may use index 16.
In function i40e_srcoff_to_flx_pit, index j + 1 can reach I40E_FDIR_MAX_FLEX_LEN.
This patch fixes this issue to avoid array bound.
Test report: http://www.dpdk.org/ml/archives/dev/2015-March/016030.html
Fixes: d8b90c4eabe9 ("i40e: take flow director flexible payload configuration") Signed-off-by: Jingjing Wu <jingjing.wu@intel.com> Acked-by: Helin Zhang <helin.zhang@intel.com> Tested-by: Min Cao <min.cao@intel.com>
Pablo de Lara [Wed, 1 Apr 2015 12:10:11 +0000 (13:10 +0100)]
doc: add note for --txqflags in testpmd
Since txqflags is now set from the default rx/tx configuration,
depending on the PMD, it might not be 0.
Therefore, user has to overwrite it with --txqflags 0.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Siobhan Butler <siobhan.a.butler@intel.com>
John McNamara [Wed, 1 Apr 2015 11:32:45 +0000 (12:32 +0100)]
mk: fix pdf doc rules order
Re-ordered the guide-pdf-% and guide-% rules to allow
the doc-guides-pdf target to build with make 3.81. It
builds unmodified with all later versions of make.
Fixes: ebf8050afd44 ("doc: add pdf output") Reported-by: Tetsuya Mukawa <mukawa@igel.co.jp> Signed-off-by: John McNamara <john.mcnamara@intel.com> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Thomas Monjalon [Tue, 31 Mar 2015 22:00:37 +0000 (00:00 +0200)]
pci: rename passthrough driver to kernel driver
Kernel driver (kdrv) seems easier to understand than
passthrough driver (pt_driver). It's also more generic
as a PMD could run on top of any PCI kernel driver if
it would offer such support.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: Michael Qiu <michael.qiu@intel.com> Acked-by: David Marchand <david.marchand@6wind.com>
Siobhan Butler [Thu, 12 Mar 2015 12:13:54 +0000 (12:13 +0000)]
doc: update release notes for new sample apps
Updated release notes release description notes:
- added new sample applications to list: Link Bonding,Skeleton, Callbacks, Jobstats
- updated copyright date to 2015
Bruce Richardson [Mon, 23 Mar 2015 16:19:50 +0000 (16:19 +0000)]
doc: add note on needing igb_uio for VF devices
Since the uio_pci_generic module requires that the device to which it is
being bound supports legacy interrupts, there can be problems using it
with VF devices. Add a note to the GSG doc to document this fact, and
provide information on loading igb_uio as a replacement.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com> Acked-by: Siobhan Butler <siobhan.a.butler@intel.com>
Olivier Matz [Thu, 19 Mar 2015 16:35:12 +0000 (17:35 +0100)]
doc: fix prefix in file references
There are some references to DPDK.xyz.mk files that do not exist in the
dpdk tree. This was probably the result of an automatic replacement, so
restore the proper file names which are rte.xyz.mk.
John McNamara [Thu, 12 Mar 2015 16:54:28 +0000 (16:54 +0000)]
ethdev: add packet count parameter to Rx callback
Added a parameter to the RX callback to pass in the number of
available RX packets in addition to the number of dequeued packets.
This provides the RX callback functions with additional information
that can be used to decide how packets from a burst are handled.
The TX callback doesn't require this additional parameter so the RX
and TX callbacks no longer have the same function parameters. As such
the single RX/TX callback has been refactored into two separate callbacks.
Signed-off-by: John McNamara <john.mcnamara@intel.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Maciej Gajdzica [Fri, 20 Feb 2015 16:13:20 +0000 (16:13 +0000)]
enic: fix possible data loss
Field ig_vlan_strip_en in struct enic type is int. It is used only by
function enic_set_nic_cfg which expects uint_8 as argument. Changed type
of the field to prevent possible loss of precision.
Macro GET_CONFIG passes result of sizeof operation to the function
vnic_dev_spec. This function expects parameter of type unsigned int.
Changed that parameter type to size_t in function declaration to prevent
possible data loss.
Define ENIC_ALIGN is used only by function rte_memzone_reserve_aligned,
which expects argument of type unsigned. Defined constant is of type
unsigned long long. Changed type to unsigned long to prevent possible
loss of precision.
In function writeq is written in two 32-bit long registers with writel
function. When trying to write val >> 32, static code analysis tool
reports that 64-bit value is passed to function expecting 32-bit value.
Added cast to clear this warning.
Issues found with static code analysis tool.
Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Maciej Gajdzica [Fri, 20 Feb 2015 16:12:39 +0000 (16:12 +0000)]
virtio: fix type for queue id
Changed vtpci_queue_idx type in function virtio_dev_queue_setup from
uint8_t to uint16_t to prevent possible data loss. Also changed type of
head variable in function virtio_send_command from uint32_t to uint16_t.
Variable rcv_cnt declared in function virtio_recv_mergeable_pkts was of
type uint32_t. It was used by virtqueue_dequeue_burst_rx function, which
expects argument of type uint16_t. Changed rcv_cnt variable type to
uint16_t to prevent possible data loss.
Issues found with static code analysis tool.
Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com> Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
hash_key8_ext, hash_key16_ext and hash_key32_ext tables allocate cache
entries to support table overload cases. The crash can occur when cache
entry is free after use.
The problem is with computing the index of the free cache entry.
Pavel Boldin [Mon, 23 Mar 2015 12:53:45 +0000 (14:53 +0200)]
vhost: fix file struct leakage
Due to increased `struct file's reference counter subsequent call
to `filp_close' does not free the `struct file'. Prepend `fput' call
to decrease the reference counter.
Signed-off-by: Pavel Boldin <pboldin@mirantis.com> Acked-by: Huawei Xie <huawei.xie@intel.com>
Haifeng Lin [Sat, 21 Mar 2015 01:47:00 +0000 (09:47 +0800)]
vhost: fix index when mbuf allocation fails
When failed to malloc buffer from mempool we just update last_used_idx but
not used->idx so after many times vhost thought have handle all packets
but virtio_net thought vhost have not handle all packets and will not
update avail->idx.
Adrien Mazarguil [Wed, 25 Mar 2015 10:34:31 +0000 (11:34 +0100)]
mlx4: remove old VMware compatibility code
CONFIG_RTE_LIBRTE_MLX4_COMPAT_VMWARE has no effect since this option enables
MLX4_PMD_COMPAT_VMWARE. This macro is not used by the PMD which expects
MLX4_COMPAT_VMWARE instead.
Because this option does not work and the related code is no longer useful
for VMware (as it actually supports the flow steering API), remove it
entirely.
Signed-off-by: Olga Shern <olgas@mellanox.com> Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> Acked-by: Neil Horman <nhorman@tuxdriver.com>
Jingjing Wu [Fri, 20 Mar 2015 07:31:48 +0000 (15:31 +0800)]
i40e: disable buggy VEB switching
Disable VEB switching by removing ALLOW_LB on SRIOV vsi.
If the source mac address of packet sent from VF is not listed in the
VEB's mac table, the VEB will switch the packet back to the VF.
It's a hardware issue. Enabling ALLOW_LB flag will block VF functions.
Test report: http://www.dpdk.org/ml/archives/dev/2015-March/015687.html
Jingjing Wu [Thu, 26 Mar 2015 04:53:21 +0000 (12:53 +0800)]
igb: fix flex filter check for unsupported 82576
Flex filter is currently not supported for NIC 82576.
Only i350 and 82580 support it.
So The MAC_TYPE_FILTER_SUP_EXT is used to check whether the MAC type is
i350 or 82580.
Fixes: 231d43909a31 ("igb: migrate flex filter to new API") Signed-off-by: Jingjing Wu <jingjing.wu@intel.com> Acked-by: Marvin Liu <yong.liu@intel.com>