dpdk.git
7 years agonet/cxgbe: improve latency for slow traffic
Rahul Lakkireddy [Sat, 27 May 2017 03:47:57 +0000 (09:17 +0530)]
net/cxgbe: improve latency for slow traffic

TX coalescing waits for ETH_COALESCE_PKT_NUM packets to be coalesced
across bursts before transmitting them.  For slow traffic, such as
100 PPS, this approach increases latency since packets are received
one at a time and tx coalescing has to wait for ETH_COALESCE_PKT
number of packets to arrive before transmitting.

To fix this:

- Update rx path to use status page instead and only receive packets
  when either the ingress interrupt timer threshold (5 us) or
  the ingress interrupt packet count threshold (32 packets) fires.
  (i.e. whichever happens first).

- If number of packets coalesced is <= number of packets sent
  by tx burst function, stop coalescing and transmit these packets
  immediately.

Also added compile time option to favor throughput over latency by
default.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
7 years agonet/cxgbe: remove LSB interrupt support
Rahul Lakkireddy [Sat, 27 May 2017 03:46:28 +0000 (09:16 +0530)]
net/cxgbe: remove LSB interrupt support

Remove RTE_PCI_DRV_INTR_LSC from driver flags, since LSC interrupts
are currently not supported.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
7 years agonet/cxgbe: fix port statistics
Rahul Lakkireddy [Sat, 27 May 2017 03:46:27 +0000 (09:16 +0530)]
net/cxgbe: fix port statistics

Do not count pause frames as part of normal TX/RX Frame/Byte counts.
Also, switch to using software counters rather than hardware for RX
stats.

Fixes: 856505d303f4 ("cxgbe: add port statistics")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
7 years agonet/cxgbe: add compressed error vector
Rahul Lakkireddy [Sat, 27 May 2017 03:46:26 +0000 (09:16 +0530)]
net/cxgbe: add compressed error vector

Add support for compressed error vector available in cpl_rx_pkt for
Chelsio T6.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
7 years agonet/cxgbe: update Rx path for Chelsio T6
Rahul Lakkireddy [Sat, 27 May 2017 03:46:25 +0000 (09:16 +0530)]
net/cxgbe: update Rx path for Chelsio T6

Update RX path to reflect Chelsio T6 register value changes.
Update ingress pack boundary value based on maximum payload size
that can be accommodated by underlying PCI.  Update ingress pad
boundary value based on smallest memory controller bus width
possible.  Enforce alignment for free list pointer start address.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
7 years agonet/cxgbe: update RXQ channel mapping for Chelsio T6
Rahul Lakkireddy [Sat, 27 May 2017 03:46:24 +0000 (09:16 +0530)]
net/cxgbe: update RXQ channel mapping for Chelsio T6

Update MPS buffer groups and TP ingress channel congestion map to
correct RXQ allocation for Chelsio T6.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
7 years agonet/cxgbe: update Tx path for Chelsio T6
Rahul Lakkireddy [Sat, 27 May 2017 03:46:23 +0000 (09:16 +0530)]
net/cxgbe: update Tx path for Chelsio T6

Update TX path to reflect Chelsio T6 changes.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
7 years agonet/cxgbe: update hardware info prints
Rahul Lakkireddy [Sat, 27 May 2017 03:46:22 +0000 (09:16 +0530)]
net/cxgbe: update hardware info prints

Update informational prints pertaining to underlying hardware.
Add bootstrap firmware version and expansion ROM version prints.
Move the prints to a single function.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
7 years agonet/cxgbe/base: add forward error correction support
Rahul Lakkireddy [Sat, 27 May 2017 03:46:21 +0000 (09:16 +0530)]
net/cxgbe/base: add forward error correction support

Add forward error correction (FEC) support and update link
configuration.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
7 years agonet/cxgbe: update link speeds and port modules
Rahul Lakkireddy [Sat, 27 May 2017 03:46:20 +0000 (09:16 +0530)]
net/cxgbe: update link speeds and port modules

Add 25G and 100G link speeds and update supported port modules.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
7 years agonet/cxgbe: grab available ports after firmware reset
Rahul Lakkireddy [Sat, 27 May 2017 03:46:19 +0000 (09:16 +0530)]
net/cxgbe: grab available ports after firmware reset

Move code to get the available ports from the firmware after it had
been reset.  This ensures that driver uses the latest info on available
ports after firmware reset.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
7 years agonet/cxgbe/base: update flash part information
Rahul Lakkireddy [Sat, 27 May 2017 03:46:18 +0000 (09:16 +0530)]
net/cxgbe/base: update flash part information

