Commit Graph

337 Commits

Author SHA1 Message Date
Rasesh Mody
8aab5d6fab net/qede: fix device link structure
8ea656f8c app/testpmd: request link status interrupt
requires QEDE PMD to populate the device link structure without
having to query the driver for link status change event.
This patch updates the device link structure when link status event is
received.
Remove unused param from qed_link_update()

Fixes: 86a2265e59 ("qede: add SRIOV support")
Fixes: ec94dbc573 ("qede: add base driver")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-11-08 00:49:59 +01:00
Harish Patil
2d62f169f1 net/qede: fix VXLAN filter deletion
Initialize ucast parameters before checking if filters exists.

Fixes: e0947ed912 ("net/qede: add support for VXLAN UDP port config over VF")

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-11-08 00:49:59 +01:00
Harish Patil
f07aa795c9 net/qede: disable per-VF Tx switching feature
Provide a knob to control per-VF Tx switching feature by adding a config
option, CONFIG_RTE_LIBRTE_QEDE_VF_TX_SWITCH. By default, it will be kept
in disabled state for better performance with small sized frames.

Fixes: 2ea6f76aff ("qede: add core driver")
Cc: stable@dpdk.org

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-11-08 00:49:59 +01:00
Santosh Shukla
df6e0a06a3 drivers/net: rename physical address type to IOVA
Renamed data type from phys_addr_t to rte_iova_t.

Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2017-11-06 22:44:26 +01:00
Thomas Monjalon
bfa9a8a460 mbuf: rename data address helpers to IOVA
The following inline functions and macros have been renamed to be
consistent with the IOVA wording:

rte_mbuf_data_dma_addr         -> rte_mbuf_data_iova
rte_mbuf_data_dma_addr_default -> rte_mbuf_data_iova_default
rte_pktmbuf_mtophys            -> rte_pktmbuf_iova
rte_pktmbuf_mtophys_offset     -> rte_pktmbuf_iova_offset

The deprecated functions and macros are kept to avoid breaking the API.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2017-11-06 22:44:26 +01:00
Thomas Monjalon
f17ca7870f memzone: rename address from physical to IOVA
The struct rte_memzone field .phys_addr is renamed to .iova.
The deprecated name is kept in an anonymous union to avoid breaking
the API.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
2017-11-06 22:25:44 +01:00
Gaetan Rivet
c752998b5e pci: introduce library and driver
The PCI lib defines the types and methods allowing to use PCI elements.

The PCI bus implements a bus driver for PCI devices by constructing
rte_bus elements using the PCI lib.

Move the relevant code out of the EAL to its expected place.

Libraries, drivers, unit tests and applications are updated to use the
new rte_bus_pci.h header when necessary.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
David Harton
289ba0c0f5 ethdev: allow returning error on VLAN offload ops
Some devices may not support or fail setting VLAN offload
configuration based on dynamic circumstances so the
vlan_offload_set_t vector is modified to return an int so
the caller can determine success or not.

rte_eth_dev_set_vlan_offload is updated to return the
value provided by the vector when called along with restoring
the original offload configs on failure.

Existing vlan_offload_set_t vectors are modified to return
an int.  Majority of cases return 0 but a few that actually
can fail now return their failure codes.

Finally, a vlan_offload_set_t vector is added to virtio
to facilitate dynamically turning VLAN strip on or off.

Signed-off-by: David Harton <dharton@cisco.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-26 02:33:01 +02:00
Olivier Matz
380a7aab1a mbuf: rename deprecated VLAN flags
PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT are deprecated for a while.
As explained in [1], these flags were kept to let the applications and
PMDs move to the new flag. There is also a need to support Rx vlan
offload without vlan strip (at least for the ixgbe driver).

This patch renames the old flags for this feature, knowing that some
PMDs were using PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT to indicate that
the vlan tci has been saved in the mbuf structure.

It is likely that some PMDs do not set the proper flags when doing vlan
offload, and it would be worth making a pass on all of them.

Link: [1] http://dpdk.org/ml/archives/dev/2017-June/067712.html

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-26 02:33:01 +02:00
Harish Patil
daee4e07fc net/qede: fix to re-enable LRO during device start
Move LRO configuration from dev_configure to dev_start so that
LRO configuration can be re-enabled following a port restart.

Fixes: 9a6d30ae6d ("net/qede: refactoring vport handling code")
Cc: stable@dpdk.org

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-10-26 02:33:00 +02:00
Harish Patil
e0947ed912 net/qede: add support for VXLAN UDP port config over VF
- Allow VXLAN enable/disable over VF using udp_tunnel_port_add/del APIs.
  Only default MAC/VLAN classification is supported.
