Commit Graph

133 Commits

Author SHA1 Message Date
Andrew Rybchenko
f1d2d9360f net/sfc: remove few conditions in Rx queue refill
If Rx refill threshold guarantees that refill happens for one or
more bulks, less checks may be done on refill.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-04-04 18:59:42 +02:00
Andrew Rybchenko
99a4949ff7 net/sfc: make Rx scatter a datapath-dependent feature
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-04-04 18:59:42 +02:00
Andrew Rybchenko
df1bfde4ff net/sfc: factor out libefx-based Rx datapath
Split control and datapath to make datapath substitutable and
possibly reusable with alternative control path.

libefx-based Rx datapath is bound to libefx control path, but
other datapaths should be possible to use with alternative
control path(s).

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-04-04 18:59:42 +02:00
Andrew Rybchenko
b762eca9dd net/sfc: do not use Rx queue control state on datapath
Rx queue flags should keep the information required on datapath.

It is a preparation to split control and data paths.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-04-04 18:59:42 +02:00
Andrew Rybchenko
ad2a75c1bb net/sfc: emphasis that RSS hash flag is an Rx queue flag
Style fix to establish namespace for Rx queue flag defines.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-04-04 18:59:42 +02:00
Andrew Rybchenko
7965557ede net/sfc: use different callbacks for event queues
Use different sets of libefx EvQ callbacks for management,
transmit and receive event queue. It makes event handling
more robust against unexpected events.

Also it is required for alternative datapath support.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-04-04 18:59:42 +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
Ivan Malov
83fef46a22 net/sfc: add callback to retrieve FW version
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
2017-04-04 18:59:41 +02:00
Ivan Malov
ba6afee9a8 net/sfc/base: add advanced function to extract FW version
Some libefx-based drivers might need this functionality to
indicate DPCPU FW IDs as part of FW version info to assist
experienced users.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2017-04-04 18:59:41 +02:00
Ivan Malov
223a29a25e net/sfc: add VFs to the table of PCI IDs for supported NICs
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
2017-04-04 18:59:40 +02:00
Ivan Malov
4650ed44c1 net/sfc: support MCDI proxy
The patch is to add support for MCDI proxy which comes in
useful, particularly, while running over VF: few commands
will normally fail with EPERM, but in some cases the host
driver (i.e. running over the corresponding PF, typically,
within a hypervisor) may set itself as a proxy to conduct
authorization for the commands coming from VFs; these are
forwarded to the corresponding access control application
which may decline or approve authorization by replying to
the requests; all in all, the guest driver has to process
the replies forwarded back by the firmware MC in order to
give up gracefully (by setting return code which could be
understood by 'libefx') or re-issue the original commands

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2017-04-04 18:59:40 +02:00
Ivan Malov
f5258439ee net/sfc: avoid failure on port start if Rx mode is rejected
If Rx mode is unacceptable, in particular, when promiscuous
or all-multicast filters are not allowed while running over
PCI function which is not a member of appropriate privilege
groups, the driver has to cope with the failures gracefully

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
2017-04-04 18:59:40 +02:00
Ivan Malov
178fc0d327 net/sfc: poll MAC stats if periodic DMA is not supported
If periodic DMA statistics feature is absent (particularly,
while running over VF), the PMD must provide an ability to
cope with it using explicit update requests which are kept
restrained according to 'stats_update_period_ms' parameter

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2017-04-04 18:59:40 +02:00
Ivan Malov
e56fa9c23e net/sfc: add kvarg control for MAC statistics update period
The patch is to make MAC statistics update interval tunable
by means of 'stats_update_period_ms' kvarg parameter making
it possible to use values different from 1000 ms in case of
SFN8xxx boards provided that firmware version is 6.2.1.1033

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
2017-04-04 18:59:40 +02:00
Andrew Rybchenko
fe8e3dc248 net/sfc/base: do not ignore MAC stats update period
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-04-04 18:59:40 +02:00
Ivan Malov
295f647a38 net/sfc: set multicast address list in started state only
According to 'libefx' API requirements, one is allowed to
apply multicast address list to the port in started state
only, otherwise the new array should be copied to a local
storage in order to be applied during the next port start

Coverity issue: 141296
Fixes: 0fa0070e43 ("net/sfc: support multicast addresses list controls")

