dpdk.git
8 years agoixgbe: fix packet type from vector Rx
Konstantin Ananyev [Tue, 22 Mar 2016 14:30:17 +0000 (14:30 +0000)]
ixgbe: fix packet type from vector Rx

Current vector RX can't always set the packet_type properly.
To be more specific:
a) it never sets RTE_PTYPE_L2_ETHER
b) it doesn't handle tunnel ipv4/ipv6 case correctly.
c) it doesn't check is IXGBE_RXDADV_PKTTYPE_ETQF set or not.
While a) is pretty easy to fix, b) and c) are not that straightforward
in terms of SIMD ops (specially b).
So far I wasn't able to make vRX support packet_type properly without
noticeable performance loss.
So for now, just remove that functionality from vector RX and
update dev_supported_ptypes_get().

Fixes: 396254175854 ("mbuf: redefine packet type")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
8 years agomlx4: check if port is configured for ethernet
Adrien Mazarguil [Tue, 22 Mar 2016 10:34:26 +0000 (11:34 +0100)]
mlx4: check if port is configured for ethernet

Notify user otherwise. A similar check has already been added to mlx5 in
commit "mlx5: check port is configured as ethernet device".

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agovhost: fix maximum of queues
Tetsuya Mukawa [Tue, 22 Mar 2016 08:09:45 +0000 (17:09 +0900)]
vhost: fix maximum of queues

Currently, the maximum value of rx/tx queues are kept by EAL. But,
the value is used like below with different meanings in vhost PMD.
 - The maximum value of current enabled queues.
 - The maximum value of current supported queues.

This wrong double meaning will cause an issue like below steps.

* Invoke application with below option.
  --vdev 'eth_vhost0,iface=<socket path>,queues=4'
* Configure queues like below.
  rte_eth_dev_configure(portid, 2, 2, ...);
* Configure queues again like below.
  rte_eth_dev_configure(portid, 4, 4, ...);

The second rte_eth_dev_configure() will fail because both
the maximum value of current enabled queues and supported queues
will be '2' after calling first rte_eth_dev_configure().

To fix the issue, the patch adds another variable to keep the maximum
number of supported queues in vhost PMD.

Fixes: 23981fb0d78b ("vhost: Add vhost PMD")

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Ciara Loftus <ciara.loftus@intel.com>
8 years agoi40e: fix build without Rx bulk alloc
Zhe Tao [Wed, 16 Mar 2016 10:19:10 +0000 (18:19 +0800)]
i40e: fix build without Rx bulk alloc

Issue:
When CONFIG_RTE_LIBTRE_I40E_RX_ALLOW_BULK_ALLOC=n in config file, there
will be a build error:
'i40e_recv_pkts_bulk_alloc' undeclared

Now DPDK i40e PMD uses the preprocessor to choose whether or not to define
the bulk recv functions, but for selection of the RX function, PMD only
depends on a C variable. This causes the inconsistency and leads to the
build error due to the bulk recv function not being defined.

Fixes: 8e109464c022 ("i40e: allow vector Rx and Tx usage")

Signed-off-by: Zhe Tao <zhe.tao@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agoapp/testpmd: add VLAN in flow director input set
Jingjing Wu [Wed, 23 Mar 2016 13:07:12 +0000 (21:07 +0800)]
app/testpmd: add VLAN in flow director input set

This patch extends the commands for changing flow director filter's input
set. It adds vlan as a possible filter input field.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoi40e: extend flow director for VLAN
Jingjing Wu [Wed, 23 Mar 2016 13:07:11 +0000 (21:07 +0800)]
i40e: extend flow director for VLAN

This patch extends flow director to select vlan id as part of
filter's input set and program the filter rule with vlan id.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoi40e: fix VLAN bitmasks for input set
Andrey Chilikin [Wed, 23 Mar 2016 13:07:10 +0000 (21:07 +0800)]
i40e: fix VLAN bitmasks for input set

This patch adds missing VLAN bitmask for inner frame in case of
tunneling and fixes VLAN tags bitmasks for single or outer frame
in case of tunneling.

Fixes: 98f055707685 ("i40e: configure input fields for RSS or flow director")

Signed-off-by: Andrey Chilikin <andrey.chilikin@intel.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoapp/testpmd: extend flow director input set commands
Jingjing Wu [Wed, 23 Mar 2016 13:07:09 +0000 (21:07 +0800)]
app/testpmd: extend flow director input set commands

This patch extends commands for changing a flow director filter's input
set. It adds tos, protocol and ttl as filter's input fields, and removes
the words selection from flex payloads.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoi40e: allow filtering on more IP header fields
Jingjing Wu [Wed, 23 Mar 2016 13:07:08 +0000 (21:07 +0800)]
i40e: allow filtering on more IP header fields

This patch extends flow director to select more IP Header fields
as filter input set.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoi40e: use default filter input set on init
Jingjing Wu [Wed, 23 Mar 2016 13:07:07 +0000 (21:07 +0800)]
i40e: use default filter input set on init

This patch adds a new function to set the fdir input set to default
when initialization.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoi40e: remove flex payload from input selection
Jingjing Wu [Wed, 23 Mar 2016 13:07:06 +0000 (21:07 +0800)]
i40e: remove flex payload from input selection

In this patch, flex payload is removed from valid fdir input set
values. This is because all flex payload configuration can be set
in struct rte_fdir_conf during device configure phase, which is
a more flexible way of setting this up.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoi40e: split function for hash and flow director input
Jingjing Wu [Wed, 23 Mar 2016 13:07:05 +0000 (21:07 +0800)]
i40e: split function for hash and flow director input

For the input set selection, Hash filter and Flow director shared
the same function, i.e. i40e_filter_inset_select.
For code readability, this patch replaces i40e_filter_inset_select
with two new functions: i40e_hash_filter_inset_select and
i40e_fdir_filter_inset_select for Hash filter and Flow director
respectively.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoethdev: add fields to flow director input
Jingjing Wu [Wed, 23 Mar 2016 13:07:04 +0000 (21:07 +0800)]
ethdev: add fields to flow director input

This patch adds RTE_ETH_INPUT_SET_L3_IP4_TTL,
RTE_ETH_INPUT_SET_L3_IP6_HOP_LIMITS input field types and extends
struct rte_eth_ipv4_flow and rte_eth_ipv6_flow to support filtering
by tos, protocol and ttl.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agovirtio: fix Rx ring descriptor starvation
Kyle Larose [Thu, 10 Mar 2016 14:44:11 +0000 (09:44 -0500)]
virtio: fix Rx ring descriptor starvation