- Enable VxLAN before UDP port configuration.
- Change VxLAN default UDP port to 4789 instead of 8472.

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-10-26 02:33:00 +02:00
Harish Patil
fb88acb59a net/qede: fix supported packet types
Update/fix supported ptypes to return both inner and outer headers,
tunnel_type, fragmented and VLAN packet types.

Fixes: 3d4bb44116 ("net/qede: add fastpath support for VXLAN tunneling")
Fixes: 2ea6f76aff ("qede: add core driver")
Cc: stable@dpdk.org

Signed-off-by: Harish Patil <harish.patil@cavium.com>
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-26 02:33:00 +02:00
Olivier Matz
cbc12b0a96 mk: do not generate LDLIBS from directory dependencies
The list of libraries in LDLIBS was generated from the DEPDIRS-xyz
variable. This is valid when the subdirectory name match the library
name, but it's not always the case, especially for PMDs.

The patches removes this feature and explicitly adds the proper
libraries in LDLIBS.

Some DEPDIRS-xyz variables become useless, remove them.

Reported-by: Gage Eads <gage.eads@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Gage Eads <gage.eads@intel.com>
2017-10-24 02:14:57 +02:00
Luca Boccassi
62bc760dea mk: sort source files before compilation
In order to achieve reproducible builds, always use the same
order when listing files for compilation.

Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
2017-10-12 22:31:33 +02:00
Matan Azrad
d5b0924ba6 ethdev: add return value to stats get dev op
The stats_get dev op API doesn't include return value, so PMD cannot
return an error in case of failure at stats getting process time.

Since PCI devices can be removed and there is a time between the
physical removal to the RMV interrupt, the user may get invalid stats
without any indication.

This patch changes the stats_get API return value to be int instead of
void.

All the net PMDs stats_get dev ops are adjusted by this patch.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-12 01:52:49 +01:00
Rasesh Mody
17d207d5eb net/qede/base: update base driver version to 8.30.8.0
This patch updates the base driver version to 8.30.8.0.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-12 01:36:58 +01:00
Rasesh Mody
da4ff1c398 net/qede/base: fix return code to align with FW
This change aligns the PF behavior with that of the L2-fw, so that flows
(to remove an incorrect MAC) for PF and VF could remain the same.

Fixes: 86a2265e59 ("qede: add SRIOV support")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-12 01:36:58 +01:00
Rasesh Mody
eb35c732fe net/qede/base: fix for VF malicious indication
IOV regression testing led to discovery of a minor issue + possibly race
in IOV flows:
 a. Malicious indications in VF-database on PF-side get cleared during
    FLR flows - but not when disabling SRIOV. At least in Linux if you
    disable IOV while having a malicious VF you wouldn't be able to
    clear the indication as driver would prevent from initializing it.
 b. Possible race during PF response to VF - the channel is made ready
    only after sending the rc via dmae to VF. It's possible due to
    context switch at end of DMAE [when releasing Mutex] that VF would
    start running and send another message prior to PF clearing the
    channel, making the FW consider that VF to be malicious.

This patch fixes that by
 - clearing the indication even if we're only going to disable VF
 - resetting the channel to ready before PF copies the rc to the VF, PF
   can then continue and send an additional message

Fixes: 47b302d646 ("net/qede/base: add handling of malicious VF")
Fixes: 86a2265e59 ("qede: add SRIOV support")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-12 01:36:58 +01:00
Rasesh Mody
8335b809f7 net/qede/base: fix access to an uninitialized list
Fix an access to an uninitialized list when the management FW is not
initialized by simply doing the list initialization always, at a
previous step, before ecore_mcp_cmd_init() can stop in the middle and
return.

Fixes: 22c996968b ("net/qede/base: revise management FW mbox access scheme")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-12 01:36:58 +01:00
Rasesh Mody
2b68b841d7 net/qede/base: change default page size of ILT clients
Change the default page size of internal lookup table (ILT) clients to
64K

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-12 01:36:58 +01:00
Rasesh Mody
955770f254 net/qede/base: check device personality for feature setting
- Add non-L2 personality macros and add a personality check before
  setting the HW features

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-12 01:36:58 +01:00
Rasesh Mody
b9ebba32cc net/qede/base: code cleanup
- Remove some dead definitions, function declarations and unused
   variables
 - Remove an obsolete workaround from ecore_int_igu_enable()
 - Remove set variables that are not used
 - Remove needless check in  ecore_init_wfq_param() when configuring
   minimum vport BW. We already check whether total for all vports is
   greater than the PF's, so no need to check independently the current
   requested configuration as well.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-12 01:36:58 +01:00