Update flash part identification and decoding to accommodate new
flash parts.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
7 years agonet/cxgbe/base: update register dump
Rahul Lakkireddy [Sat, 27 May 2017 03:46:17 +0000 (09:16 +0530)]
net/cxgbe/base: update register dump

Add Chelsio T6 registers to register dump.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
7 years agonet/cxgbe: add support to run Chelsio T6 cards
Rahul Lakkireddy [Sat, 27 May 2017 03:46:16 +0000 (09:16 +0530)]
net/cxgbe: add support to run Chelsio T6 cards

Add code to detect and run T6 devices.  Update PCI ID Device table
with Chelsio T6 device ids and update documentation.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
7 years agonet/avp: remove redundant assignment
Ferruh Yigit [Thu, 25 May 2017 17:52:45 +0000 (18:52 +0100)]
net/avp: remove redundant assignment

dev_info->driver_name is assigned by rte_eth_dev_info_get()
and existing value overwritten, removing assignment.

Fixes: 1a85922369c4 ("net/avp: add device configuration")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
7 years agonet/tap: add Rx/Tx checksum offload support
Pascal Mazon [Mon, 22 May 2017 11:20:43 +0000 (13:20 +0200)]
net/tap: add Rx/Tx checksum offload support

This patch adds basic offloading support, widely expected in a PMD.

Verify IPv4 and UDP/TCP checksums upon packet reception, and set
ol_flags accordingly.

On Tx, set IPv4 and UDP/TCP checksums when required, considering
ol_flags.

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
7 years agonet/tap: fix some flow collision
Pascal Mazon [Mon, 22 May 2017 11:19:53 +0000 (13:19 +0200)]
net/tap: fix some flow collision

The following two flow rules (testpmd syntax) should not collide:
flow create 0 priority 1 ingress pattern eth / ipv4 / end actions drop / end
flow create 0 priority 1 ingress pattern eth / ipv6 / end actions drop / end

But the eth_type in the associated TC rule was set to either "ip" or
"ipv6".  For TC, they could thus not have the same priority.

Use ETH_P_ALL only in the TC message to make sure those rules can
coexist.

Fixes: de96fe68ae95 ("net/tap: add basic flow API patterns and actions")
Cc: stable@dpdk.org
Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
7 years agobus/fslmc: reduce the debug log messages
Hemant Agrawal [Fri, 26 May 2017 06:51:25 +0000 (12:21 +0530)]
bus/fslmc: reduce the debug log messages

Reducing the amount of logging and making the err statement
as a single line statements.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agonet/dpaa2: add support for firmware version get
Hemant Agrawal [Fri, 26 May 2017 06:51:24 +0000 (12:21 +0530)]
net/dpaa2: add support for firmware version get

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agobus/fslmc: add support to detect SoC version
Hemant Agrawal [Fri, 26 May 2017 06:51:23 +0000 (12:21 +0530)]
bus/fslmc: add support to detect SoC version

This is required to configure the stashing destination
based on the cluster size.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agonet/dpaa2: configure jumbo frames
Hemant Agrawal [Fri, 26 May 2017 06:51:22 +0000 (12:21 +0530)]
net/dpaa2: configure jumbo frames

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agonet/dpaa2: add support for flow control
Hemant Agrawal [Fri, 26 May 2017 06:51:21 +0000 (12:21 +0530)]
net/dpaa2: add support for flow control

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agonet/dpaa2: add link status config support
Hemant Agrawal [Fri, 26 May 2017 06:51:20 +0000 (12:21 +0530)]
net/dpaa2: add link status config support

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agonet/dpaa2: add support for VLAN strip
Hemant Agrawal [Fri, 26 May 2017 06:51:19 +0000 (12:21 +0530)]
net/dpaa2: add support for VLAN strip

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agonet/dpaa2: add support for VLAN filter and offload
Hemant Agrawal [Fri, 26 May 2017 06:51:18 +0000 (12:21 +0530)]
net/dpaa2: add support for VLAN filter and offload

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agonet/dpaa2: add support for multicast promiscuous mode
Hemant Agrawal [Fri, 26 May 2017 06:51:17 +0000 (12:21 +0530)]
net/dpaa2: add support for multicast promiscuous mode

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agonet/dpaa2: add support for MAC address filtering
Hemant Agrawal [Fri, 26 May 2017 06:51:16 +0000 (12:21 +0530)]
net/dpaa2: add support for MAC address filtering

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agobus/fslmc: update TAILQ usages in dpaa2 objects
Hemant Agrawal [Fri, 26 May 2017 06:51:15 +0000 (12:21 +0530)]
bus/fslmc: update TAILQ usages in dpaa2 objects

