Commit Graph

202 Commits

Author SHA1 Message Date
Rasesh Mody
f8da0cd69b net/qede/base: retrieve FW crash dump info
As part of device probe, check if management FW crash dump logs are
available. If available, then log an warning message and update the
epoch value too. A new struct ecore_mdump_info is added to populate
dump info including the new "reason" field by reading shared memory
region.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:53 +01:00
Rasesh Mody
db288034ea net/qede/base: add check for get NVM info return code
Fail ecore_get_hw_info() in case ecore_hw_get_nvm_info() fails.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:53 +01:00
Rasesh Mody
fe96c1e8e3 net/qede: add new host ring type option
Add new option called external PBL (page base list) to ecore_chain_alloc
for future use. Mark chain as external if external PBL is provided.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:53 +01:00
Rasesh Mody
d54bd20d20 net/qede/base: add macros for converting pointer
Add macros PTR_LO and PTR_HI (for converting pointer to HI and LOW bits for
passing to FW hsi handles).

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:52 +01:00
Rasesh Mody
4822669ad8 net/qede/base: add new status code
Add ECORE_CONN_RESET to enum ecore_status.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:52 +01:00
Rasesh Mody
0b3cdba875 net/qede/base: enhance resource info set printouts
Add the resources names in the ecore_hw_set_resc_info() printouts.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:52 +01:00
Rasesh Mody
c0bd1181a8 net/qede: remove unused struct member
Remove b_hw_channel from struct ecore_dev.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:52 +01:00
Rasesh Mody
379cbb2c44 net/qede/base: semantic change
Semantic change: No reason to have p_ prefix to non-pointers

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:52 +01:00
Rasesh Mody
5bbda46be3 net/qede/base: improve Tx-switching performance
In order to improve Tx switching performance an additional HSI parameter
called same-as-last-id is introduced. This resource allows FW caching the
txqs packet properties. Driver needs to set same-as-last-id to be equal to
the qzone.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:52 +01:00
Rasesh Mody
7d8fddd4da net/qede/base: fix updating VF queue zone id
Pass the absolute qzone_id when creating queues.

Fixes: 5cdd769a26 ("qede: add L2 support")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:52 +01:00
Rasesh Mody
153a214d2d net/qede/base: add check to validate Tx queue
Make sure VF tx_qid and the status block index is in the allocated range,
else fail the request.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:52 +01:00
Rasesh Mody
9e004533f6 net/qede/base: rename macro
Rename OOO_LB_TC to PKT_LB_TC to give better meaning.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:52 +01:00
Rasesh Mody
e0685050ff net/qede/base: make API non-static
Move ecore_set_fw_mac_addr from ecore_l2.c to ecore_dev.c to
facilitate future code reuse.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:52 +01:00
Rasesh Mody
93fce9045f net/qede/base: change return codes in SR-IOV
Change return codes in VF/SR-IOV base driver from int to
enum _ecore_status_t.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:52 +01:00
Rasesh Mody
47b302d646 net/qede/base: add handling of malicious VF
Receive indication that VFs are malicious and pass it to the
caller/clients and stop serving those VF's additional resource requests.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:52 +01:00
Rasesh Mody
830aba26d9 net/qede/base: improve set field macro
Improve robustness of the SET_FIELD macro by using a mask.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:52 +01:00
Rasesh Mody
9e2f08a4ad net/qede/base: add request for PF FLR before load request
Add a request for PF Function Level Reset (FLR) before a load request

Fix the location of the PF FLR initiation to be after ecore_get_hw_info()
(which invokes ecore_hw_info_port_num())

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:52 +01:00
Rasesh Mody
6087d8a9cc net/qede/base: fix VF over legacy PF
Apparently VF over Legacy PF doesn't work, as VF would fail after
getting the initial rejection message [instead of sending an additional
one where it asks for a FW override and see if it works].

Fixes: 22d07d939c ("net/qede/base: update")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:52 +01:00
Rasesh Mody
b765730bc1 net/qede/base: fix to handle acquire request from VF
Add a check and fail the VF's probe request if VF is already in
VF_ACQUIRED state.

Fixes: 22d07d939c ("net/qede/base: update")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:52 +01:00
Rasesh Mody
917ce8bd36 net/qede/base: fix Rx queue access by malicious VFs
Rx queue access is still done prior to the index being validated by PF.
Hence move Rx queue and status block validation check before accessing
Rx queue to prevent malicious VFs from using out-of-bound queue indices.

Fixes: 98bc693e19 ("net/qede/base: change queue start")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:52 +01:00
Rasesh Mody
c3c5eaa085 net/qede/base: fix mutex in freeing context manager
Fix OSAL_MUTEX_DEALLOC() in freeing the context manager.

