dpdk.git
7 years agonet/ixgbe/base: add write flush required by Inphi PHY
Wei Dai [Wed, 21 Dec 2016 09:48:12 +0000 (17:48 +0800)]
net/ixgbe/base: add write flush required by Inphi PHY

This patch updates the configuration of PHY from Inphi (www.inphi.com)
to flush the register write with a reg read.
The Inphi PHY is configured in ixgbe_setup_mac_link_sfp_x550a.
The Inphi PHY setup flow has been updated to read configuration reg,
write only linear/non-linear, and then read (write flush).

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: remove unused EEE code
Wei Dai [Wed, 21 Dec 2016 09:48:11 +0000 (17:48 +0800)]
net/ixgbe/base: remove unused EEE code

Remove unused old Energy Efficient Ethernet (EEE) code.

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: fix IXGBE LSWFW register
Wei Dai [Wed, 21 Dec 2016 09:48:10 +0000 (17:48 +0800)]
net/ixgbe/base: fix IXGBE LSWFW register

This register was incorrect when compared to the data sheet.
Even though the driver doesn't currently use this register,
it is better to fix it upstream.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: remove unused enum type
Wei Dai [Wed, 21 Dec 2016 09:48:09 +0000 (17:48 +0800)]
net/ixgbe/base: remove unused enum type

remove unused enum type for master/slave control in ixbge_type.h

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: add EEE support for some PHYs
Wei Dai [Wed, 21 Dec 2016 09:48:08 +0000 (17:48 +0800)]
net/ixgbe/base: add EEE support for some PHYs

This patch adds Energy Efficient Ethernet (EEE) support for
some Marvell PHYs on some future platforms.
Because EEE capability or status was not indicated previously,
this patch simply assumes that it is supported.

As soon as there is a PHY that does not support EEE, there will
be defects in this area because the driver will not report the
EEE status correctly.

This also deletes some now-unused definitions from an earlier
Marvell PHY implementation and combines a device ID check into a
switch statement.

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: update FW PHY flow control
Wei Dai [Wed, 21 Dec 2016 09:48:07 +0000 (17:48 +0800)]
net/ixgbe/base: update FW PHY flow control

This patch removes the flow control conversion from Rx and Tx to pause
and asymmetric pause, as that is handled by the ixgbe_negotiate_fc().

Performing the conversion prior to ixgbe_negotiate_fc() results in
an incorrect fc mode if Rx only pause is selected when the link partner
is advertising Tx.

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: remove unused PHY ID
Wei Dai [Wed, 21 Dec 2016 09:48:06 +0000 (17:48 +0800)]
net/ixgbe/base: remove unused PHY ID

The first PHY ID for X550 was only used on original HW and
never released. So remove these unused PHY ID.

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: remove unneeded MAC type check
Wei Dai [Wed, 21 Dec 2016 09:48:05 +0000 (17:48 +0800)]
net/ixgbe/base: remove unneeded MAC type check

ixgbe_read_i2c_combined_generic_int() is only used by devices >= X550.
Set the initial value accordingly and remove the MAC type check.

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: add physical layer options for FW PHY type
Wei Dai [Wed, 21 Dec 2016 09:48:04 +0000 (17:48 +0800)]
net/ixgbe/base: add physical layer options for FW PHY type

The "FW" PHY type now supports speeds 10M, 100M, and 1G.
Previously, only the 1G speed was reported for this PHY type.
Add reporting 10M and 100M speed options.

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: limit 5Gb support to X550 devices
Wei Dai [Wed, 21 Dec 2016 09:48:03 +0000 (17:48 +0800)]
net/ixgbe/base: limit 5Gb support to X550 devices

Only X550 devices support 5Gb. MAC type checks for 5Gb should
be done only for X550 devices.

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: include new speeds in VFLINK interpretation
Wei Dai [Wed, 21 Dec 2016 09:48:02 +0000 (17:48 +0800)]
net/ixgbe/base: include new speeds in VFLINK interpretation

This patch moves some of the extended speeds that come with X552
(5G, 2.5G, 10M) into the link check functions.
It also now returns speed_unknown for speeds that are not known
how to interpret.

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: support busy SGMII register reads
Wei Dai [Wed, 21 Dec 2016 09:48:01 +0000 (17:48 +0800)]
net/ixgbe/base: support busy SGMII register reads

