Commit Graph

319 Commits

Author SHA1 Message Date
Rasesh Mody
a5e7b7a2ee net/qede/base: remove clock slowdown option
Remove clock slowdown NVM config option as this is not supported
for current chipsets.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:52 +02:00
Rasesh Mody
8a20e270f3 net/qede/base: add API for using MFW resource lock
Add base driver API for using the Management FW resource lock

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:52 +02:00
Rasesh Mody
70ab4d3d46 net/qede/base: add mask/shift defines for resource command
Add several mask/shift defines for the resource command

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:52 +02:00
Rasesh Mody
0e9c6de362 net/qede/base: prevent transmitter stuck condition
Change OOO TC properly to prevent transmitter stuck condition
due to credit underruns.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:52 +02:00
Rasesh Mody
45cf58a14f net/qede/base: formatting changes
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:52 +02:00
Rasesh Mody
0b090fd364 net/qede/base: support tunnelling for VF
Add new tunnelling support for VFs.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:52 +02:00
Rasesh Mody
adce1f86f8 net/qede/base: revise tunnel APIs/structs
Revise tunnel APIs/structs.
 - Unite tunnel start and update params in single struct
   "ecore_tunnel_info"
 - Remove A0 chip tunnelling support.
 - Added per tunnel info - removed bitmasks.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:52 +02:00
Rasesh Mody
a7f3cac315 net/qede/base: change infrastructure for VF tunnelling
Infrastructure changes for VF tunnelling.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:52 +02:00
Rasesh Mody
6a0f9f5c62 net/qede/base: optimize cache-line access
Optimize cache-line access in ecore_chain -
re-arrange fields so that fields that are needed for fastpath
[mostly produce/consume and their derivatives] are in the first cache
line, and the rest are in the second.

This is true for both PBL and NEXT_PTR kind of chains.
Advancing a page in a SINGLE_PAGE chain would still require the 2nd
cacheline as well, but afaik only SPQ uses it and so it isn't
considered as 'fastpath'.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:52 +02:00
Rasesh Mody
43ef668c18 net/qede/base: support handling TLV request from MFW
Add support for handling the TLV request from Management FW.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:51 +02:00
Rasesh Mody
a55e422e4e net/qede/base: make L2 queues handle based
L2 handler changes:

This is change to remove the queue-id/qzone difference for Tx queues.

It does that by mainly doing:

a. VFs queues are no longer determined by the SBs they're using.
Instead, the ecore-client needs to maintain those and choose the values
to be used by VF when initializing it.

