Commit Graph

69 Commits

Author SHA1 Message Date
Georgiy Levashov
4279b54e28 net/sfc: support Rx interrupts for efx datapath
When Rx interrupts are disabled, we simply disable rearm when
the interrupt fires the next time. So, the next packet will
trigger interrupt (if it is not happened yet after previous Rx
burst processing).

Signed-off-by: Georgiy Levashov <georgiy.levashov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-06-14 00:01:00 +09:00
Andrew Rybchenko
9aa0afd1e9 net/sfc: advertise offload capabilities by Tx datapaths
Tx datapath feature bits were useful on migration from the old offload API
to the new one. However, right now it just adds indirection which
complicates code reading and understanding. Also addition of a new
offloads requires addition of a new feature bits and makes patches longer
and harder to understand. So, remove feature bits which correspond to Tx
offloads and simply advertise device and per-queue offloads directly.
Generic code could still mask some offloads if running HW or FW does not
support it.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2019-06-13 23:54:29 +09:00
Ivan Malov
c1ce2ba218 net/sfc: support tunnel TSO on EF10 native Tx datapath
Handle VXLAN and GENEVE TSO on EF10 native Tx datapath.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-04-05 17:45:22 +02:00
Ivan Malov
9906cb2959 net/sfc: improve log about missing HW TSO support
Said message cannot be considered as warning since
the PMD anyway reports available offload capabilities
by means of device info interface. Make this log
message informational and improve its formatting
by placing the text itself on the same line.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-04-05 17:45:22 +02:00
Stephen Hemminger
42c807fee5 net/sfc: do not use PMD log type
The sfc driver was still using RTE_LOGTYPE_PMD which was superseded
by local logging.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-03-01 18:17:36 +01:00
Igor Romanov
d5371f3dfa net/sfc: use NIC EVQ descs limits instead of defines
Descriptor limits are not common for all NIC families. Use the variables
from NIC configuration instead of deprecated defines.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-08 11:35:41 +01:00
Igor Romanov
048a0d1a81 net/sfc: use NIC Rx descs limits instead of defines
Descriptor limits are not common for all NIC families. Use the variables
from NIC configuration instead of deprecated defines.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-08 11:35:41 +01:00
Igor Romanov
9dbd28df2d net/sfc: use NIC min number of Tx descs instead of define
Min limit is not common for all NIC families. Use the variable from
NIC configuration instead of deprecated define.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-08 11:35:41 +01:00
Andrew Rybchenko
2646d42fff net/sfc: support Rx packet types get in secondary process
Secondary process needs to know packet classes supported
by the NIC on Rx.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
e295f175bf net/sfc: move RSS config to adapter shared
RSS get requests are supported in secondary process.

Prepare to make sfc_adapter primary process private data.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
113a14a63e net/sfc: move TxQ shared information to adapter shared
Prepare to make sfc_adapter primary process private data.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
29e4237d46 net/sfc: remove TxQ control from shared TxQ info
libefx is not multi-process aware and all related structures
should be moved to primary process only.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
5dec95e36d net/sfc: move datapath ops pointers to process private data
The change is required to support datapath-dependent device operations
for secondary process. It is just a step in the direction.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
b57870f2ab net/sfc: avoid usage of TxQ control structure in info get
TxQ control structure contains primary process only data and will become
primary process only. TxQ info get is supported in secondary process.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
e2c3639abf net/sfc: fix logging from secondary process
Dynamic log type value may differ in different processes.

Fixes: f28ede500c ("net/sfc: support multi-process")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
5a1ae82d7b net/sfc: add Rx descriptor wait timeout
Add device argument to customize Rx descriptor wait timeout which
is supported in DPDK firmware variant only in equal stride super-buffer
Rx mode only.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-04-27 18:00:59 +01:00
Andrew Rybchenko
6e899accd2 net/sfc: support DPDK firmware variant
DPDK firmware variant supports equal stride super-buffer Rx mode which
provides higher packet rate and packet marks but requires dedicated
mempool manager with contiguous object block allocation (e.g. bucket).

Also the firmware supports subvariant without checksumming on Tx which
allows to reach higher packet rates on transmit if checksumming is not
required.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-04-27 18:00:59 +01:00
Ivan Malov
01764b20c2 net/sfc: convert to the advanced EFX RSS interface
The current code has the following drawbacks:
 - It is assumed that TCP 4-tuple hash is
   always supported, which is untrue in
   the case of packed stream FW variant.
 - The driver is unaware of UDP hash support
   available with latest firmware.