Fixes: e9ddf37a50 ("net/sfc: fix setting empty multicast list")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2017-04-04 18:59:23 +02:00
Roman Zhukov
8cb45c97d3 net/sfc: add unknown unicast/multicast match in flow API
Support individual/group destination address match (unknown unicast
and all-multicast correspondingly in terms of firmware).

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
2017-04-04 18:59:15 +02:00
Roman Zhukov
e01f84f42c net/sfc: support UDP in flow API filters
Exact match of source and destination ports is supported by parser.
IP protocol match is enforced to UDP.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
2017-04-04 18:59:02 +02:00
Roman Zhukov
e267513244 net/sfc: support TCP in flow API filters
Exact match of source and destination ports is supported by parser.
IP protocol match is enforced to TCP.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
2017-04-04 18:58:47 +02:00
Roman Zhukov
07cd4c2eed net/sfc: support IPV6 in flow API filters
Exact match of IP protocol, source and destination
addresses is supported by parser.
EtherType match is enforced to IPv6 EtherType.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
2017-04-04 18:58:33 +02:00
Roman Zhukov
9f5e606535 net/sfc: support IPV4 in flow API filters
Exact match of IP protocol, source and destination
addresses is supported by parser.
EtherType match is enforced to IPv4 EtherType.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
2017-04-04 18:58:14 +02:00
Roman Zhukov
894080975e net/sfc: support VLAN in flow API filters
Exact match of VLAN ID bits is supported only and required in VLAN item.
Mask to match VLAN ID bits only is required, default mask to match entire
TCI is not supported.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
2017-04-04 18:57:54 +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
Andrew Rybchenko
791f57ac6b net/sfc: provide a way to check if filter is supported
The information is obtained from firmware on attach. It may
change after MC reboot (firmware version or variant change).
Cache should be refreshed after MC reboot when it is handled
properly (not yet).

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
2017-04-04 15:52:52 +02:00
Andrew Rybchenko
403030f573 net/sfc: implement dummy filter control callback
Just log error for all filter types and return no support indication.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
2017-04-04 15:52:52 +02:00
Mark Spender
23c6d0dbac net/sfc/base: improve API to get supported filter matches
The previous API had various problems, including the length of the
caller provided buffer not being specified, no means being available
to discover how big the buffer needs to be, and a lack of clarity of
what the resulting list contains.

To improve it:
- add the buffer length as a parameter
- if the provided buffer is too short, fail with ENOSPC and return
  the required length
- ensure that the list contents are valid and add comments describing it

It is safe to change this API as, unsurprisingly, it has no users.

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-04-04 15:52:52 +02:00
Mark Spender
daa007afd0 net/sfc/base: split local MAC I/G back into separate flags
The flag EFX_FILTER_MATCH_LOC_MAC_IG to represent filtering on the
individual/group bit of the MAC address (with the two cases being
distinguished by the MAC address in the filter specification) was
introduced to mirror the Linux driver filtering code, but the
implementations are different enough anyway that it isn't of much
value.

Having separate flags for unknown unicast and multicast simplifies
the code and allows the set of flags to match those used by MCDI.

It will also makes it easier to report whether these filters are
supported.

In the MCDI definitions, the unknown multicast and unicast flags
have the values 0x40000000 and 0x80000000 respectively, and so using
the same values for simplicity requires 32 bits in the filter
specification to store the flags. This means the structure is now
a little bigger than 64 bytes, but filters are not often used on
critical paths so this shouldn't have much impact - on Linux they
are also bigger than they used to be.

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-04-04 15:52:52 +02:00
Andrew Rybchenko
676d11ffb2 net/sfc: remove Tx DMA descriptor boundary crossing limit
EF10 supported by the PMD has no limitations on address boundary
crossing by Tx DMA descriptors.

Fixes: 428c7ddd2f ("net/sfc: send bursts of packets")
Fixes: fec33d5bb3 ("net/sfc: support firmware-assisted TSO")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-04-04 15:52:52 +02:00
Andrew Rybchenko
1e43fe3cb4 net/sfc/base: separate limitations on Tx DMA descriptors
Siena has limitation on maximum byte count and 4k boundary crosssing
(which is stricter than maximum byte count).
EF10 has limitation on maximum byte count only.

Fixes: f7dc06bf35 ("net/sfc/base: import 5xxx/6xxx family support")
Fixes: e7cd430c86 ("net/sfc/base: import SFN7xxx family support")
Fixes: 94190e3543 ("net/sfc/base: import SFN8xxx family support")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-04-04 15:52:52 +02:00
Ivan Malov
e8acb3298d net/sfc: support statistics reset
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-04-04 15:52:52 +02:00
Ivan Malov
b5c94823dc net/sfc/base: add MCDI agnostic wrapper for MAC stats clear
If a libefx-based driver needs some way to clear port statistics,
then an MCDI agnostic method is required.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-04-04 15:52:52 +02:00
Olivier Matz
feb9f680cd mk: optimize directory dependencies
Before this patch, the management of dependencies between directories
had several issues:

- the generation of .depdirs, done at configuration is slow: it can take
  more than one minute on some slow targets (usually ~10s on a standard
  PC without -j).

- for instance, it is possible to express a dependency like:
  - app/foo depends on lib/librte_foo
  - and lib/librte_foo depends on app/bar
  But this won't work because the directories are traversed with a
  depth-first algorithm, so we have to choose between doing 'app' before
  or after 'lib'.