b. Eliminate the HW-cid array in the hw-function.
To do that, have all the rx/tx functionality turn into 'handle' base -
when queue would be started the caller would get a (void*) handle,
which it would later use with ecore for configuring various
queue-related stop [update, close].

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:51 +02:00
Rasesh Mody
d411a2b5e4 net/qede/base: refactor code of SP queues
Maintain slowpath event queue and consumer queue within HW function
structure, update corresponding alloc and free APIs accordingly.
Cleanup unused code under CONFIG_ECORE_LL2 ifdef.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:51 +02:00
Rasesh Mody
ea7c1c6f37 net/qede/base: add interfaces for MFW TLV request processing
Add new base driver interfaces for Management FW TLV request processing.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:51 +02:00
Rasesh Mody
978580d86c net/qede/base: prevent driver load with invalid resources
Prevent storage drivers from attempting to load with invalid resources.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:51 +02:00
Rasesh Mody
de5588af0b net/qede/base: set driver type before sending load request
Set the drv_type before sending LOAD_REQ and remove the
ver_str which is not used by the MFW

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:51 +02:00
Rasesh Mody
bd96f72ff9 net/qede/base: check active VF queues before stopping
Make sure VF queue are closed before stopping vport.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:51 +02:00
Rasesh Mody
5ef4119332 net/qede/base: revamp qm initialization
This patch revamps queue initialization.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:51 +02:00
Rasesh Mody
6b190a9873 net/qede/base: allow only trusted VFs to be promisc
Allow only trusted VFs to be promisc/multi-promisc. The reasonable
thing is to use the 'trusted' node instead of simply allowing VFs to
become promiscuous.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:51 +02:00
Rasesh Mody
3750b3f8d8 net/qede/base: remove unneeded step in HW init
There is no need to close the OUT_EN NIG registers, so remove that.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:51 +02:00
Rasesh Mody
86030347db net/qede/base: allow probe to succeed with minor HW-issues
Allow probe to succeed with various 'minor' HW-issues [if requested]

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:51 +02:00
Rasesh Mody
bdf4267dde net/qede/base: read card personality via MFW commands
Add support to read NIC personality via management FW for non-L2
protocols.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:50 +02:00
Rasesh Mody
f60ec68828 net/qede/base: prevent device init failure
Device initialization flow should not be failed because the FW interface
command is not available.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:50 +02:00
Rasesh Mody
8764367752 net/qede/base: update MFW when default MTU is changed
Send mailbox command to Management FW when MTU changes.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:50 +02:00
Rasesh Mody
2dfd074e6c net/qede/base: change queue/sb-id from 8 bit to 16 bit
Change the queue/sb-id values from 8 bit fields to 16 bit fields.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:50 +02:00
Rasesh Mody
5c11b7066f net/qede/base: use default MTU from shared memory
Read and use the default MTU value from shared-memory.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:50 +02:00
Rasesh Mody
5c66fd8592 net/qede/base: add comment
Add a comment for the endianness manipulation in
ecore_mcp_send_drv_version().

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:50 +02:00
Rasesh Mody
48ba75dd7d net/qede/base: add nvram options
Add a bunch of NVRAM options like MCOT, FEC selection, temperature
threshold, Reset On Lan, etc.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:50 +02:00
Rasesh Mody
bb42c23b19 net/qede/base: remove attribute from update current config
Remove attribute field from update_current_config() API, Management FW
need to know only the last entity who configured the device.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:50 +02:00
Rasesh Mody
8bb13112f3 net/qede/base: move mask constants defining NIC type
Move mask constants defining NIC type to ecore.h

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:50 +02:00
Rasesh Mody
47a06aaf5a net/qede/base: decrease maximum HW func per device
Decrease MAX_HWFNS_PER_DEVICE from 4 to 2

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:50 +02:00
Rasesh Mody
806474a684 net/qede: upgrade the FW to 8.18.9.0
This patchset adds changes to upgrade to 8.18.9.0 FW.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:50 +02:00
Rasesh Mody
69ff7477b7 net/qede/base: utilize FW 8.18.9.0
This change is in preparation to work with new FW 8.18.9.0.
Rename the defines to use E4_ and structs to use e4_. This renaming
is to add support for future chipsets.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:49 +02:00
Rasesh Mody
1a998268bf net/qede/base: print various indication on Tx-timeouts
Print various indication on Tx-timeouts.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:49 +02:00
Rasesh Mody
f061e24d8d net/qede/base: mask Rx buffer attention bits
Mask the BRB "RC0_EOP_OUT_SYNC_FIFO_PUSH_ERROR" attention.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:49 +02:00
Rasesh Mody
3ca097bbb2 net/qede/base: send FW version driver state to MFW
Add support to send FW version and driver state to Management FW.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:49 +02:00
Rasesh Mody
63efb906ba net/qede/base: return an initialized return value
Make sure ecore_iov_mark_vf_flr() always returns an initialized return
value.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:49 +02:00
Rasesh Mody
f2b852169b net/qede/base: fix to use NULL pointer
Use OSAL NULL where appropriate

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

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 18:59:45 +02:00
Rasesh Mody
0dfa4c3bdc net/qede/base: fix resource lock minimum value
Fixes: ababb5203d ("net/qede/base: semantic/formatting changes")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 18:59:45 +02:00
Rasesh Mody
2d5036ab10 net/qede/base: fix sriov typo
Typo in ecore_sriov.c; Ending line with , instead of ;