In order to cope with the mentioned issues, this
patch implements the new approach to handle hash
settings using the advanced EFX RSS interface.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:55 +01:00
Ivan Malov
d1482e21f0 net/sfc: factor out RSS fields from adapter info
RSS handling will need more sophisticated fields
in the adapter context storage in future patches.
This patch groups existing fields in a dedicated
structure and updates the rest of the code.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:55 +01:00
Ivan Malov
5e23c24988 net/sfc: remove conditional compilation for RSS
RSS is one of the most valuable features in the
driver, and one would hardly need to disable it
at build time. This patch withdraws unnecessary
conditionals for RSS snippets.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:55 +01:00
Ivan Malov
00b94c1c21 net/sfc: add missing Rx fini on RSS setup fail path
Fixes: 4ec1fc3ba8 ("net/sfc: add basic stubs for RSS support on driver attach")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 15:54:55 +01:00
Andrew Rybchenko
b16cf4b27f net/sfc: support loopback mode configuration
All loopback modes are listed in efx_loopback_type_t.
Available loopback modes are listed per link speed in
the enc_loopback_types member of the efx_nic_cfg_t.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-04-14 00:41:44 +02:00
Andrew Rybchenko
2f44752cad net/sfc: support choice of FW subvariant without Tx checksum
If running FW variant supports subvariant without checksumming
on transmit and all transmit queues do not use checksumming,
it may be disabled.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-14 00:41:44 +02:00
Andrew Rybchenko
f82e33afbb net/sfc: support link speeds up to 100G
Add 25G, 50G and 100G.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2018-03-30 14:08:44 +02:00
Roman Zhukov
9e7fc8b8f3 net/sfc: add device parameter to choose FW variant
Add support of choice the preferred firmware variant to use in device
parameters.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-03-30 14:08:44 +02:00
Gautam Dawar
d7cfb7828f net/sfc/base: support choosing firmware variant
Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-03-30 14:08:44 +02:00
Ivan Malov
91d1627654 net/sfc: prepare to merge init logs with main log type
Conversion to dynamic logging done in the previous patches
makes it possible to simplify internal controls for init
logging. This patch allows to prepare for such a change.
It makes init-unrelated messages use NOTICE level so that
the following patch will be able to convert init logging
to use INFO level and remain silent by default.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2018-03-30 14:08:44 +02:00
Ivan Malov
dad99d9267 net/sfc: support per-port dynamic logging
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2018-03-30 14:08:44 +02:00
Andy Moreton
e434de5d6b net/sfc/base: report memory BAR number
On Medford and earlier controllers the BAR layout is:
  PF BAR 0: (32bit I/O) I/O mapped registers
  PF BAR 2: (64bit Mem) Memory mapped registers (VI aperture)
  PF BAR 4: (64bit Mem) MSI-X tables

  VF BAR 0: (64bit Mem) Memory mapped registers (VI aperture)
  VF BAR 2: (64bit Mem) MSI-X tables

On Medford2, the layout is:
  PF/VF BAR 0: (64bit Mem) Memory mapped registers (VI aperture)
  PF/VF BAR 2: (64bit Mem) MSI-X tables

Make the VI aperture BAR number available for drivers that need it.
Remove EFX_MEM_BAR define as it it is not correct on all platforms.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-03-30 14:08:42 +02:00
Andrew Rybchenko
44c0947bae net/sfc: change license to BSD-3-Clause
Change license from BSD-2-Clause to BSD-3-Clause.
Bump copyright year.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-16 18:47:49 +01:00
Andrew Rybchenko
36c35355f6 net/sfc: support UDP tunnel ports configuration
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2018-01-16 18:47:49 +01:00
Andrew Rybchenko
b1ffa21148 net/sfc: retry port start to handle MC reboot in the middle
MC reboot may be provoked by the other function which is either
starting in parallel or, for example, reconfiguring UDP tunnel
ports.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-01-16 18:47:49 +01:00
Andrew Rybchenko
e77f9f1906 net/sfc: handle MC reboot event
Implement handling of the MC reboot event received on management
event queue or detected by MCDI processing.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2018-01-16 18:47:49 +01:00
Santosh Shukla
df6e0a06a3 drivers/net: rename physical address type to IOVA
Renamed data type from phys_addr_t to rte_iova_t.

Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2017-11-06 22:44:26 +01:00
Thomas Monjalon
f17ca7870f memzone: rename address from physical to IOVA
The struct rte_memzone field .phys_addr is renamed to .iova.
The deprecated name is kept in an anonymous union to avoid breaking
the API.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
2017-11-06 22:25:44 +01:00
Jianfeng Tan
a7cb2e20d2 mem: remove API to get physical address in dom0
Previously, to get MFN address in dom0, this API is a wrapper to
obtain the "physical address".