Virtio has an mbuf descriptor ring containing mbufs to be used for
receiving traffic. When the host queues traffic to be sent to the guest, it
consumes these descriptors. If none exist, it discards the packet.

The virtio pmd allocates mbufs to the descriptor ring every time it
successfully receives a packet. However, it never does it if it does not
receive a valid packet. If the descriptor ring is exhausted, and the mbuf
mempool does not have any mbufs free (which can happen for various reasons,
such as queueing along the processing pipeline), then the receive call will
not allocate any mbufs to the descriptor ring, and when it finishes, the
descriptor ring will be empty. The ring being empty means that we will
never receive a packet again, which means we will never allocate mbufs to
the ring: we are stuck.

Ultimately, the problem arises because there is a dependency between
receiving packets and making the descriptor ring not be empty, and a
dependency between the descriptor ring not being empty, and receiving
packets.

To fix the problem, this pakes makes virtio always try to allocate mbufs
to the descriptor ring, if necessary, when polling for packets. Do this by
removing the early exit if no packets were received. Since the packet loop
later will do nothing if there are no packets, this is fine.

I reproduced the problem by pushing packets through a pipelined systems
(such as the client_server sample application) after artificially
decreasing the size of the mbuf pool and introducing a delay in a secondary
stage.

Without the fix, the process stops receiving packets fairly quicky. With
the fix, it continues to receive packets.

Fixes: c1f86306a026 ("virtio: add new driver")

Signed-off-by: Kyle Larose <klarose@sandvine.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
8 years agodrivers: make struct of networking operations const
Stephen Hemminger [Mon, 21 Mar 2016 17:53:24 +0000 (10:53 -0700)]
drivers: make struct of networking operations const

This structure has immutable function pointers.
Also fix indentation.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agoenic: fix Rx descriptor limit
Nelson Escobar [Fri, 18 Mar 2016 18:33:34 +0000 (11:33 -0700)]
enic: fix Rx descriptor limit

On initialization, the rq descriptor count was set to the limit
of the vic.  When the requested number of rx descriptors was
less than this count, enic_alloc_rq() was incorrectly setting
the count to the lower value.  This results in later calls to
enic_alloc_rq() incorrectly using the lower value as the adapter
limit.

Fixes: fefed3d1e62c ("enic: new driver")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
8 years agoenic: update maintainers
John Daley [Fri, 18 Mar 2016 18:27:07 +0000 (11:27 -0700)]
enic: update maintainers

Change maintainers for ENIC PMD and fix pointer to enic
documentation in MAINTAINERS.

Signed-off-by: John Daley <johndale@cisco.com>
8 years agomlx5: fix null RSS key handling
Nélio Laranjeiro [Fri, 18 Mar 2016 12:54:43 +0000 (13:54 +0100)]
mlx5: fix null RSS key handling

Update function can be called with no key to enable or disable a RSS
protocol, or with a key to be applied to the desired protocols.

Fixes: 2f97422e7759 ("mlx5: support RSS hash update and get")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agomlx5: fix overwritten RSS configuration
Nélio Laranjeiro [Fri, 18 Mar 2016 12:54:42 +0000 (13:54 +0100)]
mlx5: fix overwritten RSS configuration

RSS configuration provided by the application should not be used as storage
by the PMD.

Fixes: 2f97422e7759 ("mlx5: support RSS hash update and get")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agoixgbe: fix RETA query and update on X550
Xiao Wang [Fri, 18 Mar 2016 02:27:35 +0000 (10:27 +0800)]
ixgbe: fix RETA query and update on X550

For x550 device, the reta table has 512 entries, but in function
ixgbe_dev_rss_reta_query and ixgbe_dev_rss_reta_update we use an
"uint8_t i" to traverse the entries, this will lead the function
to an endless loop.

This patch changes the data type from uint8_t to uint16_t to fix
the issue.

Fixes: 4bee94a6c22f ("ixgbe: support 512 RSS entries on x550")

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agoenic: remove packet error conditional
John Daley [Thu, 17 Mar 2016 22:57:07 +0000 (15:57 -0700)]
enic: remove packet error conditional

small cleanup to remove conditional.

Signed-off-by: John Daley <johndale@cisco.com>
8 years agoenic: fix error packets handling
John Daley [Thu, 17 Mar 2016 22:57:06 +0000 (15:57 -0700)]
enic: fix error packets handling

If the packet_error bit in the completion descriptor is set, the
remainder of the descriptor and data are invalid. PKT_RX_MAC_ERR
was set in the mbuf->ol_flags if packet_error was set and used
later to indicate an error packet. But since PKT_RX_MAC_ERR is
defined as 0, mbuf flags and packet types and length were being
misinterpreted.

Make the function enic_cq_rx_to_pkt_err_flags() return true for error
packets and use the return value instead of mbuf->ol_flags to indicate
error packets. Also remove warning for error packets and rely on
rx_error stats.

Fixes: 947d860c821f ("enic: improve Rx performance")

Signed-off-by: John Daley <johndale@cisco.com>
8 years agoenic: fix mbuf flags on Rx
John Daley [Thu, 17 Mar 2016 22:57:05 +0000 (15:57 -0700)]
enic: fix mbuf flags on Rx

In the receive path, the function to set mbuf ol_flags used the
mbuf packet_type before it was set.

Fixes: 947d860c821f ("enic: improve Rx performance")

Signed-off-by: John Daley <johndale@cisco.com>
8 years agoenic: fix crash when allocating too many queues
Nelson Escobar [Thu, 17 Mar 2016 22:49:58 +0000 (15:49 -0700)]
enic: fix crash when allocating too many queues

Add checks to make sure we don't try to allocate more tx or rx queues
than we support.

Fixes: fefed3d1e62c ("enic: new driver")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
8 years agoenic: add missing newline to print statements
Nelson Escobar [Thu, 17 Mar 2016 22:48:13 +0000 (15:48 -0700)]
enic: add missing newline to print statements

Add the missing '\n' character to the end of a few print statements.

Fixes: fefed3d1e62c ("enic: new driver")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Acked-by: John Daley <johndale@cisco.com>
8 years agomlx5: add VLAN insertion offload
Yaacov Hazan [Thu, 17 Mar 2016 15:38:58 +0000 (16:38 +0100)]
mlx5: add VLAN insertion offload

VLAN insertion can be done in hardware when supported in Verbs. A software
fallback is provided otherwise. The software implementation is also used
when multi-packet send is enabled on a queue, as both features are mutually
exclusive.