This patch updates the usages of malloc and TAILQ in
dpbp and dpio objects.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agonet/dpaa2: add support for tail drop on queue
Hemant Agrawal [Fri, 26 May 2017 06:51:14 +0000 (12:21 +0530)]
net/dpaa2: add support for tail drop on queue

This will help in limiting the size of queues and avoid
them growing practically infinite.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agonet/dpaa2: add support for congestion notification
Hemant Agrawal [Fri, 26 May 2017 06:51:13 +0000 (12:21 +0530)]
net/dpaa2: add support for congestion notification

In case of HW egress FQ is congested, skip further
transmission of frames.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agobus/fslmc: export qbman results in map file
Hemant Agrawal [Fri, 26 May 2017 06:51:12 +0000 (12:21 +0530)]
bus/fslmc: export qbman results in map file

In order to check the congestion state of Egress FQs,
this qbman function will be used by the DPAA2 Ethernet PMD.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agonet/dpaa2: support parallel Rx
Hemant Agrawal [Fri, 26 May 2017 06:51:11 +0000 (12:21 +0530)]
net/dpaa2: support parallel Rx

Typically when the PMD issues a Rx command to DPAA2 hardware,
the HW writes the available descriptors into the given memory.
The RX function then processes the frames and prepare them as
mbufs.

This patch adds support to issue another pull request to hardware
in another memory location, before we start processing the output
of the first request. This help in controlling the CPU cycles
wasted during the wait for the hardware to write the descriptors.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agobus/fslmc: support for parallel Rx DQ requests
Hemant Agrawal [Fri, 26 May 2017 06:51:10 +0000 (12:21 +0530)]
bus/fslmc: support for parallel Rx DQ requests

DPAA2 hardware support the option to configure
multiple memories for Rx recv buffer (DPAA2-DQRR).
Each Rx request executing is called as 'DQ' request.
This patch adds routines to get information w.r.t each DQ request.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agonet/dpaa2: improve the error handling in dev init
Hemant Agrawal [Fri, 26 May 2017 06:51:09 +0000 (12:21 +0530)]
net/dpaa2: improve the error handling in dev init

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agonet/dpaa2: stop using software annotation
Hemant Agrawal [Fri, 26 May 2017 06:51:08 +0000 (12:21 +0530)]
net/dpaa2: stop using software annotation

The DPAA2 driver is not using the DPAA2 frame descriptor
software annotation area. This patch reduces the
PTA length to zero and adjust the RX Buffer Layout
accordingly.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agonet/dpaa2: remove port level buffer layout definition
Hemant Agrawal [Fri, 26 May 2017 06:51:07 +0000 (12:21 +0530)]
net/dpaa2: remove port level buffer layout definition

This code in device init is not required, as the buffer
layout setting is also being programmed during queue configuration.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agomk: change dpaa2 machine flag to cortex-a72
Hemant Agrawal [Fri, 26 May 2017 06:51:06 +0000 (12:21 +0530)]
mk: change dpaa2 machine flag to cortex-a72

DPAA2 devices now support cortex-a72. They no longer support a57.
Also fp and simd is no more required to be stated explicitly for
standard a72 core.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agonet/sfc: advertise that device is detachable
Andrew Rybchenko [Thu, 25 May 2017 12:03:18 +0000 (13:03 +0100)]
net/sfc: advertise that device is detachable

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
7 years agonet/liquidio: set device speed capability info
Shijith Thotton [Thu, 25 May 2017 09:24:18 +0000 (14:54 +0530)]
net/liquidio: set device speed capability info

Add subsystem device id of CN23xx cards and expose speed capability of
devices. Update liquidio feature file to mark support.

Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
7 years agonet/igb: fix add/delete of flex filters
Markus Theil [Mon, 22 May 2017 10:17:50 +0000 (12:17 +0200)]
net/igb: fix add/delete of flex filters

Before this patch, flex_filter->index was always zero when it was read
and used after rte_zmalloc. The corresponding code was therefore moved
into the add and delete parts of the if/else statement.

Fixes: 231d43909a31 ("igb: migrate flex filter to new API")
Cc: stable@dpdk.org
Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agonet/igb: support flex filters on i210/i211
Markus Theil [Mon, 22 May 2017 10:17:49 +0000 (12:17 +0200)]
net/igb: support flex filters on i210/i211

i210/i211 also support flex filters. Tested on i210.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agonet/mlx5: fix completion buffer size
Shahaf Shuler [Thu, 18 May 2017 10:44:45 +0000 (13:44 +0300)]
net/mlx5: fix completion buffer size

