Commit Graph

234 Commits

Author SHA1 Message Date
Jerin Jacob
98a7ea332b fix typos using codespell utility
Fixing typos across dpdk source code using codespell utility.
Skipped the ethdev driver's base code fixes to keep the base
code intact.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2017-06-14 23:54:13 +02:00
Harish Patil
91cc1bb97c net/qede: refactor Tx routine
Refactor TX routine such that TX BD updates can all be grouped together.
Based on the TX offloads requested the TX bitfields are calculated in
a temporary variable and TX BDs are updated at the end. This will minimize
the if checks also. This change is done to easily accommodate newer TX
offload operations in the future.

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-06-12 10:41:29 +01:00
Harish Patil
44346c24b7 net/qede: fix VXLAN tunnel Tx offload flag setting
This patch fixes missing PKT_TX_TUNNEL_VXLAN Tx offload flag from the
supported Tx offloads and an incorrect tunnel TX BD bit setting.

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

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-06-12 10:41:29 +01:00
Rasesh Mody
2e2f392b24 net/qede/base: upgrade the FW to 8.20.0.0
This patch adds changes to upgrade to 8.20.0.0 FW.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-06-12 10:41:29 +01:00
Harish Patil
4c4bdadfa9 net/qede: refactoring multi-queue implementation
This patch does the following refactoring and cleanup:

- As part of multi-queue support a struct member called 'type' was added
  in struct qede_fastpath in order to identify whether a queue is RX or
  TX and take actions based on that. This was unnecessary in the first
  place since pointers to RX and TX queues are already available in
  rte_eth_dev->data. So all usage of fp->type is removed.

- Remove remaining additional layer of internal callbacks for RX/TX
  queues and fastpath related operations from the qed_eth_ops_pass.
  With this change the files qede_eth_if.[c,h] are no longer needed.

- Add new per-queue start/stop APIs instead of clubbing it all together.

- Remove multiple TXQs references (num_tc and fp->txqs) since CoS is not
  supported.

- Enable sharing of the status block for each queue pair.

- Remove enum qede_dev_state and instead make use of existing port
  states RTE_ETH_QUEUE_STATE_STOPPED/RTE_ETH_QUEUE_STATE_STARTED.

- Move qede_dev_start() and qede_dev_stop() to qede_ethdev.c from
  qede_rxtc.c.

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-06-12 10:41:29 +01:00
Harish Patil
9a6d30ae6d net/qede: refactoring vport handling code
The refactoring is mainly for two reasons:

- To remove an additional layer of internal callbacks for all vport
  related operations from the struct qed_eth_ops_pass. Instead, we
  can invoke base APIs directly.

- Splitting a single large vport-update configuration into multiple and
  independent vport-update operations. Each configuration would touch
  only the required config bits that needs an update.

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-06-12 10:41:29 +01:00
Ferruh Yigit
c0802544d9 drivers/net: add generic ethdev macro to get PCI device
Instead of many PMD define their own macro, define a generic one in
ethdev and use that in PMDs.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-06-12 10:41:25 +01:00
Ferruh Yigit
dd2c630a5f drivers/net: remove unnecessary macro for unused variables
remove __rte_unused instances that are not required.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-06-12 10:41:25 +01:00
David Marchand
06e81dc9b7 drivers/net: fix vfio kmod dependency
vfio is the kernel framework used by the vfio-pci kernel driver.
DPDK drivers do not rely solely on vfio, but rather on vfio-pci to gain
access to pci resources.

Fixes: 0880c40113 ("drivers: advertise kmod dependencies in pmdinfo")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2017-06-05 20:56:54 +02:00
Rasesh Mody
8b3ee85efe net/qede: fix RSS table entries for 100G adapter
With the change in base APIs the logic for 100G handling needs to be
adjusted to pass cid values instead for queue ids. The current API
works assuming its queue id.

Fixes: 69d7ba88f1 ("net/qede/base: use L2-handles for RSS configuration")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-05-10 18:07:15 +02:00
Bruce Richardson
803d48340c drivers/net: disable new gcc 7 warnings for base code
For base code in drivers shared with other projects, disable the new
warnings from gcc 7 about unlabelled fall-through in switch statements.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2017-05-05 18:27:09 +02:00
Wei Dai
6d01e580ac ethdev: fix adding invalid MAC address
Some customers find adding MAC addr to VF sometimes can fail,
but it is still stored in dev->data->mac_addrs[ ]. So this
can lead to some errors that assumes the non-zero entry in
dev->data->mac_addrs[ ] is valid.
Following acknowledgements are from specific NIC PMD
maintainer for their managing part.