Rasesh Mody
c68f27a2a4 net/qede/base: semantic changes
- Move define CRC8_TABLE_SIZE to header file
 - Move/relocate ecore_vf_start()
 - Other semantic changes

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-12 01:36:58 +01:00
Rasesh Mody
49f4b9dc8a net/qede/base: add/change/revise logs
Changes include:
 - adding new log to print Dcbx version
 - reformatting log in ecore_dmae_operation_wait() in case of DMA engine
   failure
 - changing verbosity of some log messages such as:
   VFs incorrect behavior should be logged on PF with DP_VERBOSE(), not
   DP_NOTICE(). In general keep IOV-related logs at low verbosity.
   Log the critical issues from VF perspective, like message to PF
   times-out or the PF rejects the VF configuration, as NOTICE than
   VERBOSE
 - Add a printout of some MCP CPU info in case of no MFW response

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-12 01:36:58 +01:00
Rasesh Mody
aa96bcbdae net/qede/base: add/fix comments
Fix few comments and add a new one describing SW channel implementation
limitation

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-12 01:36:58 +01:00
Rasesh Mody
70f1a93d7b net/qede/base: add various OS abstraction macros
- Introduce OSAL_IOV_VF_VPORT_STOP to allow VF to carry out required
   operations and prevent a potential assert before closing vport
 - Add OSAL_DIV_S64() for 64-bit division on 32-bit platforms.
 - Add OSAL for transceiver update OSAL_TRANSCEIVER_UPDATE()
 - Add OSAL for MFW command preemption OSAL_MFW_CMD_PREEMPT() within the
   spinning loops while sending a mailbox command to the MFW
 - Implement OSAL_SPIN_LOCK_IRQSAVE macro
 - Rename OSAL_NUM_ACTIVE_CPU() to OSAL_NUM_CPUS()

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-12 01:36:58 +01:00
Rasesh Mody
3ea74d896c net/qede/base: use the correct size value
Use the correct size value while copying chassis/port id values.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-12 01:36:58 +01:00
Rasesh Mody
b21e05c9cf net/qede/base: add check for DMA engine state
Check DMA engine state to verify it is not called before it is
initialized

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-12 01:36:58 +01:00
Rasesh Mody
81dba2b2ff net/qede/base: add LLDP support
This patch adds base driver LLDP protocol support and handle LLDP
received TLV update events.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-12 01:36:58 +01:00
Rasesh Mody
01491d291e net/qede/base: introduce HW/SW channel
Introduce 2 new API functions, one for the VF and the other for
PF [per-VF] which allows to decide whether to use HW/SW channel
for PF<->VF communication(a per-VF configuration). A HyperV might
have different VMs with different requirements.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-12 01:36:58 +01:00
Rasesh Mody
abd4fa3155 net/qede/base: add NVRAM config options
Add NVRAM config options:
 - Rename caution temperature threshold
 - New field EXT_PHY_MDI_PAIR_SWAP
 - BCM54220 1GBT PHY

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-12 01:36:58 +01:00
Rasesh Mody
78f121f53d net/qede/base: add xcvr type and DON FW defines
Add support to firmware for:
 - New SFP type 1000BaseT
 - DON (Diag Over Network). This feature implements a server side for
   process data access commands over Ethernet.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-12 01:36:58 +01:00
Zhiyong Yang
f8244c6399 ethdev: increase port id range
Extend port_id definition from uint8_t to uint16_t in lib and drivers
data structures, specifically rte_eth_dev_data. Modify the APIs,
drivers and app using port_id at the same time.

Fix some checkpatch issues from the original code and remove some
unnecessary cast operations.

release_17_11 and deprecation docs have been updated in this patch.

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-06 18:23:25 +02:00
Olivier Matz
f4b7699c88 net/qede: fix compilation with -Og
The compilation with gcc-6.3.0 and EXTRA_CFLAGS=-Og gives the following
error:

  CC qede_rxtx.o
  qede_rxtx.c: In function ‘qede_start_queues’:
  qede_rxtx.c:797:9: error: ‘rc’ may be used uninitialized in this
                            function [-Werror=maybe-uninitialized]
    return rc;
           ^~

If there is no Rx or Tx queue, rc will not be initialized. Fix it
by initializing rc to -1.