Signed-off-by: Yaacov Hazan <yaacovh@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agomlx5: support HW packet padding
Olga Shern [Thu, 17 Mar 2016 15:38:57 +0000 (16:38 +0100)]
mlx5: support HW packet padding

Environment variable MLX5_PMD_ENABLE_PADDING enables HW packet padding
in PCI bus transactions.

When packet size is cache aligned and CRC stripping is enabled, 4 fewer
bytes are written to the PCI bus. Enabling padding makes such packets
aligned again.

In cases where PCI bandwidth is the bottleneck, padding can improve
performance by 10%.

This is disabled by default since this can also decrease performance for
unaligned packet sizes.

Signed-off-by: Olga Shern <olgas@mellanox.com>
fix packet padding macro check

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agomlx5: add Rx CRC stripping configuration
Olga Shern [Thu, 17 Mar 2016 15:38:56 +0000 (16:38 +0100)]
mlx5: add Rx CRC stripping configuration

Until now, CRC was always stripped by hardware. This feature can be
configured since MLNX_OFED >= 3.2.

Signed-off-by: Olga Shern <olgas@mellanox.com>
8 years agomlx5: allow operation in secondary processes
Or Ami [Thu, 17 Mar 2016 15:38:55 +0000 (16:38 +0100)]
mlx5: allow operation in secondary processes

Secondary processes are expected to use queues and other resources
allocated by the primary, however Verbs resources can only be shared
between processes when inherited through fork().

This limitation can be worked around for TX by configuring separate queues
from secondary processes.

Signed-off-by: Or Ami <ora@mellanox.com>
8 years agomlx5: support setting link up or down
Or Ami [Thu, 17 Mar 2016 15:38:54 +0000 (16:38 +0100)]
mlx5: support setting link up or down

Add driver functions to set link state up or down.
Burst functions are updated to make sure applications cannot attempt to
send/receive after link is brought down.

Signed-off-by: Or Ami <ora@mellanox.com>
8 years agoi40evf: support reporting PF reset
Jingjing Wu [Tue, 15 Mar 2016 01:59:40 +0000 (09:59 +0800)]
i40evf: support reporting PF reset

When Linux PF and DPDK VF are used for i40e PMD, when a PF reset occurs,
an interrupt will go via adminq event to inform the VF of the reset.
A callback mechanism is introduced for the VF to allow it to invoke a
registered callback when PF  reset happens.

Users can register a callback for this interrupt event using:
  rte_eth_dev_callback_register(portid,
RTE_ETH_EVENT_INTR_RESET,
reset_event_callback,
arg);

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoi40evf: allocate virtchnl commands buffer per VF
Jingjing Wu [Tue, 15 Mar 2016 01:59:39 +0000 (09:59 +0800)]
i40evf: allocate virtchnl commands buffer per VF

Currently, i40evf PMD uses a global static buffer to send virtchnl
commands to host driver. It is shared by multiple VFs.
This patch changed to allocate a virtchnl cmd buffer for each VF.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agovhost: add driver on top of the library
Tetsuya Mukawa [Mon, 21 Mar 2016 05:45:08 +0000 (14:45 +0900)]
vhost: add driver on top of the library

The patch introduces a new PMD. This PMD is implemented as thin wrapper
of librte_vhost. It means librte_vhost is also needed to compile the PMD.
The vhost messages will be handled only when a port is started. So start
a port first, then invoke QEMU.

The PMD has 2 parameters.
 - iface:  The parameter is used to specify a path to connect to a
           virtio-net device.
 - queues: The parameter is used to specify the number of the queues
           virtio-net device has.
           (Default: 1)

Here is an example.
$ ./testpmd -c f -n 4 --vdev 'eth_vhost0,iface=/tmp/sock0,queues=1' -- -i

To connect above testpmd, here is qemu command example.

$ qemu-system-x86_64 \
        <snip>
        -chardev socket,id=chr0,path=/tmp/sock0 \
        -netdev vhost-user,id=net0,chardev=chr0,vhostforce,queues=1 \
        -device virtio-net-pci,netdev=net0,mq=on

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Rich Lane <rich.lane@bigswitch.com>
Tested-by: Rich Lane <rich.lane@bigswitch.com>
Update for queue state event name:
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agoethdev: add queue state change event type
Tetsuya Mukawa [Mon, 21 Mar 2016 05:45:07 +0000 (14:45 +0900)]
ethdev: add queue state change event type

This patch adds a below event type.
 - RTE_ETH_EVENT_QUEUE_STATE

This event will occur when some queues are enabled or disabled.
So far, only vhost PMD supports the event, and it indicates some queues
are enabled or disabled by virtio-net device. Such an event is needed
because virtio-net device may not enable all queues vhost PMD prepare.

Because only vhost PMD uses the event so far, it isn't an actual hardware
interrupt but a simple software event.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Rich Lane <rich.lane@bigswitch.com>
Tested-by: Rich Lane <rich.lane@bigswitch.com>
Minor modification to event name and comment:
Suggested-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agoena: add polling-mode driver
Jan Medala [Thu, 17 Mar 2016 14:31:18 +0000 (15:31 +0100)]
ena: add polling-mode driver

This is a PMD for the Amazon ethernet ENA (Elastic Network Adapters)
family.
The driver operates variety of ENA adapters through feature negotiation
with the adapter and upgradable commands set.
ENA driver handles PCI Physical and Virtual ENA functions.

Signed-off-by: Evgeny Schemeilin <evgenys@amazon.com>
Signed-off-by: Jan Medala <jan@semihalf.com>
Signed-off-by: Jakub Palider <jpa@semihalf.com>
Release Note addition:
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agoena: add communication layer for DPDK
Jan Medala [Thu, 17 Mar 2016 14:31:17 +0000 (15:31 +0100)]
ena: add communication layer for DPDK

Implementation of platform specific code for ENA communication layer.

Signed-off-by: Evgeny Schemeilin <evgenys@amazon.com>
Signed-off-by: Jan Medala <jan@semihalf.com>
Signed-off-by: Jakub Palider <jpa@semihalf.com>
8 years agoena: import communication layer
Jan Medala [Thu, 17 Mar 2016 14:31:16 +0000 (15:31 +0100)]
ena: import communication layer

Low level common abstraction for ENA device communication.

Signed-off-by: Netanel Belgazal <netanel@amazon.com>
Signed-off-by: Jan Medala <jan@semihalf.com>
Signed-off-by: Jakub Palider <jpa@semihalf.com>
8 years agoena: introduce documentation
Jan Medala [Thu, 17 Mar 2016 14:31:15 +0000 (15:31 +0100)]
ena: introduce documentation