Fixes: 22d07d939c ("net/qede/base: update")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:52 +01:00
Rasesh Mody
3eb0add0c2 net/qede/base: fix error code in resc allocation
Fix to return error code ECORE_INVAL instead of 0 when EQ elements
is too large as done elsewhere in this function.

Fixes: 22d07d939c ("net/qede/base: update")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:52 +01:00
Rasesh Mody
a1f761e16f net/qede/base: fix multiple acquisition requests by VF
There are certain conditions under which VF would infinitely send
ACQUIRE messages, as it will fail to understand that PF has rejected
the ACQUIRE request. Fix to reject multiple acquisition requests by VF.

Fixes: 22d07d939c ("net/qede/base: update")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:52 +01:00
Rasesh Mody
3013f8c161 net/qede/base: fix SRIOV printouts
Remove unmeaningful function ID value in print.

Don't print the number of Multicast filters as part of Acquire response,
as this is an obsolete field which isn't enforced by PF.

Fixes: 86a2265e59 ("qede: add SRIOV support")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:52 +01:00
Harish Patil
52d94b57e1 net/qede: add slowpath support for VXLAN tunneling
- Enable/disable VXLAN tunneling
- Add/remove VXLAN classification rules
- Destination UDP port configuration

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2017-01-17 19:40:52 +01:00
Rasesh Mody
7d178e9ef6 net/qede: remove zlib dependency and enable PMD
The QEDE PMD now uses unzipped firmware file eliminating the dependency
on zlib. Hence remove LDLIBS entry form the Makefile and enable qede
PMD by default.

Fixes: 6adac0bf30 ("qede: add missing external dependency and disable by default")

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
2016-10-26 19:42:23 +02:00
Harish Patil
f1e4b6c0ac net/qede: fix status block index for VF queues
o Fix the fastpath status block index such that each queue pair shares
the same index value.

o Add ecore_vf_get_num_sbs() API that returns the number of status
blocks assigned by PF. Use that to decide how many VF queues can be
advertised. Additionally, restrict maximum number of VF queues to 16
for 100G VF case.

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

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2016-10-26 19:42:22 +02:00
Harish Patil
40c926ba26 net/qede/base: support to initiate PF FLR
Add support to send PF FLR request to the management firmware to
bringup the device in clean slate. This cleanup is necessary
in some corner cases where the device would be left in a bad
state from its previous operations. The driver will send PF FLR
request before slowpath initialization.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2016-10-26 19:42:22 +02:00
Rasesh Mody
98bc693e19 net/qede/base: change queue start
Changed q_{rx,tx}_start APIs to use common queue start parameters

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
2016-10-26 19:42:22 +02:00
Harish Patil
fdc6a6f92b net/qede: remove unused code
Fixes: 2ea6f76aff ("qede: add core driver")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
2016-10-26 19:42:22 +02:00
Harish Patil
20e961bc9e net/qede/base: allow MTU change
Add support to allow MTU change on a deactivated vport in
the qede/base driver and the core driver shall utilize the same.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2016-10-26 19:42:22 +02:00
Rasesh Mody
301ea2d714 net/qede/base: support MFW crash dump
Add support for management firmware(MFW) crash dump collection.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
2016-10-26 19:42:22 +02:00
Rasesh Mody
610ccd98a4 net/qede/base: enhance comments
Comment additions and modifications

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
2016-10-26 19:42:22 +02:00
Rasesh Mody
57a304ef29 net/qede/base: rename pmm prefix to eth
Renamed following to match with HSI changes
 - PMM_* to ETH_*
 - pmm_* to eth_*

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
2016-10-26 19:42:22 +02:00
Rasesh Mody
22d07d939c net/qede/base: update
This patch updates the base driver and incorporates necessary changes
required to bring in the new firmware 8.10.9.0.

In addition, it would allow driver to add new functionalities that might
be needed in future.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
2016-10-26 19:42:21 +02:00
Harish Patil
252b88b58f net/qede/base: add selftest and query sensor info
This patch adds API support for NIC selftests (BIST) and APIs to retrieve
GPIO info, sensor data like temperature, MBA versions, ECC events etc.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2016-10-26 19:42:21 +02:00
Harish Patil
1db31dcd6e net/qede/base: serialize access to MFW mbox
Add ecore_mcp_mb_lock() and ecore_mcp_mb_unlock() APIs to ensure
a single thread is accessing MFW mailbox.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2016-10-26 19:42:16 +02:00
Harish Patil
ffdd059917 net/qede/base: change signature of MCP command
Change ecore_mcp_cmd_and_union() to accept pointer to a structure rather
than accepting multiple arguments. A new struct ecore_mcp_mb_params is
added for that purpose. Also make this function static. This change is
mostly keeping in mind the future requests which needs additional
arguments.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2016-10-26 19:42:11 +02:00
Rasesh Mody
9455b556b7 net/qede/base: update formatting and comments
Change details:
 - adds new comments
 - modifies some of the existing comments
 - abstract code into macros
 - split long lines

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
2016-10-26 19:38:29 +02:00
Rasesh Mody
8427c66479 net/qede/base: add attention formatting string
In case of attention from a signal that's represented by multiple bits
in misc AEU, add the format string which is populated with proper index
and resulting prints will show string as a prefix.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
2016-10-26 19:38:29 +02:00
Rasesh Mody
3cbc0bd272 net/qede/base: add HSI changes and register defines
- add the hardware software interface(HSI) changes
- add register definitions

