Commit Graph

42 Commits

Author SHA1 Message Date
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
fb58ad9ea0 net/qede: add vendor/device id info
The vendor_id and device_id are used to determine device type. If you
don't have them, then check for determining device type fails and is
always set to default device type.

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

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-01-17 19:40:52 +01:00
Harish Patil
528fcfab23 net/qede: restrict maximum queues for PF/VF
HW can support up to 128 queues based on the NIC config/personality.
But most of the testing is done with 32 queues for PF and 16 for VF
device across different qede devices, so change here is to advertise
only those many instead of returning max queues supported by HW.

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

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2017-01-17 19:40:52 +01:00
Harish Patil
b7f714fd75 net/qede: fix reporting PF driver as disabled
qede PMD does not support SR-IOV PF driver functionality, so
max_vfs is set to 0 to imply the same.

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

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2017-01-17 19:40:52 +01:00
Harish Patil
7ab35bf6b9 net/qede: fix RSS
This patch includes the following:

- Fix missing hash_key_size advertisement
- Fix RSS hash query function
- Update RSS offload flag
- Accept user provided RSS configuration params via rx_adv_conf
  in dev_configure()
- Decouple RSS configuration from common qed_update_vport() and
  instead make use of existing RSS APIs for default RSS configuration

Fixes: 6d9e26c42c ("net/qede: get RSS hash configuration")
Fixes: 9c5d0a669f ("net/qede: fix RSS")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2017-01-17 19:40:52 +01:00
Harish Patil
3d4bb44116 net/qede: add fastpath support for VXLAN tunneling
- Support HW checksum and RSS offload for VXLAN traffic
- Identify inner/outer packet_types using lookup table
- Update documentation

Signed-off-by: Harish Patil <harish.patil@qlogic.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
Harish Patil
77fac1b54f net/qede: fix filtering code
In qede_mac_addr_add() a check is added to differentiate between
unicast/multicast mac to prevent a multicast mac from being wrongly added
to unicast filter table. Secondly, two separate lists will be used to keep
track of unicast/multicast mac filters to prevent duplicate filter
programming. The other change is to remove filter_config from struct
qed_eth_ops_pass and invoke the base APIs directly. This avoids the need
to have multiple structs and function calls.

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

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2017-01-17 19:40:51 +01:00
David Marchand
d857736110 net: remove dead driver names
Since commit b1fb53a39d ("ethdev: remove some PCI specific handling"),
rte_eth_dev_info_get() relies on dev->data->drv_name to report the driver
name to caller.

Having the pmds set driver_info->driver_name in the pmds is useless,
since ethdev overwrites it right after.
The only thing the pmd must do is:
- for pci drivers, call rte_eth_copy_pci_info() which then sets
  data->drv_name
- for vdev drivers, manually set data->drv_name

At this stage, virtio-user does not properly report a driver name (fixed in
next commit).

Signed-off-by: David Marchand <david.marchand@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Jan Blunck <jblunck@infradead.org>
2017-01-17 19:24:51 +01:00
Olivier Matz
513c78ae3f ethdev: fix extended statistics name index
The function rte_eth_xstats_get() return an array of tuples (id,
value). The value is the statistic counter, while the id references a
name in the array returned by rte_eth_xstats_get_name().

Today, each 'id' returned by rte_eth_xstats_get() is equal to the index
in the returned array, making this value useless. It also prevents a
driver from having different indexes for names and value, like in the
example below:

  rte_eth_xstats_get_name() returns:
    0: "rx0_stat"
    1: "rx1_stat"
    2: ...
    7: "rx7_stat"
    8: "tx0_stat"
    9: "tx1_stat"
    ...
    15: "tx7_stat"

  rte_eth_xstats_get() returns:
    0: id=0, val=<stat>    ("rx0_stat")
    1: id=1, val=<stat>    ("rx1_stat")
    2: id=8, val=<stat>    ("tx0_stat")
    3: id=9, val=<stat>    ("tx1_stat")