Signed-off-by: Alexander Matushevsky <matua@amazon.com>
Signed-off-by: Jan Medala <jan@semihalf.com>
Signed-off-by: Jakub Palider <jpa@semihalf.com>
8 years agoethdev: query supported packet types
Jianfeng Tan [Mon, 14 Mar 2016 20:50:50 +0000 (04:50 +0800)]
ethdev: query supported packet types

Add a new API rte_eth_dev_get_supported_ptypes to query what packet types
can be filled by a given device. The device should be already started or
its PMD RX burst function already decided, since the packet types supported
may vary depending on RX function.

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agoscripts: improve quiet checkpatch
Thomas Monjalon [Sun, 13 Dec 2015 02:32:58 +0000 (03:32 +0100)]
scripts: improve quiet checkpatch

The option --no-summary will remove this line in quiet mode:
total: 1 errors, 0 warnings, 7 lines checked

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoscripts: fix checkpatch help
Olivier Matz [Tue, 16 Feb 2016 14:36:54 +0000 (15:36 +0100)]
scripts: fix checkpatch help

When started without defining DPDK_CHECKPATCH_PATH, the usage was not
displayed.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agotools: fix setup with built-in kernel modules
Jerin Jacob [Mon, 14 Mar 2016 12:15:32 +0000 (17:45 +0530)]
tools: fix setup with built-in kernel modules

probe the kernel module existence through /sys/module/ to make it work
with both module and inbuilt kernel module

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
8 years agotools: fix setup with huge page size other than 2MB
Jerin Jacob [Mon, 14 Mar 2016 12:15:31 +0000 (17:45 +0530)]
tools: fix setup with huge page size other than 2MB

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
8 years agotools: fix flake8 warnings in bind script
Mauricio Vasquez B [Fri, 19 Feb 2016 17:03:18 +0000 (18:03 +0100)]
tools: fix flake8 warnings in bind script

flake8 checks were run for both python 2.7 and 3.4

There were some style issues as:
- Line width > 79
- No double blank line before function definition
- No double blank space before inline comment
- Some other minor issues

Signed-off-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agotools: remove extra blank lines in CPU layout
Keith Wiles [Tue, 8 Dec 2015 18:52:17 +0000 (12:52 -0600)]
tools: remove extra blank lines in CPU layout

The output for the core list included an extra linefeed making
the number of lines displayed much larger then required.

Signed-off-by: Keith Wiles <keith.wiles@intel.com>
8 years agoapp/test: fix check for virtual ring device
Olivier Matz [Tue, 15 Mar 2016 12:25:29 +0000 (13:25 +0100)]
app/test: fix check for virtual ring device

This test expects that a vdev is instanciated on the command
line. If it's not the case, just skip this part.

Fixes: 4ea3801b3222 ("app/test: fix ring unit test")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agoapp/test: display command line when starting
Olivier Matz [Tue, 15 Mar 2016 12:25:22 +0000 (13:25 +0100)]
app/test: display command line when starting

It's useful for debug purposes to see the command line used by
autotest.py.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agoexamples/l2fwd-crypto: add NULL algorithms
Pablo de Lara [Tue, 22 Mar 2016 21:24:01 +0000 (21:24 +0000)]
examples/l2fwd-crypto: add NULL algorithms

NULL crypto operation is now supported, but l2fwd-crypto
was missing an update on the list of supported algorithms
that can be passed from command line.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agoexamples/l2fwd-crypto: add AES-GCM algorithm
Pablo de Lara [Tue, 22 Mar 2016 21:24:00 +0000 (21:24 +0000)]
examples/l2fwd-crypto: add AES-GCM algorithm

AES GCM is an algorithm for both ciphering and authentication,
but the authentication algorithm was missing in the
list of supported algorithms that can be passed from command line.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agoexamples/l2fwd-crypto: add SNOW 3G algorithms
Pablo de Lara [Tue, 22 Mar 2016 21:23:59 +0000 (21:23 +0000)]
examples/l2fwd-crypto: add SNOW 3G algorithms

Since SNOW3G UEA2/UIA2 are supported now by both HW and SW,
l2fwd-crypto may use them, extending the list of algorithms
parsed from command line.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agoexamples/l2fwd-crypto: fix command line help
Pablo de Lara [Thu, 24 Mar 2016 13:39:45 +0000 (13:39 +0000)]
examples/l2fwd-crypto: fix command line help

Previous cdev parameter was changed to cdev_type,
to select a crypto device type preference (HW/SW/ANY),
instead of the device itself (QAT/AESNI...).
Also deleted cdev duplicated parameter from the help.

Fixes: 27cf2d1b18e1 ("examples/l2fwd-crypto: discover capabilities")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
8 years agoeal/arm: disable NEON for 32-bit memcpy
Jan Viktorin [Sat, 19 Mar 2016 19:58:04 +0000 (20:58 +0100)]
eal/arm: disable NEON for 32-bit memcpy

The new flag CONFIG_RTE_ARCH_ARM_NEON_MEMCPY is used to enable memcpy
optimizations in EAL.
As it is not always the performance benefit, the feature is disabled.

Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
8 years agomk: improve ARM NEON detection
Jan Viktorin [Sat, 19 Mar 2016 19:58:03 +0000 (20:58 +0100)]
mk: improve ARM NEON detection

The __ARM_NEON declares that the arm_neon.h is available
which is not always true for the __ARM_NEON_FP.

 $ arm-linux-gnueabi-gcc -dM -E - < /dev/null  | grep "_FP\|_NEON"
 #define __ARM_FP 12
 #define __ARM_NEON_FP 4
 #define __VFP_FP__ 1

 $ arm-linux-gnueabi-gcc -mfpu=neon -dM -E - < /dev/null  | grep "_FP\|_NEON"
 #define __ARM_FP 12
 #define __ARM_NEON_FP 4
 #define __ARM_NEON__ 1
 #define __VFP_FP__ 1
 #define __ARM_NEON 1

 $ aarch64-linux-gnu-gcc -dM -E - < /dev/null | grep "NEON\|FP"
 #define __FP_FAST_FMAF 1
 #define __ARM_NEON 1
 #define __FP_FAST_FMA 1

 $ aarch64-thunderx-linux-gnu-gcc -dM -E - < /dev/null |grep "NEON\|FP"
 #define __ARM_FP 12
 #define __ARM_NEON_FP 12
 #define __FP_FAST_FMAF 1
 #define __ARM_NEON 1
 #define __FP_FAST_FMA 1

Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
8 years agoconfig: remove ARM NEON option
Jan Viktorin [Sat, 19 Mar 2016 19:58:02 +0000 (20:58 +0100)]
config: remove ARM NEON option

