Commit Graph

31 Commits

Author SHA1 Message Date
Olivier Matz
538da7a1ca net: add rte prefix to ether functions
Add 'rte_' prefix to functions:
- rename is_same_ether_addr() as rte_is_same_ether_addr().
- rename is_zero_ether_addr() as rte_is_zero_ether_addr().
- rename is_unicast_ether_addr() as rte_is_unicast_ether_addr().
- rename is_multicast_ether_addr() as rte_is_multicast_ether_addr().
- rename is_broadcast_ether_addr() as rte_is_broadcast_ether_addr().
- rename is_universal_ether_addr() as rte_is_universal_ether_addr().
- rename is_local_admin_ether_addr() as rte_is_local_admin_ether_addr().
- rename is_valid_assigned_ether_addr() as rte_is_valid_assigned_ether_addr().
- rename eth_random_addr() as rte_eth_random_addr().
- rename ether_addr_copy() as rte_ether_addr_copy().
- rename ether_format_addr() as rte_ether_format_addr().

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:45 +02:00
Olivier Matz
6d13ea8e8e net: add rte prefix to ether structures
Add 'rte_' prefix to structures:
- rename struct ether_addr as struct rte_ether_addr.
- rename struct ether_hdr as struct rte_ether_hdr.
- rename struct vlan_hdr as struct rte_vlan_hdr.
- rename struct vxlan_hdr as struct rte_vxlan_hdr.
- rename struct vxlan_gpe_hdr as struct rte_vxlan_gpe_hdr.

Do not update the command line library to avoid adding a dependency to
librte_net.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:45 +02:00
Andrew Rybchenko
e0d5ba7eaa net/sfc: move isolated flag in adapter shared
The flag is required in default RSS RETA get which does not make sense
in isolated mode.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
ab77a0013a net/sfc: fix Rx packets counter
Errors, missed and pauses should not be included in delivered
good Rx packets reported by ipackets.

Fixes: 1caab2f1e6 ("net/sfc: add basic statistics")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-01-18 09:47:26 +01:00
Andrew Rybchenko
0b19aec12a net/sfc: use default FEC mode
All FEC modes are supported and allowed, but none are explicitly
requested.

This effectively means that FEC mode is determined solely form cable
requirements and link partner capabilities / requirements.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-14 00:43:30 +02: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
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
Andrew Rybchenko
c953aea983 net/sfc: size MAC stats DMA buffer to support Medford2
Medford2 supports more MAC stats than previous HW. So DMA
buffer must be sized properly.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-03-30 14:08:42 +02:00
Ivan Malov
ff6a1197c3 net/sfc: convert to new Rx offload API
Ethdev Rx offloads API has changed since:
commit ce17eddefc ("ethdev: introduce Rx queue offloads API")
This commit support the new Rx offloads API.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-01-21 15:51:52 +01: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
Ivan Malov
642088ddff net/sfc: fix main MAC address handling
There is a school of thought that rte_eth_dev_default_mac_addr_set()
must call the PMD callback first and then save the new MAC address
in dev->data->mac_addrs[0]. If this concept gets approved, it will
break the current approach used in sfc driver as the latter relies
on the assumption that the new MAC address is already contained in
dev->data->mac_addrs[0], and, if adapter restart is needed to make
the HW apply the new address, the outdated value will be retrieved
from dev->data. In order to preclude any possible bugs, this patch
adds device private storage for the up-to-date copy of the address.

Fixes: c100fd464b ("net/sfc: support main MAC address change")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-01-16 18:47:49 +01:00
Andrew Rybchenko
1883f4b8a5 net/sfc: fix DMA memory leak after kvarg processing failure
Fixes: e56fa9c23e ("net/sfc: add kvarg control for MAC statistics update period")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-01-16 18:47:49 +01:00
Andrew Rybchenko
8ae36890ca net/sfc: fix multicast address list copy memory leak
Fixes: 295f647a38 ("net/sfc: set multicast address list in started state only")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-01-16 18:47:49 +01:00
Andrew Rybchenko
6636afdf77 net/sfc: stop periodic DMA if MAC stats upload fails
Fixes: 3b257f7e6c ("net/sfc: request MAC stats upload immediately on port start")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-01-16 18:47:49 +01:00
Ivan Malov
73280c1e4f net/sfc: support xstats retrieval by ID
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Remy Horton <remy.horton@intel.com>
2017-07-19 11:09:13 +03:00
Ivan Malov
3b257f7e6c net/sfc: request MAC stats upload immediately on port start
If MAC stats refresh is arranged to be done by periodic DMA,
the first DMA transaction is unlikely to occur right on the
port start; if the user tries to get stats right after port
start and before the transaction occurs, bogus figures will
be collected; a one-off stats upload on port start is a fix

Fixes: 1caab2f1e6 ("net/sfc: add basic statistics")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-07-19 11:09:13 +03:00
Ivan Malov
84a9b48128 net/sfc: support flow API isolated mode
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-07-06 15:00:56 +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
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
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
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
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
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
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
Ivan Malov
f3de384044 net/sfc: support promiscuous and all-multicast control
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
Andrew Rybchenko
d23f3a89ab net/sfc: support link speed and duplex settings
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
Andrew Rybchenko
cdbb29cf4b net/sfc: support flow control settings
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
Andrew Rybchenko
1caab2f1e6 net/sfc: add basic statistics
Does not implement any deprecated statistics.
No per-queue statistics yet.

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
Artem Andreev
886f8d8a05 net/sfc: retrieve link info
Signed-off-by: Artem Andreev <artem.andreev@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-01-17 19:39:26 +01:00
Andrew Rybchenko
03ed21195d net/sfc: minimum port control sufficient to receive traffic
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-01-17 19:39:26 +01:00