Completion buffer size was computed wrongly, causing
completion polling to wraparound too early and miss entries.

Fixing it by using Direct Verbs to query the CQ info.

Fixes: 6218063b39a6 ("net/mlx5: refactor Rx data path")
Fixes: 1d88ba171942 ("net/mlx5: refactor Tx data path")
Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/af_packet: fix packet bytes counting
Chas Williams [Wed, 17 May 2017 18:03:35 +0000 (14:03 -0400)]
net/af_packet: fix packet bytes counting

On error, we also need to zero the bytes transmitted.

Fixes: f4ff17a465d2 ("net/af_packet: guard against buffer overruns in Tx path")
Cc: stable@dpdk.org
Signed-off-by: Chas Williams <ciwillia@brocade.com>
7 years agonet/af_packet: handle possible null pointer
Chas Williams [Wed, 17 May 2017 18:03:33 +0000 (14:03 -0400)]
net/af_packet: handle possible null pointer

Fixes: 1b93c2aa81b4 ("net/af_packet: add interface name to internals")
Cc: stable@dpdk.org
Signed-off-by: Chas Williams <ciwillia@brocade.com>
7 years agonet/sfc: support multi-process
Andrew Rybchenko [Thu, 18 May 2017 14:00:04 +0000 (15:00 +0100)]
net/sfc: support multi-process

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
7 years agonet/sfc: use locally stored data for logging
Andrew Rybchenko [Thu, 18 May 2017 14:00:03 +0000 (15:00 +0100)]
net/sfc: use locally stored data for logging

Required to be able to use logging in the secondary process
where Ethernet device pointer stored in sfc_adapter is invalid.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
7 years agonet/sfc: carefully cleanup on init failure and shutdown
Andrew Rybchenko [Thu, 18 May 2017 14:00:02 +0000 (15:00 +0100)]
net/sfc: carefully cleanup on init failure and shutdown

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
7 years agonet/enic: flow API documentation
John Daley [Wed, 17 May 2017 22:38:11 +0000 (15:38 -0700)]
net/enic: flow API documentation

Update enic NIC guide, release notes and add flow API to the
supported features list.

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
7 years agonet/enic: flow API debug
John Daley [Wed, 17 May 2017 22:38:10 +0000 (15:38 -0700)]
net/enic: flow API debug

Added a debug function to print enic filters and actions when
rte_validate_flow is called. Compiled in CONFIG_RTE_LIBRTE_ENIC_DEBUG_FLOW
is enabled and log level is INFO.

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
7 years agonet/enic: flow API for Legacy NICs
John Daley [Wed, 17 May 2017 22:38:09 +0000 (15:38 -0700)]
net/enic: flow API for Legacy NICs

5-tuple exact Flow support for 1200 series adapters. This allows:
Attributes: ingress
Items: ipv4, ipv6, udp, tcp (must exactly match src/dst IP
       addresses and ports and all must be specified).
Actions: queue and void
Selectors: 'is'

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
7 years agonet/enic: flow API for NICs with advanced filters disabled
John Daley [Wed, 17 May 2017 22:38:08 +0000 (15:38 -0700)]
net/enic: flow API for NICs with advanced filters disabled

Flow support for 1300 series adapters with the 'Advanced Filter'
mode disabled via the UCS management interface. This allows:
Attributes: ingress
Items: Outer eth, ipv4, ipv6, udp, sctp, tcp, vxlan. Inner eth, ipv4,
       ipv6, udp, tcp.
Actions: queue and void
Selectors: 'is', 'spec' and 'mask'. 'last' is not supported

With advanced filters disabled, an IPv4 or IPv6 item must be specified
in the pattern.

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
7 years agonet/enic: flow API mark and flag support
John Daley [Wed, 17 May 2017 22:38:07 +0000 (15:38 -0700)]
net/enic: flow API mark and flag support

For VICs with filter tagging, support the MARK and FLAG actions
by setting appropriate mbuf ol_flags if there is a filter match.

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
7 years agonet/enic: flow API for NICs with advanced filters enabled
John Daley [Wed, 17 May 2017 22:38:06 +0000 (15:38 -0700)]
net/enic: flow API for NICs with advanced filters enabled

Flow support for 1300 series adapters with the 'Advanced Filter'
mode enabled via the UCS management interface. This enables:
Attributes: ingress
Items: Outer eth, ipv4, ipv6, udp, sctp, tcp, vxlan. Inner eth, ipv4,
       ipv6, udp, tcp.
Actions: queue, and void
Selectors: 'is', 'spec' and 'mask'. 'last' is not supported

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
7 years agonet/enic: flow API skeleton
John Daley [Wed, 17 May 2017 22:38:05 +0000 (15:38 -0700)]
net/enic: flow API skeleton