- the script depdirs-rule.sh is too complex.

- we cannot use "make -d" for debug, because the output of make is used for
  the generation of .depdirs.

This patch moves the DEPDIRS-* variables in the upper Makefile, making
the dependencies much easier to calculate. A DEPDIRS variable is still
used to process library dependencies in LDLIBS.

After this commit, "make config" is almost immediate.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Tested-by: Robin Jarry <robin.jarry@6wind.com>
Tested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-03-27 23:28:43 +02:00
Ivan Malov
e9ddf37a50 net/sfc: fix setting empty multicast list
The patch is to fix sfc_set_mc_addr_list() behaviour in order
to make it accept an empty multicast address list thus making
it possible to remove multicast addresses inserted previously

Fixes: 0fa0070e43 ("net/sfc: support multicast addresses list controls")

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-02-10 12:25:48 +01:00
Ferruh Yigit
f2462150ec drivers/net: remove redundant new line from logs
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2017-01-30 22:18:27 +01:00
Ivan Malov
1f01425813 net/sfc: fix TSO limits imposed to the number of Tx queues
The number of Tx queues requested by the user must not be overridden;
instead, the limits imposed by TSO must be applied to the advertised
maximum

Fixes: fec33d5bb3 ("net/sfc: support firmware-assisted TSO")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2017-01-30 22:18:26 +01:00
Andrew Rybchenko
7a7cfb7a75 net/sfc: use eal I/O device memory barriers API
The previous version relied on the fact that DMA sync for device and
PIO write barrier in pair. Now each does its job.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-01-30 22:18:26 +01:00
Andrew Rybchenko
c4378dacc4 net/sfc: use eal I/O device memory read/write API
Use relaxed version of these functions to guarantee no changes on
the step.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-01-30 22:18:26 +01:00
Andrew Rybchenko
2a5a433ba5 net/sfc: enable TSO by default
Remove RTE_LIBRTE_SFC_EFX_TSO config option since it is not
required any more:
 - unreasonable limit on number of Tx queues when TSO is not
   actually required should be solved using per-device parameter
 - performance difference with and without TSO compiled in is small

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-01-30 22:18:26 +01:00
Andrew Rybchenko
323706ab8b net/sfc: do not panic if alarms are not supported
Alarms are not supported on the FreeBSD.
Application must poll link status periodically itself using
rte_eth_link_get_nowait() to avoid management event queue overflow.

Fixes: 2de39f4e13 ("net/sfc: periodic management EVQ polling using alarm")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2017-01-30 22:18:26 +01:00
Andrew Rybchenko
0e7449cabc net/sfc: fix flow control settings on port start
efx_phy_adv_cap_set() sets all advertised phy capabilities including
pause capabilities which are also configured using efx_mac_fcntl_set().

If we set speed and autonegotiation capabilities only, we should
preserve already configured pause capabilities.

Fixes: d23f3a89ab ("net/sfc: support link speed and duplex settings")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
2017-01-30 22:18:25 +01:00
Andrew Rybchenko
9b098c525b net/sfc: fix link status when port is not started
Fixes: 886f8d8a05 ("net/sfc: retrieve link info")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
2017-01-30 22:18:25 +01:00
Andrew Rybchenko
f08a237783 net/sfc: synchronize link status with HW on start
Fixes: 886f8d8a05 ("net/sfc: retrieve link info")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
2017-01-30 22:18:25 +01:00
Andrew Rybchenko
c7c915e1e3 net/sfc: avoid usage of possibly uninitialized link mode
In fact efx_port_poll() always initializes it, but it isn't
explicitly documented feature of the API. Moreover, the API
annocation suggests that return code should be checked.

Fixes: 886f8d8a05 ("net/sfc: retrieve link info")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
2017-01-30 22:18:25 +01:00
Andrew Rybchenko
e0cbe4945c net/sfc: advertise kmod dependencies in pmdinfo
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-01-17 19:40:51 +01:00
Ivan Malov
fec33d5bb3 net/sfc: support firmware-assisted TSO
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Mark Spender <mspender@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
2017-01-17 19:40:51 +01:00
Ivan Malov
32bcfb0a50 net/sfc: update RSS redirection table
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
2017-01-17 19:40:50 +01:00
Ivan Malov
af0d931797 net/sfc: query RSS redirection table
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
2017-01-17 19:40:50 +01:00
Ivan Malov
82faef5076 net/sfc: set RSS key and hash types config
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
2017-01-17 19:40:50 +01:00
Ivan Malov
088e17210a net/sfc: query RSS key and hash types config
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
2017-01-17 19:40:50 +01:00
Ivan Malov
d9ff551fc9 net/sfc: support RSS hash offload
Extract RSS hash provided by the HW in the prefix and put it to mbuf.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
2017-01-17 19:40:50 +01:00