As we will removed xen dom0 support, this API is not necessary.

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-10-09 01:52:37 +02:00
Andrew Rybchenko
37a42c61c4 net/sfc: use RSS key size define from base driver
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-10-06 02:49:47 +02:00
Mark Spender
cca9f9099f net/sfc/base: rename API to check Rx scale and hash support
Rename efx_rx_scale_support_get() to efx_rx_scale_default_support_get(),
and efx_rx_hash_support_get() to efx_rx_hash_default_support_get().

All these really report is whether an exclusive RSS context was
successfully acquired at efx_rx_init().

efx_rx_scale_support_get() sounds like it reports whether the device
supports RSS, and whether exclusive or shared contexts are supported,
but it doesn't do that. Renaming it to
efx_rx_scale_default_support_get() helps to reflect that it reports
what RSS support the client gets without trying to allocate RSS
contexts itself.

Also rename efx_rx_scale_support_t to efx_rx_scale_context_type_t, to
make the enum more suitable for specifying the type of an RSS context
to be allocated.

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2017-10-06 02:49:47 +02:00
Ivan Malov
879b01bdfa net/sfc: fix unused variable in RSS-agnostic build
Unused variables will be found in several places if RSS
support is disabled at build time; the patch is to fix it

Fixes: 4ec1fc3ba8 ("net/sfc: add basic stubs for RSS support on driver attach")
Fixes: d9ff551fc9 ("net/sfc: support RSS hash offload")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-10-06 02:49:47 +02: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
Andrew Rybchenko
005870b4d3 net/sfc: fix device reconfigure
Device reconfigure should be done without close which releases
all transmit and receive queue. ethdev API assumes that previously
setup queues (minimum from configured before and now) are kept
across device reconfigure.

Fixes: aaa3f5f0f7 ("net/sfc: add configure and close stubs")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2017-04-04 19:03:01 +02:00
Andrew Rybchenko
df64eadd29 net/sfc: clarify Tx subsystem configure/close function names
Prepare to fix device reconfigure. Make it clear that corresponding
functions should be called on device configure and close operations.
No functional change.

Fixes: a8ad8cf83f ("net/sfc: provide basic stubs for Tx subsystem")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2017-04-04 19:03:00 +02:00
Andrew Rybchenko
f7637d4d55 net/sfc: clarify Rx subsystem configure/close function names
Prepare to fix device reconfigure. Make it clear that corresponding
functions should be called on device configure and close operations.
No functional change.

Fixes: a8e64c6b45 ("net/sfc: implement Rx subsystem stubs")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2017-04-04 19:03:00 +02:00
Andrew Rybchenko
c577a525d2 net/sfc: initialize port data on attach
Port configuration should be initialized on attach to avoid reset to
defaults on device reconfigure.

Fixes: 03ed21195d ("net/sfc: minimum port control sufficient to receive traffic")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2017-04-04 19:03:00 +02:00
Andrew Rybchenko
47995190cf net/sfc: move event support init to attach stage
Prepare to fix device reconfigure.
Device arguments should be parsed once on attach.
Management event queue should be initialized once on attach.

Fixes: 58294ee65a ("net/sfc: support event queue")
Fixes: c22d3c508e ("net/sfc: support parameter to choose performance profile")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2017-04-04 19:03:00 +02:00
Andrew Rybchenko
5259739677 net/sfc: clarify interrupts support function names
Make it clear that corresponding functions should be called on device
configure and close operations. No functional change.

Fixes: 06bc197796 ("net/sfc: interrupts support sufficient for event queue init")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-04-04 19:02:59 +02:00
Andrew Rybchenko
b3b667c992 net/sfc: do not drop TSO on device configure
If Tx datapath does not support TSO, TSO was dropped on device configure.
It is incorrect to change advertised offloads.

Fixes: 7a4d44a639 ("net/sfc: make TSO a datapath-dependent feature")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-04-04 19:02:59 +02:00
Andrew Rybchenko
329472d444 net/sfc: choose datapaths after probe and before attach
Datapath choice requires NIC capabilities knowledge and, therefore,
should be done after probe. Whereas NIC resources estimation needs
to know chosen datapath (e.g. if Tx datapath is going to use TSO).

Fixes: df1bfde4ff ("net/sfc: factor out libefx-based Rx datapath")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-04-04 19:02:59 +02:00
Andrew Rybchenko
244cfa79a4 net/sfc: add missing BSD license line and update year
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-04-04 18:59:41 +02:00
Roman Zhukov
a9825ccf5b net/sfc: support flow API filters
Only pattern items VOID, ETH and actions VOID, QUEUE is now
supported.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-04-04 18:57:21 +02:00