These will be required for 8.10.9.0 FW upgrade.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
2016-10-26 19:38:29 +02:00
Rasesh Mody
48e8d2396f net/qede: use firmware config macros as needed
Replaced CONFIG_QED_BINARY_FW with CONFIG_ECORE_BINARY_FW.
Use CONFIG_ECORE_BINARY_FW and CONFIG_ECORE_ZIPPED_FW defines as
required.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
2016-10-26 19:38:29 +02:00
Rasesh Mody
d2e7d931d0 net/qede/base: formatting changes
Fixes white spaces and tabs.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
2016-10-26 19:38:29 +02:00
Rasesh Mody
c018d2b49d net/qede/base: add new files and rearrange the code
Added ecore_hsi_debug_tools.h, ecore_hsi_init_func.h,
ecore_hsi_init_tool.h files. Rearranged code from ecore_hsi_common.h and
ecore_hsi_tools.h to the new files. Removed unused code.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
2016-10-26 19:38:18 +02:00
Sony Chacko
40e9f6fc15 net/qede: enable VF-VF traffic with unmatched dest address
This patch enables VF to VF traffic with unmatched destination addresses.
The steps to enable this are:
- Enable promiscuous mode filter settings.
- Check for VF mode and enable promiscuous mode settings for VF.
- Check filter configuration to ensure conflicting filter modes
are not set.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
2016-06-23 17:47:18 +02:00
Harish Patil
8a9c69ae4a net/qede: allow firmware to query LAN stats
Under certain scenarios, management firmware (MFW) periodically polls
the driver for LAN statistics. This patch implements the osal hook to
fill in the stats.

Fixes: ec94dbc573 ("qede: add base driver")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2016-06-15 17:13:55 +02:00
Thomas Monjalon
2c577ba417 qede: fix 32-bit build with debug enabled
Some 64-bit variables are printed for debug.
%PRIx64 qualifier must be used because %lx is not long enough
on 32-bit systems

Fixes: ec94dbc573 ("qede: add base driver")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Harish Patil <harish.patil@qlogic.com>
2016-05-24 16:16:25 +02:00
Rasesh Mody
26ae839d06 qede: add DCBX support
This patch adds LLDP and DCBX capabilities to the qede PMD.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
2016-05-06 15:51:22 +02:00
Rasesh Mody
e6051bd6b0 qede: add interrupt handling support
The physical link is handled by the management Firmware.
This patch lays the infrastructure for interrupt/attention handling in
the driver, as link change notifications arrive via async interrupts,
as well as the handling of such notifications. It adds async event
notification handler interfaces to the PMD.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
2016-05-06 15:51:22 +02:00
Rasesh Mody
86a2265e59 qede: add SRIOV support
This patch adds following SRIOV features to qede PMD:
 - VF configuration
 - VF intialization/de-initialization
 - VF PF communications channel
 - statistics capture and query

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
2016-05-06 15:51:22 +02:00
Rasesh Mody
5cdd769a26 qede: add L2 support
This patch adds the features to supports configuration of various Layer 2
elements, such as channels and filtering options.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
2016-05-06 15:51:22 +02:00
Rasesh Mody
ec94dbc573 qede: add base driver
The base driver is the backend module for the QLogic FastLinQ QL4xxxx
25G/40G CNA family of adapters as well as their virtual functions (VF)
in SR-IOV context.

The purpose of the base module is to:
 - provide all the common code that will be shared between the various
   drivers that would be used with said line of products. Flows such as
   chip initialization and de-initialization fall under this category.
 - abstract the protocol-specific HW & FW components, allowing the
   protocol drivers to have clean APIs, which are detached in its
   slowpath configuration from the actual Hardware Software Interface(HSI).

This patch adds a base module without any protocol-specific bits.
I.e., this adds a basic implementation that almost entirely falls under
the first category.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
2016-05-06 15:51:22 +02:00