This patch changes the ethdev internal API, it should not be
backported to a stable/LTS release so far.

Fixes: af75078fec ("first public release")

Signed-off-by: Wei Dai <wei.dai@intel.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-05-05 16:27:11 +02:00
Rasesh Mody
af785e475c net/qede: fix CFLAGS for base files
Changes included in this fix
 - limit CFLAGS to base files
 - fix to remove/mark unused members
 - add checks for debug config option
 - make qede_set_mtu() and qede_udp_dst_port_del() static and others
   non-static as appropriate
 - move local APIs qede_vlan_offload_set() and qede_rx_cqe_to_pkt_type()
 - initialize variables as required

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

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-28 14:46:18 +02:00
Rasesh Mody
9a671097bc net/qede/base: fix find zero bit macro
Use appropriate operator for if condition

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

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-28 14:46:18 +02:00
Rasesh Mody
f6c63e390d net/qede/base: fix macro ecore MFW set field
Fix ECORE_MFW_SET_FIELD macro

Coverity issue: 1423907
Coverity issue: 1423908
Fixes: 0b6bf70d7e ("net/qede/base: support previous driver unload")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-28 14:46:18 +02:00
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
738f56d41a net/qede: fix FW version string for VF
In SRIOV testing, print adapter info shows firmware version used by PF,
this patch provides fix to populate correct firmware version used by VF.

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

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-28 14:46:18 +02:00
Harish Patil
e82b275b32 net/qede: remove IPv4/IPv6 as valid ntuple flows
Firmware supports ntuple configuration which is always based on 4-tuples.
So remove RTE_ETH_FLOW_FRAG_IPV4 and RTE_ETH_FLOW_FRAG_IPV6 as valid flows.
Also merge the two switch statements into one.

Fixes: 622075356e ("net/qede: support ntuple and flow director filter")

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-04-28 14:46:18 +02:00
Harish Patil
a8ebf42f56 net/qede: use new stripped VLAN mbuf flags
Use new mbuf flags PKT_RX_VLAN_STRIPPED and PKT_RX_QINQ_STRIPPED
introduced by the patch:
commit b37b528d95 ("mbuf: add new Rx flags for stripped VLAN")

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-04-28 14:46:18 +02:00
Harish Patil
15ccf70af9 net/qede: fix possible uninitialized pointer
This defect is a functional issue where the RX CQE pointer remains
uninitialized in the LRO code path which can cause null pointer exception
while accessing VLAN or RSS hash value from CQE.

Coverity issue: 143474
Fixes: 29540be7ef ("net/qede: support LRO/TSO offloads")

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-04-28 14:46:17 +02:00
Harish Patil
680c850f7e net/qede: fix LRO handling
- Add a common routine to handle ETH_RX_CQE_TYPE_TPA_CONT and
ETH_RX_CQE_TYPE_TPA_END.
- Remove enum qede_agg_state since there is no need to maintain
aggregation state.
- Modify the segment chaining logic by tracking head and tail
TPA segments of each aggregation.
- Add more debug and comments.
- Mark the packet as PKT_RX_LRO.

Fixes: 29540be7ef ("net/qede: support LRO/TSO offloads")

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-04-28 14:46:17 +02:00
Harish Patil
b3fb8c5ea0 net/qede: fix fastpath rings reset phase
Perform reset of the fastpath RX/TX rings after stopping device port and
not while starting the ports.

Fixes: cfe28a9885 ("net/qede: support unequal number of Rx/Tx queues")
Cc: stable@dpdk.org

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-04-28 14:46:17 +02:00
Harish Patil
49d8b54e86 net/qede: fix default MAC address handling
- In qede_mac_addr_set(), in order to configure default MAC address we
first delete the existing MAC address before trying to add new one. During
init time, there is no MAC filter to begin with, so trying to remove a
non-existing MAC address causes a firmware exception. This can be prevented
by internally calling qede_mac_addr_add() which has the checks in place to
delete a MAC address only if it was added before.

- Remove setting of the default MAC address from within
qede_dev_configure() since rte_eth_dev_start() calls mac_addr_set() anyway.

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

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-04-28 14:46:17 +02:00
Jan Blunck
fdf91e0f2f drivers/net: do not use ethdev driver
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2017-04-18 19:05:46 +02:00
Qi Zhang
c23a1a3000 eal: clean up interrupt handle
The patch change the prototype of callback function
(rte_intr_callback_fn) by removing the unnecessary parameter.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-04-06 21:15:55 +02:00
Harish Patil
1ef4c3a5c1 net/qede: prevent crash while changing MTU dynamically
The driver can handle dynamic MTU change without needing the port to be
stopped explicitly by the application. However, there is currently no
check to prevent I/Os from happening on a different thread while the
port is going thru' reset internally. This patch fixes this issue by
assigning RX/TX burst functions to a dummy function and also reconfigure
RX bufsize for each rx queue based on the new MTU value.

