Johannes Berg [Fri, 18 Sep 2020 11:21:16 +0000 (13:21 +0200)]
mac80211: fix some encapsulation offload kernel-doc
Add a missing kernel-doc entry for the offload_flags, and
correct the name of the update_vif_offload method.
Link: https://lore.kernel.org/r/20200918132115.d46a0915ba8a.Ibba536d04a5a5fb655f8ef6e51b247457bfda4ca@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 18 Sep 2020 11:19:22 +0000 (13:19 +0200)]
cfg80211: add missing kernel-doc for S1G band capabilities
Add missing kernel-doc for the S1G band capabilities in the
per band data.
Link: https://lore.kernel.org/r/20200918131921.08c893cd73a1.Id71583c37baca8a9a3329426e02b66d9ab65ac03@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Aloka Dixit [Fri, 11 Sep 2020 00:33:01 +0000 (00:33 +0000)]
mac80211: Unsolicited broadcast probe response support
This patch adds mac80211 support to configure unsolicited
broadcast probe response transmission for in-band discovery in 6GHz.
Changes include functions to store and retrieve probe response template,
and packet interval (0 - 20 TUs).
Setting interval to 0 disables the unsolicited broadcast probe response
transmission.
Signed-off-by: Aloka Dixit <alokad@codeaurora.org>
Link: https://lore.kernel.org/r/010101747a946b35-ad25858a-1f1f-48df-909e-dc7bf26d9169-000000@us-west-2.amazonses.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Aloka Dixit [Fri, 11 Sep 2020 00:33:00 +0000 (00:33 +0000)]
nl80211: Unsolicited broadcast probe response support
This patch adds new attributes to support unsolicited broadcast
probe response transmission used for in-band
discovery in 6GHz band (IEEE P802.11ax/D6.0 26.17.2.3.2, AP behavior for
fast passive scanning).
The new attribute, NL80211_ATTR_UNSOL_BCAST_PROBE_RESP, is nested which
supports following parameters:
(1) NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT - Packet interval
(2) NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL - Template data
Signed-off-by: Aloka Dixit <alokad@codeaurora.org>
Link: https://lore.kernel.org/r/010101747a946698-aac263ae-2ed3-4dab-9590-0bc7131214e1-000000@us-west-2.amazonses.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Aloka Dixit [Fri, 11 Sep 2020 00:05:31 +0000 (00:05 +0000)]
mac80211: Add FILS discovery support
This patch adds mac80211 support to configure FILS discovery
transmission.
Changes include functions to store and retrieve FILS discovery
template, minimum and maximum packet intervals.
Signed-off-by: Aloka Dixit <alokad@codeaurora.org>
Link: https://lore.kernel.org/r/20200805011838.28166-3-alokad@codeaurora.org
[remove SUPPORTS_FILS_DISCOVERY, driver can just set wiphy info]
Link: https://lore.kernel.org/r/010101747a7b3cbb-6edaa89c-436d-4391-8765-61456d7f5f4e-000000@us-west-2.amazonses.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Aloka Dixit [Fri, 11 Sep 2020 00:05:29 +0000 (00:05 +0000)]
nl80211: Add FILS discovery support
FILS discovery attribute, NL80211_ATTR_FILS_DISCOVERY, is nested which
supports following parameters as given in IEEE Std 802.11ai-2016,
Annex C.3 MIB detail:
(1) NL80211_FILS_DISCOVERY_ATTR_INT_MIN - Minimum packet interval
(2) NL80211_FILS_DISCOVERY_ATTR_INT_MAX - Maximum packet interval
(3) NL80211_FILS_DISCOVERY_ATTR_TMPL - Template data
Signed-off-by: Aloka Dixit <alokad@codeaurora.org>
Link: https://lore.kernel.org/r/20200805011838.28166-2-alokad@codeaurora.org
[fix attribute and other names, use NLA_RANGE(), use policy only once]
Link: https://lore.kernel.org/r/010101747a7b38a8-306f06b2-9061-4baf-81c1-054a42a18e22-000000@us-west-2.amazonses.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Felix Fietkau [Wed, 16 Sep 2020 16:46:11 +0000 (18:46 +0200)]
mac80211: allow bigger A-MSDU sizes in VHT, even if HT is limited
Some APs (e.g. Asus RT-AC88U) have been observed to report an HT MSDU size
limit of 3839 and a VHT limit of 7991. These APs can handle bigger frames
than 3839 bytes just fine, so we should remove the VHT limit based on the
HT capabilities. This improves tx throughput.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://lore.kernel.org/r/20200916164611.8022-1-nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Thomas Pedersen [Tue, 8 Sep 2020 19:03:06 +0000 (12:03 -0700)]
nl80211: support setting S1G channels
S1G channels have a single width defined per frequency, so
derive it from the channel flags with
ieee80211_s1g_channel_width().
Also support setting an S1G channel where control frequency may
differ from operating, and add some basic validation to
ensure the control channel is with the operating.
Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
Link: https://lore.kernel.org/r/20200908190323.15814-6-thomas@adapt-ip.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Thomas Pedersen [Tue, 8 Sep 2020 19:03:05 +0000 (12:03 -0700)]
nl80211: correctly validate S1G beacon head
The S1G beacon has a different header size than regular
beacons, so adjust the beacon head validator.
Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
Link: https://lore.kernel.org/r/20200908190323.15814-5-thomas@adapt-ip.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Thomas Pedersen [Tue, 8 Sep 2020 19:03:04 +0000 (12:03 -0700)]
cfg80211: regulatory: handle S1G channels
S1G channels have a minimum bandwidth of 1Mhz, and there
is a 1:1 mapping of allowed bandwidth to channel number.
Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
Link: https://lore.kernel.org/r/20200908190323.15814-4-thomas@adapt-ip.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Thomas Pedersen [Tue, 8 Sep 2020 19:03:03 +0000 (12:03 -0700)]
nl80211: advertise supported channel width in S1G
S1G supports 5 channel widths: 1, 2, 4, 8, and 16. One
channel width is allowed per frequency in each operating
class, so it makes more sense to advertise the specific
channel width allowed.
Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
Link: https://lore.kernel.org/r/20200908190323.15814-3-thomas@adapt-ip.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Thomas Pedersen [Tue, 8 Sep 2020 19:03:02 +0000 (12:03 -0700)]
ieee80211: redefine S1G bits with GENMASK
The S1G capability fields were defined by ORing BITS()
together, and expecting a custom macro to use the _SHIFT
definitions. Use the Linux kernel GENMASK for the
definitions now, and FIELD_{GET,PREP} to access the fields
in the future.
Take the chance to rename eg. S1G_CAPAB_B0 to the more
compact S1G_CAP0.
Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
Link: https://lore.kernel.org/r/20200908190323.15814-2-thomas@adapt-ip.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Felix Fietkau [Tue, 8 Sep 2020 12:37:02 +0000 (14:37 +0200)]
mac80211: reorganize code to remove a forward declaration
Remove the newly added ieee80211_set_vif_encap_ops declaration.
No further code changes.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://lore.kernel.org/r/20200908123702.88454-15-nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Felix Fietkau [Tue, 8 Sep 2020 12:37:00 +0000 (14:37 +0200)]
mac80211: extend ieee80211_tx_status_ext to support bulk free
Store processed skbs ready to be freed in a list so the driver bulk free them
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://lore.kernel.org/r/20200908123702.88454-13-nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Felix Fietkau [Tue, 8 Sep 2020 12:36:59 +0000 (14:36 +0200)]
mac80211: support using ieee80211_tx_status_ext to free skbs without status info
For encap-offloaded packets, ieee80211_free_txskb cannot be used, since it
does not have the vif pointer.
Using ieee80211_tx_status_ext for this purpose has the advantage of being able
avoid an extra station lookup for AQL
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://lore.kernel.org/r/20200908123702.88454-12-nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Felix Fietkau [Tue, 8 Sep 2020 12:36:58 +0000 (14:36 +0200)]
mac80211: unify 802.3 (offload) and 802.11 tx status codepath
Make ieee80211_tx_status_8023 call ieee80211_tx_status_ext, similar to
ieee80211_tx_status.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://lore.kernel.org/r/20200908123702.88454-11-nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Felix Fietkau [Tue, 8 Sep 2020 12:36:56 +0000 (14:36 +0200)]
mac80211: optimize station connection monitor
Calling mod_timer for every rx/tx packet can be quite expensive.
Instead of constantly updating the timer, we can simply let it run out
and check the timestamp of the last ACK or rx packet to re-arm it.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://lore.kernel.org/r/20200908123702.88454-9-nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Felix Fietkau [Tue, 8 Sep 2020 12:37:01 +0000 (14:37 +0200)]
mac80211: notify the driver when a sta uses 4-address mode
This is needed for encapsulation offload of 4-address mode packets
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://lore.kernel.org/r/20200908123702.88454-14-nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Felix Fietkau [Tue, 8 Sep 2020 12:36:57 +0000 (14:36 +0200)]
mac80211: swap NEED_TXPROCESSING and HW_80211_ENCAP tx flags
In order to unify the tx status path, the hw 802.11 encapsulation flag
needs to survive the trip to the tx status call.
Since we don't have any free bits in info->flags, we need to move one.
IEEE80211_TX_INTFL_NEED_TXPROCESSING is only used internally in mac80211,
and only before the call into the driver.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://lore.kernel.org/r/20200908123702.88454-10-nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Felix Fietkau [Tue, 8 Sep 2020 12:36:55 +0000 (14:36 +0200)]
mac80211: remove tx status call to ieee80211_sta_register_airtime
All drivers using airtime fairness are calling ieee80211_sta_register_airtime
directly, now they must. Document this as well.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://lore.kernel.org/r/20200908123702.88454-8-nbd@nbd.name
[johannes: update the documentation to suit]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Felix Fietkau [Tue, 8 Sep 2020 12:36:54 +0000 (14:36 +0200)]
mac80211: reduce duplication in tx status functions
Move redundant functionality from __ieee80211_tx_status into
ieee80211_tx_status_ext. Preparation for unifying with the 802.3 tx status
codepath.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://lore.kernel.org/r/20200908123702.88454-7-nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Felix Fietkau [Tue, 8 Sep 2020 12:36:53 +0000 (14:36 +0200)]
mac80211: rework tx encapsulation offload API
The current API (which lets the driver turn on/off per vif directly) has a
number of limitations:
- it does not deal with AP_VLAN
- conditions for enabling (no tkip, no monitor) are only checked at
add_interface time
- no way to indicate 4-addr support
In order to address this, store offload flags in struct ieee80211_vif
(easy to extend for decap offload later). mac80211 initially sets the enable
flag, but gives the driver a chance to modify it before its settings are
applied. In addition to the .add_interface op, a .update_vif_offload op is
introduced, which can be used for runtime changes.
If a driver can't disable encap offload at runtime, or if it has some extra
limitations, it can simply override the flags within those ops.
Support for encap offload with 4-address mode interfaces can be enabled
by setting a flag from .add_interface or .update_vif_offload.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://lore.kernel.org/r/20200908123702.88454-6-nbd@nbd.name
[resolved conflict with commit
aa2092a9bab3 ("ath11k: add raw mode and
software crypto support")]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Felix Fietkau [Tue, 8 Sep 2020 12:36:52 +0000 (14:36 +0200)]
mac80211: set info->control.hw_key for encap offload packets
This is needed for drivers that don't do the key lookup themselves
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://lore.kernel.org/r/20200908123702.88454-5-nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Felix Fietkau [Tue, 8 Sep 2020 12:36:51 +0000 (14:36 +0200)]
mac80211: skip encap offload for tx multicast/control packets
This simplifies the checks in the encap offload tx handler and allows using
it in cases where software crypto is used for multicast packets, e.g. when
using an AP_VLAN.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://lore.kernel.org/r/20200908123702.88454-4-nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Felix Fietkau [Tue, 8 Sep 2020 12:36:50 +0000 (14:36 +0200)]
mac80211: check and refresh aggregation session in encap offload tx
Update the last_tx timestamp to avoid tearing down the aggregation session
early. Fall back to the slow path if the session setup is still running
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://lore.kernel.org/r/20200908123702.88454-3-nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Felix Fietkau [Tue, 8 Sep 2020 12:36:49 +0000 (14:36 +0200)]
mac80211: add missing queue/hash initialization to 802.3 xmit
Fixes AQL for encap-offloaded tx
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://lore.kernel.org/r/20200908123702.88454-2-nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Wright Feng [Tue, 8 Sep 2020 06:01:57 +0000 (01:01 -0500)]
cfg80211: add more comments for ap_isolate in bss_parameters
The value of struct bss_parameters::ap_isolate will be -1, 0 or 1.
The value -1 means not to change. To prevent developers from thinking
ap_isolate is only 0 or 1, I add more comments on it.
Signed-off-by: Wright Feng <wright.feng@cypress.com>
Reviewed-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200908060157.98846-1-wright.feng@cypress.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
YueHaibing [Sat, 29 Aug 2020 11:55:06 +0000 (19:55 +0800)]
lib80211: Remove unused macro DRV_NAME
There is no caller in tree any more.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20200829115506.17828-1-yuehaibing@huawei.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Paolo Abeni [Thu, 17 Sep 2020 21:07:24 +0000 (23:07 +0200)]
mptcp: fix integer overflow in mptcp_subflow_discard_data()
Christoph reported an infinite loop in the subflow receive path
under stress condition.
If there are multiple subflows, each of them using a large send
buffer, the delta between the sequence number used by
MPTCP-level retransmission can and the current msk->ack_seq
can be greater than MAX_INT.
In the above scenario, when calling mptcp_subflow_discard_data(),
such delta will be truncated to int, and could result in a negative
number: no bytes will be dropped, and subflow_check_data_avail()
will try again to process the same packet, looping forever.
This change addresses the issue by expanding the 'limit' size to 64
bits, so that overflows are not possible anymore.
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/87
Fixes:
6719331c2f73 ("mptcp: trigger msk processing even for OoO data")
Reported-and-tested-by: Christoph Paasch <cpaasch@apple.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ursula Braun [Thu, 17 Sep 2020 20:46:02 +0000 (22:46 +0200)]
net/smc: fix double kfree in smc_listen_work()
If smc_listen_rmda_finish() returns with an error, the storage
addressed by 'buf' is freed a second time.
Consolidate freeing under a common label and jump to that label.
Fixes:
6bb14e48ee8d ("net/smc: dynamic allocation of CLC proposal buffer")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Shannon Nelson [Thu, 17 Sep 2020 20:33:35 +0000 (13:33 -0700)]
ionic: add DIMLIB to Kconfig
>> ld.lld: error: undefined symbol: net_dim_get_rx_moderation
>>> referenced by ionic_lif.c:52 (drivers/net/ethernet/pensando/ionic/ionic_lif.c:52)
>>> net/ethernet/pensando/ionic/ionic_lif.o:(ionic_dim_work) in archive drivers/built-in.a
>> ld.lld: error: undefined symbol: net_dim
>>> referenced by ionic_txrx.c:456 (drivers/net/ethernet/pensando/ionic/ionic_txrx.c:456)
>>> net/ethernet/pensando/ionic/ionic_txrx.o:(ionic_dim_update) in archive drivers/built-in.a
v2: removed sketchy dashes in commit message
Fixes:
04a834592bf5 ("ionic: dynamic interrupt moderation")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jakub Kicinski [Thu, 17 Sep 2020 17:51:32 +0000 (10:51 -0700)]
net: remove comments on struct rtnl_link_stats
We removed the misleading comments from struct rtnl_link_stats64
when we added proper kdoc. struct rtnl_link_stats has the same
inline comments, so remove them, too.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Andrew Lunn [Thu, 17 Sep 2020 16:19:49 +0000 (18:19 +0200)]
net: mdio: octeon: Select MDIO_DEVRES
This driver makes use of devm_mdiobus_alloc_size. To ensure this is
available select MDIO_DEVRES which provides it.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Signed-off-by: David S. Miller <davem@davemloft.net>
David Ahern [Thu, 17 Sep 2020 15:13:33 +0000 (09:13 -0600)]
selftests: Set default protocol for raw sockets in nettest
IPPROTO_IP (0) is not valid for raw sockets. Default the protocol for
raw sockets to IPPROTO_RAW if the protocol has not been set via the -P
option.
Signed-off-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Qinglang Miao [Thu, 17 Sep 2020 12:45:08 +0000 (20:45 +0800)]
dpaa2-eth: Convert to DEFINE_SHOW_ATTRIBUTE
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Qinglang Miao [Thu, 17 Sep 2020 12:45:07 +0000 (20:45 +0800)]
net: hsr: Convert to DEFINE_SHOW_ATTRIBUTE
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Fri, 18 Sep 2020 00:01:38 +0000 (17:01 -0700)]
Merge branch 'mlxsw-Support-dcbnl_setbuffer-dcbnl_getbuffer'
Ido Schimmel says:
====================
mlxsw: Support dcbnl_setbuffer, dcbnl_getbuffer
Petr says:
On Spectrum, port buffers, also called port headroom, is where packets are
stored while they are parsed and the forwarding decision is being made. For
lossless traffic flows, in case shared buffer admission is not allowed,
headroom is also where to put the extra traffic received before the sent
PAUSE takes effect.
Linux supports two DCB interfaces related to the headroom: dcbnl_setbuffer
for configuration, and dcbnl_getbuffer for inspection. This patch set
implements them.
With dcbnl_setbuffer in place, there will be two sources of authority over
the ingress configuration: the DCB ETS hook, because ETS configuration is
mirrored to ingress, and the DCB setbuffer hook. mlxsw is in a similar
situation on the egress side, where there are two sources of the ETS
configuration: the DCB ETS hook, and the TC qdisc hooks. This is a
non-intuitive situation, because the way the ASIC ends up being configured
depends not only on the actual configured bits, but also on the order in
which they were configured.
To prevent these issues on the ingress side, two configuration modes will
exist: DCB mode and TC mode. DCB ETS will keep getting projected to ingress
in the (default) DCB mode. When a qdisc is installed on a port, it will be
switched to the TC mode, the ingress configuration will be done through the
dcbnl_setbuffer callback. The reason is that the dcbnl_setbuffer hook is
not standardized and supported by lldpad. Projecting DCB ETS configuration
to ingress is a reasonable heuristic to configure ingress especially when
PFC is in effect.
In patch #1, the toggle between the DCB and TC modes of headroom
configuration, described above, is introduced.
Patch #2 implements dcbnl_getbuffer and dcbnl_setbuffer. dcbnl_getbuffer
can be always used to determine the current port headroom configuration.
dcbnl_setbuffer is only permitted in the TC mode.
In patch #3, make the qdisc module toggle the headroom mode from DCB to TC
and back, depending on whether there is an offloaded qdisc on the port.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Petr Machata [Thu, 17 Sep 2020 06:49:03 +0000 (09:49 +0300)]
mlxsw: spectrum_qdisc: Disable port buffer autoresize with qdiscs
There are two interfaces to configure ETS: qdiscs and DCB. Historically,
DCB ETS configuration was projected to ingress as well, and configured port
buffers. Qdisc was not.
Keep qdiscs behaving this way, and if an offloaded qdisc is configured on a
port, move this port's headroom to a manual mode, thus allowing
configuration of port buffers through dcbnl_setbuffer.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Petr Machata [Thu, 17 Sep 2020 06:49:02 +0000 (09:49 +0300)]
mlxsw: spectrum_dcb: Implement dcbnl_setbuffer / getbuffer
Add dcbnl_setbuffer, which bounces requests if a headroom is in DCB mode.
Implement dcbnl_getbuffer such that it can always be used to determine
port-buffer configuration, regardless of headroom mode.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Petr Machata [Thu, 17 Sep 2020 06:49:01 +0000 (09:49 +0300)]
mlxsw: spectrum_buffers: Support two headroom modes
There are two interfaces to configure ETS: qdiscs and DCB. Historically,
DCB ETS configuration was projected to ingress as well, and configured port
buffers. Qdisc was not.
So as not to break clients that today use DCB ETS and PFC and rely on
getting a reasonable ingress buffer priomap, keep the ETS mirroring in
effect.
Since qdiscs have not done this mirroring historically, it is reasonable
not to introduce it, but rather permit manual ingress configuration through
dcbnl_setbuffer only in the qdisc mode.
This will require a toggle to indicate whether buffer sizes should be
autocomputed or taken from dcbnl_setbuffer, and likewise for priomaps.
Introduce such and initialize it, and guard port buffer size configuration
as appropriate. The toggle is currently left in the DCB position. In a
following patch, qdisc code will switch it.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Yang Yingliang [Thu, 17 Sep 2020 03:32:23 +0000 (11:32 +0800)]
netlink: add spaces around '&' in netlink_recv/sendmsg()
It's hard to read the code without spaces around '&',
for better reading, add spaces around '&'.
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
YueHaibing [Thu, 17 Sep 2020 02:19:10 +0000 (10:19 +0800)]
netdev: Remove unused functions
There is no callers in tree, so can remove it.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ye Bin [Thu, 17 Sep 2020 01:12:33 +0000 (09:12 +0800)]
mptcp: Fix unsigned 'max_seq' compared with zero in mptcp_data_queue_ofo
Fixes coccicheck warnig:
net/mptcp/protocol.c:164:11-18: WARNING: Unsigned expression compared with zero: max_seq > 0
Fixes:
ab174ad8ef76 ("mptcp: move ooo skbs into msk out of order queue")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Thu, 17 Sep 2020 23:35:47 +0000 (16:35 -0700)]
Merge branch 'net-marvell-prestera-Add-Switchdev-driver-for-Prestera-family-ASIC-device-98DX3255-AC3x'
Vadym Kochan says:
====================
net: marvell: prestera: Add Switchdev driver for Prestera family ASIC device 98DX3255 (AC3x)
Marvell Prestera 98DX3255 integrates up to 24 ports of 1GbE with 8
ports of 10GbE uplinks or 2 ports of 40Gbps stacking for a largely
wireless SMB deployment.
Prestera Switchdev is a firmware based driver that operates via PCI bus. The
current implementation supports only boards designed for the Marvell Switchdev
solution and requires special firmware.
This driver implementation includes only L1, basic L2 support, and RX/TX.
The core Prestera switching logic is implemented in prestera_main.c, there is
an intermediate hw layer between core logic and firmware. It is
implemented in prestera_hw.c, the purpose of it is to encapsulate hw
related logic, in future there is a plan to support more devices with
different HW related configurations.
The following Switchdev features are supported:
- VLAN-aware bridge offloading
- VLAN-unaware bridge offloading
- FDB offloading (learning, ageing)
- Switchport configuration
The original firmware image is uploaded to the linux-firmware repository.
PATCH v9:
1) Replace read_poll_timeout_atomic() by original 'do {} while()' loop
because it works much better than read_poll_timeout_atomic()
considering the TX rate. Also it fixes warning reported on v8.
2) Use ENOENT instead of EEXIST when item is not found in few
places - prestera_hw.c and prestera_rxtx.c
Patches updated:
[1] net: marvell: prestera: Add driver for Prestera family ASIC devices
PATCH v8:
1) Put license in one line.
2) Sort includes.
3) Add missing comma for last enum member
4) Return original error code from last called func
in places where instead other error code was used.
5) Add comma for last member in initialized struct in prestera_hw.c
6) Do not initialize 'int err = 0' where it is not needed.
7) Simplify device-tree "marvell,prestera" node parsing by removing not
needed checking on 'np == NULL'.
8) Use u32p_replace_bits() instead of open-coded ((word & ~mask) | val)
9) Use dev_warn_ratelimited() instead of pr_warn_ratelimited to indicate the device
instance in prestera_rxtx.c
10) Simplify circular buffer list creation in prestera_sdma_{rx,tx}_init() by using
do { } while (prev != tail) construction.
11) Use MSEC_PER_SEC instead of hard-coded 1000.
12) Use traditional error handling pattern:
err = F();
if (err)
return err;
13) Use ether_addr_copy() instead of memcpy() for mac FDB copying in prestera_hw.c
14) Drop swdev->ageing_time member which is not used.
15) Fix ageing macro to be in ms instead of seconds.
Patches updated:
[1] net: marvell: prestera: Add driver for Prestera family ASIC devices
[2] net: marvell: prestera: Add PCI interface support
[3] net: marvell: prestera: Add basic devlink support
[4] net: marvell: prestera: Add ethtool interface support
[5] net: marvell: prestera: Add Switchdev driver implementation
PATCH v7:
1) Use ether_addr_copy() in prestera_main.c:prestera_port_set_mac_address()
instead of memcpy().
2) Removed not needed device's DMA address range check on
dma_pool_alloc() in prestera_rxtx.c:prestera_sdma_buf_init(),
this should be handled by dma_xxx() API considerig device's DMA mask.
3) Removed not needed device's DMA address range check on
dma_map_single() in prestera_rxtx.c:prestera_sdma_rx_skb_alloc(),
this should be handled by dma_xxx() API considerig device's DMA mask.
4) Add comment about port mac address limitation in the code where
it is used and checked - prestera_main.c:
- prestera_is_valid_mac_addr()
- prestera_port_create()
5) Add missing destroy_workqueue(swdev_wq) in prestera_switchdev.c:prestera_switchdev_init()
on error path handling.
Patches updated:
[1] net: marvell: prestera: Add driver for Prestera family ASIC devices
[5] net: marvell: prestera: Add Switchdev driver implementation
PATCH v6:
1) Use rwlock to protect port list on create/delete stages. The list
is mostly readable by fw event handler or packets receiver, but
updated only on create/delete port which are performed on switch init/fini
stages.
2) Remove not needed variable initialization in prestera_dsa.c:prestera_dsa_parse()
3) Get rid of bounce buffer used by tx handler in prestera_rxtx.c,
the bounce buffer should be handled by dma_xxx API via swiotlb.
4) Fix PRESTERA_SDMA_RX_DESC_PKT_LEN macro by using correct GENMASK(13, 0) in prestera_rxtx.c
Patches updated:
[1] net: marvell: prestera: Add driver for Prestera family ASIC devices
PATCH v5:
0) add Co-developed tags for people who was involved in development.
1) Make SPDX license as separate comment
2) Change 'u8 *' -> 'void *', It allows to avoid not-needed u8* casting.
3) Remove "," in terminated enum's.
4) Use GENMASK(end, start) where it is applicable in.
5) Remove not-needed 'u8 *' casting.
6) Apply common error-check pattern
7) Use ether_addr_copy instead of memcpy
8) Use define for maximum MAC address range (255)
9) Simplify prestera_port_state_set() in prestera_main.c by
using separate if-blocks for state setting:
if (is_up) {
...
} else {
...
}
which makes logic more understandable.
10) Simplify sdma tx wait logic when checking/updating tx_ring->burst.
11) Remove not-needed packed & aligned attributes
12) Use USEC_PER_MSEC as multiplier when converting ms -> usec on calling
readl_poll_timeout.
13) Simplified some error path handling by simple return error code in.
14) Remove not-needed err assignment in.
15) Use dev_err() in prestera_devlink_register(...).
Patches updated:
[1] net: marvell: prestera: Add driver for Prestera family ASIC devices
[2] net: marvell: prestera: Add PCI interface support
[3] net: marvell: prestera: Add basic devlink support
[4] net: marvell: prestera: Add ethtool interface support
[5] net: marvell: prestera: Add Switchdev driver implementation
PATCH v4:
1) Use prestera_ prefix in netdev_ops variable.
2) Kconfig: use 'default PRESTERA' build type for CONFIG_PRESTERA_PCI to be
synced by default with prestera core module.
3) Use memcpy_xxio helpers in prestera_pci.c for IO buffer copying.
4) Generate fw image path via snprintf() instead of macroses.
5) Use pcim_ helpers in prestera_pci.c which simplified the
probe/remove logic.
6) Removed not needed initializations of variables which are used in
readl_poll_xxx() helpers.
7) Fixed few grammar mistakes in patch[2] description.
8) Export only prestera_ethtool_ops struct instead of each
ethtool handler.
9) Add check for prestera_dev_check() in switchdev event handling to
make sure there is no wrong topology.
Patches updated:
[1] net: marvell: prestera: Add driver for Prestera family ASIC devices
[2] net: marvell: prestera: Add PCI interface support
[4] net: marvell: prestera: Add ethtool interface support
[5] net: marvell: prestera: Add Switchdev driver implementation
PATCH v3:
1) Simplify __be32 type casting in prestera_dsa.c
2) Added per-patch changelog under "---" line.
PATCH v2:
1) Use devlink_port_type_clear()
2) Add _MS prefix to timeout defines.
3) Remove not-needed packed attribute from the firmware ipc structs,
also the firmware image needs to be uploaded too (will do it soon).
4) Introduce prestera_hw_switch_fini(), to be mirrored with init and
do simple validation if the event handlers are unregistered.
5) Use kfree_rcu() for event handler unregistering.
6) Get rid of rcu-list usage when dealing with ports, not needed for
now.
7) Little spelling corrections in the error/info messages.
8) Make pci probe & remove logic mirrored.
9) Get rid of ETH_FCS_LEN in headroom setting, not needed.
PATCH:
1) Fixed W=1 warnings
2) Renamed PCI driver name to be more generic "Prestera DX" because
there will be more devices supported.
3) Changed firmware image dir path: marvell/ -> mrvl/prestera/
to be aligned with location in linux-firmware.git (if such
will be accepted).
RFC v3:
1) Fix prestera prefix in prestera_rxtx.c
2) Protect concurrent access from multiple ports on multiple CPU system
on tx path by spinlock in prestera_rxtx.c
3) Try to get base mac address from device-tree, otherwise use a random generated one.
4) Move ethtool interface support into separate prestera_ethtool.c file.
5) Add basic devlink support and get rid of physical port naming ops.
6) Add STP support in Switchdev driver.
7) Removed MODULE_AUTHOR
8) Renamed prestera.c -> prestera_main.c, and kernel module to
prestera.ko
RFC v2:
1) Use "pestera_" prefix in struct's and functions instead of mvsw_pr_
2) Original series split into additional patches for Switchdev ethtool support.
3) Use major and minor firmware version numbers in the firmware image filename.
4) Removed not needed prints.
5) Use iopoll API for waiting on register's value in prestera_pci.c
6) Use standart approach for describing PCI ID matching section instead of using
custom wrappers in prestera_pci.c
7) Add RX/TX support in prestera_rxtx.c.
8) Rewritten prestera_switchdev.c with following changes:
- handle netdev events from prestera.c
- use struct prestera_bridge for bridge objects, and get rid of
struct prestera_bridge_device which may confuse.
- use refcount_t
9) Get rid of macro usage for sending fw requests in prestera_hw.c
10) Add base_mac setting as module parameter. base_mac is required for
generation default port's mac.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Vadym Kochan [Wed, 16 Sep 2020 16:31:02 +0000 (19:31 +0300)]
dt-bindings: marvell,prestera: Add description for device-tree bindings
Add brief description how to configure base mac address binding in
device-tree.
Describe requirement for the PCI port which is connected to the ASIC, to
allow access to the firmware related registers.
Signed-off-by: Vadym Kochan <vadym.kochan@plvision.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vadym Kochan [Wed, 16 Sep 2020 16:31:01 +0000 (19:31 +0300)]
net: marvell: prestera: Add Switchdev driver implementation
The following features are supported:
- VLAN-aware bridge offloading
- VLAN-unaware bridge offloading
- FDB offloading (learning, ageing)
- Switchport configuration
Currently there are some limitations like:
- Only 1 VLAN-aware bridge instance supported
- FDB ageing timeout parameter is set globally per device
Co-developed-by: Serhiy Boiko <serhiy.boiko@plvision.eu>
Signed-off-by: Serhiy Boiko <serhiy.boiko@plvision.eu>
Co-developed-by: Serhiy Pshyk <serhiy.pshyk@plvision.eu>
Signed-off-by: Serhiy Pshyk <serhiy.pshyk@plvision.eu>
Co-developed-by: Taras Chornyi <taras.chornyi@plvision.eu>
Signed-off-by: Taras Chornyi <taras.chornyi@plvision.eu>
Signed-off-by: Vadym Kochan <vadym.kochan@plvision.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vadym Kochan [Wed, 16 Sep 2020 16:31:00 +0000 (19:31 +0300)]
net: marvell: prestera: Add ethtool interface support
The ethtool API provides support for the configuration of the following
features: speed and duplex, auto-negotiation, MDI-x, forward error
correction, port media type. The API also provides information about the
port status, hardware and software statistic. The following limitation
exists:
- port media type should be configured before speed setting
- ethtool -m option is not supported
- ethtool -p option is not supported
- ethtool -r option is supported for RJ45 port only
- the following combination of parameters is not supported:
ethtool -s sw1pX port XX autoneg on
- forward error correction feature is supported only on SFP ports, 10G
speed
- auto-negotiation and MDI-x features are not supported on
Copper-to-Fiber SFP module
Co-developed-by: Andrii Savka <andrii.savka@plvision.eu>
Signed-off-by: Andrii Savka <andrii.savka@plvision.eu>
Co-developed-by: Serhiy Boiko <serhiy.boiko@plvision.eu>
Signed-off-by: Serhiy Boiko <serhiy.boiko@plvision.eu>
Signed-off-by: Vadym Kochan <vadym.kochan@plvision.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vadym Kochan [Wed, 16 Sep 2020 16:30:59 +0000 (19:30 +0300)]
net: marvell: prestera: Add basic devlink support
Add very basic support for devlink interface:
- driver name
- fw version
- devlink ports
Signed-off-by: Vadym Kochan <vadym.kochan@plvision.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vadym Kochan [Wed, 16 Sep 2020 16:30:58 +0000 (19:30 +0300)]
net: marvell: prestera: Add PCI interface support
Add PCI interface driver for Prestera Switch ASICs family devices, which
provides:
- Firmware loading mechanism
- Requests & events handling to/from the firmware
- Access to the firmware on the bus level
The firmware has to be loaded each time the device is reset. The driver
is loading it from:
/lib/firmware/mrvl/prestera/mvsw_prestera_fw-v{MAJOR}.{MINOR}.img
The full firmware image version is located within the internal header
and consists of 3 numbers - MAJOR.MINOR.PATCH. Additionally, driver has
hard-coded minimum supported firmware version which it can work with:
MAJOR - reflects the support on ABI level between driver and loaded
firmware, this number should be the same for driver and loaded
firmware.
MINOR - this is the minimum supported version between driver and the
firmware.
PATCH - indicates only fixes, firmware ABI is not changed.
Firmware image file name contains only MAJOR and MINOR numbers to make
driver be compatible with any PATCH version.
Co-developed-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
Signed-off-by: Vadym Kochan <vadym.kochan@plvision.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vadym Kochan [Wed, 16 Sep 2020 16:30:57 +0000 (19:30 +0300)]
net: marvell: prestera: Add driver for Prestera family ASIC devices
Marvell Prestera 98DX326x integrates up to 24 ports of 1GbE with 8
ports of 10GbE uplinks or 2 ports of 40Gbps stacking for a largely
wireless SMB deployment.
The current implementation supports only boards designed for the Marvell
Switchdev solution and requires special firmware.
The core Prestera switching logic is implemented in prestera_main.c,
there is an intermediate hw layer between core logic and firmware. It is
implemented in prestera_hw.c, the purpose of it is to encapsulate hw
related logic, in future there is a plan to support more devices with
different HW related configurations.
This patch contains only basic switch initialization and RX/TX support
over SDMA mechanism.
Currently supported devices have DMA access range <= 32bit and require
ZONE_DMA to be enabled, for such cases SDMA driver checks if the skb
allocated in proper range supported by the Prestera device.
Also meanwhile there is no TX interrupt support in current firmware
version so recycling work is scheduled on each xmit.
Port's mac address is generated from the switch base mac which may be
provided via device-tree (static one or as nvme cell), or randomly
generated. This is required by the firmware.
Co-developed-by: Andrii Savka <andrii.savka@plvision.eu>
Signed-off-by: Andrii Savka <andrii.savka@plvision.eu>
Co-developed-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
Co-developed-by: Serhiy Boiko <serhiy.boiko@plvision.eu>
Signed-off-by: Serhiy Boiko <serhiy.boiko@plvision.eu>
Co-developed-by: Serhiy Pshyk <serhiy.pshyk@plvision.eu>
Signed-off-by: Serhiy Pshyk <serhiy.pshyk@plvision.eu>
Co-developed-by: Taras Chornyi <taras.chornyi@plvision.eu>
Signed-off-by: Taras Chornyi <taras.chornyi@plvision.eu>
Co-developed-by: Volodymyr Mytnyk <volodymyr.mytnyk@plvision.eu>
Signed-off-by: Volodymyr Mytnyk <volodymyr.mytnyk@plvision.eu>
Signed-off-by: Vadym Kochan <vadym.kochan@plvision.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
YueHaibing [Wed, 16 Sep 2020 14:17:28 +0000 (22:17 +0800)]
genetlink: Remove unused function genl_err_attr()
It is never used, so can remove it.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
YueHaibing [Wed, 16 Sep 2020 14:16:29 +0000 (22:16 +0800)]
net/sched: Remove unused function qdisc_queue_drop_head()
It is not used since commit
a09ceb0e0814 ("sched: remove qdisc->drop")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Matthieu Baerts [Wed, 16 Sep 2020 13:13:51 +0000 (15:13 +0200)]
selftests: mptcp: interpret \n as a new line
In case of errors, this message was printed:
(...)
# read: Resource temporarily unavailable
# client exit code 0, server 3
# \nnetns ns1-0-BJlt5D socket stat for 10003:
(...)
Obviously, the idea was to add a new line before the socket stat and not
print "\nnetns".
Fixes:
b08fbf241064 ("selftests: add test-cases for MPTCP MP_JOIN")
Fixes:
048d19d444be ("mptcp: add basic kselftest for mptcp")
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Xie He [Wed, 16 Sep 2020 12:23:08 +0000 (05:23 -0700)]
net/packet: Fix a comment about mac_header
1. Change all "dev->hard_header" to "dev->header_ops"
2. On receiving incoming frames when header_ops == NULL:
The comment only says what is wrong, but doesn't say what is right.
This patch changes the comment to make it clear what is right.
3. On transmitting and receiving outgoing frames when header_ops == NULL:
The comment explains that the LL header will be later added by the driver.
However, I think it's better to simply say that the LL header is invisible
to us. This phrasing is better from a software engineering perspective,
because this makes it clear that what happens in the driver should be
hidden from us and we should not care about what happens internally in the
driver.
4. On resuming the LL header (for RAW frames) when header_ops == NULL:
The comment says we are "unlikely" to restore the LL header.
However, we should say that we are "unable" to restore it.
It's not possible (rather than not likely) to restore it, because:
1) There is no way for us to restore because the LL header internally
processed by the driver should be invisible to us.
2) In function packet_rcv and tpacket_rcv, the code only tries to restore
the LL header when header_ops != NULL.
Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Signed-off-by: Xie He <xie.he.0141@gmail.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Thu, 17 Sep 2020 23:14:28 +0000 (16:14 -0700)]
Merge branch 'net-hns3-updates-for-next'
Huazhong Tan says:
====================
net: hns3: updates for -next
There are some optimizations related to IO path.
Change since V1:
- fixes a unsuitable handling in hns3_lb_clear_tx_ring() of #6 which
pointed out by Saeed Mahameed.
previous version:
V1: https://patchwork.ozlabs.org/project/netdev/cover/
1600085217-26245-1-git-send-email-tanhuazhong@huawei.com/
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Yunsheng Lin [Wed, 16 Sep 2020 09:33:50 +0000 (17:33 +0800)]
net: hns3: use napi_consume_skb() when cleaning tx desc
Use napi_consume_skb() to batch consuming skb when cleaning
tx desc in NAPI polling.
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Yunsheng Lin [Wed, 16 Sep 2020 09:33:49 +0000 (17:33 +0800)]
net: hns3: use writel() to optimize the barrier operation
writel() can be used to order I/O vs memory by default when
writing portable drivers. Use writel() to replace wmb() +
writel_relaxed(), and writel() is dma_wmb() + writel_relaxed()
for ARM64, so there is an optimization here because dma_wmb()
is a lighter barrier than wmb().
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Yunsheng Lin [Wed, 16 Sep 2020 09:33:48 +0000 (17:33 +0800)]
net: hns3: optimize the rx clean process
Currently HNS3_RING_RX_RING_FBDNUM_REG register is read to determine
how many rx desc can be cleaned. To avoid the register read operation
in the critical data path, use the valid bit in the rx desc to determine
if a specific rx desc can be cleaned.
The hns3 driver clear valid bit in the rx desc before notifying the
rx desc to the hw, and hw will only set the valid bit of the rx desc
after corresponding buffer is filled with packet data and other field
in the rx desc is set accordingly.
Add hns3_rx_ring_move_fw() function to clear the valid bit in the rx
desc before moving rx ring's next_to_clean forward to avoid double
cleaning a rx desc, also add a dma_rmb() barrier in hns3_handle_rx_bd()
to make sure valid bit is set before reading other field in the rx desc.
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Yunsheng Lin [Wed, 16 Sep 2020 09:33:47 +0000 (17:33 +0800)]
net: hns3: optimize the tx clean process
Currently HNS3_RING_TX_RING_HEAD_REG register is read to determine
how many tx desc can be cleaned. To avoid the register read operation
in the critical data path, use the valid bit in the tx desc to determine
if a specific tx desc can be cleaned.
The hns3 driver sets valid bit in the tx desc before ringing a doorbell
to the hw, and hw will only clear the valid bit of the tx desc after
corresponding packet is sent out to the wire. And because next_to_use
for tx ring is a changing variable when the driver is filling the tx
desc, so reuse the pull_len for rx ring to record the tx desc that has
notified to the hw, so that hns3_nic_reclaim_desc() can decide how many
tx desc's valid bit need checking when reclaiming tx desc.
And io_err_cnt stat is also removed for it is not used anymore.
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Yunsheng Lin [Wed, 16 Sep 2020 09:33:46 +0000 (17:33 +0800)]
net: hns3: batch tx doorbell operation
Use netdev_xmit_more() to defer the tx doorbell operation when
the skb is passed to the driver continuously. By doing this we
can improve the overall xmit performance by avoid some doorbell
operations.
Also, the tx_err_cnt stat is not used, so rename it to tx_more
stat.
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Yunsheng Lin [Wed, 16 Sep 2020 09:33:45 +0000 (17:33 +0800)]
net: hns3: batch the page reference count updates
Batch the page reference count updates instead of doing them
one at a time. By doing this we can improve the overall receive
performance by avoid some atomic increment operations when the
rx page is reused.
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Liu Shixin [Wed, 16 Sep 2020 02:50:18 +0000 (10:50 +0800)]
cxgb4vf: convert to use DEFINE_SEQ_ATTRIBUTE macro
Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code.
Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Shannon Nelson [Tue, 15 Sep 2020 23:59:03 +0000 (16:59 -0700)]
ionic: dynamic interrupt moderation
Use the dim library to manage dynamic interrupt
moderation in ionic.
v3: rebase
v2: untangled declarations in ionic_dim_work()
Signed-off-by: Shannon Nelson <snelson@pensando.io>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Karsten Graul [Tue, 15 Sep 2020 20:57:09 +0000 (22:57 +0200)]
net/smc: check variable before dereferencing in smc_close.c
smc->clcsock and smc->clcsock->sk are used before the check if they can
be dereferenced. Fix this by checking the variables first.
Fixes:
a60a2b1e0af1 ("net/smc: reduce active tcp_listen workers")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Nikolay Aleksandrov [Tue, 15 Sep 2020 14:57:24 +0000 (17:57 +0300)]
net: bridge: mcast: don't ignore return value of __grp_src_toex_excl
When we're handling TO_EXCLUDE report in EXCLUDE filter mode we should
not ignore the return value of __grp_src_toex_excl() as we'll miss
sending notifications about group changes.
Fixes:
5bf1e00b6849 ("net: bridge: mcast: support for IGMPV3/MLDv2 CHANGE_TO_INCLUDE/EXCLUDE report")
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Song, Yoong Siang [Wed, 16 Sep 2020 07:40:20 +0000 (15:40 +0800)]
net: stmmac: Add support to Ethtool get/set ring parameters
This patch add support to --show-ring & --set-ring Ethtool functions:
- Adding min, max, power of two check to new ring parameter's value.
- Bring down the network interface before changing the value of ring
parameters.
- Bring up the network interface after changing the value of ring
parameters.
Signed-off-by: Song, Yoong Siang <yoong.siang.song@intel.com>
Signed-off-by: Voon Weifeng <weifeng.voon@intel.com>
Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Wed, 16 Sep 2020 22:19:30 +0000 (15:19 -0700)]
Merge branch 'mlxsw-Refactor-headroom-management'
Ido Schimmel says:
====================
mlxsw: Refactor headroom management
Petr says:
On Spectrum, port buffers, also called port headroom, is where packets are
stored while they are parsed and the forwarding decision is being made. For
lossless traffic flows, in case shared buffer admission is not allowed,
headroom is also where to put the extra traffic received before the sent
PAUSE takes effect. Another aspect of the port headroom is the so called
internal buffer, which is used for egress mirroring.
Linux supports two DCB interfaces related to the headroom: dcbnl_setbuffer
for configuration, and dcbnl_getbuffer for inspection. In order to make it
possible to implement these interfaces, it is first necessary to clean up
headroom handling, which is currently strewn in several places in the
driver.
The end goal is an architecture whereby it is possible to take a copy of
the current configuration, adjust parameters, and then hand the proposed
configuration over to the system to implement it. When everything works,
the proposed configuration is accepted and saved. First, this centralizes
the reconfiguration handling to one function, which takes care of
coordinating buffer size changes and priority map changes to avoid
introducing drops. Second, the fact that the configuration is all in one
place makes it easy to keep a backup and handle error path rollbacks, which
were previously hard to understand.
Patch #1 introduces struct mlxsw_sp_hdroom, which will keep port headroom
configuration.
Patch #2 unifies handling of delay provision between PFC and PAUSE. From
now on, delay is to be measured in bytes of extra space, and will not
include MTU. PFC handler sets the delay directly from the parameter it gets
through the DCB interface. For PAUSE, MLXSW_SP_PAUSE_DELAY is converted to
have the same meaning.
In patches #3-#5, MTU, lossiness and priorities are gradually moved over to
struct mlxsw_sp_hdroom.
In patches #6-#11, handling of buffer resizing and priority maps is moved
from spectrum.c and spectrum_dcb.c to spectrum_buffers.c. The API is
gradually adapted so that struct mlxsw_sp_hdroom becomes the main interface
through which the various clients express how the headroom should be
configured.
Patch #12 is a small cleanup that the previous transformation made
possible.
In patch #13, the port init code becomes a boring client of the headroom
code, instead of rolling its own thing.
Patches #14 and #15 move handling of internal mirroring buffer to the new
headroom code as well. Previously, this code was in the SPAN module. This
patchset converts the SPAN module to another boring client of the headroom
code.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Petr Machata [Wed, 16 Sep 2020 06:35:28 +0000 (09:35 +0300)]
mlxsw: spectrum_buffers: Manage internal buffer in the hdroom code
Traffic mirroring modes that are in-chip implemented on egress need an
internal buffer to work. As the only client, the SPAN module was managing
the buffer so far. However logically it belongs to the buffers module. E.g.
buffer size validation needs to take the size of the internal buffer into
account.
Therefore move the related code from SPAN to spectrum_buffers. Move over
the callbacks that determine the minimum buffer size as a function of
maximum speed and MTU. Add a field describing the internal buffer to struct
mlxsw_sp_hdroom. Extend mlxsw_sp_hdroom_bufs_reset_sizes() to take care of
sizing the internal buffer as well. Change the SPAN module to invoke that
function and mlxsw_sp_hdroom_configure() like all the other hdroom clients.
Drop the now-unnecessary mlxsw_sp_span_port_buffer_disable().
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Petr Machata [Wed, 16 Sep 2020 06:35:27 +0000 (09:35 +0300)]
mlxsw: spectrum_buffers: Introduce shared buffer ops
The size of the internal buffer is currently calculated in the SPAN module.
Logically it belongs to the spectrum_buffers module, where it should be
moved. However, that being a chip-specific operation, it needs dynamic
dispatch. There currently is a chip-specific structure for description of
shared buffer values, struct mlxsw_sp_sb_vals. However placing ops into
this structure would be confusing. Therefore introduce a new per-chip
structure, currently empty, and initialize the ops pointer as appropriate.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Petr Machata [Wed, 16 Sep 2020 06:35:26 +0000 (09:35 +0300)]
mlxsw: spectrum_buffers: Convert mlxsw_sp_port_headroom_init()
Currently mlxsw_sp_port_headroom_init() configures both priomap and buffers
by hand. Additionally, for port buffers, it configures buffer 0 with a size
that it will never again have if PFC configuration is touched.
Rewrite the init code to become a client of the new hdroom code. The only
difference in invocation is that the configuration is forced, so that it is
issued even if the desired configuration happens to match what is contained
in (hitherto not initialized with meaningful values) mlxsw_sp_port->hdroom.
Since now mlxsw_sp_port_headroom_init() initializes all the PG buffers to
meaningful values, mlxsw_sp_hdroom_configure_buffers() can avoid querying
the current configuration, and can fill the whole PBMC itself.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Petr Machata [Wed, 16 Sep 2020 06:35:25 +0000 (09:35 +0300)]
mlxsw: spectrum_buffers: Inline mlxsw_sp_sb_max_headroom_cells()
This function is now only used from the buffers module, and is a trivial
field reference. Just inline it and drop the related artifacts.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Petr Machata [Wed, 16 Sep 2020 06:35:24 +0000 (09:35 +0300)]
mlxsw: spectrum_buffers: Move here the new headroom code
Move all the headroom code to the spectrum_buffers module, where it
belongs.
Rename mlxsw_sp_pg_buf_threshold_get() and mlxsw_sp_pg_buf_pack() to
..._hdroom_... to match the naming convention of the new headroom code.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Petr Machata [Wed, 16 Sep 2020 06:35:23 +0000 (09:35 +0300)]
mlxsw: spectrum: Move here the three-step headroom configuration from DCB
The ETS handler performs the headroom configuration in three steps: first
it resizes the buffers and adds any new ones. Then it redirects priorities
to the new buffers. And finally it sets the size of the now-unused buffers
to zero. This way no packet drops are introduced.
This sort of careful approach will also be useful for configuring port
buffer sizes and priority map by hand, through dcbnl_setbuffer. Therefore
move the code from the DCB handler to the generic headroom function.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Petr Machata [Wed, 16 Sep 2020 06:35:22 +0000 (09:35 +0300)]
mlxsw: spectrum_dcb: Convert mlxsw_sp_port_pg_prio_map() to hdroom code
The new hdroom code has certain conventions: iteration over priorities is
done through a variable named `prio', configuration is not pushed unless it
is dirty, but a `force' flag can be used to override this, updated
configuration is written to port. Convert the function
mlxsw_sp_port_pg_prio_map() to use these conventions and rename
appropriately to fit in.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Petr Machata [Wed, 16 Sep 2020 06:35:21 +0000 (09:35 +0300)]
mlxsw: spectrum_dcb: Convert ETS handler fully to mlxsw_sp_hdroom_configure()
The ETS handler performs the headroom configuration in three steps: first
it resizes the buffers and adds any new ones. Then it redirects priorities
to the new buffers. And finally it sets the size of the now-unused buffers
to zero. This way no packet drops are introduced.
Both of the buffer size configuration operations are simply buffer size
configurations, there is no material difference between setting buffers to
zero and any other value. Therefore simply invoke the same
mlxsw_sp_hdroom_configure(), and drop mlxsw_sp_port_pg_destroy() and
mlxsw_sp_ets_has_pg() which are now unused.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Petr Machata [Wed, 16 Sep 2020 06:35:20 +0000 (09:35 +0300)]
mlxsw: spectrum: Split headroom autoresize out of buffer configuration
Split mlxsw_sp_port_headroom_set() to three functions.
mlxsw_sp_hdroom_bufs_reset_sizes() changes the sizes of the individual PG
buffers, and mlxsw_sp_hdroom_configure_buffers() will actually apply the
configuration. A third function, mlxsw_sp_hdroom_bufs_fit(), verifies that
the requested buffer configuration matches total headroom size
requirements.
Add wrappers, mlxsw_sp_hdroom_configure() and __..., that will eventually
perform full headroom configuration, but for now, only have them verify the
configured headroom size, and invoke mlxsw_sp_hdroom_configure_buffers().
Have them take the `force` argument to prepare for a later patch, even
though it is currently unused.
Note that the loop in mlxsw_sp_hdroom_configure_buffers() only goes through
DCBX_MAX_BUFFERS. Since there is no logic to configure the control buffer,
it needs to keep the values queried from the FW. Eventually this function
should configure all the PGs.
Note that conversion of __mlxsw_sp_dcbnl_ieee_setets() is not trivial. That
function performs the headroom configuration in three steps: first it
resizes the buffers and adds any new ones. Then it redirects priorities to
the new buffers. And finally it sets the size of the now-unused buffers to
zero. This way no packet drops are introduced.
So after invoking mlxsw_sp_hdroom_bufs_reset_sizes(), tweak the
configuration to keep the old sizes of PG buffers for those buffers whose
size was set to zero.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Petr Machata [Wed, 16 Sep 2020 06:35:19 +0000 (09:35 +0300)]
mlxsw: spectrum: Track buffer sizes in struct mlxsw_sp_hdroom
So far, port buffers were always autoconfigured. When dcbnl_setbuffer
callback is implemented, it will allow the user to change the buffer size
configuration by hand. The sizes therefore need to be a configuration
parameter, not always deduced, and therefore belong to struct
mlxsw_sp_hdroom, where the configuration routine should take them from.
Update mlxsw_sp_port_headroom_set() to update these sizes. Have the
function update the sizes even for the case that a given buffer is not
used.
Additionally, change the loop iteration end to DCBX_MAX_BUFFERS instead of
IEEE_8021QAZ_MAX_TCS. The value is the same, but the semantics differ.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Petr Machata [Wed, 16 Sep 2020 06:35:18 +0000 (09:35 +0300)]
mlxsw: spectrum: Track lossiness in struct mlxsw_sp_hdroom
Client-side configuration has lossiness as an attribute of a priority.
Therefore add a "lossy" attribute to struct mlxsw_sp_hdroom_prio.
To a Spectrum ASIC, lossiness is a feature of a port buffer. Therefore add
struct mlxsw_sp_hdroom_buf, which in the following patches will get more
attributes, but right now only use it to track port buffer lossiness.
Instead of passing around the primary indicators of PFC and pause_en, add a
function mlxsw_sp_hdroom_bufs_reset_lossiness() to compute the buffer
lossiness from the priority map and priority lossiness. Change
mlxsw_sp_port_headroom_set() to take the buffer lossy flag from the
headroom configuration. Have the PFC and pause handlers configure priority
lossiness in mlxsw_sp_hdroom, from where it will propagate.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Petr Machata [Wed, 16 Sep 2020 06:35:17 +0000 (09:35 +0300)]
mlxsw: spectrum: Track priorities in struct mlxsw_sp_hdroom
The mapping from priorities to buffers determines which buffers should be
configured. Lossiness of these priorities combined with the mapping
determines whether a given buffer should be lossy.
Currently this configuration is stored implicitly in DCB ETS, PFC and
ethtool PAUSE configuration. Keeping it together with the rest of the
headroom configuration and deriving it as needed from PFC / ETS / PAUSE
will make things clearer. To that end, add a field "prios" to struct
mlxsw_sp_hdroom.
Previously, __mlxsw_sp_port_headroom_set() took prio_tc as an argument, and
assumed that the same mapping as we use on the egress should be used on
ingress as well. Instead, track this configuration at each priority, so
that it can be adjusted flexibly.
In the following patches, as dcbnl_setbuffer is implemented, it will need
to store its own mapping, and it will also be sometimes necessary to revert
back to the original ETS mapping. Therefore track two buffer indices: the
one for chip configuration (buf_idx), and the source one (ets_buf_idx).
Introduce a function to configure the chip-level buffer index, and for now
have it simply copy the ETS mapping over to the chip mapping.
Update the ETS handler to project prio_tc to the ets_buf_idx and invoke the
buf_idx recomputation.
Now that there is a canonical place to look for this configuration,
mlxsw_sp_port_headroom_set() does not need to invent def_prio_tc to use if
DCB is compiled out.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Petr Machata [Wed, 16 Sep 2020 06:35:16 +0000 (09:35 +0300)]
mlxsw: spectrum: Track MTU in struct mlxsw_sp_hdroom
MTU influences sizes of auto-allocated buffers. Make it a part of port
buffer configuration and have __mlxsw_sp_port_headroom_set() take it from
there, instead of as an argument.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Petr Machata [Wed, 16 Sep 2020 06:35:15 +0000 (09:35 +0300)]
mlxsw: spectrum: Unify delay handling between PFC and pause
When a priority is marked as lossless using DCB PFC, or when pause frames
are enabled on a port, mlxsw adds to port buffers an extra space to cover
the traffic that will arrive between the time that a pause or PFC frame is
emitted, and the time traffic actually stops. This is called the delay. The
concept is the same in PFC and pause, however the way the extra buffer
space is calculated differs.
In this patch, unify this handling. Delay is to be measured in bytes of
extra space, and will not include MTU. PFC handler sets the delay directly
from the parameter it gets through the DCB interface.
To convert pause handler, move MLXSW_SP_PAUSE_DELAY to ethtool module,
convert to bytes, and reduce it by maximum MTU, and divide by two. Then it
has the same meaning as the delay_bytes set by the PFC handler.
Keep the delay_bytes value in struct mlxsw_sp_hdroom introduced in the
previous patch. Change PFC and pause handlers to store the new delay value
there and have __mlxsw_sp_port_headroom_set() take it from there.
Instead of mlxsw_sp_pfc_delay_get() and mlxsw_sp_pg_buf_delay_get(),
introduce mlxsw_sp_hdroom_buf_delay_get() to calculate the delay provision.
Drop the unnecessary MLXSW_SP_CELL_FACTOR, and instead add an explanatory
comment describing the formula used.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Petr Machata [Wed, 16 Sep 2020 06:35:14 +0000 (09:35 +0300)]
mlxsw: spectrum_buffers: Add struct mlxsw_sp_hdroom
The port headroom handling is currently strewn across several modules and
tricky to follow: MTU, DCB PFC, DCB ETS and ethtool pause all influence the
settings, and then there is the completely separate initial configuraion in
spectrum_buffers. A following patch will implement the dcbnl_setbuffer
callback, which is going to further complicate the landscape.
In order to simplify work with port buffers, the following patches are
going to centralize all port-buffer handling in spectrum_buffers. As a
first step, introduce a (currently empty) struct mlxsw_sp_hdroom that will
keep the configuration parameters, and allocate and free it in appropriate
places.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Wed, 16 Sep 2020 22:16:51 +0000 (15:16 -0700)]
Merge tag 'mlx5-updates-2020-09-15' of git://git./linux/kernel/git/saeed/linux
Saeed Mahameed says:
====================
mlx5-updates-2020-09-15
Various updates to mlx5 driver,
1) Eli adds support for TC trap action.
2) Eran, minor improvements to clock.c code structure
3) Better handling of error reporting in LAG from Jianbo
4) IPv6 traffic class (DSCP) header rewrite support from Maor
5) Ofer Levi adds support for CQE compression of multi-strides packets
6) Vu, Enables use of vport meta data by default.
7) Some minor code cleanup
====================
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 15 Sep 2020 23:31:44 +0000 (16:31 -0700)]
Merge branch 'nexthop-Small-changes'
Ido Schimmel says:
====================
nexthop: Small changes
This patch set contains a few small changes that I split out of the RFC
I sent last week [1]. Main change is the conversion of the nexthop
notification chain to a blocking chain so that it could be reused by
device drivers for nexthop objects programming in the future.
Tested with fib_nexthops.sh:
Tests passed: 164
Tests failed: 0
[1] https://lore.kernel.org/netdev/
20200908091037.2709823-1-idosch@idosch.org/
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Ido Schimmel [Tue, 15 Sep 2020 11:41:03 +0000 (14:41 +0300)]
selftests: fib_nexthops: Test cleanup of FDB entries following nexthop deletion
Commit
c7cdbe2efc40 ("vxlan: support for nexthop notifiers") registered
a listener in the VXLAN driver to the nexthop notification chain. Its
purpose is to cleanup FDB entries that use a nexthop that is being
deleted.
Test that such FDB entries are removed when the nexthop group that they
use is deleted. Test that entries are not deleted when a single nexthop
in the group is deleted.
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ido Schimmel [Tue, 15 Sep 2020 11:41:02 +0000 (14:41 +0300)]
nexthop: Only emit a notification when nexthop is actually deleted
Currently, the in-kernel delete notification is emitted from the error
path of nexthop_add() and replace_nexthop(), which can be confusing to
in-kernel listeners as they are not familiar with the nexthop.
Instead, only emit the notification when the nexthop is actually
deleted. The following sub-cases are covered:
1. User space deletes the nexthop
2. The nexthop is deleted by the kernel due to a netdev event (e.g.,
nexthop device going down)
3. A group is deleted because its last nexthop is being deleted
4. The network namespace of the nexthop device is deleted
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ido Schimmel [Tue, 15 Sep 2020 11:41:01 +0000 (14:41 +0300)]
nexthop: Convert to blocking notification chain
Currently, the only listener of the nexthop notification chain is the
VXLAN driver. Subsequent patches will add more listeners (e.g., device
drivers such as netdevsim) that need to be able to block when processing
notifications.
Therefore, convert the notification chain to a blocking one. This is
safe as notifications are always emitted from process context.
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ido Schimmel [Tue, 15 Sep 2020 11:41:00 +0000 (14:41 +0300)]
nexthop: Remove NEXTHOP_EVENT_ADD
Not used anywhere.
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Suggested-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ido Schimmel [Tue, 15 Sep 2020 11:40:59 +0000 (14:40 +0300)]
nexthop: Remove unused function declaration from header file
Not used or implemented anywhere.
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Geert Uytterhoeven [Tue, 15 Sep 2020 09:35:51 +0000 (11:35 +0200)]
chelsio/chtls: Re-add dependencies on CHELSIO_T4 to fix modular CHELSIO_T4
As CHELSIO_INLINE_CRYPTO is bool, and CHELSIO_T4 is tristate, the
dependency of CHELSIO_INLINE_CRYPTO on CHELSIO_T4 is not sufficient to
protect CRYPTO_DEV_CHELSIO_TLS and CHELSIO_IPSEC_INLINE. The latter two
are also tristate, hence if CHELSIO_T4=n, they cannot be builtin, as
that would lead to link failures like:
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_main.c:259: undefined reference to `cxgb4_port_viid'
and
drivers/net/ethernet/chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c:752: undefined reference to `cxgb4_reclaim_completed_tx'
Fix this by re-adding dependencies on CHELSIO_T4 to tristate symbols.
The dependency of CHELSIO_INLINE_CRYPTO on CHELSIO_T4 is kept to avoid
asking the user.
Fixes:
6bd860ac1c2a0ec2 ("chelsio/chtls: CHELSIO_INLINE_CRYPTO should depend on CHELSIO_T4")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 15 Sep 2020 22:57:16 +0000 (15:57 -0700)]
Merge branch 'mlxsw-Introduce-fw_fatal-health-reporter-and-test-cmd-to
-trigger-test-event'
Ido Schimmel says:
====================
mlxsw: Introduce fw_fatal health reporter and test cmd to trigger test event
Jiri says:
This patch set introduces a health reporter for mlxsw that reports FW
fatal events. Alongside that, it introduces a test command that is used
to trigger a dummy FW fatal event by user:
$ sudo devlink health test pci/0000:03:00.0 reporter fw_fatal
$ devlink health
pci/0000:03:00.0:
reporter fw_fatal
state error error 1 recover 0 last_dump_date 2020-07-27 last_dump_time 16:33:27 auto_dump true
$ sudo devlink health dump show pci/0000:03:00.0 reporter fw_fatal -j -p
{
"irisc_id": 0,
"event": [
"id": 3 ],
"method": "query",
"long_process": false,
"command_type": "mad",
"reg_attr_id": 0
}
As a dependency, the FW validation and flashing is moved to core.c.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Jiri Pirko [Tue, 15 Sep 2020 08:40:58 +0000 (11:40 +0300)]
mlxsw: core: Introduce fw_fatal health reporter
Introduce devlink health reporter to report FW fatal events. Implement
the event listener using MFDE trap and enable the events to be
propagated using MFGD register configuration.
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jiri Pirko [Tue, 15 Sep 2020 08:40:57 +0000 (11:40 +0300)]
devlink: introduce the health reporter test command
Introduce a test command for health reporters. User might use this
command to trigger test event on a reporter if the reporter supports it.
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jiri Pirko [Tue, 15 Sep 2020 08:40:56 +0000 (11:40 +0300)]
mlxsw: reg: Add Monitoring FW General Debug Register
Introduce MFGD register that is used to configure firmware debugging.
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jiri Pirko [Tue, 15 Sep 2020 08:40:55 +0000 (11:40 +0300)]
mlxsw: reg: Add Monitoring FW Debug Register
Introduce MFDE register that is passed through MFDE trap in case of
fatal FW event.
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jiri Pirko [Tue, 15 Sep 2020 08:40:54 +0000 (11:40 +0300)]
mlxsw: Move fw_load_policy devlink param into core.c
As the fw flashing code was moved to core.c, move the param which is
related to it there as well. Remove unnecessary parentheses on the way.
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jiri Pirko [Tue, 15 Sep 2020 08:40:53 +0000 (11:40 +0300)]
mlxsw: core: Push code doing params register/unregister into separate helpers
Extract the code calling params register/unregister driver ops into
separate functions. Call publish/unpublish unconditionally.
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jiri Pirko [Tue, 15 Sep 2020 08:40:52 +0000 (11:40 +0300)]
mlxsw: Move fw flashing code into core.c
As the firmware flashing is not specific to Spectrum, move the code to
core.c and avoid one op call and 2 exported symbols. Also, this allows
to do flash before call of driver->init function and possibly do other
core calls in between.
Do some small renaming here and there on the way to be consistent with
the rest of core.c code.
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jiri Pirko [Tue, 15 Sep 2020 08:40:51 +0000 (11:40 +0300)]
mlxsw: Bump firmware version to XX.2008.1310
Among other changes, this version supports FW monitoring.
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 15 Sep 2020 22:40:04 +0000 (15:40 -0700)]
Merge branch 'net-stmmac-Add-ethtool-support-for-get-set-channels'
Wong Vee Khee says:
====================
net: stmmac: Add ethtool support for get|set channels
This patch set is to add support for user to get or set Tx/Rx channel
via ethtool. There are two patches that fixes bug introduced on upstream
in order to have the feature work.
Tested on Intel Tigerlake Platform.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>