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>
Bruce Richardson [Thu, 26 Mar 2015 17:02:45 +0000 (17:02 +0000)]
ethdev: fix crash with multiprocess
The data structure for the rx and tx callbacks is local to each process
since it contains function pointers and cannot be shared between
different unique binaries. However, because it is not in
rte_eth_dev_data structure, the array is not getting initialized for
secondary processes - neither is it getting appropriately resized if the
number of RX/TX queues changes. This causes crashes in secondary
processes as they dereference a null pointer in struct rte_eth_dev.
This patch fixes this by introducing an upper-bound on the number of
queues per port that can be configured, and then uses this to make the
array statically sized, thereby avoiding the crashes.
Fixes: 4dc294158cac ("ethdev: support optional Rx and Tx callbacks") Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Tested-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Fix rte_hash_crc() function by making use of uintptr_t variable
to hold a pointer to data being hashed. In this way, casting uint64_t
pointer to uint32_t avoided.
Fixes: 614289298daf ("hash: slice CRC data into 8-byte pieces") Signed-off-by: Yerden Zhumabekov <e_zhumabekov@sts.kz> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Andre Richter [Mon, 23 Mar 2015 12:06:25 +0000 (13:06 +0100)]
tools: fix vfio support
This patch fixes several minor issues in setup.sh:
- show_nics() would not display the current Ethernet settings if
the user only loads the vfio-pci module, b/c it only checks for
presence of igb_uio. Fix this by adding a check for vfio-pci.
- unbind_nics(): Fix option naming and string inside function.
- Exchange a forgotten "igb_uio" with "vfio-pci" in a comment.
Signed-off-by: Andre Richter <andre.o.richter@gmail.com>
Julien Cretin [Mon, 9 Mar 2015 13:21:09 +0000 (14:21 +0100)]
app/testpmd: fix potential out of bounds read
After the last enabled port has been seen, and the last time we
evaluate the loop condition, there is an out of bounds read in
ports[p].enabled because p is equal to size, which is the length of
ports.
Signed-off-by: Julien Cretin <julien.cretin@trust-in-soft.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Pablo de Lara [Sun, 22 Mar 2015 18:02:16 +0000 (18:02 +0000)]
kni: fix build with kernel 3.19
Due to API changes in functions ndo_dflt_bridge_getlink
(commit 2c3c031c) and ndo_fdb_add (commit f6f6424b)
in kernel 3.19, DPDK would not build.
This patch solves the problem, by checking the kernel version
and adding the necessary new parameters.
Mind that function igb_ndo_fdb_add does not need the extra parameter
if USE_CONST_DEV_UC_CHAR is not set, since that macro is only defined
when kernel is greater or equal than 3.7
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Marvin Liu [Thu, 19 Mar 2015 03:16:55 +0000 (11:16 +0800)]
enic: fix build with gcc < 4.4
gcc4.3 will raise warnings in blow code for initialized field overwritten.
enic_main.c: In function ‘enic_set_rsskey’:
enic_main.c:845: error: initialized field overwritten
enic_main.c:845: error: (near initialization for ‘rss_key.key’)
enic_main.c:846: error: initialized field overwritten
enic_main.c:846: error: (near initialization for ‘rss_key.key’)
enic_main.c:847: error: initialized field overwritten
enic_main.c:847: error: (near initialization for ‘rss_key.key’)
Marvin Liu [Thu, 19 Mar 2015 03:16:52 +0000 (11:16 +0800)]
eal/x86: fix build sse3 functions with gcc < 4.4
In Suse11 SP3, there'll be errors for not found sse3 functions.
rte_memcpy.h: In function ‘rte_memcpy’:
rte_memcpy.h:625: error: implicit declaration of function ‘_mm_alignr_epi8’
rte_memcpy.h:625: error: nested extern declaration of ‘_mm_alignr_epi8’
rte_memcpy.h:625: error: incompatible type for argument 2 of ‘_mm_storeu_si128’
These functions defined in tmmintrin.h and should be included in.
Fixes: 9144d6bcdefd ("eal/x86: optimize memcpy for SSE and AVX") Signed-off-by: Marvin Liu <yong.liu@intel.com>
Yong Liu [Fri, 13 Mar 2015 02:38:23 +0000 (10:38 +0800)]
app/testpmd: fix reconfig flag for all ports
When port id is RTE_PORT_ALL, port_id_is_invalid will also return zero.
So this function will only set ports[255] need_reconfig flag, other ports will
be skipped.
Fixes: edab33b1c01d ("app/testpmd: support port hotplug") Signed-off-by: Marvin Liu <yong.liu@intel.com> Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
Pawel Wodkowski [Thu, 19 Mar 2015 16:09:16 +0000 (17:09 +0100)]
ixgbe: fix buffer overrun in non-bulk alloc mode
When bulk alloc is enabled at compile time but preconditions for
it are not met at runtime the ixgbe_reset_rx_queue() function
overrides rxq->sw_ring not allocated elements.
Fixes: 01fa1d6215fa ("ixgbe: unify Rx setup") Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
If RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC is disabled in the config file,
RTE_PMD_IXGBE_RX_MAX_BURST macro and ixgbe_recv_pkts_bulk_alloc function
are not declared, and some parts of the ixgbe code were still trying to
use them.
Fixes: 01fa1d6215fa ("ixgbe: unify Rx setup") Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Thomas Monjalon [Wed, 18 Mar 2015 17:25:51 +0000 (18:25 +0100)]
doc: fix version for python 3
When generating Latex for PDF, this error occurs:
! Undefined control sequence.
\version ->b'2.0.0-rc2\n
Decoding bytes stream into UTF-8 fixes the issue.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: John McNamara <john.mcnamara@intel.com>
John McNamara [Tue, 3 Feb 2015 14:11:14 +0000 (14:11 +0000)]
doc: add pdf output
Add make system support for building PDF versions of
the guides. Requires Python Sphinx and TexLive Full.
Signed-off-by: John McNamara <john.mcnamara@intel.com> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: John McNamara <john.mcnamara@intel.com>
Thomas Monjalon [Wed, 18 Mar 2015 09:55:09 +0000 (10:55 +0100)]
i40e: revert internal switch of PF
VEB switching is blocking VF.
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 an hardware issue.
Reverts: 2ccabd8cd1f6 ("i40e: enable internal switch of PF").
Ouyang Changchun [Wed, 11 Mar 2015 01:34:01 +0000 (09:34 +0800)]
af_packet: fix some leaks
Fix possible memory leak issue: free kvlist before return;
Fix possible resource lost issue: close qssockfd before return;
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com> Acked-by: Michael Qiu <michael.qiu@intel.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Acked-by: John W. Linville <linville@tuxdriver.com>
Andre Richter [Thu, 12 Mar 2015 17:18:00 +0000 (18:18 +0100)]
tools: remove absolute path of chmod for vfio setup
setup.sh uses /usr/bin/chmod, but depending on distribution, it is not always there.
For example, Ubuntu has /bin/chmod. Fix this by removing the absolute path, like it is
done e.g. with grep.
Signed-off-by: Andre Richter <andre.o.richter@gmail.com>
Neil Horman [Tue, 17 Mar 2015 18:08:41 +0000 (14:08 -0400)]
scripts: add ABI checking utility
There was a request for an abi validation utilty for the ongoing ABI stability
work. As it turns out there is a abi compliance checker in development that
seems to be under active development and provides fairly detailed ABI compliance
reports. Its not yet intellegent enough to understand symbol versioning, but it
does provide the ability to identify symbols which have changed between
releases, along with details of the change, and offers developers the
opportunity to identify which symbols then need versioning and validation for a
given update via manual testing.
This script automates the use of the compliance checker between two arbitrarily
specified tags within the dpdk tree. To execute enter the $RTE_SDK directory
and run:
DPDK introduced pmd driver for PCIE host-interface of Intel Ethernet
Switch FM10000 Series, update programming guide to describe the new
driver and usage.
This patch add contents for major change in single virtio implementation,
also add back something for merge-able feature and promiscuous mode in virtio.
John McNamara [Wed, 25 Feb 2015 19:46:02 +0000 (19:46 +0000)]
doc: add Rx and Tx callbacks sample app user guide
Added a sample application guide for the rxtx_callbacks app.
Signed-off-by: John McNamara <john.mcnamara@intel.com> Acked-by: Siobhan Butler <siobhan.a.butler@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
John McNamara [Wed, 25 Feb 2015 19:46:00 +0000 (19:46 +0000)]
examples/skeleton: improve documentation
Minor refactoring and comments to make the sample app and
code examples clearer for the sample app guide.
Signed-off-by: John McNamara <john.mcnamara@intel.com> Acked-by: Siobhan Butler <siobhan.a.butler@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Vlad Zolotarov [Thu, 12 Mar 2015 21:17:32 +0000 (23:17 +0200)]
ixgbe: unify Rx setup
- Set the callback in a single function that is called from
ixgbe_dev_rx_init() for a primary process and from eth_ixgbe_dev_init()
for a secondary processes. This is instead of multiple, hard to track places.
- Added ixgbe_hw.rx_bulk_alloc_allowed - see ixgbe_hw.rx_vec_allowed description below.
- Added ixgbe_hw.rx_vec_allowed: like with Bulk Allocation, Vector Rx is
enabled or disabled on a per-port level. All queues have to meet the appropriate
preconditions and if any of them doesn't - the feature has to be disabled.
Therefore ixgbe_hw.rx_vec_allowed will be updated during each queues configuration
(rte_eth_rx_queue_setup()) and then used in rte_eth_dev_start() to configure the
appropriate callbacks. The same happens with ixgbe_hw.rx_vec_allowed in a Bulk Allocation
context.
- Bugs fixed:
- Vector scattered packets callback was called regardless the appropriate
preconditions:
- Vector Rx specific preconditions.
- Bulk Allocation preconditions.
- Vector Rx was enabled/disabled according to the last queue setting and not
based on all queues setting (which may be different for each queue).
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Vlad Zolotarov [Thu, 12 Mar 2015 21:17:30 +0000 (23:17 +0200)]
ixgbe: fix endianness of ring descriptor access
Use the rte_le_to_cpu_xx()/rte_cpu_to_le_xx() when reading/setting HW ring
descriptor fields.
Fixed the above in ixgbe_rx_alloc_bufs() and in ixgbe_recv_scattered_pkts().
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Huawei Xie [Thu, 12 Mar 2015 15:30:23 +0000 (23:30 +0800)]
vhost: add build option for vhost-user
Turn on CONFIG_RTE_LIBRTE_VHOST to enable vhost.
vhost-user is turned on by default. Turn off CONFIG_RTE_LIBRTE_VHOST_USER to
enable vhost-cuse implementation.
John McNamara [Mon, 16 Mar 2015 17:05:06 +0000 (17:05 +0000)]
eal: fix type casting of value to align
Fix a warning when the rte_common.h header is included in a compilation
using -Wbad-function-cast, such as in Open vSwitch where the
following warning is emitted repeatedly:
../rte_common.h: In function 'rte_is_aligned':
../rte_common.h:184:9: warning: cast from function call of
type 'uintptr_t' to non-matching type 'void *' [-Wbad-function-cast]
This change fixes the issue in rte_common.h by using the RTE_ALIGN_FLOOR
macro to get the aligned floor value with generic type casting.
Also removed the rte_align_floor_int() function and replaced it with
the RTE_PTR_ALIGN_FLOOR() macro.
Signed-off-by: John McNamara <john.mcnamara@intel.com> Acked-by: Neil Horman <nhorman@tuxdriver.com>
Yong Liu [Wed, 11 Mar 2015 07:23:10 +0000 (15:23 +0800)]
app/testpmd: fix incorrect port number check
testpmd parameter "nb-port" mean the number of forwarding port.
It's incorrect to use function port_id_is_invalid to check number of ports.
Fixes: edab33b1c01d ("app/testpmd: support port hotplug") Signed-off-by: Yong Liu <yong.liu@intel.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Jingjing Wu [Fri, 6 Mar 2015 09:36:13 +0000 (17:36 +0800)]
ixgbe: fix supported flow types
Ixgbe doesn't support the ipv4-frag and ipv6-frag flow types, remove them.
Ixgbe doesn't support configure flex mask on each kind of flow type, this
patch uses RTE_ETH_FLOW_UNKNOWN to specify global flex mask setting.
This patch also changes the string "raw" to "none" to indicate flex mask
setting unrelated with flow type in testpmd for ixgbe.
Pablo de Lara [Fri, 27 Feb 2015 11:18:39 +0000 (11:18 +0000)]
app/testpmd: stop forwarding when quitting
When user quits testpmd, and there is traffic being forwarded,
that may produce a segmentation fault, due to ports being closed,
while they are still transmitting packets.
This patch prevents the issue from happening,
by stopping packet forwarding before closing the ports.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
The contigmem module was using an "int" type for specifying the
size of blocks of memory to be reserved. A 2GB block was therefore
overflowing the signed 32-bit value, making 1GB the largest block
size that could be reserved as a single unit.
The fix is to change the type used for the buffer/block size to
an "int64_t" value.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>