Commit Graph

36 Commits

Author SHA1 Message Date
Rasesh Mody
c2069af8f3 net/qede/base: fix code flow and remove unused code
Remove unused code to address coverity issues and
address a code flow issue.

Coverity issue: 1379468
Coverity issue: 1379521
Coverity issue: 1379522
Coverity issue: 1379523
Coverity issue: 1423918
Fixes: 86a2265e59 ("qede: add SRIOV support")
Fixes: ec94dbc573 ("qede: add base driver")
Fixes: 2ea6f76aff ("qede: add core driver")
Fixes: 29540be7ef ("net/qede: support LRO/TSO offloads")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-28 14:46:18 +02:00
Rasesh Mody
eb8e81ad0d net/qede/base: multi-Txq support on same queue-zone for VFs
A step toward having multi-Txq support on same queue-zone for VFs.

This change takes care of:

 - VFs assume a single CID per-queue, where queue X receives CID X.
   Switch to a model similar to that of PF - I.e., Use different CIDs
   for Rx/Tx, and use mapping to acquire/release those. Each VF
   currently will have 32 CIDs available for it [for its possible 16
   Rx & 16 Tx queues].

 - To retain the same interface for PFs/VFs when initializing queues,
   the base driver would have to retain a unique number per-each queue
   that would be communicated in some extended TLV [current TLV
   interface allows the PF to send only the queue-id]. The new TLV isn't
   part of the current change but base driver would now start adding
   such unique keys internally to queue_cids. This would also force
   us to start having alloc/setup/free for L2 [we've refrained from
   doing so until now]
   The limit would be no-more than 64 queues per qzone [This could be
   changed if needed, but hopefully no one needs so many queues]

 - In IOV, Add infrastructure for up to 64 qids per-qzone, although
   at the moment hard-code '0' for Rx and '1' for Tx [Since VF still
   isn't communicating via new TLV which index to associate with a
   given queue in its queue-zone].

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:54 +02:00
Rasesh Mody
4727343d27 net/qede/base: add UDP ports in bulletin board message
Add UDP ports in bulletin board message.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:54 +02:00
Rasesh Mody
35da959606 net/qede/base: allow PMD to control vport and RSS engine ids
Let PMD have control over the vport-id and rss-eng-id of a given VF
during initialization.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:54 +02:00
Rasesh Mody
6b8962e0ef net/qede/base: support coalescing for VF
Add coalescing support for VFs.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:53 +02:00
Rasesh Mody
6ccecc10ba net/qede/base: update bulletin board during VF init
Updated bulletin board with link state during VF initialization.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:53 +02:00
Rasesh Mody
a261b214b2 net/qede/base: change valloc to vzalloc
Change OSAL_VALLOC() into OSAL_VZALLOC() which would also zero memory.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:53 +02:00
Rasesh Mody
69d7ba88f1 net/qede/base: use L2-handles for RSS configuration
Move RSS configuration into using L2-handles instead of queue-ids.

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