Fixes: 4c4bdadfa9 ("net/qede: refactoring multi-queue implementation")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Harish Patil <harish.patil@cavium.com>
2017-10-06 02:49:50 +02:00
Rasesh Mody
aa23609500 net/qede/base: update PMD version to 2.6.0.1
Update QEDE PMD version to 2.6.0.1

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-06 02:49:49 +02:00
Rasesh Mody
5f4504bffb net/qede/base: remove unused input parameter
Remove unused input parameter from ecore_dcbx_info_free().

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-06 02:49:49 +02:00
Rasesh Mody
2fdeb693de net/qede/base: support WoL writes
Add support programing of WoL Bitmap paterns via management FW mailbox.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-06 02:49:49 +02:00
Rasesh Mody
a2dc43f31c net/qede/base: disable aRFS for NPAR and 100G
Disable accelerated RFS for NPAR and 100G using ECORE_MF_DISABLE_ARFS
multi function mode bit.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-06 02:49:49 +02:00
Rasesh Mody
36341ac6f3 net/qede/base: retain dcbx config till actually applied
Retain user dcbx configurations till the config is applied to the adapter
i.e. till the negotiation completes. If base driver receives a config
update before negotiation completes, then base driver merges the new config
with the cached config and sends it to management FW.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-06 02:49:49 +02:00
Rasesh Mody
3af0c2a203 net/qede/base: catch an init command write failure
In case ecore_init_rt() fails for some reason, catch the failure and
fail the initialization.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-06 02:49:49 +02:00
Rasesh Mody
fe0deb21d4 net/qede/base: add feature support for per-PF virtual link
Add per-PF virtual link support.
This feature adds a logical layer over the physical link to reflect the
control of OEM management protocols either thru' sideband or a switch.
For example, a switch could send a link-down tlv for a PF and this will
put down logical link and virtual link in shared mem (SHMEM) for that PF
inspite of physical link being up for that port.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-06 02:49:49 +02:00
Rasesh Mody
13c0ec8ae8 net/qede/base: dcbx dscp related extensions
- Add an internal API ecore_dcbx_get_dscp_value() for getting the
dscp value for a given priority.

- Initialize dscp parameters in the dcbx-config cache to be used by
the clients for configuring dcbx parameters.

- Reset NIG_REG_DSCP_TO_TC_MAP_ENABLE register when user disables the dscp.

- Fix to always send "dscp + dcbx" update to FW.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-06 02:49:49 +02:00
Rasesh Mody
442fb29b39 net/qede/base: move define to header file
Move FW_MB_PARAM_LOAD_DONE_DID_EFUSE_ERROR to header file

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-06 02:49:49 +02:00
Rasesh Mody
f5940e7d0f net/qede/base: support driver attribute repository
Add support for driver attributes repository in MFW and base driver.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-06 02:49:49 +02:00
Rasesh Mody
c73d7da71c net/qede/base: support mapped doorbell BARs for VF
Determines whether VF utilizes doorbells via limited register bar or via
the doorbell bar and return the size of the HW doorbell bar via acquire
response. By doing that limit the VF CIDs to an amount that would make sure
doorbells for all CIDs fall within the bar.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-06 02:49:49 +02:00
Rasesh Mody
47af701989 net/qede/base: add UFP support
Add support for UFP (Unified Fabric Port) multi-function mode.
It includes new APIs for reading UFP configuration, handling
UFP events, retriving UFP status and UFP ramrod update etc.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-06 02:49:49 +02:00
Rasesh Mody
40cf1e753e net/qede/base: update firmware to 8.30.12.0
Upgrade QEDE PMD FW to version 8.30.12.0.

The firmware upgrade change details are as:
 - Add support for steering by IP and UDP destination port.
 - Add source QP field for GSI offload.
 - Add UFP support.
 - Add support for outer IPv4 TX CSO with unknown tunnel type (in addition
   to inner header CSO).
 - Support flow ID in accelerated RFS flow.
 - Allow Doorbell on empty SPQ and LL2 TX queue (for doorbell recovery).
 - Enable PCI Relaxed Ordering for L2 RX data placement.
 - Additional enhancements and bug fixes

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-06 02:49:49 +02:00
Rasesh Mody
211507c164 net/qede/base: fix number of app table entries
Configure only the available/requested number of app entries rather
than max entries (DCBX_MAX_APP_PROTOCOL) in ecore_dcbx_get_app_data().
Also, fixed a minor issue where incorrect size value is being passed for
memcpy().

Fixes: 26ae839d06 ("qede: add DCBX support")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-06 02:49:49 +02:00
Rasesh Mody
85dfd0c55d net/qede/base: change verbosity
Change verbosity of events related to malicious VFs to DP_NOTICE
from DP_INFO. They are not just informational events.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-06 02:49:49 +02:00
Rasesh Mody
c0845c33ff net/qede/base: add new macro for CMT mode
- Add ECORE_IS_CMT macro (CMT: couple mode teaming) and use that in all the
places where there are checks for number of HW functions per device > 1.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-06 02:49:49 +02:00