Read and store NW_MNG_IF_SEL register because register fields are
used to determine SGMII link for busy SGMII register reads.

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: use FW commands to control some PHYs
Wei Dai [Wed, 21 Dec 2016 09:48:00 +0000 (17:48 +0800)]
net/ixgbe/base: use FW commands to control some PHYs

Use the new firmware interface to access and control some PHYs.

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: support FW commands to control some PHYs
Wei Dai [Wed, 21 Dec 2016 09:47:59 +0000 (17:47 +0800)]
net/ixgbe/base: support FW commands to control some PHYs

Implement support for new firmware commands to be used to access
and control some PHYs.

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: fix setting unsupported autoneg speeds
Wei Dai [Wed, 21 Dec 2016 09:47:58 +0000 (17:47 +0800)]
net/ixgbe/base: fix setting unsupported autoneg speeds

Update ixgbe_setup_phy_link_generic that set/unset auto-negotiation.
Ensure that unsupported auto-negotiation speeds are unset.

This is necessary since the PHY NVM may advertise unsupported speeds.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: cleanup dead EEE code
Wei Dai [Wed, 21 Dec 2016 09:47:57 +0000 (17:47 +0800)]
net/ixgbe/base: cleanup dead EEE code

Remove some specific code for enabling/disabling Energy Efficient
Ethernet (EEE).

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: fix SGMII link setup for M88 PHYs
Wei Dai [Wed, 21 Dec 2016 09:47:56 +0000 (17:47 +0800)]
net/ixgbe/base: fix SGMII link setup for M88 PHYs

Fix ixgbe_setup_sgmii_m88 to set lane speed to autoneg instead of 1G
to prevent problems with link between PHYs

Fixes: d4b4c6845487 ("net/ixgbe/base: add X550em_a FW ALEF support")

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: fix getting PHY type for some x550 devices
Wei Dai [Wed, 21 Dec 2016 09:47:55 +0000 (17:47 +0800)]
net/ixgbe/base: fix getting PHY type for some x550 devices

Return correct physical layer for some x550 devices.

Fixes: 76d5b807ff74 ("ixgbe/base: new X557 phy")
Fixes: d2e72774e58c ("ixgbe/base: support X550")

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: limit iXFI setup to X552 devices
Wei Dai [Wed, 21 Dec 2016 09:47:54 +0000 (17:47 +0800)]
net/ixgbe/base: limit iXFI setup to X552 devices

The MAC register NW_MNG_IF_SEL fields have been redefined for X553.
These changes impact the iXFI driver code flow. Since iXFI is only
supported in X552, this patch adds X552 MAC check for iXFI flows.

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: enable LASI only for X552 devices
Wei Dai [Wed, 21 Dec 2016 09:47:53 +0000 (17:47 +0800)]
net/ixgbe/base: enable LASI only for X552 devices

Enable the Link Alarm Status Interrupt (LASI) only for X552 devices
to receive notifications of the link configurations of the external
PHY and correspondingly support the configuration of the internal
iXFI link, since iXFI does not support auto-negotiation.

This is not required for X553 devices having KR support, which
performs auto-negotiations and which is used as the internal
link to the external PHY.

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: cleanup X540 checksum calculation
Wei Dai [Wed, 21 Dec 2016 09:47:52 +0000 (17:47 +0800)]
net/ixgbe/base: cleanup X540 checksum calculation

The variable checksum_last_word is used only for bounds check.
So remove this variable and use IXGBE_EEPROM_CHECKSUM directly.

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: store link active LED
Wei Dai [Wed, 21 Dec 2016 09:47:51 +0000 (17:47 +0800)]
net/ixgbe/base: store link active LED

Add support to get the link active LED index via the LEDCTL register.
If the LEDCTL register does not have link active LED set then
use MAC default LED index.
Link active LED is used for adapter identify/blink support.

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: add driver version to firmware
Wei Dai [Wed, 21 Dec 2016 09:47:50 +0000 (17:47 +0800)]
net/ixgbe/base: add driver version to firmware