Fixes: 200645ac79 ("net/qede: set MTU")
Cc: stable@dpdk.org

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2017-04-04 19:02:57 +02:00
Harish Patil
8130abb3ec net/qede: fix VF RSS configuration
The newer SR-IOV PF drivers expects RX/TX queues to be created before
applying RSS configuration. This patch addresses this requirement by
deferring RSS configuration till the queues are created. Even though
this issue is only seen in SR-IOV context, the changes will be made
applicable to PF also to keep the behavior consistent between VF/PF.

Fixes: 7ab35bf6b9 ("net/qede: fix RSS")
Cc: stable@dpdk.org

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2017-04-04 19:02:57 +02:00
Harish Patil
82bd0987bd net/qede: fix missing UDP protocol in RSS offload types
Both UDP and TCP based RSS offload types are supported by the device.
This patch adds UDP protocol which got missed out in the original patch.

Fixes: 4c98f2768e ("net/qede: support RSS hash configuration")
Cc: stable@dpdk.org

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2017-04-04 19:02:57 +02:00
Rasesh Mody
755e3fa70d net/qede: update PMD version to 2.4.0.1
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:55 +02:00
Harish Patil
29540be7ef net/qede: support LRO/TSO offloads
This patch includes slowpath configuration and fastpath changes
to support LRO and TSO. A bit of revamping is needed in order
to make use of existing packet classification schemes in Rx fastpath
and for SG element processing in Tx.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2017-04-04 19:02:55 +02:00
Harish Patil
622075356e net/qede: support ntuple and flow director filter
Add limited support for ntuple filter and flow director configuration.
The filtering is based on 4-tuples viz src-ip, dst-ip, src-port,
dst-port. The mask fields, tcp_flags, flex masks, priority fields,
Rx queue drop etc are not supported.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2017-04-04 19:02:55 +02:00
Harish Patil
5343700290 net/qede/base: support ARFS mode
Add base driver APIs to enable accelerated RFS[aRFS] mode and ramrod
to configure rfs and ntuple filter.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2017-04-04 19:02:55 +02:00
Rasesh Mody
7a5dfdc1f3 net/qede/base: semantic changes
Make APIs static and other semantic changes.
A step toward cleaning 'make C=1' with GCC 4.8.3.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:54 +02:00
Rasesh Mody
39f0eb3bbb net/qede/base: prevent race condition during unload
Merge hw_stop and hw_reset into one function.
Prevent race condition between MFW attentions and pf stop command during
unload flow that causes an ASSERT.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:54 +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
eb6088c168 net/qede/base: prevent DMAE transactions during recovery
Prevent DMA engine transactions during recovery phase.

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
615438cba3 net/qede/base: add PF parameter
Add a common enum to pf_params for RDMA.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:54 +02:00
Rasesh Mody
0863dbe396 net/qede/base: move code bits
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:54 +02:00
Rasesh Mody
e32dc0f722 net/qede/base: zero out MFW mailbox data
Zero the whole union data of the Management FW mailbox before copying
the actual union member

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:54 +02:00
Rasesh Mody
2c3945f6b8 net/qede/base: add return code check
Add a check of the return code of ecore_mcp_cmd_and_union() in
ecore_mcp_send_protocol_stats()

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:54 +02:00
Rasesh Mody
49ca6a7bcb net/qede/base: set max values for soft resources
Add support for the new interface with the Management FW for setting
max values of "soft" resources.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:53 +02:00
Rasesh Mody
6da551eeac net/qede/base: add macro for unsupported command
Add a macro for unsupported management FW command

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:53 +02:00
Rasesh Mody
619618b938 net/qede/base: add mailbox for resource allocation
Add the Management FW mailbox for getting non-l2 resource allocation
information.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:53 +02:00
Rasesh Mody
4cf46f140c net/qede/base: add macro got resource value message
Add macro got resource value message

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:53 +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
2e2680e0d2 net/qede/base: support non-L2 dcbx tlv application
Add non-l2 dcbx tlv application support.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:53 +02:00
Rasesh Mody
0b6bf70d7e net/qede/base: support previous driver unload
New driver/management fw load request sequence for handling previous
driver unload.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-04-04 19:02:53 +02:00