Commit Graph

94 Commits

Author SHA1 Message Date
Stephen Hemminger
69b6573980 net/qede: implement dynamic logging
This driver is mostly like others with slightly different logging
macros. The semantics were retained, with some minor reformatting.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2018-01-16 18:47:49 +01:00
Shahed Shaikh
d378cefab8 net/qede: add support for GENEVE tunneling offload
This patch refactors existing VXLAN tunneling offload code and enables
following features for GENEVE:
 - destination UDP port configuration
 - checksum offloads
 - filter configuration

Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
Acked-by: Rasesh Mody <rasesh.mody@cavium.com>
2018-01-16 18:47:49 +01:00
Harish Patil
e60644c442 net/qede: fix to reject config with no Rx queue
The qede firmware expects minimum one RX queue to be created, otherwise
it results in firmware exception. So a check is added to prevent that.

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

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2018-01-16 18:47:49 +01:00
Harish Patil
749d2329f3 net/qede: fix to enable LRO over tunnels
Enable LRO feature to work with tunnel encapsulation protocols.

Fixes: 29540be7ef ("net/qede: support LRO/TSO offloads")
Cc: stable@dpdk.org

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2018-01-16 18:47:49 +01:00
Harish Patil
1282943aa0 net/qede: fix default config option
Restore the default configuration as in previous releases and
add a debug msg.

Fixes: f07aa795c9 ("net/qede: disable per-VF Tx switching feature")
Cc: stable@dpdk.org

Signed-off-by: Harish Patil <harish.patil@cavium.com>
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-11-10 08:12:20 +00:00
Rasesh Mody
2c93d5baf9 net/qede: fix null pointer dereferences
Fix null pointer dereferences in qede_vxlan_enable() and
qede_conf_udp_dst_port()

Coverity issue: 195010, 195012, 198439
Fixes: e0947ed912 ("net/qede: add support for VXLAN UDP port config over VF")
Fixes: 739a5b2f2b ("net/qede/base: use passed ptt handler")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-11-08 00:49:59 +01:00
Rasesh Mody
feea1b85ce net/qede: fix PF translation table release
Appropriately release the ptt[PF translation table] handler that is
acquired in error case

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

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-11-08 00:49:59 +01:00
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
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
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
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
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
Rasesh Mody
739a5b2f2b net/qede/base: use passed ptt handler
Use the ptt[PF translation table] handler that is passed rather than using
main ptt from the HW function.
In ecore_hw_get_resc()'s error flow, release the MFW generic resource lock
only if needed.
Change the verbosity level of GRC timeout from DP_INFO() to DP_NOTICE().
Reduce verbosity of print in ecore_hw_bar_size().

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-06 02:49:49 +02:00
RongQiang Xie
ef86e67ad5 net/qede: fix possible null pointer dereference
In function qede_rss_reta_update(), the pointer params returned from
call to function rte_zmalloc() may be NULL and will be dereferenced.
So, should judge if the params is NULL or not.

Fixes: 8b3ee85efe ("net/qede: fix RSS table entries for 100G adapter")
Cc: stable@dpdk.org

Signed-off-by: RongQiang Xie <xie.rongqiang@zte.com.cn>
Acked-by: Harish Patil <harish.patil@cavium.com>
2017-10-06 02:49:47 +02:00
Rasesh Mody
3818ac224f net/qede: fix chip details print
Fix chip details printed as part of print adapter info

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

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-07-31 19:58:41 +02:00
Rasesh Mody
9c1aa3e1c2 net/qede/base: fix for adapter specific stats
Handle different MAC statistic fields between two chip variants by
reading the MAC counters from the adapter suitable statistics bins.

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

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-07-31 19:58:41 +02:00
Rasesh Mody
d2a2468e36 net/qede: add missing check for VNI
Add missing check for VNI field while adding unicast filter.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-07-06 15:00:57 +02:00
Rasesh Mody
4ffa2af94a net/qede: change debug verbosity of messages
Convert DP_NOTICE() to DP_ERR() as appropriate in PMD files.
Change DP_NOTICE() macro to make use of boolean flag to log
it as error message or informational message.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-07-06 15:00:57 +02:00
Rasesh Mody
e8fb98d608 net/qede: add comments traces and format changes
Changes include
 - comment modifications
 - adds tracing during initialization
 - adds/removes new lines

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-07-06 15:00:57 +02:00
Harish Patil
c008e17b61 net/qede: limit ring size to 32k
Since nb_max is a u16 it can store value up to 65535 only (not 64K),
but this value is not a power-of-2. So limit the ring sizes to 32K.

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-07-06 15:00:57 +02:00
Harish Patil
a39001d90d net/qede: fix DMA memory leak
Implement the macro OSAL_DMA_FREE_COHERENT to release DMA memories.
Track all DMA memory allocations using an array of memzone pointers and
use that to free memory resources along with other resource deallocation.
With this change there is no need to alter the base code to additionally
pass an unique string needed for memzone creation.

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

Signed-off-by: Harish Patil <harish.patil@cavium.com>
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-07-06 15:00:57 +02: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
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
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
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
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
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
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
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
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
Ferruh Yigit
28a1fd4fd0 drivers/net: make PCI device id struct const
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-01-30 22:18:26 +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
06e83c4e9f net/qede: fix per queue statisitics
If value of number of rxq/txq is different than
RTE_ETHDEV_QUEUE_STAT_CNTRS, limit per queue
stats/xstats to minimum of the two.

Fixes: 7634c5f915 ("net/qede: add queue statistics")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:54 +01:00