Fixes: 379cbb2c44 ("net/qede/base: semantic change")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 18:59:45 +02:00
Rasesh Mody
ada5b88f63 net/qede/base: refactor return path
No need to return - base on return at end of function.

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

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 18:59:45 +02:00
Rasesh Mody
613949ff26 net/qede/base: fix typo
Fixes: 22d07d939c ("net/qede/base: update")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 18:59:45 +02:00
Rasesh Mody
1c46a0fc02 net/qede/base: fix first VF index calculation
When a server doesn't support ARI, VF offsets begin at a much higher
number. As a result, ecore miscalculates the first_vf_in_pf and
initialization fails since base driver incorrectly learns there are
no SBs for its VF [as its VFs are out of range].

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

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 18:59:44 +02:00
Rasesh Mody
32376ac6b5 net/qede/base: fix remove the unneeded conversion to LE
Remove the unneeded conversion to LE when writing to the 32-bit
XSDM_REG_OPERATION_GEN register

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

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 18:59:44 +02:00
Rasesh Mody
96d1cace81 net/qede/base: fix to remove redundant memset
Fixes: 22d07d939c ("net/qede/base: update")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 18:59:44 +02:00
Rasesh Mody
68cd48d059 net/qede/base: fix out-of-bound memory access
Fix out-of-bound memory access on Management FW interaction for
resource allocation

Fixes: 252b88b58f ("net/qede/base: add selftest and query sensor info")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 18:59:44 +02:00
Rasesh Mody
e06959e662 net/qede/base: fix DORQ attention mask
Fix Doorbell Queue(DORQ) attention mask

Fixes: e6051bd6b0 ("qede: add interrupt handling support")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 18:59:44 +02:00
Rasesh Mody
6bd042a099 net/qede/base: fix printout
Fixes: ec94dbc573 ("qede: add base driver")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 18:59:44 +02:00
Rasesh Mody
121f1cbda7 net/qede/base: add attention bits for AH chip
add attention bits for CHIP_NUM_AH_xxx

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 18:59:44 +02:00
Rasesh Mody
3320ca8c90 net/qede/base: fix to prevent VF promisc config
VFs are seeing the number of MACs available to them as '0',
and as a result configure themselves as PROMISC. This fix is to
prevent that.

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

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 18:59:44 +02:00
Rasesh Mody
cf584e02a7 net/qede/base: fix index printing of multi-bit attentions
Fix the logic for identifying which bit amongst the Multi-bit
attention sources is set.

Fixes: e6051bd6b0 ("qede: add interrupt handling support")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 18:59:44 +02:00
Rasesh Mody
d9237ae227 net/qede/base: fix numbering L2 VF queues
There are some constellations where Due to lack of resource allocation
in MFW, There would be an insufficient number of L2 queues for all the
VFs.

This introduces a new feature ECORE_VF_L2_QUE which correctly numbers
the number of VF queues. Notice it might be larger than the actual
number of VFs in configuration space, in which case its the ecore
client responsibility not to try activating that many.

As part of the fix, also correct the nubmering of the VF queues. As
their numbering is dependent on the SBs of the PF, which might only be
partially used by L2 [as half would be assigned for RDMA which doesn't
require L2 queues], we make the numbering consecutive with that of the
L2 queues only.

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

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 18:59:44 +02:00
Rasesh Mody
8168b63d8c net/qede/base: fix VF init after malicious VF FLR
Fix VF init after malicious VF FLR.

Fixes: 40c926ba26 ("net/qede/base: support to initiate PF FLR")
Fixes: 86a2265e59 ("qede: add SRIOV support")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 18:59:43 +02:00
Rasesh Mody
d843caff0c net/qede/base: fix printout
Prints in ecore_get_dev_info showed only chip revision,
and did that as number instead of letter.
I.e.,  BB A0 --> BB0, BB B0 --> BB1, AH A0 --> AH0, AH A1 --> AH0.

Correct the printing scheme into
{AH, BB} {A, B}{0, 1}

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

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 18:59:43 +02:00
Rasesh Mody
56d1a16a7f net/qede/base: fix TM block ILT initialization
Fix Timer(TM) block Internal Lookup Table(or ILT for logical to
physical address translation) initialization for SRIOV's coexistence
with other protocols.

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

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 18:59:43 +02:00
Rasesh Mody
e0d26cd273 net/qede/base: fix forcing driver default resc allocation
Remove the forcing of the driver's default resource allocation.