Stub callbacks for the generic flow API and a new FLOW debug define.

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
7 years agonet/enic/base: bring NIC interface functions up to date
John Daley [Wed, 17 May 2017 22:38:04 +0000 (15:38 -0700)]
net/enic/base: bring NIC interface functions up to date

Update the base functions for the Cisco VIC. These files are mostly
common with other VIC drivers so are left alone is as much as possible.
Includes in a new filter/action interface which is needed for Generic
Flow API PMD support. Update FDIR code to use the new interface.

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
7 years agonet/i40e/base: fix Tx error stats on VF
Wenzhuo Lu [Thu, 18 May 2017 03:29:04 +0000 (11:29 +0800)]
net/i40e/base: fix Tx error stats on VF

Unfortunately the datasheet has a mistake. The
address of the TX error counter is wrong.

Fixes: 8db9e2a1b232 ("i40e: base driver")
CC: stable@dpdk.org
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agonet/igb: support MAC filters for i210 and i211 chips
Markus Theil [Wed, 17 May 2017 18:06:28 +0000 (20:06 +0200)]
net/igb: support MAC filters for i210 and i211 chips

i210 and i211 also support unicast MAC filters.
The patch was tested on i210 based hw, for i211
support was looked up in the specs.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agonet/i40e: improve FDIR programming times
Michael Lilja [Wed, 17 May 2017 14:57:57 +0000 (16:57 +0200)]
net/i40e: improve FDIR programming times

Previously, the FDIR programming time is +11ms on i40e.
This patch will result in an average programming time of
22usec with a max of 60usec .

Signed-off-by: Michael Lilja <ml@napatech.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
7 years agonet/ark: fix return value of null not checked
John Miller [Tue, 16 May 2017 16:14:18 +0000 (12:14 -0400)]
net/ark: fix return value of null not checked

Coverity issue: 144517
Fixes: 1131cbf0fb2b ("net/ark: stub PMD for Atomic Rules Arkville")
Cc: stable@dpdk.org
Signed-off-by: John Miller <john.miller@atomicrules.com>
7 years agonet/ark: fix null pointer dereference
John Miller [Tue, 16 May 2017 16:14:17 +0000 (12:14 -0400)]
net/ark: fix null pointer dereference

Coverity issue: 144520
Fixes: 727b3fe292bc ("net/ark: integrate PMD")
Cc: stable@dpdk.org
Signed-off-by: John Miller <john.miller@atomicrules.com>
7 years agonet/ark: fix return code not checked
John Miller [Tue, 16 May 2017 16:14:16 +0000 (12:14 -0400)]
net/ark: fix return code not checked

Coverity issue: 144514
Fixes: 727b3fe292bc ("net/ark: integrate PMD")
Cc: stable@dpdk.org
Signed-off-by: John Miller <john.miller@atomicrules.com>
7 years agonet/ark: fix buffer not null terminated
John Miller [Tue, 16 May 2017 16:14:15 +0000 (12:14 -0400)]
net/ark: fix buffer not null terminated

Coverity issue: 144512
Coverity issue: 144513
Fixes: 9c7188a68d7b ("net/ark: provide API for hardware modules pktchkr and pktgen")
Cc: stable@dpdk.org
Signed-off-by: John Miller <john.miller@atomicrules.com>
7 years agodrivers/net: add generic ethdev macro to get PCI device
Ferruh Yigit [Mon, 15 May 2017 10:24:03 +0000 (11:24 +0100)]
drivers/net: add generic ethdev macro to get PCI device

Instead of many PMD define their own macro, define a generic one in
ethdev and use that in PMDs.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
7 years agodrivers/net: remove unnecessary macro for unused variables
Ferruh Yigit [Fri, 12 May 2017 10:33:03 +0000 (11:33 +0100)]
drivers/net: remove unnecessary macro for unused variables

remove __rte_unused instances that are not required.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agonet/tap: do not set remote MAC if not necessary
Pascal Mazon [Fri, 12 May 2017 13:01:40 +0000 (15:01 +0200)]
net/tap: do not set remote MAC if not necessary

Check for the current MAC address on both the remote and the tap
netdevices before setting a new value.

While there, remove wrong empty lines and ensure tap_ioctl() return
value is negative, just like what is done throughout this code.

Fixes: 2bc06869cd94 ("net/tap: add remote netdevice traffic capture")

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
7 years agonet/tap: create netdevice during probing
Pascal Mazon [Fri, 12 May 2017 13:01:39 +0000 (15:01 +0200)]
net/tap: create netdevice during probing