This patch fixes the drivers to set the 'id' in their ethdev->xstats_get()
(except e1000 which was already doing it), and fixes ethdev by not setting
the 'id' field to the index of the table for pmd-specific stats: instead,
they should just be shifted by the max number of generic statistics.

Fixes: bd6aa172cf ("ethdev: fetch extended statistics with integer ids")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2017-01-04 19:04:30 +01:00
Jan Blunck
eac901ce29 ethdev: decouple from PCI device
This makes struct rte_eth_dev independent of struct rte_pci_device by
replacing it with a pointer to the generic struct rte_device.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2016-12-25 23:30:19 +01:00
Jan Blunck
ae34410a8a ethdev: move info filling of PCI into drivers
Only the drivers itself can decide if it could fill PCI information fields
of dev_info.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2016-12-25 23:25:42 +01:00
Jan Blunck
d4b7f6734f net/qede: localize mapping of ethdev to PCI device
This simplifies later changes to ethdev.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Harish Patil <harish.patil@qlogic.com>
2016-12-25 23:16:51 +01:00
Olivier Matz
0880c40113 drivers: advertise kmod dependencies in pmdinfo
Add a new macro RTE_PMD_REGISTER_KMOD_DEP() that allows a driver to
declare the list of kernel modules required to run properly.

Today, most PCI drivers require uio/vfio.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2016-12-20 18:26:00 +01:00
Harish Patil
1ea56b80f9 net/qede: fix speed capability
- Fix to use bitmapped values in NVM configuration for speed capability
  advertisement. This issue is specific to 25G NIC since it is capable
  of 25G and 10G speeds.

- Update feature list.

Fixes: 64c239b7f8 ("net/qede: fix advertising link speed capability")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2016-11-12 22:27:09 +01:00
Harish Patil
64c239b7f8 net/qede: fix advertising link speed capability
Fix to advertise device's link speed capability based on NVM
port configuration instead of returning driver supported speeds.

Fixes: 95e67b4795 ("net/qede: add 100G link speed capability")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2016-11-07 20:46:52 +01:00
Rasesh Mody
7634c5f915 net/qede: add queue statistics
This patch adds support for pulling per queue statistics.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
2016-10-26 19:42:22 +02:00
Harish Patil
7eca78cefd net/qede: fix driver version string
This patch fixes the base driver version display.
The driver version notation is:
<Base-Version_PMD-Version>

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
de027ce7ce net/qede: skip slow path polling for 100G VF device
There is no need to poll for slowpath events for VF
device since the ramrod responses are received over
PF-VF backchannel synchronously. So the fix is to
restrict the slowpath polling for PF device only.

Fixes: 2af14ca79c ("net/qede: support 100G")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2016-10-26 19:42:22 +02:00
Sony Chacko
bec0228816 net/qede: support scatter gather
Add scatter gather support to enable transmit and receive of larger
packets.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
2016-10-26 19:42:22 +02:00
Harish Patil
9c5d0a669f net/qede: fix RSS
This patch contains few RSS related changes as follows:

o Fix inadvertent initializing of rss_params outside of the
  if block in qed_update_vport() which could cause FW exception.

o Fix disabling of RSS when hash function is 0.

o Rename qede_config_rss() to qede_check_vport_rss_enable()
  for better clarity.

o Avoid code duplication using a helper function
  qede_init_rss_caps().

Fixes: 4c98f2768e ("net/qede: support RSS hash configuration")
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
d87246a437 net/qede: enable and disable VLAN filtering
The device doesn't explicitly support enable/disable
of VLAN filtering. However, VLAN filtering takes effect
when a matching VLAN is configured. So in order to
support enable/disable of VLAN filtering, VLAN 0 is
added/removed respectively. A check is added to ensure that
the user removes all the configured VLANs before disabling
VLAN filtering.