Send the driver version string to firmware through
the host interface command on x550 devices.

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: clean up X557 link status check
Wei Dai [Wed, 21 Dec 2016 09:47:49 +0000 (17:47 +0800)]
net/ixgbe/base: clean up X557 link status check

This patch cleans up the code and clarifies the comment around
the X557 PHY link status check in ixgbe_check_link_t_x550em().

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: fix PHY identification for x550a
Wei Dai [Wed, 21 Dec 2016 09:47:48 +0000 (17:47 +0800)]
net/ixgbe/base: fix PHY identification for x550a

Method to identify the CS4223/CS4227 is incorrect and unreliable.
Provide a new register to differentiate between these PHY SKUs.

Fixes: fc0559bdb5e3 ("net/ixgbe/base: add link MAC setup for X550a SFP+")

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: use fast MDIO for non-10G devices
Wei Dai [Wed, 21 Dec 2016 09:47:47 +0000 (17:47 +0800)]
net/ixgbe/base: use fast MDIO for non-10G devices

Devices that cannot go 10G speeds can safely select a faster
Management Data Input/Output (MDIO) speed.
Select fast MDIO clock speed for for those devices.

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: fix clearing SAN MAC address
Wei Dai [Wed, 21 Dec 2016 09:47:46 +0000 (17:47 +0800)]
net/ixgbe/base: fix clearing SAN MAC address

Receive Address Register (RAR) entries, including SAN MAC address,
are cleared when VMDq pool bits are cleared.
Prevent SAN MAC address to be cleared.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: fix PHY reset check for x550em-ext
Wei Dai [Wed, 21 Dec 2016 09:47:45 +0000 (17:47 +0800)]
net/ixgbe/base: fix PHY reset check for x550em-ext

PHY type ixgbe_phy_x550em_ext_t requires different check
to verify reset status.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/nfp: extend speed capabilities advertised
Alejandro Lucero [Tue, 20 Dec 2016 12:52:45 +0000 (12:52 +0000)]
net/nfp: extend speed capabilities advertised

NFP supports more speeds than just 40 and 100GB, which were
what was advertised before.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/nfp: report link speed using hardware info
Alejandro Lucero [Tue, 20 Dec 2016 13:22:00 +0000 (13:22 +0000)]
net/nfp: report link speed using hardware info

Previous reported speed was hardcoded because there was not firmware
support for getting this information. This change needs also to support
old firmware versions, but instead of the previous hardcoded report, no
speed is reported to the user avoiding to give the wrong speed when link
is not configured to 40G.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/nfp: fix typo in Tx offload capabilities
Alejandro Lucero [Mon, 19 Dec 2016 12:22:39 +0000 (12:22 +0000)]
net/nfp: fix typo in Tx offload capabilities

Because macros for TCP and UDP related to offload cksums have
same values, this was not a main problem. But better to use the
right ones.

Fixes: d4a27a3b092a ("nfp: add basic features")

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/nfp: remove Rx port metadata
Alejandro Lucero [Mon, 19 Dec 2016 12:14:50 +0000 (12:14 +0000)]
net/nfp: remove Rx port metadata

This was required for middlebox-like firmware which NFP does
not support anymore.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/vmxnet3: fix Rx deadlock
Stefan Puiu [Mon, 19 Dec 2016 09:40:53 +0000 (11:40 +0200)]
net/vmxnet3: fix Rx deadlock

Our use case is that we have an app that needs to keep mbufs around
for a while. We've seen cases when calling vmxnet3_post_rx_bufs() from
vmxet3_recv_pkts(), it might not succeed to add any mbufs to any RX
descriptors (where it returns -err). Since there are no mbufs that the
virtual hardware can use, no packets will be received after this; the
driver won't refill the mbuf after this so it gets stuck in this
state. I call this a deadlock for lack of a better term - the virtual
HW waits for free mbufs, while the app waits for the hardware to
notify it for data (by flipping the generation bit on the used Rx
descriptors). Note that after this, the app can't recover.