This has three main benefits:
 - tun_alloc is now generic again for any queue,
 - mtu no longer needs to be handled in tap_setup_queue(),
 - an actual netdevice is created as soon as the device is probed.

On top of it, code in eth_dev_tap_create() has been reworked to have a
more logical behavior; initialization can now fail if a remote is
requested but cannot be set up.

Fixes: 2bc06869cd94 ("net/tap: add remote netdevice traffic capture")

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
7 years agonet/tap: drop unnecessary nested block
Pascal Mazon [Fri, 12 May 2017 13:01:38 +0000 (15:01 +0200)]
net/tap: drop unnecessary nested block

This is cosmetic; the code is functionally equivalent.

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
7 years agonet/tap: remove unnecessary functions
Pascal Mazon [Fri, 12 May 2017 13:01:37 +0000 (15:01 +0200)]
net/tap: remove unnecessary functions

These functions are only two lines each and are used only once.

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
7 years agonet/tap: add debug messages
Pascal Mazon [Fri, 12 May 2017 13:01:36 +0000 (15:01 +0200)]
net/tap: add debug messages

Print a detailed debug message inside tap_ioctl() directly. The caller
now only needs to check for return value.

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
7 years agonet/tap: add support for fixed MAC addresses
Pascal Mazon [Wed, 12 Apr 2017 07:30:21 +0000 (09:30 +0200)]
net/tap: add support for fixed MAC addresses

Support for a fixed MAC address for testing with the last octet
incrementing by one for each interface defined with the new 'mac=fixed'
string on the --vdev option. The default option is still to randomize
the MAC address for each tap interface.

Signed-off-by: Keith Wiles <keith.wiles@intel.com>
Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
7 years agonet/i40e: add return value checks
Herakliusz Lipiec [Tue, 9 May 2017 14:37:34 +0000 (15:37 +0100)]
net/i40e: add return value checks

Coverity issue: 1379362
Coverity issue: 1379365
Fixes: 71d35259ff67 ("i40e: tear down flow director")
Cc: stable@dpdk.org
Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
7 years agonet/null: do not touch mbuf next or nb segs on Rx
Ferruh Yigit [Thu, 4 May 2017 15:43:58 +0000 (16:43 +0100)]
net/null: do not touch mbuf next or nb segs on Rx

mbuf next and nb_segs fields already have the default values when get
from mempool, no need to update them in PMD.

See: 8f094a9ac5d7 ("mbuf: set mbuf fields while in pool")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
7 years agonet/ixgbe: do not touch mbuf initialized fields
Ferruh Yigit [Thu, 4 May 2017 15:59:23 +0000 (16:59 +0100)]
net/ixgbe: do not touch mbuf initialized fields

See: 8f094a9ac5d7 ("mbuf: set mbuf fields while in pool")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agonet/thunderx: add compile-time checks
Jerin Jacob [Mon, 1 May 2017 06:40:18 +0000 (12:10 +0530)]
net/thunderx: add compile-time checks

The thunderx PMD is sensitive to the layout of the mbuf on
the RX path. Add in some compile-time checks to make sure the mbuf layout
assumptions are valid, and to provide hints to anyone changing the mbuf
where things may need to be updated.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agonet/fm10k: add compile-time checks to vector driver
Bruce Richardson [Fri, 28 Apr 2017 16:21:15 +0000 (17:21 +0100)]
net/fm10k: add compile-time checks to vector driver

The vector PMD is very sensitive to the layout of the mbuf, especially on
the RX path. Add in some compile-time checks to make sure the mbuf layout
assumptions are valid, and to provide hints to anyone changing the mbuf
where things may need to be updated.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agonet/i40e: add compile-time checks to vector driver
Bruce Richardson [Fri, 28 Apr 2017 16:21:14 +0000 (17:21 +0100)]
net/i40e: add compile-time checks to vector driver

The vector PMD is very sensitive to the layout of the mbuf, especially on
the RX path. Add in some compile-time checks to make sure the mbuf layout
assumptions are valid, and to provide hints to anyone changing the mbuf
where things may need to be updated.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agonet/ixgbe: enable ixgbe vector PMD for i686
Bruce Richardson [Fri, 28 Apr 2017 16:21:13 +0000 (17:21 +0100)]
net/ixgbe: enable ixgbe vector PMD for i686

The ixgbe vector PMD was disabled for i686 unnecessarily. Enable it.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agonet/ixgbe: add compile-time checks to vector driver
Bruce Richardson [Fri, 28 Apr 2017 16:21:12 +0000 (17:21 +0100)]
net/ixgbe: add compile-time checks to vector driver