Also VLAN offloads shall be enabled by default and
vlan_tci_outer is to set to 0 for Q-in-Q packets.

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

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2016-10-26 19:42:22 +02:00
Harish Patil
d6cb17535f net/qede: fix VLAN filters
- fix to prevent duplicate VLAN filters

librte_ether does not keep track of VLAN filters
configured, so it becomes driver's responsibility to
keep track of it and prevent duplicate filter
programming. The fix is to use a singly linked
list for tracking the entries and there by prevent
duplicates.

 - fix num vlan filters

Fix num vlan filter when filling Ethernet device information.

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
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
95e67b4795 net/qede: add 100G link speed capability
This patch fixes the missing 100G link speed advertisement
when the 100G support was initially added.

Fixes: 2af14ca79c ("net/qede: support 100G")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2016-10-26 19:42:22 +02:00
Harish Patil
dbac54c2d3 net/qede: fix port (re)configuration
Some applications set port configuration params like promisc mode
before calling dev_start(). This config results in a firmware exception
since this operation internally translates to sending of VPORT-UPDATE
before VPORT-START ramrod which is considered illegal from firmware
standpoint. So the fix is to send VPORT-START ramrod sooner
in dev_configure() rather than deferring it to dev_start().
This requires a bit of reshuffling in the code to move sending of
VPORT-START from qede_start_queues() to qede_dev_configure()
and VPORT-STOP from qede_stop_queues() to qede_dev_stop().

This sequence change also exposes a flaw in the port restart
flows where the fastpath resource allocation routine qede_init_fp()
functionalities need to be split, so that appropriate action is taken
based on the current port state. Eg: Do not re-initialize the status
block in a port restart case. This change ensures port start/stop
can be paired.

A new port state QEDE_DEV_CONFIG is added to distinguish between
port started from scratch vs port requiring a reconfig (like MTU).
The function qede_config_rx_mode() is removed since the individual
port config will be replayed anyways on a restart.

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

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2016-10-26 19:42:22 +02:00
Sony Chacko
cfe28a9885 net/qede: support unequal number of Rx/Tx queues
Previous release of the qede PMD had a limitation that the
driver expects the number of tx and rx queues to be the same.
This patch fixes this issue by making appropriate changes in
control and data path.

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

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
2016-10-26 19:42:22 +02:00
Shreyansh Jain
01f1922786 drivers: rename register macro prefix
All macros related to driver registeration renamed from DRIVER_*
to RTE_PMD_*

This includes:

 DRIVER_REGISTER_PCI -> RTE_PMD_REGISTER_PCI
 DRIVER_REGISTER_PCI_TABLE -> RTE_PMD_REGISTER_PCI_TABLE
 DRIVER_REGISTER_VDEV -> RTE_PMD_REGISTER_VDEV
 DRIVER_REGISTER_PARAM_STRING -> RTE_PMD_REGISTER_PARAM_STRING
 DRIVER_EXPORT_* -> RTE_PMD_EXPORT_*

Fix PMDINFOGEN tool to look for matches of RTE_PMD_REGISTER_*.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-10-14 01:49:32 +02:00
Jan Viktorin
2f3193cf0f pci: inherit common driver in PCI driver
Remove the 'name' member from rte_pci_driver and move to generic
rte_driver.

Most of the PMD drivers were initially using DRIVER_REGISTER_PCI(<name>..)
as well as assigning a name to eth_driver.pci_drv.name member.
In this patch, only the original DRIVER_REGISTER_PCI(<name>..) name has
been populated into the rte_driver.name member - assignments through
eth_driver has been removed.

Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
[Shreyansh: Rebase and expand changes to newly added files]
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: David Marchand <david.marchand@6wind.com>
2016-10-03 16:33:55 +02:00
David Marchand
c830cb2954 drivers: use PCI registration macro
Simplify crypto and ethdev pci drivers init by using newly introduced
init macros and helpers.
Those drivers then don't need to register as "rte_driver"s anymore.