Fixes: 77f7222124 ("net/qede: add PCI ids for new chip variant")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 18:59:43 +02:00
Rasesh Mody
74cd03120d net/qede/base: fix to set pointers to NULL after freeing
Set pointers to NULL after freeing the allocations. Change OSAL_FREE
macro to take care of this and cleanup relevant code.

Fixes: 26ae839d06 ("qede: add DCBX support")
Fixes: ec94dbc573 ("qede: add base driver")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 18:59:43 +02:00
Rasesh Mody
d4806aba9b net/qede/base: fix incorrect typecasting of flag
dcbx-update-flag is incorrectly converted to boolean before assigining
it to ramrod data, fix this typecasting. Also, added more debug
messages in the dcbx code paths.

Fixes: 26ae839d06 ("qede: add DCBX support")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 18:59:43 +02:00
Rasesh Mody
679fe2e426 net/qede/base: fix FreeBSD build
This patch addresses compilation errors on FreeBSD with clang 3.8.0.

drivers/net/qede/base/ecore_cxt.c:1257:2: error:
     shifting a negative signed value is undefined
          SET_FIELD(cdu_params, CDUC_NCIB, elems_per_page);
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/qede/base/ecore.h:82:27: note: expanded from macro 'SET_FIELD'
          (value) &= ~(name##_MASK << name##_SHIFT);
                    ~~~~~~~~~~~ ^

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

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Tested-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-01-30 22:18:26 +01:00
Santosh Shukla
94ce07962a net/qede: use I/O device memory read/write API
Replace the raw I/O device memory read/write access with eal
abstraction for I/O device memory read/write access to fix
portability issues across different architectures.

CC: Harish Patil <harish.patil@cavium.com>
CC: Rasesh Mody <rasesh.mody@cavium.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-01-18 17:18:27 +01:00
Rasesh Mody
61a8429ffd net/qede: change few log levels
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:54 +01:00
Rasesh Mody
3d1babca08 net/qede/base: dcbx changes for base driver
This patch includes changes for DCBX like:
 - Return empty parameters for oper-params query when negotiation is not
   complete
 - Use the ieee specific mask value for reading the ethtype value in the
   ieee dcbx mode
 - Endian-ness conversion is not needed for priority<->TC field, as the
   data is already being read/written by ecore in the bigendian way
 - While writing the ets config, base driver incorrectly merges the input
   values with the operational values. The values should be either set
   or unset
 - CEE selection field must be set regardless CEE/IEEE mode
 - Fail the dcbx query for VF interfaces
 - Semantic changes

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:53 +01:00
Rasesh Mody
96ebe3b1f0 net/qede/base: refactor some code bits
Bits of code refactoring in ecore_hw_bar_size(), ecore_get_hw_info()
and ecore_init_cmd_*.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:53 +01:00
Rasesh Mody
ababb5203d net/qede/base: semantic/formatting changes
This patch consists of semantic/formatting changes. It also includes
comment additions.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:53 +01:00
Rasesh Mody
869c47d051 net/qede/base: add support for new firmware
Add support for 8.14.x.x firmware.

The new firmware adds support for external PHY BCM8485x; configures
fixed link speed with transceiver/cable not supporting negotiation;
supports engine swap; supports overriding PCIe preset equalization
value; checks pause too long for ports and reads die temperature
every second for shutdown threshold.
It includes change in FLR flow when there is a SW initiated FLR.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:53 +01:00
Rasesh Mody
77f7222124 net/qede: add PCI ids for new chip variant
Add PCI IDs for new asic type (defined as CHIP_NUM_AH_xxx).
It supports 50G, 40G, 25G and 10G speeds.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:53 +01:00
Rasesh Mody
0b46a4e6ae net/qede/base: add support for 2x10G mode
Add support for 2x10G mode

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:53 +01:00
Rasesh Mody
05a1abcdfc net/qede/base: add support for external PHY
Add support for external PHY BCM8485x.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:53 +01:00
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