The vector PMD is very sensitive to the layout of the mbuf, especially on
the RX path. Add in some compile-time checks to make sure the mbuf layout
assumptions are valid, and to provide hints to anyone changing the mbuf
where things may need to be updated.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agoethdev: keep port id unchanged if obtaining by name failed
Ilya Maximets [Thu, 18 May 2017 12:19:40 +0000 (15:19 +0300)]
ethdev: keep port id unchanged if obtaining by name failed

Currently, 'rte_eth_dev_get_port_by_name' changes transmitted
'port_id' unconditionally. This is undocumented and misleading
behaviour as user may expect unchanged value in case of error.

Otherwise, there is no sense having both return value and
a pointer in the function.

Fixes: 9c5b8d8b9feb ("ethdev: clean port id retrieval when attaching")

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
7 years agoapp/testpmd: add TCP flags in flow rules
Beilei Xing [Thu, 18 May 2017 09:06:12 +0000 (17:06 +0800)]
app/testpmd: add TCP flags in flow rules

This commit adds TCP flags support in flow API as
some drivers have SYN filter.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Tested-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agoapp/testpmd: fix creating E-Tag and NVGRE flow rules
Beilei Xing [Fri, 12 May 2017 07:13:09 +0000 (15:13 +0800)]
app/testpmd: fix creating E-Tag and NVGRE flow rules

Application fails to create NVGRE and E-Tag flows with
current configuration, this commit fixes the issue by
adding flow items for E_TAG and NVGRE.

Fixes: e4840ef2685d ("ethdev: fix incomplete items in flow API")
Cc: stable@dpdk.org
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agoeal: introduce macro for no inline
Jerin Jacob [Sat, 13 May 2017 09:27:27 +0000 (14:57 +0530)]
eal: introduce macro for no inline

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agoeal: introduce macro for always inline
Jerin Jacob [Sat, 13 May 2017 09:27:25 +0000 (14:57 +0530)]
eal: introduce macro for always inline

Different drivers use internal macros like force_inline for compiler
always inline feature.
Standardizing it through __rte_always_inline macro.

Verified the change by comparing the output binary file.
No difference found in the output binary file with this change.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agovfio: fix array bounds check
Alejandro Lucero [Fri, 12 May 2017 10:18:25 +0000 (11:18 +0100)]
vfio: fix array bounds check

Checking against VFIO_MAX_GROUPS goes beyond the maximum array
index which should be (VFIO_MAX_GROUPS - 1).

Coverity issue: 144555, 144556, 144557
Fixes: 94c0776b1bad ("support hotplug")
Cc: stable@dpdk.org
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
7 years agodrivers/net: fix vfio kmod dependency
David Marchand [Sat, 20 May 2017 13:12:37 +0000 (15:12 +0200)]
drivers/net: fix vfio kmod dependency

vfio is the kernel framework used by the vfio-pci kernel driver.
DPDK drivers do not rely solely on vfio, but rather on vfio-pci to gain
access to pci resources.

Fixes: 0880c40113ef ("drivers: advertise kmod dependencies in pmdinfo")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
7 years agomemzone: check NUMA id when reserving a zone
Tonghao Zhang [Fri, 12 May 2017 06:03:43 +0000 (23:03 -0700)]
memzone: check NUMA id when reserving a zone

If the socket_id is invalid (e.g. -2, -3), the
memzone_reserve_aligned_thread_unsafe should return the
EINVAL and not ENOMEM. To avoid it, we should check the
socket_id before calling malloc_heap_alloc.

Signed-off-by: Tonghao Zhang <nic@opencloud.tech>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agoexamples/exception_path: support FreeBSD
Tiwei Bie [Fri, 19 May 2017 00:13:48 +0000 (08:13 +0800)]
examples/exception_path: support FreeBSD

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agoexamples/multi_process: remove unused variable
Andrew Rybchenko [Thu, 25 May 2017 15:46:32 +0000 (16:46 +0100)]
examples/multi_process: remove unused variable

Fix broken build with -Werror=unused-but-set-variable

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
7 years agokni: fix build on RHEL 7.4
Lee Roberts [Wed, 31 May 2017 15:40:15 +0000 (09:40 -0600)]
kni: fix build on RHEL 7.4

Linux: 9b36627acecd ("net: remove dev->trans_start")

Signed-off-by: Lee Roberts <lee.roberts@hpe.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agometrics: fix out of bound access
Remy Horton [Thu, 11 May 2017 12:53:30 +0000 (13:53 +0100)]
metrics: fix out of bound access

Fixes memory access errors detected by Coverity.
All cases are the maximum permissable value causing an
out-by-one overrun.