ARMv7 machines have usually the NEON available.
Customization of the -mfpu=neon must be done by hand or by defining
another machine rte.vars.mk.
So, the CONFIG_RTE_ARCH_ARM_NEON is useless (and confusing).

Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
8 years agoethdev: fix xstats size query with NULL
Stephen Hemminger [Tue, 22 Mar 2016 22:09:17 +0000 (15:09 -0700)]
ethdev: fix xstats size query with NULL

Normal usage of rte_eth_dev_xstats_get is to call twice. The
first time the function is called with portid, xstats = NULL
and n = 0; this returns the number of entries in the statistics
table that need to be allocated.

The problem is that the routine adds a count value to NULL (0)
and assumes that this is a valid pointer (it isn't). Device drivers
all have a check for NULL, and this no longer matches.

Fixes: d4fef8b0d5e5 ("ethdev: expose generic and driver specific stats in xstats")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomk: fix gcc-5 version on Suse
Markos Chandras [Tue, 22 Mar 2016 17:13:36 +0000 (17:13 +0000)]
mk: fix gcc-5 version on Suse

In openSUSE Tumbleweed (and in any other SUSE distribution which
uses (or will use) gcc >= 5), gcc -dumpversion returns '5'. This is on
purpose as discussed in https://bugzilla.opensuse.org/show_bug.cgi?id=941428
As a result of which, the gcc-4.x comparison (40 against 5) does not
work leading to tons of warnings and failures during build.

This patch aims to change the way the gcc version is obtained by using
the gcc macros directly.
This is similar to what's being used in the Linux kernel. Querying the
GCC macros directly gives more accurate results compared to -dumpversion
which could vary across distributions.

Signed-off-by: Markos Chandras <mchandras@suse.de>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agomk: fix missing librt dependencies
Daniel Mrzyglod [Tue, 22 Mar 2016 12:51:02 +0000 (13:51 +0100)]
mk: fix missing librt dependencies

For GLIBC < 2.17 it is necessery to add -lrt for linker
from glibc > 2.17 The `clock_*' suite of functions (declared in <time.h>) is now
available directly in the main C library. This affect Ubuntu 12.04 in i686
and other older Linux Distros).

Fixes: 4758404a3084 ("mk: fix eal shared library dependencies")

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
8 years agomk: fix missing libm dependencies
Panu Matilainen [Mon, 21 Mar 2016 11:33:58 +0000 (13:33 +0200)]
mk: fix missing libm dependencies

Commit e86a699cf6b1 missed two further libm dependencies: ceil() used
by librte_meter is typically inlined so the missing dependency does not
actually cause failures, and librte_pmd_nfp is not built by default
so its easy to miss.

This causes duplicates in LDLIBS in many configurations so its vital
they are removed before passing to linker.

Fixes: e86a699cf6b1 ("mk: fix shared library dependencies on libm and librt")

Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
8 years agomk: eliminate duplicates from libraries list
Panu Matilainen [Mon, 21 Mar 2016 11:33:57 +0000 (13:33 +0200)]
mk: eliminate duplicates from libraries list

Duplicates in LDLIBS can cause link failures from multiply defined
symbols, ensure all libraries are only mentioned once. Can't use
sorting for duplicate elimination as order is critical so awk one-liner
is used.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
8 years agomk: restrict CPU flags list
Thomas Monjalon [Mon, 21 Mar 2016 20:12:55 +0000 (21:12 +0100)]
mk: restrict CPU flags list

When compiling each file, the CPU flags are given as RTE_MACHINE_CPUFLAG_*
and in the list RTE_COMPILE_TIME_CPUFLAGS.

RTE_MACHINE_CPUFLAG_* are used to check the CPU features when compiling.

The list RTE_COMPILE_TIME_CPUFLAGS is used only to check the CPU at
runtime in the function rte_cpu_check_supported(). So it is not needed to
define this list for every files.
That's why RTE_COMPILE_TIME_CPUFLAGS is removed from the common variable
MACHINE_CFLAGS and is added only to the CFLAGS of eal_common_cpuflags.c.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoexamples/l3fwd: remove old SSE4 comments
Thomas Monjalon [Mon, 21 Mar 2016 14:34:33 +0000 (15:34 +0100)]
examples/l3fwd: remove old SSE4 comments

The flag ENABLE_MULTI_BUFFER_OPTIMIZE has been removed so the
related comments are now useless.

Fixes: 268888b5b020 ("examples/l3fwd: modularize")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoexamples/performance-thread: fix build without SSE4.1
Thomas Monjalon [Wed, 3 Feb 2016 18:56:38 +0000 (19:56 +0100)]
examples/performance-thread: fix build without SSE4.1

clang reports these errors:

error: too many arguments to function call, expected 2, have 3
examples/performance-thread/l3fwd-thread/main.c:1220:1: note:
'l3fwd_simple_forward' declared here

examples/l3fwd/main.c:550:1: error: unused function 'send_packetsx4'

The function is used only when ENABLE_MULTI_BUFFER_OPTIMIZE is 1.

Fixes: d48415e1fee3 ("examples/performance-thread: add l3fwd-thread app")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoexamples/ip_pipeline: fix configuration parser
Fan Zhang [Mon, 14 Mar 2016 12:22:02 +0000 (12:22 +0000)]
examples/ip_pipeline: fix configuration parser

Fixes: 377cd98e0ab6 ("examples/ip_pipeline: add link identification")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agoapp/testpmd: fix build with icc
Tomasz Kulasek [Tue, 22 Mar 2016 14:52:09 +0000 (15:52 +0100)]
app/testpmd: fix build with icc

This patch fixes error #188: enumerated type mixed with another type,
when uint32_t is casted on enum type in icc.

Fixes: 05f1b9c82ec2 ("app/testpmd: add commands for L2 tunnel config")

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
8 years agoring: fix deadlock in zero object multi enqueue or dequeue
Lazaros Koromilas [Thu, 17 Mar 2016 15:49:43 +0000 (17:49 +0200)]
ring: fix deadlock in zero object multi enqueue or dequeue

Issuing a zero objects dequeue with a single consumer has no effect.
Doing so with multiple consumers, can get more than one thread to succeed
the compare-and-set operation and observe starvation or even deadlock in
the while loop that checks for preceding dequeues.  The problematic piece
of code when n = 0:

    cons_next = cons_head + n;
    success = rte_atomic32_cmpset(&r->cons.head, cons_head, cons_next);

The same is possible on the enqueue path.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Lazaros Koromilas <l@nofutznetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
8 years agolpm6: fix use after free
Christian Ehrhardt [Mon, 21 Mar 2016 14:06:11 +0000 (15:06 +0100)]
lpm6: fix use after free

In certain autotests lpm->max_rules turned out to be non initialized.
That was caused by a failing allocation for lpm->rules_tbl in rte_lpm6_create.
It then left the function via goto exit with lpm freed, but still a pointer
value being set.

In case of an allocation failure it resets lpm to NULL now, to avoid the
upper layers operate on that already freed memory.
Along that is also makes the RTE_LOG message of the failed allocation unique.

Fixes: 5c510e13a9cb ("lpm: add IPv6 support")

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
8 years agolpm6: fix missing free
Christian Ehrhardt [Mon, 21 Mar 2016 14:06:12 +0000 (15:06 +0100)]
lpm6: fix missing free

lpm6 autotests failed with the default alloc of 512M Memory.
While >=2500M was a workaround it became clear while debugging that it
had a leak.
One could see a lot of output like:
  LPM Test tests6[i]: FAIL
  LPM: LPM memory allocation failed

It turned out that in rte_lpm6_free
- lpm might not be freed if it didn't find a te (early return)
- lpm->rules_tbl was not freed ever

Fixes: 899d8bc9b3b5 ("lpm: make tailq fully local")

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
8 years agolpm: fix use after free
Christian Ehrhardt [Mon, 21 Mar 2016 14:06:14 +0000 (15:06 +0100)]
lpm: fix use after free

There were further chances for a use after free by returning an already
freed pointer in rte_lpm_create for v20 and v1604.
Along that is also makes the RTE_LOG messages of the failed allocations
unique.

Fixes: f1f7261838b3 ("lpm: add a new config structure for IPv4")

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
8 years agolpm: fix missing free
Christian Ehrhardt [Mon, 21 Mar 2016 14:06:13 +0000 (15:06 +0100)]
lpm: fix missing free

In rte_lpm_free lpm might not be freed if it didn't find a te (early return)

The two lpm interfaces rte_lpm_free_v20 and rte_lpm_free_v1604 had a leak.
rte_lpm_free_v20 might have missed to free rules_tbl
rte_lpm_free_v1604 due to an early exit might have missed to free
rules_tbl and lpm itself.

Fixes: 899d8bc9b3b5 ("lpm: make tailq fully local")

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
8 years agodoc: notify Rx errors not counting missed packets anymore
Thomas Monjalon [Tue, 22 Mar 2016 15:51:30 +0000 (16:51 +0100)]
doc: notify Rx errors not counting missed packets anymore

Fixes: 86057c9992f5 ("ethdev: remove missed packets from error counter")

Suggested-by: Maryam Tahhan <maryam.tahhan@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoethdev: remove missed packets from error counter
Igor Ryzhov [Thu, 10 Mar 2016 13:03:30 +0000 (16:03 +0300)]
ethdev: remove missed packets from error counter

Comment for "ierrors" counter says that it counts erroneous received
packets. But for some reason "imissed" counter is added to "ierrors"
counter in most drivers.
It is a mistake, because missed packets are obviously not received.
This patch fixes it.

Fixes: 70bdb18657da ("ethdev: add Rx error counters for missed, badcrc and badlen packets")
Fixes: 6bfe648406b5 ("i40e: add Rx error statistics")
Fixes: 856505d303f4 ("cxgbe: add port statistics")

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agomaintainers: sort examples
Thomas Monjalon [Tue, 22 Mar 2016 09:59:52 +0000 (10:59 +0100)]
maintainers: sort examples

Keep sorting examples and fix l2fwd-cat path.

Fixes: ab129e9065a5 ("examples/ptpclient: add minimal PTP client")
Fixes: f6baccbc2b3b ("examples/l2fwd-cat: add sample application for PQoS CAT and CDP")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoexamples/l2fwd-cat: add sample application for PQoS CAT and CDP
Wojciech Andralojc [Mon, 14 Mar 2016 13:46:59 +0000 (13:46 +0000)]
examples/l2fwd-cat: add sample application for PQoS CAT and CDP

This patch implements PQoS as a sample application.
PQoS allows management of the CPUs last level cache,
which can be useful for DPDK to ensure quality of service.
The sample app links against the existing 01.org PQoS library
(https://github.com/01org/intel-cmt-cat).

White paper demonstrating example use case "Increasing Platform Determinism
with Platform Quality of Service for the Data Plane Development Kit"
(http://www.intel.com/content/www/us/en/communications/increasing-platform-determinism-pqos-dpdk-white-paper.html)

Signed-off-by: Wojciech Andralojc <wojciechx.andralojc@intel.com>
Signed-off-by: Tomasz Kantecki <tomasz.kantecki@intel.com>
Signed-off-by: Marcel D Cornu <marcel.d.cornu@intel.com>
8 years agoexamples/l3fwd: fix exact match performance
Tomasz Kulasek [Fri, 18 Mar 2016 13:31:46 +0000 (14:31 +0100)]
examples/l3fwd: fix exact match performance

It seems that for the most use cases, previous hash_multi_lookup provides
better performance, and more, sequential lookup can cause significant
performance drop.

This patch sets previously optional hash_multi_lookup method as default.
It also provides some minor optimizations such as queue drain only on used
tx ports.

Fixes: 94c54b4158d5 ("examples/l3fwd: rework exact-match")
Fixes: dc81ebbacaeb ("lpm: extend IPv4 next hop field")
Fixes: 64d3955de1de ("examples/l3fwd: fix ARM build")

Reported-by: Qian Xu <qian.q.xu@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
8 years agoexamples/l3fwd: fix build with hash multi-lookup
Maciej Czekaj [Wed, 16 Mar 2016 06:23:24 +0000 (07:23 +0100)]
examples/l3fwd: fix build with hash multi-lookup

l3fwd does not compile with HASH_MULTI_LOOKUP.
2 issues:
 * in 64d395 mask0 changed type from xmm_t to rte_xmm_t
      -> use x field from rte_xmm_t
 * in dc81eb dst_port parameter changed to uint32_t
      -> change uint16_t dst_port to uin32_t dsp_port

Fixes: dc81ebbacaeb ("lpm: extend IPv4 next hop field")
Fixes: 64d3955de1de ("examples/l3fwd: fix ARM build")

Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
8 years agolpm: fix pipeline apps
Michal Kobylinski [Thu, 17 Mar 2016 08:47:25 +0000 (09:47 +0100)]
lpm: fix pipeline apps

Updated ip_pipeline app is using new changes from LPM library
(Increased number of next hops and added new config structure
for LPM IPv4).

Fixes: f1f7261838b3 ("lpm: add a new config structure for IPv4")

Signed-off-by: Michal Kobylinski <michalx.kobylinski@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agovhost: remove unnecessary memset when enqueueing
Yuanhan Liu [Wed, 16 Mar 2016 06:44:56 +0000 (14:44 +0800)]
vhost: remove unnecessary memset when enqueueing

We have to reset the virtio net hdr at virtio_enqueue_offload()
before, due to all mbufs share a single virtio_hdr structure:

struct virtio_net_hdr_mrg_rxbuf virtio_hdr = {{0, }, 0};

foreach (mbuf) {
virtio_enqueue_offload(mbuf, &virtio_hdr.hdr);

copy net hdr and mbuf to desc buf
}

However, after the vhost rxtx refactor, the code looks like:

copy_mbuf_to_desc(mbuf)
{
struct virtio_net_hdr_mrg_rxbuf virtio_hdr = {{0, }, 0}

virtio_enqueue_offload(mbuf, &virtio_hdr.hdr);

copy net hdr and mbuf to desc buf
}

foreach (mbuf) {
copy_mbuf_to_desc(mbuf);
}

Therefore, the memset at virtio_enqueue_offload() is not necessary
any more; remove it.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
8 years agomk: fix linker script when re-building
Sergio Gonzalez Monroy [Wed, 16 Mar 2016 23:22:23 +0000 (23:22 +0000)]
mk: fix linker script when re-building

The linker script is generated by simply finding all libraries in
RTE_OUTPUT/lib.

The issue shows up when re-building the DPDK, hence already having a
linker script in that directory, resulting in the linker script
including itself.

That does not play well with the linker.

Simply filtering the linker script from all the found libraries solves
the problem.

Fixes: 948fd64befc3 ("mk: replace the combined library with a linker script")

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
8 years agoversion: 16.04-rc1
Thomas Monjalon [Wed, 16 Mar 2016 20:44:50 +0000 (21:44 +0100)]
version: 16.04-rc1

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agodoc: add packet framework release notes
Jasvinder Singh [Mon, 14 Mar 2016 13:44:36 +0000 (13:44 +0000)]
doc: add packet framework release notes

This patch updates the release notes with the features that
have been added to ip_pipeline application.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agopci: fix ioport support for uio_pci_generic on x86
David Marchand [Tue, 15 Mar 2016 06:29:13 +0000 (07:29 +0100)]
pci: fix ioport support for uio_pci_generic on x86

uio_pci_generic does not offer the same sysfs helpers as igb_uio.
In this case, ioport number can only be retrieved by parsing /proc/ioports.

Fixes: 756ce64b1ecd ("eal: introduce PCI ioport API")

Reported-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
Signed-off-by: David Marchand <david.marchand@6wind.com>
8 years agopci: separate ioport handlers per UIO driver
David Marchand [Tue, 15 Mar 2016 06:29:10 +0000 (07:29 +0100)]
pci: separate ioport handlers per UIO driver

Prepare for fixes on x86 by separating igb_uio and uio_pci_generic cases.

Signed-off-by: David Marchand <david.marchand@6wind.com>
8 years agopci: align ioport special case for x86 in read/write/unmap
David Marchand [Tue, 15 Mar 2016 06:29:12 +0000 (07:29 +0100)]
pci: align ioport special case for x86 in read/write/unmap

Commit b8eb345378bd ("pci: ignore devices already managed in Linux when
mapping x86 ioport") did not update other parts of the ioport api.

The application is not supposed to call these read/write/unmap ioport
functions if map call failed but I prefer aligning the code for the sake
of consistency.

Signed-off-by: David Marchand <david.marchand@6wind.com>
8 years agopci: align ioport unmap error handling to ioport map
David Marchand [Tue, 15 Mar 2016 06:29:11 +0000 (07:29 +0100)]
pci: align ioport unmap error handling to ioport map

Same idea as commit bd80d4730aca ("pci: rework ioport map error handling").

Signed-off-by: David Marchand <david.marchand@6wind.com>
8 years agobonding: fix crash when no slave device
Bernard Iremonger [Mon, 7 Mar 2016 11:40:40 +0000 (11:40 +0000)]
bonding: fix crash when no slave device

If a bonded device is created when there are no slave devices
there is a loop in bond_ethdev_promiscuous_enable() which results
in a segmentation fault.

The solution is to initialise the current_primary_port to an
invalid port value when the bonded port is created.

Fixes: 2efb58cbab6e ("bond: new link bonding library")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
8 years agobonding: do not activate slave twice
Eric Kinzie [Tue, 1 Mar 2016 17:32:02 +0000 (09:32 -0800)]
bonding: do not activate slave twice

The current code for detecting link during slave addition can cause a
slave interface to be activated twice -- once during slave_configure()
and again at the end of __eth_bond_slave_add_lock_free().  This will
either cause the active slave count to be incorrect or will cause the
802.3ad activation function to panic.  Ensure that the interface is not
activated more than once.

Fixes: 46fb43683679 ("bond: add mode 4")

Signed-off-by: Eric Kinzie <ekinzie@brocade.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Declan Doherty <declan.doherty@intel.com>
8 years agobonding: fix active slaves with no primary
Eric Kinzie [Tue, 1 Mar 2016 17:32:01 +0000 (09:32 -0800)]
bonding: fix active slaves with no primary

If the link state of a slave is "up" when added, it is added to the list
of active slaves but, even if it is the only slave, is not selected as
the primary interface.  Generally, handling of link state interrupts
selects an interface to be primary, but only if the active count is zero.
This change avoids the situation where there are active slaves but
no primary.

Fixes: 2efb58cbab6e ("bond: new link bonding library")

Signed-off-by: Eric Kinzie <ekinzie@brocade.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Declan Doherty <declan.doherty@intel.com>
8 years agobonding: do not ignore multicast in mode 4
Eric Kinzie [Tue, 1 Mar 2016 17:32:00 +0000 (09:32 -0800)]
bonding: do not ignore multicast in mode 4

The bonding PMD in mode 4 puts all enslaved interfaces into promiscuous
mode in order to receive LACPDUs and must filter unwanted packets
after the traffic has been "collected".  Allow broadcast and multicast
through so that ARP and IPv6 neighbor discovery continue to work.

Fixes: 46fb43683679 ("bond: add mode 4")

Signed-off-by: Eric Kinzie <ekinzie@brocade.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Declan Doherty <declan.doherty@intel.com>
8 years agobonding: copy entire config structure in mode 4
Eric Kinzie [Tue, 1 Mar 2016 17:31:59 +0000 (09:31 -0800)]
bonding: copy entire config structure in mode 4

Copy all needed fields from the mode8023ad_private structure in
bond_mode_8023ad_conf_get().  This help ensure that a subsequent call
to rte_eth_bond_8023ad_setup() is not passed uninitialized data that
would result in either incorrect behavior or a failed sanity check.

Fixes: 46fb43683679 ("bond: add mode 4")

Signed-off-by: Eric Kinzie <ekinzie@brocade.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Declan Doherty <declan.doherty@intel.com>
8 years agobonding: fix detach of slave devices
Bernard Iremonger [Wed, 10 Feb 2016 10:13:45 +0000 (10:13 +0000)]
bonding: fix detach of slave devices

Ensure that a bonded slave device is not detached,
until it is removed from the bonded device.

Fixes: 2efb58cbab6e ("bond: new link bonding library")
Fixes: a45b288ef21a ("bond: support link status polling")
Fixes: 494adb7f63f2 ("ethdev: add device fields from PCI layer")
Fixes: b1fb53a39d88 ("ethdev: remove some PCI specific handling")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
8 years agobonding: fix detach of bonded device
Bernard Iremonger [Wed, 10 Feb 2016 10:13:44 +0000 (10:13 +0000)]
bonding: fix detach of bonded device

Check that the bonded device has no slaves before detaching it.

Fixes: 8d30fe7fa737 ("bonding: support port hotplug")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
8 years agonull: remove duplicate fields in internal struct
Ferruh Yigit [Fri, 26 Feb 2016 16:58:09 +0000 (16:58 +0000)]
null: remove duplicate fields in internal struct

1- remove duplicate nb_rx/tx_queues fields from internals
2- remove duplicate numa_node field from internals

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Nicolás Pernas Maradei <nicolas.pernas.maradei@emutex.com>
8 years agoring: free rings when detaching device
Mauricio Vasquez B [Mon, 7 Mar 2016 16:20:31 +0000 (17:20 +0100)]
ring: free rings when detaching device

When a device is created with "CREATE" as action, new rings are
allocated for it, then it is a good practice to free them when the
rte_ethdev_dettach method is invoked by the application.

Rings are not freeded when "ATTACH" is used or when the device is
created by means of the rte_eth_from_rings function.

Signed-off-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agoring: clean up driver
Ferruh Yigit [Fri, 26 Feb 2016 16:58:08 +0000 (16:58 +0000)]
ring: clean up driver

Rename nb_rx/tx_queues fields in internals struct to max_rx/tx_queues
Updated fields required to keep max queue numbers configured. For current
queue number requirements data->nb_rx/tx_queues fields used.

Some checkpatch corrections and code clenaup.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agopcap: reduce duplication
Ferruh Yigit [Fri, 26 Feb 2016 16:58:07 +0000 (16:58 +0000)]
pcap: reduce duplication

1- Remove duplicate nb_rx/tx_queues fields from internals
2- Move duplicate code into a common function

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Nicolás Pernas Maradei <nicolas.pernas.maradei@emutex.com>
8 years agopcap: fix captured frame length
Dror Birkman [Thu, 28 Jan 2016 11:09:50 +0000 (13:09 +0200)]
pcap: fix captured frame length

The actual captured length is header.caplen, whereas header.len is
the original length on the wire.

Fixes: 4c173302c307 ("pcap: add new driver")

Signed-off-by: Dror Birkman <dror.birkman@lightcyber.com>
Acked-by: Nicolás Pernas Maradei <nicolas.pernas.maradei@emutex.com>
8 years agoaf_packet: make the device detachable
Wojciech Zmuda [Wed, 2 Mar 2016 11:55:41 +0000 (12:55 +0100)]
af_packet: make the device detachable

Allow dynamic deallocation of af_packet device through proper
API functions. To achieve this:
* set device flag to RTE_ETH_DEV_DETACHABLE
* implement rte_pmd_af_packet_devuninit() and expose it
  through rte_driver.uninit()
* copy device name to ethdev->data to make discoverable with
  rte_eth_dev_allocated()
Moreover, make af_packet init function static, as there is no
reason to keep it public.

Signed-off-by: Wojciech Zmuda <woz@semihalf.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
8 years agovmxnet3: support setting MAC address
Stephen Hemminger [Fri, 4 Mar 2016 18:08:02 +0000 (10:08 -0800)]
vmxnet3: support setting MAC address

Allow overriding the base mac address of the device.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Remy Horton <remy.horton@intel.com>
8 years agovmxnet3: fix VLAN filtering
Charles (Chas) Williams [Fri, 4 Mar 2016 18:08:01 +0000 (10:08 -0800)]
vmxnet3: fix VLAN filtering

During an MTU change, the adapter is restarted.  If hardware VLAN offload
is in use, this existing filter table would also be cleared.  Instead,
setup the shadow table once during device initialization and just update
during restart.

vmxnet3_dev_vlan_offload_set(dev, mask) was incorrectly treating the
mask parameter as the bitmask for vlan_strip and vlan_filter, whereas
the mask indicates only what has changed - the values for
vlan_stripping and vlan_filter needs to be taken from dev_conf.rxmode.

Fixes: f003fc383487 ("vmxnet3: enable vlan filtering")

Signed-off-by: Charles (Chas) Williams <ciwillia@brocade.com>
Signed-off-by: Nachiketa Prachanda <nprachan@brocade.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Remy Horton <remy.horton@intel.com>
8 years agovmxnet3: support jumbo frames
Stephen Hemminger [Fri, 4 Mar 2016 18:08:00 +0000 (10:08 -0800)]
vmxnet3: support jumbo frames

Add support for linking multi-segment buffers together to
handle Jumbo packets. The vmxnet3 API supports having header
and body buffer types. What this patch does is fill the primary
ring completely with header buffers and the secondary ring
with body buffers. This allows for non-jumbo frames to only
use one mbuf (from primary ring); and jumbo frames will have
first mbuf from primary ring and following mbufs from other
ring.

This could be optimized in future if the DPDK had API
to supply different sized mbufs (two pools) into driver.

Signed-off-by: Stephen Hemminger <shemming@brocade.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Release note addition:
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>