Exceptions:
- virtio and mlx* use RTE_INIT directly as they have custom initialization
  steps.
- VDEV devices are not modified - they continue to use PMD_REGISTER_DRIVER.

Update documentation for replacing an example referring to
PMD_REGISTER_DRIVER.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2016-10-03 16:33:23 +02:00
Pablo de Lara
2f45703c17 drivers: make driver names consistent
As discussed in the past release, driver names are modified
to be more consistent, and the future driver should follow
this new convention.

Driver names consist of:
"driver category"_"driver folder name"_"optional extra name".

For example:
- Crypto null driver       -> "crypto_null"
- Network IXGBE VF driver  -> "net_ixgbe_vf"

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-09-16 11:55:59 +02:00
Rasesh Mody
d1216e2229 net/qede: add xstats
This patch adds support for extended statistics for QEDE PMD.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2016-07-08 22:55:19 +02:00
Neil Horman
cb6696d220 drivers: update registration macro usage
Modify the PMD_REGISTER_DRIVER macro, adding a name argument to it.  The
addition of a name argument creates a token that can be used for subsequent
macros in the creation of unique symbol names to export additional bits of
information for use by the pmdinfogen tool.  For example:

PMD_REGISTER_DRIVER(ena_driver, ena);

registers the ena_driver struct as it always did, and creates a symbol
const char this_pmd_name0[] __attribute__((used)) = "ena";

which pmdinfogen can search for and extract.  The subsequent macro

DRIVER_REGISTER_PCI_TABLE(ena, ena_pci_id_map);

creates a symbol const char ena_pci_tbl_export[] __attribute__((used)) =
"ena_pci_id_map";

Which allows pmdinfogen to find the pci table of this driver

Using this pattern, we can export arbitrary bits of information.

pmdinfo uses this information to extract hardware support from an object
file and create a json string to make hardware support info discoverable
later.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2016-07-06 23:21:40 +02:00
Harish Patil
2af14ca79c net/qede: support 100G
- Add device id to the PCI table
 - Add polling for the slowpath events for CMT mode device
 - Add prerequisites to allow 100g mode
        * Min number of queues needed is 2
        * Only even number of queues are allowed
 - Update documentation

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
2016-06-23 16:34:04 +02:00
Sony Chacko
200645ac79 net/qede: set MTU
Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
[NIC overview doc update]
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2016-06-23 16:26:48 +02:00
Sony Chacko
3dadf73e94 net/qede: query RSS redirection table
Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
2016-06-23 16:22:51 +02:00
Sony Chacko
e8876556a8 net/qede: update RSS redirection table
Add support for configuring the RSS redirection table and update
corresponding documentation.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
2016-06-23 16:22:31 +02:00
Sony Chacko
6d9e26c42c net/qede: get RSS hash configuration
Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
2016-06-23 16:22:21 +02:00
Sony Chacko
4c98f2768e net/qede: support RSS hash configuration
Add support for setting hash configuration based on adapter capability
and update corresponding NIC documentation.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
2016-06-23 16:22:06 +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
2ea6f76aff qede: add core driver
The Qlogic Everest Driver for Ethernet(QEDE) Poll Mode Driver(PMD) is
the DPDK specific module for QLogic FastLinQ QL4xxxx 25G/40G CNA family
of adapters as well as their virtual functions (VF) in SR-IOV context.

This patch adds QEDE PMD, which interacts with base driver and
initialises the HW.

This patch content also includes:
 - eth_dev_ops callbacks
 - Rx/Tx support for the driver
 - link default configuration
 - change link property
 - link up/down/update notifications
 - vlan offload and filtering capability
 - device/function/port statistics
 - qede nic guide and updated overview.rst

Note that the follow on commits contain the code for the features mentioned
in documents but not implemented in this patch.

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