Coverity issue: 143433, 143434, 143460, 143464
Fixes: 349950ddb9c5 ("metrics: add information metrics library")

Signed-off-by: Remy Horton <remy.horton@intel.com>
7 years agolpm: fix build with gcc -O0 option
Sangjin Han [Fri, 2 Jun 2017 05:07:46 +0000 (05:07 +0000)]
lpm: fix build with gcc -O0 option

When rte_lpm.h is used on x86, -O0 option (no optimization at all)
given to gcc causes a compile error like this:

error: the last argument must be an 8-bit immediate
   i24 = _mm_srli_si128(i24, sizeof(uint64_t));

-O0 option is useful for debugging and code coverage measurement, but
this error prevents DPDK programs from building. This patch replaces
"sizeof(uint64_t)" with a constant literal "8" to work around the issue.
The issue occurs on gcc/g++ versions from 4.8 to 5.

Signed-off-by: Sangjin Han <sangjin@eecs.berkeley.edu>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agoexamples/vhost: fix uninitialized descriptor indexes
Jerin Jacob [Fri, 2 Jun 2017 11:20:31 +0000 (16:50 +0530)]
examples/vhost: fix uninitialized descriptor indexes

Fixing the below error by returning from the function early
when count == 0.

Issue flagged by GCC 7.1.1

examples/vhost/virtio_net.c:370:38: error: ‘desc_indexes[0]’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
  rte_prefetch0(&vr->desc[desc_indexes[0]]);

Fixes: ca059fa5e290 ("examples/vhost: demonstrate the new generic APIs")
Cc: stable@dpdk.org
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
7 years agoexamples/qos_sched: suppress gcc 7.1.1 warning
Jerin Jacob [Fri, 2 Jun 2017 11:20:30 +0000 (16:50 +0530)]
examples/qos_sched: suppress gcc 7.1.1 warning

This one is more of a compiler issue as application
checks the app_parse_opt_vals() return value.

Since this code is in slow path, adding a memset
to fix following "maybe-uninitialized" warning.

qos_sched/args.c: In function ‘app_parse_args’:
examples/qos_sched/args.c:254:32: error: ‘vals[0]’ may be
used uninitialized in this function [-Werror=maybe-uninitialized]
pconf->rx_port = (uint8_t)vals[0];
                            ~~~~^~~

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
7 years agoexamples/performance-thread: add fall-through comments
Jerin Jacob [Fri, 2 Jun 2017 11:20:29 +0000 (16:50 +0530)]
examples/performance-thread: add fall-through comments

This fixes compiler warnings with GCC 7.1.1

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

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agoexamples/l3fwd: add switch fall-through comments
Jerin Jacob [Fri, 2 Jun 2017 11:20:28 +0000 (16:50 +0530)]
examples/l3fwd: add switch fall-through comments

This fixes compiler warnings with GCC 7.1.1

Fixes: 268888b5b020 ("examples/l3fwd: modularize")
Fixes: 94c54b4158d5 ("examples/l3fwd: rework exact-match")

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agoconfig: fix comment
Herakliusz Lipiec [Mon, 29 May 2017 14:56:50 +0000 (15:56 +0100)]
config: fix comment

Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation")

Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agoapp/testpmd: remove duplicated license
Ferruh Yigit [Tue, 9 May 2017 10:35:05 +0000 (11:35 +0100)]
app/testpmd: remove duplicated license

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agoeal: remove duplicated license
Ferruh Yigit [Tue, 9 May 2017 10:35:04 +0000 (11:35 +0100)]
eal: remove duplicated license

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agodoc: change line length limit in contributors guide
John McNamara [Thu, 11 May 2017 14:09:40 +0000 (15:09 +0100)]
doc: change line length limit in contributors guide

The DPDK documentation guidelines state that lines should be wrapped as
follows:

* The recommended style for the DPDK documentation is to put sentences on
  separate lines. This allows for easier reviewing of patches. ...
* Long sentences should be wrapped at 120 characters +/- 10 characters.
  They should be wrapped at words.

  http://dpdk.org/doc/guides/contributing/documentation.html#line-length

However, in practice, users almost never submit doc patches in this format.
Instead most users wrap their doc patches at 80 characters.

This patch updates the documentation contributors guide to reflect this
as the recommended guideline.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Shreyansh Jain <shreyansh.jain@nxp.com>
7 years agomaintainers: update email address
Yuanhan Liu [Fri, 2 Jun 2017 13:34:36 +0000 (21:34 +0800)]
maintainers: update email address

Signed-off-by: Yuanhan Liu <yliu@fridaylinux.org>