This fix is a rework of this patch by Marco Lee:
http://dpdk.org/dev/patchwork/patch/6575/. I had to forward port
it, address review comments and also reverted the allocation
failure handling to the first version of the patch
(http://dpdk.org/ml/archives/dev/2015-July/022079.html), since
that's the only approach that seems to work, and seems to be what
other drivers are doing (I checked ixgbe and em). Reusing the mbuf
that's getting passed to the application doesn't seem to make
sense, and it was causing weird issues in our app. Also, reusing
rxm without checking if it's NULL could cause the code to crash.

Fixes: 14680e3747d5 ("vmxnet3: improve Rx performance")

Signed-off-by: Stefan Puiu <stefan.puiu@gmail.com>
Acked-by: Yong Wang <yongwang@vmware.com>
7 years agonet/af_packet: guard against buffer overruns in Tx path
Michał Mirosław [Tue, 13 Dec 2016 01:28:34 +0000 (02:28 +0100)]
net/af_packet: guard against buffer overruns in Tx path

Signed-off-by: Michał Mirosław <michal.miroslaw@atendesoftware.pl>
Acked-by: John W. Linville <linville@tuxdriver.com>
7 years agonet/af_packet: guard against buffer overruns in Rx path
Michał Mirosław [Tue, 13 Dec 2016 01:28:34 +0000 (02:28 +0100)]
net/af_packet: guard against buffer overruns in Rx path

Signed-off-by: Michał Mirosław <michal.miroslaw@atendesoftware.pl>
Acked-by: John W. Linville <linville@tuxdriver.com>
7 years agonet/pcap: fix timestamps in output pcap file
Piotr Bartosiewicz [Tue, 13 Dec 2016 01:08:17 +0000 (02:08 +0100)]
net/pcap: fix timestamps in output pcap file

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

Signed-off-by: Michał Mirosław <michal.miroslaw@atendesoftware.pl>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agonet/sfc: support firmware-assisted TSO
Ivan Malov [Thu, 15 Dec 2016 12:51:23 +0000 (12:51 +0000)]
net/sfc: support firmware-assisted TSO

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Mark Spender <mspender@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: update RSS redirection table
Ivan Malov [Thu, 15 Dec 2016 12:51:22 +0000 (12:51 +0000)]
net/sfc: update RSS redirection table

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: query RSS redirection table
Ivan Malov [Thu, 15 Dec 2016 12:51:21 +0000 (12:51 +0000)]
net/sfc: query RSS redirection table

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: set RSS key and hash types config
Ivan Malov [Thu, 15 Dec 2016 12:51:20 +0000 (12:51 +0000)]
net/sfc: set RSS key and hash types config

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: query RSS key and hash types config
Ivan Malov [Thu, 15 Dec 2016 12:51:19 +0000 (12:51 +0000)]
net/sfc: query RSS key and hash types config

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: support RSS hash offload
Ivan Malov [Thu, 15 Dec 2016 12:51:18 +0000 (12:51 +0000)]
net/sfc: support RSS hash offload

Extract RSS hash provided by the HW in the prefix and put it to mbuf.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: add basic stubs for RSS support on driver attach
Ivan Malov [Thu, 15 Dec 2016 12:51:17 +0000 (12:51 +0000)]
net/sfc: add basic stubs for RSS support on driver attach

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc/base: do not use enum type when values are bitmask
Andrew Rybchenko [Thu, 15 Dec 2016 12:51:16 +0000 (12:51 +0000)]
net/sfc/base: do not use enum type when values are bitmask

ICC complains that enumerated type mixed with another type.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: support VLAN offload on transmit path
Ivan Malov [Thu, 15 Dec 2016 12:51:15 +0000 (12:51 +0000)]
net/sfc: support VLAN offload on transmit path

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: support deferred start of transmit queues
Ivan Malov [Thu, 15 Dec 2016 12:51:14 +0000 (12:51 +0000)]
net/sfc: support deferred start of transmit queues

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: support Tx free threshold
Ivan Malov [Thu, 15 Dec 2016 12:51:13 +0000 (12:51 +0000)]
net/sfc: support Tx free threshold

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: get transmit queue information
Ivan Malov [Thu, 15 Dec 2016 12:51:12 +0000 (12:51 +0000)]
net/sfc: get transmit queue information

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: support deferred start of receive queues
Andrew Rybchenko [Thu, 15 Dec 2016 12:51:11 +0000 (12:51 +0000)]
net/sfc: support deferred start of receive queues

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: support scattered Rx DMA
Andrew Rybchenko [Thu, 15 Dec 2016 12:51:10 +0000 (12:51 +0000)]
net/sfc: support scattered Rx DMA

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: get RxQ descriptor done
Andrew Rybchenko [Thu, 15 Dec 2016 12:51:09 +0000 (12:51 +0000)]
net/sfc: get RxQ descriptor done

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: get RxQ pending descriptors count
Andrew Rybchenko [Thu, 15 Dec 2016 12:51:08 +0000 (12:51 +0000)]
net/sfc: get RxQ pending descriptors count

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: support Rx free threshold
Andrew Rybchenko [Thu, 15 Dec 2016 12:51:07 +0000 (12:51 +0000)]
net/sfc: support Rx free threshold

Rx free threshold defines minimum number of free Rx descriptors
when Rx ring refill should be done.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: get receive queue information
Andrew Rybchenko [Thu, 15 Dec 2016 12:51:06 +0000 (12:51 +0000)]
net/sfc: get receive queue information

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: handle received packet type info from HW
Andrew Rybchenko [Thu, 15 Dec 2016 12:51:05 +0000 (12:51 +0000)]
net/sfc: handle received packet type info from HW

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: support checksum offloads on receive
Andrew Rybchenko [Thu, 15 Dec 2016 12:51:04 +0000 (12:51 +0000)]
net/sfc: support checksum offloads on receive

IPv4 header and TCP/UDP checksums for both IPv4 and IPv6 are supported.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: support multicast addresses list controls
Ivan Malov [Thu, 15 Dec 2016 12:51:03 +0000 (12:51 +0000)]
net/sfc: support multicast addresses list controls

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: support main MAC address change
Ivan Malov [Thu, 15 Dec 2016 12:51:02 +0000 (12:51 +0000)]
net/sfc: support main MAC address change

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: support promiscuous and all-multicast control
Ivan Malov [Thu, 15 Dec 2016 12:51:01 +0000 (12:51 +0000)]
net/sfc: support promiscuous and all-multicast control

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: support link up/down
Artem Andreev [Thu, 15 Dec 2016 12:51:00 +0000 (12:51 +0000)]
net/sfc: support link up/down

Signed-off-by: Artem Andreev <artem.andreev@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: support link speed and duplex settings
Andrew Rybchenko [Thu, 15 Dec 2016 12:50:59 +0000 (12:50 +0000)]
net/sfc: support link speed and duplex settings

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: support MTU change
Andrew Rybchenko [Thu, 15 Dec 2016 12:50:58 +0000 (12:50 +0000)]
net/sfc: support MTU change

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: support link status change interrupt
Andrew Rybchenko [Thu, 15 Dec 2016 12:50:57 +0000 (12:50 +0000)]
net/sfc: support link status change interrupt

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: support flow control settings
Andrew Rybchenko [Thu, 15 Dec 2016 12:50:56 +0000 (12:50 +0000)]
net/sfc: support flow control settings

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: support extended statistics
Andrew Rybchenko [Thu, 15 Dec 2016 12:50:55 +0000 (12:50 +0000)]
net/sfc: support extended statistics

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: add basic statistics
Andrew Rybchenko [Thu, 15 Dec 2016 12:50:54 +0000 (12:50 +0000)]
net/sfc: add basic statistics

Does not implement any deprecated statistics.
No per-queue statistics yet.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: support parameter to choose performance profile
Andrew Rybchenko [Thu, 15 Dec 2016 12:50:53 +0000 (12:50 +0000)]
net/sfc: support parameter to choose performance profile

Supported options are auto (based on NIC firmware variant and
installed licences), throughput, low-latency.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/sfc: implement MCDI logging callback
Andrew Rybchenko [Thu, 15 Dec 2016 12:50:52 +0000 (12:50 +0000)]
net/sfc: implement MCDI logging callback

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
7 years agonet/tap: add TUN/TAP device PMD
Keith Wiles [Mon, 12 Dec 2016 14:38:38 +0000 (08:38 -0600)]
net/tap: add TUN/TAP device PMD

The PMD allows for DPDK and the host to communicate using a raw
device interface on the host and in the DPDK application. The device
created is a Tap device with a L2 packet header.

Signed-off-by: Keith Wiles <keith.wiles@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Aws Ismail <aismail@ciena.com>
Tested-by: Vasily Philipov <vasilyf@mellanox.com>
7 years agoethdev: remove some VF functions
Bernard Iremonger [Tue, 13 Dec 2016 11:40:40 +0000 (11:40 +0000)]
ethdev: remove some VF functions

remove the following API's:

rte_eth_dev_set_vf_rxmode
rte_eth_dev_set_vf_rx
rte_eth_dev_set_vf_tx
rte_eth_dev_set_vf_vlan_filter
rte_eth_dev_set_vf_rate_limit

Increment LIBABIVER in Makefile
Remove deprecation notice for removing rte_eth_dev_set_vf_* API's.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
7 years agonet/ixgbe: remove static set VF functions
Bernard Iremonger [Tue, 13 Dec 2016 11:40:39 +0000 (11:40 +0000)]
net/ixgbe: remove static set VF functions

remove the following static functions:

ixgbe_set_pool_rx_mode
ixgbe_set_pool_rx
ixgbe_set_pool_tx
ixgbe_set_pool_vlan_filter
ixgbe_set_vf_rate_limit

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
7 years agoexamples/ethtool: use ixgbe public function
Bernard Iremonger [Tue, 13 Dec 2016 11:40:38 +0000 (11:40 +0000)]
examples/ethtool: use ixgbe public function

Replace rte_eth_dev_set_vf_rxmode with rte_pmd_ixgbe_set_vf_rx_mode.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
7 years agoapp/testpmd: cleanup parameter checking
Bernard Iremonger [Tue, 13 Dec 2016 11:40:37 +0000 (11:40 +0000)]
app/testpmd: cleanup parameter checking

Parameter checking is done in the rte_pmd_ixgbe_* functions.
Remove parameter checking from before calls to the rte_pmd_ixgbe_*
functions.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
7 years agoapp/testpmd: use ixgbe public functions
Bernard Iremonger [Tue, 13 Dec 2016 11:40:36 +0000 (11:40 +0000)]
app/testpmd: use ixgbe public functions

Use the the following ixgbe public functions:

rte_pmd_ixgbe_set_vf_rate_limit
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
7 years agonet/ixgbe: move set VF functions from the ethdev
Bernard Iremonger [Tue, 13 Dec 2016 11:40:35 +0000 (11:40 +0000)]
net/ixgbe: move set VF functions from the ethdev

Move the following functions from eth_dev_ops to the ixgbe PMD and rename:

ixgbe_set_pool_rx_mode
ixgbe_set_pool_rx
ixgbe_set_pool_tx
ixgbe_set_pool_vlan_filter
ixgbe_set_vf_rate_limit

Rename the functions to the following:

rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter
rte_pmd_ixgbe_set_vf_rate_limit

Use public function internally

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
7 years agonet/qede: fix resource leak
Yong Wang [Wed, 30 Nov 2016 12:32:09 +0000 (07:32 -0500)]
net/qede: fix resource leak

Current code does not close 'fd' on function exit, leaking resources.

Fixes: 2ea6f76aff40 ("qede: add core driver")

Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Acked-by: Harish Patil <harish.patil@qlogic.com>
7 years agonet/i40e: remove unused macro
Jingjing Wu [Sat, 10 Dec 2016 11:24:53 +0000 (19:24 +0800)]
net/i40e: remove unused macro

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e/base: remove unused macro
Jingjing Wu [Sat, 10 Dec 2016 11:24:52 +0000 (19:24 +0800)]
net/i40e/base: remove unused macro

remove X722_SUPPORT and I40E_NDIS_SUPPORT MACROs

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e/base: fix byte order
Jingjing Wu [Sat, 10 Dec 2016 11:24:51 +0000 (19:24 +0800)]
net/i40e/base: fix byte order

Big Endian platform will accidentally send the wrong
data to the firmware command. This patch fixes the issue.

Fixes: 788fc17b2dec ("i40e/base: support proxy config for X722")
Fixes: 3c89193a36fd ("i40e/base: support WOL config for X722")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e/base: fix division by zero
Jingjing Wu [Sat, 10 Dec 2016 11:24:50 +0000 (19:24 +0800)]
net/i40e/base: fix division by zero

For some cases when reading from device are incorrect or image is
incorrect, this part of code causes crash due to division by zero.

Fixes: 8db9e2a1b232 ("i40e: base driver")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e/base: add broadcast promiscuous control per VLAN
Jingjing Wu [Sat, 10 Dec 2016 11:24:49 +0000 (19:24 +0800)]
net/i40e/base: add broadcast promiscuous control per VLAN

Add a new adminq function that allows driver to configure per-VLAN
broadcast promiscuous mode, similar to how we handle unicast and
multicast promiscuous modes.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e/base: add error state for NVM update state machine
Jingjing Wu [Sat, 10 Dec 2016 11:24:48 +0000 (19:24 +0800)]
net/i40e/base: add error state for NVM update state machine

This patch adds I40E_NVMUPD_STATE_ERROR state for NVM update.
Without this patch driver has no possibility to return NVM image write
failure.This state is being set when ARQ rises error.
arq_last_status is also updated every time when ARQ event comes,
not only on error cases.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e/base: remove duplicate definitions
Jingjing Wu [Sat, 10 Dec 2016 11:24:47 +0000 (19:24 +0800)]
net/i40e/base: remove duplicate definitions

We already define I40E_AQ_PHY_TYPE_EXT_25G* flags in the response adminq
structure above, and do not need to re-define these.

While we are here, replace 0X with 0x as normal style.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e/base: comment that UDP port must be in host order
Jingjing Wu [Sat, 10 Dec 2016 11:24:46 +0000 (19:24 +0800)]
net/i40e/base: comment that UDP port must be in host order

The firmware expects the Port number to be in Little Endian format, and
the i40e_aq_add_udp_tunnel command clearly expects the udp_port variable
to be in Host order, as it uses CPU_TO_LE16(). It was recently
discovered in the Linux driver that we were passing a Big Endian port
number, which was therefor not enabling the UDP tunnel correctly.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e/base: convert shift values to hex
Jingjing Wu [Sat, 10 Dec 2016 11:24:45 +0000 (19:24 +0800)]
net/i40e/base: convert shift values to hex

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e/base: fix NVM access interfering
Jingjing Wu [Sat, 10 Dec 2016 11:24:44 +0000 (19:24 +0800)]
net/i40e/base: fix NVM access interfering

Acquire NVM lock before reads on all devices.  Previously, locks were
only used for X722 and later.  Fixes an issue where simultaneous X710
NVM accesses were interfering with each other.

Fixes: 8db9e2a1b232 ("i40e: base driver")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e/base: save link FEC info from link up event
Jingjing Wu [Sat, 10 Dec 2016 11:24:43 +0000 (19:24 +0800)]
net/i40e/base: save link FEC info from link up event

Store the FEC status bits from the link up event into the
hw_link_info structure.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e/base: fix WoL failure on PF reset
Jingjing Wu [Sat, 10 Dec 2016 11:24:42 +0000 (19:24 +0800)]
net/i40e/base: fix WoL failure on PF reset

By default the device clears all MAC filter information on PF Reset.
However, this will cause Wake-On-LAN to fail because the wake filters
are deleted on transition to D3 power state. To get around this,
firmware is adding functionality to preserve certain MAC filters during
PFR. These bits allow the driver tell the FW which filters to preserve.

Set the datalen field and add I40E_AQ_FLAG_BUF/I40E_AQ_FLAG_RD flags in the
desc struct for the WoL/Proxy AQ descriptors. The WoL/Proxy AQ commands
were failing because these were missing.

Fixes: 3c89193a36fd ("i40e/base: support WOL config for X722")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e/base: implement VSI full promiscuous mode
Jingjing Wu [Sat, 10 Dec 2016 11:24:41 +0000 (19:24 +0800)]
net/i40e/base: implement VSI full promiscuous mode

This patch implements a function to set a VSI to broadcast, multicast, and
unicast promiscuous mode all at once. This is specifically needed to set
the WoL/Proxy VSI created by FW to full promiscuous mode during power down
for WoL patterns and protocol offloads to function properly.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e/base: implement clear all WoL filters
Jingjing Wu [Sat, 10 Dec 2016 11:24:40 +0000 (19:24 +0800)]
net/i40e/base: implement clear all WoL filters

This patch implements the clear Wake on LAN (WoL) filters admin queue
function which clears out ALL WoL patterns programmed into
the flex filters.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e/base: adjust 25G PHY type values
Jingjing Wu [Sat, 10 Dec 2016 11:24:39 +0000 (19:24 +0800)]
net/i40e/base: adjust 25G PHY type values

Define the values for the 25G PHY type bit-fields that match
reported values from firmware. There was a gap in the bit
fields but no corresponding gap i40e_aq_phy_type enum.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e/base: use BIT macro instead of bit fields
Jingjing Wu [Sat, 10 Dec 2016 11:24:38 +0000 (19:24 +0800)]
net/i40e/base: use BIT macro instead of bit fields

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e/base: add FEC bits to PHY capabilities
Jingjing Wu [Sat, 10 Dec 2016 11:24:37 +0000 (19:24 +0800)]
net/i40e/base: add FEC bits to PHY capabilities

Add FEC bits to the PHY capabilities AQ command struct. This is required
for 25GbE support. Change the name of the generic mod_type_ext field to
indicate that it is now used for handling FEC.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e/base: remove FPK HyperV VF device ID
Jingjing Wu [Sat, 10 Dec 2016 11:24:36 +0000 (19:24 +0800)]
net/i40e/base: remove FPK HyperV VF device ID

Microsoft recently removed the requirement for VFs to use the VMBus.
The Fort Park Windows VF has been changed to use only the hardware
mailbox, so the Hyper-V VF device ID can be removed.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e/base: deprecate unused macro
Jingjing Wu [Sat, 10 Dec 2016 11:24:35 +0000 (19:24 +0800)]
net/i40e/base: deprecate unused macro

I40E_MAC_X710 was supposed to be for 10G and I40E_MAC_XL710
was supposed to be for 40G. But i40e_set_mac_type() sets
I40E_MAC_XL710 for all device IDS. I40E_MAC_X710 is not
used at all. Thus deprecating this extra macro.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e/base: replace memcpy
Jingjing Wu [Sat, 10 Dec 2016 11:24:34 +0000 (19:24 +0800)]
net/i40e/base: replace memcpy

To align with current memcpy use, replace existing legacy memcpy() calls
with i40e_memcpy() calls.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e/base: fix unknown PHYs incorrect identification
Jingjing Wu [Sat, 10 Dec 2016 11:24:33 +0000 (19:24 +0800)]
net/i40e/base: fix unknown PHYs incorrect identification

The PHY type value for unrecognized PHYs and cables was changed
based on firmware version number. Newer hardware use lower firmware
version numbers and this was causing some PHYs to be identified
as type 0x16 instead of 0xe (unknown).

Without this patch, newer card will incorrectly identify unknown
PHYs and cables.

This change adds hardware type to the check for firmware version
so the PHY type is reported correctly.

Fixes: 8db9e2a1b232 ("i40e: base driver")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e/base: add protocols when discover capabilities
Jingjing Wu [Sat, 10 Dec 2016 11:24:32 +0000 (19:24 +0800)]
net/i40e/base: add protocols when discover capabilities

Add logical_id to I40E_AQ_CAP_ID_MNG_MODE capability starting from major
version 2.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e/base: add bus number info
Jingjing Wu [Sat, 10 Dec 2016 11:24:31 +0000 (19:24 +0800)]
net/i40e/base: add bus number info

Currently i40e_bus_info has PCI device and function info only. However
in log messages slot number (i.e hw->bus.device) is being printed
as bus number. Another field should be added to provide bus number
info and preserve existing information.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e/base: add clause22 and clause45 implementation
Jingjing Wu [Sat, 10 Dec 2016 11:24:30 +0000 (19:24 +0800)]
net/i40e/base: add clause22 and clause45 implementation

Some external PHYs require Clause22 and Clause45 method for
accessing registers. Mostly used for X722 support.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>