]> Git Repo - linux.git/log
linux.git
5 years agoi40e: Missing response checks in driver when starting/stopping FW LLDP
Aleksandr Loktionov [Wed, 24 Apr 2019 12:20:55 +0000 (05:20 -0700)]
i40e: Missing response checks in driver when starting/stopping FW LLDP

Driver updated pf->flags before calling i40e_aq_start_lldp().
This patch moved down updating pf->flags down so flags will be
updated only in case of successful i40e_aq_start_lldp() call.
Also was introduced is_reset_needed local flag to avoid unnecessary h/w
reset in case 40e_aq_start_lldp() didn't change lldp state.

Signed-off-by: Aleksandr Loktionov <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
5 years agoi40e: remove duplicate stat calculation for tx_errors
Jacob Keller [Wed, 24 Apr 2019 12:20:54 +0000 (05:20 -0700)]
i40e: remove duplicate stat calculation for tx_errors

The tx_errors statistic was being calculated twice in
i40e_update_eth_stats.

This appears to be as of commit 201db2898f2c ("i40e: add missing VSI
statistics", 2014-03-25).

Remove the extra i40e_stat_update32 call for GLV_TEPC.

Signed-off-by: Jacob Keller <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
5 years agoi40e: Check if the BAR size is large enough before writing to registers
Adam Ludkiewicz [Wed, 24 Apr 2019 12:20:53 +0000 (05:20 -0700)]
i40e: Check if the BAR size is large enough before writing to registers

This patch fixes the problem with a kernel panic occurring when trying
to bind the i40e driver to a non-i40e port. The problem is fixed by
checking if the BAR size in the device is large enough by reading the
highest register.

Signed-off-by: Adam Ludkiewicz <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
5 years agoi40e: Missing response checks in driver when starting/stopping FW LLDP
Piotr Marczak [Wed, 24 Apr 2019 12:20:52 +0000 (05:20 -0700)]
i40e: Missing response checks in driver when starting/stopping FW LLDP

Driver did not check response on LLDP flag change and always returned
SUCCESS.

This patch now checks for an error and returns an error code and has
additional information in the log.

Signed-off-by: Piotr Marczak <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
5 years agoi40e: add input validation for virtchnl handlers
Sergey Nemov [Wed, 24 Apr 2019 12:20:51 +0000 (05:20 -0700)]
i40e: add input validation for virtchnl handlers

Change some data to unsigned int instead of integer when we compare.

Check LUT values in VIRTCHNL_OP_CONFIG_RSS_LUT handler.

Also enhance error/warning messages to print the real values of
I40E_MAX_VF_QUEUES, I40E_MAX_VF_VSI and I40E_DEFAULT_QUEUES_PER_VF
instead of plain text.

Refactor code to comply with 'check first then assign' policy.

Remove duplicate checks for VIRTCHNL_OP_CONFIG_RSS_KEY and
VIRTCHNL_OP_CONFIG_RSS_LUT opcodes in i40e_vc_process_vf_msg(). We have
the very same checks inside the handlers already.

Signed-off-by: Sergey Nemov <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
5 years agoi40e: Improve AQ log granularity
Doug Dziggel [Wed, 24 Apr 2019 12:20:50 +0000 (05:20 -0700)]
i40e: Improve AQ log granularity

This patch makes it possible to log only AQ descriptors, without the
entire AQ message buffers being dumped too. It should greatly reduce
kernel log size in cases where a full AQ dump is not needed.
Selection is made by setting flags in hw->debug_mask.

Additionally, some debug messages that preceded an AQ dump have been
moved to I40E_DEBUG_AQ_COMMAND class, which seems more appropriate.

Signed-off-by: Doug Dziggel <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
5 years agoi40e: Add bounds check for ch[] array
Piotr Kwapulinski [Wed, 24 Apr 2019 12:20:49 +0000 (05:20 -0700)]
i40e: Add bounds check for ch[] array

Add bounds check for ch[] array.
Use ARRAY_SIZE() to ensure that idx is within the range.

Signed-off-by: Piotr Kwapulinski <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
5 years agoi40e: Use signed variable
Mitch Williams [Wed, 24 Apr 2019 12:20:48 +0000 (05:20 -0700)]
i40e: Use signed variable

The counter variable in i40e_clean_tx_irq starts out negative and climbs
to 0. So it should not be defined as a u16. This was working by accident
due to the fact the u16 overflows and underflows predictably.

Replace the u16 with int, which is signed and can handle the negativity.

Signed-off-by: Mitch Williams <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
5 years agoi40e: add constraints for accessing veb array
Piotr Kwapulinski [Wed, 24 Apr 2019 12:20:47 +0000 (05:20 -0700)]
i40e: add constraints for accessing veb array

Add veb array access boundary checks.
Ensure veb array index is smaller than I40E_MAX_VEB.

Signed-off-by: Piotr Kwapulinski <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
5 years agoi40e: let untrusted VF to create up to 16 VLANs
Piotr Kwapulinski [Wed, 24 Apr 2019 12:20:46 +0000 (05:20 -0700)]
i40e: let untrusted VF to create up to 16 VLANs

This patch lets untrusted VF to create up to 16 VLANs.
It was implemented by increasing I40E_VC_MAX_VLAN_PER_VF up to 16.
Without this patch untrusted VF could create only up to 8 VLANs.

Signed-off-by: Piotr Kwapulinski <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
5 years agoi40e: add functions stubs to support EEE
Aleksandr Loktionov [Sat, 30 Mar 2019 00:04:56 +0000 (17:04 -0700)]
i40e: add functions stubs to support EEE

This patch adds functions stubs to support EEE on/off.

Signed-off-by: Aleksandr Loktionov <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
5 years agoMerge tag 'mac80211-next-for-davem-2019-06-14' of git://git.kernel.org/pub/scm/linux...
David S. Miller [Fri, 14 Jun 2019 18:27:26 +0000 (11:27 -0700)]
Merge tag 'mac80211-next-for-davem-2019-06-14' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next

Johannes Berg says:

====================
Many changes all over:
 * HE (802.11ax) work continues
 * WPA3 offloads
 * work on extended key ID handling continues
 * fixes to honour AP supported rates with auth/assoc frames
 * nl80211 netlink policy improvements to fix some issues
   with strict validation on new commands with old attrs
====================

Signed-off-by: David S. Miller <[email protected]>
5 years agosched: act_ctinfo: use extack error reporting
Kevin Darbyshire-Bryant [Fri, 14 Jun 2019 09:09:44 +0000 (10:09 +0100)]
sched: act_ctinfo: use extack error reporting

Use extack error reporting mechanism in addition to returning -EINVAL

NL_SET_ERR_* code shamelessy copy/paste/adjusted from act_pedit &
sch_cake and used as reference as to what I should have done in the
first place.

Signed-off-by: Kevin Darbyshire-Bryant <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agol2tp: no need to check return value of debugfs_create functions
Greg Kroah-Hartman [Fri, 14 Jun 2019 07:04:38 +0000 (09:04 +0200)]
l2tp: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Also, there is no need to store the individual debugfs file name, just
remove the whole directory all at once, saving a local variable.

Cc: "David S. Miller" <[email protected]>
Cc: Guillaume Nault <[email protected]>
Cc: [email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Acked-by: Guillaume Nault <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agoMerge branch 'r8169-add-and-use-helper-rtl_is_8168evl_up'
David S. Miller [Fri, 14 Jun 2019 15:38:27 +0000 (08:38 -0700)]
Merge branch 'r8169-add-and-use-helper-rtl_is_8168evl_up'

Heiner Kallweit says:

====================
r8169: add and use helper rtl_is_8168evl_up

Few registers have been added or changed its purpose with version
RTL8168e-vl, so create a helper for identifying chip versions from
RTL8168e-vl.
====================

Signed-off-by: David S. Miller <[email protected]>
5 years agor8169: use helper rtl_is_8168evl_up for setting register MaxTxPacketSize
Heiner Kallweit [Fri, 14 Jun 2019 05:55:21 +0000 (07:55 +0200)]
r8169: use helper rtl_is_8168evl_up for setting register MaxTxPacketSize

>From RTL8168e-vl the value in register MaxTxPacketSize is interpreted
differently, therefore use new helper rtl_is_8168evl_up to set this
register.

Signed-off-by: Heiner Kallweit <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agor8169: add helper rtl_is_8168evl_up
Heiner Kallweit [Fri, 14 Jun 2019 05:54:07 +0000 (07:54 +0200)]
r8169: add helper rtl_is_8168evl_up

Add helper rtl_is_8168evl_up to make the code better readable and to
simplify it.

Signed-off-by: Heiner Kallweit <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agomac80211: notify offchannel expire on mgmt_tx
James Prestwood [Wed, 12 Jun 2019 19:35:10 +0000 (12:35 -0700)]
mac80211: notify offchannel expire on mgmt_tx

When the offchannel TX wait time expires, send the appropriate event.

Signed-off-by: James Prestwood <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
5 years agonl80211: send event when CMD_FRAME duration expires
James Prestwood [Wed, 12 Jun 2019 19:35:09 +0000 (12:35 -0700)]
nl80211: send event when CMD_FRAME duration expires

cfg80211_remain_on_channel_expired is used to notify userspace when
the remain on channel duration expired by sending an event. There is
no such equivalent to CMD_FRAME, where if offchannel and a duration
is provided, the card will go offchannel for that duration. Currently
there is no way for userspace to tell when that duration expired
apart from setting an independent timeout. This timeout is quite
erroneous as the kernel may not immediately send out the frame
because of scheduling or work queue delays. In testing, it was found
this timeout had to be quite large to accomidate any potential delays.

A better solution is to have the kernel send an event when this
duration has expired. There is already NL80211_CMD_FRAME_WAIT_CANCEL
which can be used to cancel a NL80211_CMD_FRAME offchannel. Using this
command matches perfectly to how NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL
works, where its both used to cancel and notify if the duration has
expired.

Signed-off-by: James Prestwood <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
5 years agomac80211: no need to check return value of debugfs_create functions
Greg Kroah-Hartman [Fri, 14 Jun 2019 06:59:34 +0000 (08:59 +0200)]
mac80211: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Johannes Berg <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
5 years agomac80211: extend __rate_control_send_low warning
Johannes Berg [Wed, 29 May 2019 12:25:37 +0000 (15:25 +0300)]
mac80211: extend __rate_control_send_low warning

This appears to happen occasionally, and if it does we
really want even more information than we have now.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
5 years agomac80211: fill low rate even for HAS_RATE_CONTROL
Johannes Berg [Wed, 29 May 2019 12:25:36 +0000 (15:25 +0300)]
mac80211: fill low rate even for HAS_RATE_CONTROL

If HW advertises it has rate control, we skip all of the
rate control assignments, but sometimes the data we have
here is useful, especially so that we don't have to do
the lookups again on which rates are configured and are
supported.

So do the low rate assignment anyway to help out drivers
that might need it.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
5 years agomac80211: use STA info in rate_control_send_low()
Johannes Berg [Wed, 29 May 2019 12:25:35 +0000 (15:25 +0300)]
mac80211: use STA info in rate_control_send_low()

Even if we have a station, we currently call rate_control_send_low()
with the NULL station unless further rate control (driver, minstrel)
has been initialized.

Change this so we can use more information about the station to use
a better rate. For example, when we associate with an AP, we will
now use the lowest rate it advertised as supported (that we can)
rather than the lowest mandatory rate. This aligns our behaviour
with most other 802.11 implementations.

To make this possible, we need to also ensure that we have non-zero
rates at all times, so in case we really have *nothing* pre-fill
the supp_rates bitmap with the very lowest mandatory bitmap (11b
and 11a on 2.4 and 5 GHz respectively).

Additionally, hostapd appears to be giving us an empty supported
rates bitmap (it can and should do better, since the STA must have
supported for at least the basic rates in the BSS), so ignore any
such bitmaps that would actually zero out the supp_rates, and in
that case just keep the pre-filled mandatory rates.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
5 years agomac80211: call rate_control_send_low() internally
Johannes Berg [Thu, 16 May 2019 09:44:52 +0000 (11:44 +0200)]
mac80211: call rate_control_send_low() internally

There's no rate control algorithm that *doesn't* want to call
it internally, and calling it internally will let us modify
its behaviour in the future.

Signed-off-by: Johannes Berg <[email protected]>
5 years agoieee80211: Add a missing extended capability flag definition
Ilan Peer [Wed, 29 May 2019 12:25:33 +0000 (15:25 +0300)]
ieee80211: Add a missing extended capability flag definition

Add the "OBSS Narrow Bandwidth RU In OFDMA Tolerance Support" flag
definition to the definitions of the flags covered by the Extended
Capability IE.

Signed-off-by: Ilan Peer <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
5 years agocfg80211: Add a function to iterate all BSS entries
Ilan Peer [Wed, 29 May 2019 12:25:32 +0000 (15:25 +0300)]
cfg80211: Add a function to iterate all BSS entries

Add a function that iterates over the BSS entries associated with a
given wiphy and calls a callback for each iterated BSS. This can be
used by drivers in various ways, e.g., to evaluate some property for
all the BSSs in the medium.

Signed-off-by: Ilan Peer <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
5 years agomac80211: allow turning TWT responder support on and off via netlink
John Crispin [Tue, 28 May 2019 11:49:48 +0000 (13:49 +0200)]
mac80211: allow turning TWT responder support on and off via netlink

Allow the userland daemon to en/disable TWT support for an AP.

Signed-off-by: Shashidhar Lakkavalli <[email protected]>
Signed-off-by: John Crispin <[email protected]>
[simplify parsing code]
Signed-off-by: Johannes Berg <[email protected]>
5 years agomac80211: dynamically enable the TWT requester support on STA interfaces
John Crispin [Tue, 28 May 2019 11:49:47 +0000 (13:49 +0200)]
mac80211: dynamically enable the TWT requester support on STA interfaces

Turn TWT for STA interfaces when they associate and/or receive a
beacon where the twt_responder bit has changed.

Signed-off-by: Shashidhar Lakkavalli <[email protected]>
Signed-off-by: John Crispin <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
5 years agonl80211: require and validate vendor command policy
Johannes Berg [Tue, 28 May 2019 08:56:03 +0000 (10:56 +0200)]
nl80211: require and validate vendor command policy

Require that each vendor command give a policy of its sub-attributes
in NL80211_ATTR_VENDOR_DATA, and then (stricly) check the contents,
including the NLA_F_NESTED flag that we couldn't check on the outer
layer because there we don't know yet.

It is possible to use VENDOR_CMD_RAW_DATA for raw data, but then no
nested data can be given (NLA_F_NESTED flag must be clear) and the
data is just passed as is to the command.

Signed-off-by: Johannes Berg <[email protected]>
5 years agomac80211: add ieee80211_get_he_iftype_cap() helper
John Crispin [Tue, 21 May 2019 15:02:58 +0000 (17:02 +0200)]
mac80211: add ieee80211_get_he_iftype_cap() helper

This function is similar to ieee80211_get_he_sta_cap() but allows passing
the iftype. Also make ieee80211_get_he_sta_cap() use the new helper
rather than duplicating the code.

Signed-off-by: Shashidhar Lakkavalli <[email protected]>
Signed-off-by: John Crispin <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
5 years agonl80211: add support for SAE authentication offload
Chung-Hsien Hsu [Thu, 9 May 2019 09:49:06 +0000 (09:49 +0000)]
nl80211: add support for SAE authentication offload

Let drivers advertise support for station-mode SAE authentication
offload with a new NL80211_EXT_FEATURE_SAE_OFFLOAD flag.

Signed-off-by: Chung-Hsien Hsu <[email protected]>
Signed-off-by: Chi-Hsien Lin <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
5 years agonl80211: add WPA3 definition for SAE authentication
Chung-Hsien Hsu [Thu, 9 May 2019 09:49:05 +0000 (09:49 +0000)]
nl80211: add WPA3 definition for SAE authentication

Add definition of WPA version 3 for SAE authentication.

Signed-off-by: Chung-Hsien Hsu <[email protected]>
Signed-off-by: Chi-Hsien Lin <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
5 years agonl80211: add NL80211_ATTR_IFINDEX to port authorized event
Chung-Hsien Hsu [Thu, 9 May 2019 09:48:25 +0000 (09:48 +0000)]
nl80211: add NL80211_ATTR_IFINDEX to port authorized event

Add NL80211_ATTR_IFINDEX attribute to port authorized event to indicate
the operating interface of the device. Also put NL80211_ATTR_WIPHY
attribute in it to be consistent with the other MLME notifications.

Signed-off-by: Chung-Hsien Hsu <[email protected]>
Signed-off-by: Chi-Hsien Lin <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
5 years agomac80211: AMPDU handling for Extended Key ID
Alexander Wetzel [Mon, 6 May 2019 19:01:48 +0000 (21:01 +0200)]
mac80211: AMPDU handling for Extended Key ID

IEEE 802.11 - 2016 forbids mixing MPDUs with different keyIDs in one
A-MPDU. Drivers supporting A-MPDUs and Extended Key ID must actively
enforce that requirement due to the available two unicast keyIDs.

Allow driver to signal mac80211 that they will not check the keyID in
MPDUs when aggregating them and that they expect mac80211 to stop Tx
aggregation when rekeying a connection using Extended Key ID.

Signed-off-by: Alexander Wetzel <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
5 years agor8169: improve rtl_coalesce_info
Heiner Kallweit [Tue, 11 Jun 2019 19:09:19 +0000 (21:09 +0200)]
r8169: improve rtl_coalesce_info

tp->coalesce_info is used in rtl_coalesce_info() only, so we can
remove this member. In addition replace phy_ethtool_get_link_ksettings
with a direct access to tp->phydev->speed.

Signed-off-by: Heiner Kallweit <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agor8169: let mdio read functions return -ETIMEDOUT
Heiner Kallweit [Tue, 11 Jun 2019 19:04:09 +0000 (21:04 +0200)]
r8169: let mdio read functions return -ETIMEDOUT

In case of a timeout currently ~0 is returned. Callers often just check
whether a certain bit is set and therefore may behave incorrectly.
So let's return -ETIMEDOUT in case of a timeout.

r8168_phy_ocp_read is used in r8168g_mdio_read only, therefore we can
apply the same change.

Signed-off-by: Heiner Kallweit <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agonet: dsa: tag_sja1105: Select CONFIG_PACKING
Vladimir Oltean [Tue, 11 Jun 2019 18:47:45 +0000 (21:47 +0300)]
net: dsa: tag_sja1105: Select CONFIG_PACKING

The packing facility is needed to decode Ethernet meta frames containing
source port and RX timestamping information.

The DSA driver selects CONFIG_PACKING, but the tagger did not, and since
taggers can be now compiled as modules independently from the drivers
themselves, this is an issue now, as CONFIG_PACKING is disabled by
default on all architectures.

Fixes: e53e18a6fe4d ("net: dsa: sja1105: Receive and decode meta frames")
Signed-off-by: Vladimir Oltean <[email protected]>
Reported-by: Randy Dunlap <[email protected]>
Acked-by: Randy Dunlap <[email protected]> # build-tested
Signed-off-by: David S. Miller <[email protected]>
5 years agonet: axienet: move use of resource after validity check
Robert Hancock [Tue, 11 Jun 2019 16:56:02 +0000 (10:56 -0600)]
net: axienet: move use of resource after validity check

We were accessing the pointer returned from platform_get_resource before
checking if it was valid, causing an oops if it was not. Move this access
after the call to devm_ioremap_resource which does the validity check.

Signed-off-by: Robert Hancock <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agoMerge branch 's390-qeth-next'
David S. Miller [Fri, 14 Jun 2019 05:39:32 +0000 (22:39 -0700)]
Merge branch 's390-qeth-next'

Julian Wiedmann says:

====================
s390/qeth: updates 2019-06-11

please apply the following patch series for qeth to net-next.
This brings all sorts of cleanups and minor improvements,
primarily for the control IO path.
====================

Signed-off-by: David S. Miller <[email protected]>
5 years agos390/qeth: allocate a single cmd on read channel
Julian Wiedmann [Tue, 11 Jun 2019 16:38:00 +0000 (18:38 +0200)]
s390/qeth: allocate a single cmd on read channel

We statically allocate 8 cmd buffers on the read channel, when the only
IO left that's still using them is the long-running READ.
Replace this with a single allocated cmd, that gets restarted whenever
the READ completed.

This introduces refcounting for allocated cmds, so that the READ cmd can
survive the IO completion.

Signed-off-by: Julian Wiedmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agos390/qeth: command-chain the IDX sequence
Julian Wiedmann [Tue, 11 Jun 2019 16:37:59 +0000 (18:37 +0200)]
s390/qeth: command-chain the IDX sequence

The current IDX sequence first sends one WRITE cmd to activate the
device, and then sends a second cmd that READs the response.

Using qeth_alloc_cmd(), we can combine this into a single IO with two
command-chained CCWs.

Signed-off-by: Julian Wiedmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agos390/qeth: convert RCD code to common IO infrastructure
Julian Wiedmann [Tue, 11 Jun 2019 16:37:58 +0000 (18:37 +0200)]
s390/qeth: convert RCD code to common IO infrastructure

The RCD code is the last remaining IO path that doesn't use the
qeth_send_control_data() infrastructure. Doing so allows us to remove
all sorts of custom state machinery and logic in the IRQ handler.

Instead of introducing statically allocated cmd buffers for this single
IO on the data channel, use the new qeth_alloc_cmd() helper.

Signed-off-by: Julian Wiedmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agos390/qeth: add support for dynamically allocated cmds
Julian Wiedmann [Tue, 11 Jun 2019 16:37:57 +0000 (18:37 +0200)]
s390/qeth: add support for dynamically allocated cmds

qeth currently uses a fixed set of statically allocated cmd buffers for
the read and write IO channels. This (1) doesn't play well with the single
RCD cmd we need to issue on the data channel, (2) doesn't provide the
necessary flexibility for certain IDX improvements, and (3) is also rather
wasteful since the buffers are idle most of the time.

Add a new type of cmd buffer that is dynamically allocated, and keeps
its ccw chain in the DMA data area. Since this touches most callers of
qeth_setup_ccw(), also add a new CCW flags parameter for future usage.

Signed-off-by: Julian Wiedmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agos390/qeth: remove 'channel' parameter from callbacks
Julian Wiedmann [Tue, 11 Jun 2019 16:37:56 +0000 (18:37 +0200)]
s390/qeth: remove 'channel' parameter from callbacks

Each cmd buffer maintains a pointer to the IO channel that it was/will
be issued on. So when dealing with cmd buffers, we don't need to pass
around a separate channel pointer.

Signed-off-by: Julian Wiedmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agos390/qeth: convert device-specific trace entries
Julian Wiedmann [Tue, 11 Jun 2019 16:37:55 +0000 (18:37 +0200)]
s390/qeth: convert device-specific trace entries

The vast majority of SETUP-classified trace entries can be moved to
their device-specific trace file. This reduces pollution of the global
SETUP file, and provides a consistent trace view of all activity on the
device.

Signed-off-by: Julian Wiedmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agos390/qeth: remove OSN-specific IO code
Julian Wiedmann [Tue, 11 Jun 2019 16:37:54 +0000 (18:37 +0200)]
s390/qeth: remove OSN-specific IO code

OSN currently provides a custom code path to submit IPA cmds, without
waiting for the cmd response. Replace it with qeth_send_ipa_cmd(), which
uses the common qeth_send_control_data() IO infrastructure.

By setting a custom iob->callback, we can now provide feedback to the
caller about whether the cmd has been successfully submitted to HW.
Since the callback then immediately wakes up the reply-waiter object, we
maintain the old behaviour of returning early without waiting for the
response.

Signed-off-by: Julian Wiedmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agos390/qeth: remove qeth_wait_for_buffer()
Julian Wiedmann [Tue, 11 Jun 2019 16:37:53 +0000 (18:37 +0200)]
s390/qeth: remove qeth_wait_for_buffer()

The basic MPC initialization sequence is strictly sequential, and
waiting for an available cmd buffer should never be necessary.
So this change only affects the OSN path, where dangling waiters on an
unbounded wait_event() are not desirable. Switch to qeth_get_buffers(),
and let OSN callers deal with -ENOMEM.

Signed-off-by: Julian Wiedmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agos390/qeth: clean up setting of BLKT defaults
Julian Wiedmann [Tue, 11 Jun 2019 16:37:52 +0000 (18:37 +0200)]
s390/qeth: clean up setting of BLKT defaults

When called from qeth_core_probe_device(), qeth_determine_capabilities()
initializes the device's BLKT defaults. From all other callers, the
ccw_device has already been set online and the BLKT setting is skipped.

Clean this up by extracting the BLKT setting into a separate helper that
gets called from the right place.

Signed-off-by: Julian Wiedmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agos390/qeth: restart pending READ cmd from callback
Julian Wiedmann [Tue, 11 Jun 2019 16:37:51 +0000 (18:37 +0200)]
s390/qeth: restart pending READ cmd from callback

The completion of a pending READ cmd is processed via
qeth_issue_next_read_cb(). Let this callback also start the next READ
cmd, instead of hardcoding that step into the IRQ handler.

While at it remove the check of the channel state,
__qeth_issue_next_read() already does this.

Signed-off-by: Julian Wiedmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agos390/qeth: simplify DOWN state handling
Julian Wiedmann [Tue, 11 Jun 2019 16:37:50 +0000 (18:37 +0200)]
s390/qeth: simplify DOWN state handling

When the tear down sequence in qeth_l?_stop_card() has finished, the
card is guaranteed to be in DOWN state and we don't have to check for
it again.
With this insight we can also remove the redundant setting of
card->state in qeth_l?_set_online()'s error path.

Signed-off-by: Julian Wiedmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agos390/qeth: use mm helpers
Julian Wiedmann [Tue, 11 Jun 2019 16:37:49 +0000 (18:37 +0200)]
s390/qeth: use mm helpers

Slightly reduce the complexity of the core xmit path, by replacing some
open-coded logic with the corresponding helpers.

Signed-off-by: Julian Wiedmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agos390/qeth: don't mask TX errors on IQD devices
Julian Wiedmann [Tue, 11 Jun 2019 16:37:48 +0000 (18:37 +0200)]
s390/qeth: don't mask TX errors on IQD devices

Current code suppresses debug entries when an TX buffer completes in
ERROR state with no error indication set in SBALF15.
This was introduced back with
commit 58490f18071d ("qeth: HiperSockets SIGA retry support on CC=2.").
But qeth no longer retries after CC=2, and this sort of suppression
make no sense anymore. Remove it.

Signed-off-by: Julian Wiedmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agoMerge branch 'mlxsw-Add-support-for-physical-hardware-clock'
David S. Miller [Fri, 14 Jun 2019 05:34:55 +0000 (22:34 -0700)]
Merge branch 'mlxsw-Add-support-for-physical-hardware-clock'

Ido Schimmel says:

====================
mlxsw: Add support for physical hardware clock

Shalom says:

This patchset adds support for physical hardware clock for Spectrum-1
ASIC only.

Patches #1, #2 and #3 add the ability to query the free running clock
PCI address.

Patches #4 and #5 add two new register, the Management UTC Register and
the Management Pulse Per Second Register.

Patch #6 publishes scaled_ppm_to_ppb() to allow drivers to use it.

Patch #7 adds the physical hardware clock operations.

Patch #8 initializes the physical hardware clock.

Patch #9 adds a selftest for testing the PTP physical hardware clock.

v2 (Richard):
* s/ptp_clock_scaled_ppm_to_ppb/scaled_ppm_to_ppb/
* imply PTP_1588_CLOCK in mlxsw Kconfig
* s/mlxsw_sp1_ptp_update_phc_settime/mlxsw_sp1_ptp_phc_settime/
* s/mlxsw_sp1_ptp_update_phc_adjfreq/mlxsw_sp1_ptp_phc_adjfreq/
====================

Signed-off-by: David S. Miller <[email protected]>
5 years agoselftests: ptp: Add Physical Hardware Clock test
Shalom Toledo [Tue, 11 Jun 2019 15:45:12 +0000 (18:45 +0300)]
selftests: ptp: Add Physical Hardware Clock test

Test the PTP Physical Hardware Clock functionality using the "phc_ctl" (a
part of "linuxptp").

The test contains three sub-tests:
  * "settime" test
  * "adjtime" test
  * "adjfreq" test

"settime" test:
  * set the PHC time to 0 seconds.
  * wait for 120.5 seconds.
  * check if PHC time equal to 120.XX seconds.

"adjtime" test:
  * set the PHC time to 0 seconds.
  * adjust the time by 10 seconds.
  * check if PHC time equal to 10.XX seconds.

"adjfreq" test:
  * adjust the PHC frequency to be 1% faster.
  * set the PHC time to 0 seconds.
  * wait for 100.5 seconds.
  * check if PHC time equal to 101.XX seconds.

Usage:
  $ ./phc.sh /dev/ptp<X>

  It is possible to run a subset of the tests, for example:
    * To run only the "settime" test:
      $ TESTS="settime" ./phc.sh /dev/ptp<X>

Signed-off-by: Shalom Toledo <[email protected]>
Reviewed-by: Petr Machata <[email protected]>
Acked-by: Richard Cochran <[email protected]>
Tested-by: Vladimir Oltean <[email protected]>
Signed-off-by: Ido Schimmel <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agomlxsw: spectrum: PTP physical hardware clock initialization
Shalom Toledo [Tue, 11 Jun 2019 15:45:11 +0000 (18:45 +0300)]
mlxsw: spectrum: PTP physical hardware clock initialization

Initialize the PTP physical hardware clock.

Signed-off-by: Shalom Toledo <[email protected]>
Acked-by: Jiri Pirko <[email protected]>
Reviewed-by: Petr Machata <[email protected]>
Signed-off-by: Ido Schimmel <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agomlxsw: spectrum_ptp: Add implementation for physical hardware clock operations
Shalom Toledo [Tue, 11 Jun 2019 15:45:10 +0000 (18:45 +0300)]
mlxsw: spectrum_ptp: Add implementation for physical hardware clock operations

Implement physical hardware clock operations.

Signed-off-by: Shalom Toledo <[email protected]>
Acked-by: Jiri Pirko <[email protected]>
Reviewed-by: Petr Machata <[email protected]>
Signed-off-by: Ido Schimmel <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agoptp: ptp_clock: Publish scaled_ppm_to_ppb
Shalom Toledo [Tue, 11 Jun 2019 15:45:09 +0000 (18:45 +0300)]
ptp: ptp_clock: Publish scaled_ppm_to_ppb

Publish scaled_ppm_to_ppb to allow drivers to use it.

Signed-off-by: Shalom Toledo <[email protected]>
Reviewed-by: Petr Machata <[email protected]>
Signed-off-by: Ido Schimmel <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agomlxsw: reg: Add Management Pulse Per Second Register
Shalom Toledo [Tue, 11 Jun 2019 15:45:08 +0000 (18:45 +0300)]
mlxsw: reg: Add Management Pulse Per Second Register

The MTPPS register provides the device PPS capabilities, configure the PPS
in and out modules and holds the PPS in time stamp.

Signed-off-by: Shalom Toledo <[email protected]>
Acked-by: Jiri Pirko <[email protected]>
Reviewed-by: Petr Machata <[email protected]>
Signed-off-by: Ido Schimmel <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agomlxsw: reg: Add Management UTC Register
Shalom Toledo [Tue, 11 Jun 2019 15:45:07 +0000 (18:45 +0300)]
mlxsw: reg: Add Management UTC Register

The MTUTC register configures the HW UTC counter.

Signed-off-by: Shalom Toledo <[email protected]>
Reviewed-by: Petr Machata <[email protected]>
Acked-by: Jiri Pirko <[email protected]>
Signed-off-by: Ido Schimmel <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agomlxsw: pci: Query free running clock PCI BAR and offsets
Shalom Toledo [Tue, 11 Jun 2019 15:45:06 +0000 (18:45 +0300)]
mlxsw: pci: Query free running clock PCI BAR and offsets

Query free running clock PCI BAR and offsets during the pci_init.

Signed-off-by: Shalom Toledo <[email protected]>
Acked-by: Jiri Pirko <[email protected]>
Reviewed-by: Petr Machata <[email protected]>
Signed-off-by: Ido Schimmel <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agomlxsw: core: Add a new interface for reading the hardware free running clock
Shalom Toledo [Tue, 11 Jun 2019 15:45:05 +0000 (18:45 +0300)]
mlxsw: core: Add a new interface for reading the hardware free running clock

Add two new bus operations for reading the hardware free running clock.

Signed-off-by: Shalom Toledo <[email protected]>
Acked-by: Jiri Pirko <[email protected]>
Reviewed-by: Petr Machata <[email protected]>
Signed-off-by: Ido Schimmel <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agomlxsw: cmd: Free running clock PCI BAR and offsets via query firmware
Shalom Toledo [Tue, 11 Jun 2019 15:45:04 +0000 (18:45 +0300)]
mlxsw: cmd: Free running clock PCI BAR and offsets via query firmware

Add free running clock PCI BAR and offset to query firmware command.

Signed-off-by: Shalom Toledo <[email protected]>
Reviewed-by: Petr Machata <[email protected]>
Acked-by: Jiri Pirko <[email protected]>
Signed-off-by: Ido Schimmel <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agotc-tests: updated fw with bind actions by reference use cases
Roman Mashak [Tue, 11 Jun 2019 14:02:22 +0000 (10:02 -0400)]
tc-tests: updated fw with bind actions by reference use cases

Extended fw TDC tests with use cases where actions are pre-created and
attached to a filter by reference, i.e. by action index.

Signed-off-by: Roman Mashak <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agoMerge branch 'net-stmmac-Convert-to-phylink'
David S. Miller [Thu, 13 Jun 2019 21:02:09 +0000 (14:02 -0700)]
Merge branch 'net-stmmac-Convert-to-phylink'

Jose Abreu says:

====================
net: stmmac: Convert to phylink

This converts stmmac to use phylink. Besides the code redution this will
allow to gain more flexibility.
====================

Signed-off-by: David S. Miller <[email protected]>
5 years agonet: stmmac: Convert to phylink and remove phylib logic
Jose Abreu [Tue, 11 Jun 2019 15:18:47 +0000 (17:18 +0200)]
net: stmmac: Convert to phylink and remove phylib logic

Convert everything to phylink.

Signed-off-by: Jose Abreu <[email protected]>
Cc: Joao Pinto <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Giuseppe Cavallaro <[email protected]>
Cc: Alexandre Torgue <[email protected]>
Cc: Russell King <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: Heiner Kallweit <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agonet: stmmac: Start adding phylink support
Jose Abreu [Tue, 11 Jun 2019 15:18:46 +0000 (17:18 +0200)]
net: stmmac: Start adding phylink support

Start adding the phylink callbacks.

Signed-off-by: Jose Abreu <[email protected]>
Cc: Joao Pinto <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Giuseppe Cavallaro <[email protected]>
Cc: Alexandre Torgue <[email protected]>
Cc: Russell King <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: Heiner Kallweit <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agonet: stmmac: Prepare to convert to phylink
Jose Abreu [Tue, 11 Jun 2019 15:18:45 +0000 (17:18 +0200)]
net: stmmac: Prepare to convert to phylink

In preparation for the convertion, split the adjust_link function into
mac_config and add the mac_link_up and mac_link_down functions.

Signed-off-by: Jose Abreu <[email protected]>
Cc: Joao Pinto <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Giuseppe Cavallaro <[email protected]>
Cc: Alexandre Torgue <[email protected]>
Cc: Russell King <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: Heiner Kallweit <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agoqede: Make two functions static
YueHaibing [Tue, 11 Jun 2019 14:07:09 +0000 (22:07 +0800)]
qede: Make two functions static

Fix sparse warning:

drivers/net/ethernet/qlogic/qede/qede_main.c:963:6:
 warning: symbol 'qede_lock' was not declared. Should it be static?
drivers/net/ethernet/qlogic/qede/qede_main.c:969:6:
 warning: symbol 'qede_unlock' was not declared. Should it be static?

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: YueHaibing <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agonet: dsa: sja1105: Make two functions static
YueHaibing [Tue, 11 Jun 2019 13:58:34 +0000 (21:58 +0800)]
net: dsa: sja1105: Make two functions static

Fix sparse warnings:

drivers/net/dsa/sja1105/sja1105_main.c:1848:6:
 warning: symbol 'sja1105_port_rxtstamp' was not declared. Should it be static?
drivers/net/dsa/sja1105/sja1105_main.c:1869:6:
 warning: symbol 'sja1105_port_txtstamp' was not declared. Should it be static?

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: YueHaibing <[email protected]>
Tested-by: Vladimir Oltean <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agoDocumentation: net: mlx5: Devlink health documentation
Moshe Shemesh [Sat, 1 Jun 2019 13:40:16 +0000 (16:40 +0300)]
Documentation: net: mlx5: Devlink health documentation

Documentation for devlink health reporters supported by mlx5.

Signed-off-by: Moshe Shemesh <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
5 years agonet/mlx5: Report devlink health on FW fatal issues
Moshe Shemesh [Sun, 27 Jan 2019 16:38:39 +0000 (18:38 +0200)]
net/mlx5: Report devlink health on FW fatal issues

Report devlink health on FW fatal issues via fw_fatal_reporter. The
driver recover flow for FW fatal error is now being handled by the
devlink health.

Having the recovery controlled by devlink health, the user has the
ability to cancel the auto-recovery for debug session and run it
manually.

Call mlx5_enter_error_state() before calling devlink_health_report() to
ensure entering device error state even if auto-recovery is off.

Signed-off-by: Moshe Shemesh <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
5 years agonet/mlx5: Add support for FW fatal reporter dump
Moshe Shemesh [Wed, 16 Jan 2019 11:23:25 +0000 (13:23 +0200)]
net/mlx5: Add support for FW fatal reporter dump

Add support of dump callback for mlx5 FW fatal reporter.
The FW fatal dump uses cr-dump functionality to gather cr-space data for
debug. The cr-dump uses vsc interface which is valid even if the FW
command interface is not functional, which is the case in most FW fatal
errors.

Command example and output:
$ devlink health dump show pci/0000:82:00.0 reporter fw_fatal
 crdump_data:
  00 20 00 01 00 00 00 00 03 00 00 00 00 00 00 00
  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80
  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  00 00 00 00 00 00 00 00 00 00 00 00 ba 82 00 00
  0c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 20
  00 00 00 00 00 00 00 00 00 00 00 00 00 00 fa 00
  a4 0e 00 00 00 00 00 00 80 c7 fe ff 50 0a 00 00
...
...

Signed-off-by: Moshe Shemesh <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
5 years agonet/mlx5: Add fw fatal devlink_health_reporter
Moshe Shemesh [Tue, 11 Dec 2018 14:09:57 +0000 (16:09 +0200)]
net/mlx5: Add fw fatal devlink_health_reporter

Create mlx5_devlink_health_reporter for fw fatal reporter.
The fw fatal reporter is added in addition to the fw reporter and
implements the recover callback.
The point of having two reporters for FW issues, is that we
don't want to run FW recover on any issue, but only fatal ones.

Signed-off-by: Moshe Shemesh <[email protected]>
Signed-off-by: Eran Ben Elisha <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
5 years agonet/mlx5: Report devlink health on FW issues
Moshe Shemesh [Tue, 11 Dec 2018 14:09:56 +0000 (16:09 +0200)]
net/mlx5: Report devlink health on FW issues

Use devlink_health_report() to report any symptom of FW issue as FW
counter miss or new health syndrome.
The FW issues detected in mlx5 during poll_health which is called in
timer atomic context and so health work queue is used to schedule the
reports.

Signed-off-by: Moshe Shemesh <[email protected]>
Signed-off-by: Eran Ben Elisha <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
5 years agonet/mlx5: Add support for FW reporter dump
Moshe Shemesh [Tue, 11 Dec 2018 14:09:54 +0000 (16:09 +0200)]
net/mlx5: Add support for FW reporter dump

Add support of dump callback for mlx5 FW reporter.  Once we trigger FW
dump, the FW will write the core dump to its raw data buffer. The tracer
translates the raw data to traces and save it to a cyclic array. Once
dump is done, the saved traces data is filled into the dump buffer. In
case syndrome is not zero the health buffer content will be printed as
well.

FW dump example:
$ devlink health dump show pci/0000:82:00.0 reporter fw
 dump fw traces:
   timestamp: 509006640427 lost: false event_id: 185 msg: dump general
info GVMI=0x0000
   timestamp: 509006645474 lost: false event_id: 185 msg: GVMI
management info, gvmi_management context:
   timestamp: 509006654463 lost: false event_id: 185 msg: [000]:
00000000  00000000  00000000  00000000
   timestamp: 509006656127 lost: false event_id: 185 msg: [010]:
00000000  00000000  00000000  00000000
   timestamp: 509006656255 lost: false event_id: 185 msg: [020]:
00000000  00000000  00000000  00000000
   timestamp: 509006656511 lost: false event_id: 185 msg: [030]:
00000000  00000000  00000000  00000000
   timestamp: 509006656639 lost: false event_id: 185 msg: [040]:
00000000  00000000  00000000  00000000
   timestamp: 509006656895 lost: false event_id: 185 msg: [050]:
00000000  00000000  00000000  00000000
   timestamp: 509006657023 lost: false event_id: 185 msg: [060]:
00000000  00000000  00000000  00000000
   timestamp: 509006657180 lost: false event_id: 185 msg: [070]:
00000000  00000000  00000000  00000000
   timestamp: 509006659839 lost: false event_id: 185 msg: CMDIF dbase
from IRON: active_dbase_slots = 0x00000000
   timestamp: 509006667391 lost: false event_id: 185 msg: GVMI=0x0000
hw_toc context:
   timestamp: 509006667647 lost: false event_id: 185 msg: [000]:
00000000  00000000  00000000  fffff000
   timestamp: 509006667775 lost: false event_id: 185 msg: [010]:
00000000  00000000  00000000  80d00000
...
...

Signed-off-by: Moshe Shemesh <[email protected]>
Signed-off-by: Eran Ben Elisha <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
5 years agonet/mlx5: Create FW devlink_health_reporter
Moshe Shemesh [Tue, 11 Dec 2018 14:09:53 +0000 (16:09 +0200)]
net/mlx5: Create FW devlink_health_reporter

Create mlx5_devlink_health_reporter for FW reporter. The FW reporter
implements devlink_health_reporter diagnose callback.

The fw reporter diagnose command can be triggered any time by the user
to check current fw status.
In healthy status, it will return clear syndrome. Otherwise it will
return the syndrome and description of the error type.

Command example and output on healthy status:
$ devlink health diagnose pci/0000:82:00.0 reporter fw
Syndrome: 0

Command example and output on non healthy status:
$ devlink health diagnose pci/0000:82:00.0 reporter fw
Syndrome: 8 Description: unrecoverable hardware error

Signed-off-by: Moshe Shemesh <[email protected]>
Signed-off-by: Eran Ben Elisha <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
5 years agonet/mlx5: Issue SW reset on FW assert
Feras Daoud [Mon, 12 Nov 2018 14:40:17 +0000 (16:40 +0200)]
net/mlx5: Issue SW reset on FW assert

If a FW assert is considered fatal, indicated by a new bit in the health
buffer, reset the FW. After the reset go through the normal recovery
flow. Only one PF needs to issue the reset, so an attempt is made to
prevent the 2nd function from also issuing the reset.
It's not an error if that happens, it just slows recovery.

Signed-off-by: Feras Daoud <[email protected]>
Signed-off-by: Alex Vesker <[email protected]>
Signed-off-by: Moshe Shemesh <[email protected]>
Signed-off-by: Daniel Jurgens <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
5 years agonet/mlx5: Control CR-space access by different PFs
Feras Daoud [Sun, 2 Dec 2018 12:41:22 +0000 (14:41 +0200)]
net/mlx5: Control CR-space access by different PFs

Since the FW can be shared between different PFs/VFs it is common
that more than one health poll will detected a failure, this can
lead to multiple resets which are unneeded.

The solution is to use a FW locking mechanism using semaphore space
to provide a way to allow only one device to collect the cr-dump and
to issue a sw-reset.

Signed-off-by: Feras Daoud <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
5 years agonet/mlx5: Handle SW reset of FW in error flow
Feras Daoud [Mon, 12 Nov 2018 13:23:02 +0000 (15:23 +0200)]
net/mlx5: Handle SW reset of FW in error flow

New mlx5 adapters allow the driver to reset the FW in the event of an
error, this action called "SW Reset". When an SW reset is issued on any
PF all PFs enter reset state which is a recoverable condition. The
existing recovery flow was designed to allow the recovery of a VF after
a PF driver reload. This patch adds the sw reset to the NIC states
as a preparation for sw reset handling.

When a software reset is issued the following occurs:
1. The NIC interface mode is set to 7 while the reset is in progress.
2. Once the reset completes the NIC interface mode is set to 1.

Signed-off-by: Feras Daoud <[email protected]>
Signed-off-by: Moshe Shemesh <[email protected]>
Signed-off-by: Daniel Jurgens <[email protected]>
Reviewed-by: Alex Vesker <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
5 years agonet/mlx5: Add Crdump support
Alex Vesker [Tue, 17 Jul 2018 08:18:26 +0000 (11:18 +0300)]
net/mlx5: Add Crdump support

Crdump allows the driver to retrieve a dump of the FW PCI crspace.
This is useful in case of catastrophic issues which may require FW
reset. The crspace dump can be used for later debug.

Signed-off-by: Alex Vesker <[email protected]>
Signed-off-by: Moshe Shemesh <[email protected]>
Reviewed-by: Feras Daoud <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
5 years agonet/mlx5: Add Vendor Specific Capability access gateway
Alex Vesker [Thu, 28 Jun 2018 12:05:58 +0000 (15:05 +0300)]
net/mlx5: Add Vendor Specific Capability access gateway

The Vendor Specific Capability (VSC) is used to activate a gateway
interfacing with the device. The gateway is used to read or write
device configurations, which are organized in different domains (spaces).
A configuration access may result in multiple actions, reads, writes.

Example usages are accessing the Crspace domain to read the crspace or
locking a device semaphore using the Semaphore domain.

The configuration access use pci_cfg_access to prevent parallel access to
the VSC space by the driver and userspace calls.

Signed-off-by: Alex Vesker <[email protected]>
Signed-off-by: Feras Daoud <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
5 years agonet/mlx5: Move all devlink related functions calls to devlink.c
Eran Ben Elisha [Tue, 11 Dec 2018 14:09:51 +0000 (16:09 +0200)]
net/mlx5: Move all devlink related functions calls to devlink.c

Centralize all devlink related callbacks in one file.
In the downstream patch, some more functionality will be added, this
patch is preparing the driver infrastructure for it.

Currently, move devlink un/register functions calls into this file.

Signed-off-by: Eran Ben Elisha <[email protected]>
Reviewed-by: Moshe Shemesh <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
5 years agoDocumentation: net: mlx5: Add mlx5 initial documentation
Saeed Mahameed [Wed, 12 Jun 2019 00:15:13 +0000 (17:15 -0700)]
Documentation: net: mlx5: Add mlx5 initial documentation

Add initial documentation for mlx5 driver.

Signed-off-by: Saeed Mahameed <[email protected]>
5 years agodevlink: Hang reporter's dump method on a dumpit cb
Aya Levin [Thu, 16 May 2019 06:49:20 +0000 (09:49 +0300)]
devlink: Hang reporter's dump method on a dumpit cb

The devlink health reporter provides a dump method on an error. Dump
may contain a large amount of data, in this case doit cb isn't sufficient.
This is because the user side is blocking and doesn't allow draining of
the socket until the socket runs out of buffers. Using dumpit cb
is the correct way to go.
Please note that thankfully the dump op is not yet implemented in any
driver and therefore this change is not breaking userspace.

Fixes: 35455e23e6f3 ("devlink: Add health dump {get,clear} commands")
Signed-off-by: Aya Levin <[email protected]>
Acked-by: Jiri Pirko <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
5 years agotcp: add optional per socket transmit delay
Eric Dumazet [Wed, 12 Jun 2019 18:57:25 +0000 (11:57 -0700)]
tcp: add optional per socket transmit delay

Adding delays to TCP flows is crucial for studying behavior
of TCP stacks, including congestion control modules.

Linux offers netem module, but it has unpractical constraints :
- Need root access to change qdisc
- Hard to setup on egress if combined with non trivial qdisc like FQ
- Single delay for all flows.

EDT (Earliest Departure Time) adoption in TCP stack allows us
to enable a per socket delay at a very small cost.

Networking tools can now establish thousands of flows, each of them
with a different delay, simulating real world conditions.

This requires FQ packet scheduler or a EDT-enabled NIC.

This patchs adds TCP_TX_DELAY socket option, to set a delay in
usec units.

  unsigned int tx_delay = 10000; /* 10 msec */

  setsockopt(fd, SOL_TCP, TCP_TX_DELAY, &tx_delay, sizeof(tx_delay));

Note that FQ packet scheduler limits might need some tweaking :

man tc-fq

PARAMETERS
   limit
       Hard  limit  on  the  real  queue  size. When this limit is
       reached, new packets are dropped. If the value is  lowered,
       packets  are  dropped so that the new limit is met. Default
       is 10000 packets.

   flow_limit
       Hard limit on the maximum  number  of  packets  queued  per
       flow.  Default value is 100.

Use of TCP_TX_DELAY option will increase number of skbs in FQ qdisc,
so packets would be dropped if any of the previous limit is hit.

Use of a jump label makes this support runtime-free, for hosts
never using the option.

Also note that TSQ (TCP Small Queues) limits are slightly changed
with this patch : we need to account that skbs artificially delayed
wont stop us providind more skbs to feed the pipe (netem uses
skb_orphan_partial() for this purpose, but FQ can not use this trick)

Because of that, using big delays might very well trigger
old bugs in TSO auto defer logic and/or sndbuf limited detection.

Signed-off-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agoMerge branch 'ena-dynamic-queue-sizes'
David S. Miller [Wed, 12 Jun 2019 18:23:45 +0000 (11:23 -0700)]
Merge branch 'ena-dynamic-queue-sizes'

Sameeh Jubran says:

====================
Support for dynamic queue size changes

This patchset introduces the following:
* add new admin command for supporting different queue size for Tx/Rx
* add support for Tx/Rx queues size modification through ethtool
* allow queues allocation backoff when low on memory
* update driver version

Difference from v2:
* Dropped superfluous range checks which are already done in ethtool. [patch 5/7]
* Dropped inline keyword from function. [patch 4/7]
* Added a new patch which drops inline keyword all *.c files. [patch 6/7]

Difference from v1:
* Changed ena_update_queue_sizes() signature to use u32 instead of int
  type for the size arguments. [patch 5/7]
====================

Signed-off-by: David S. Miller <[email protected]>
5 years agonet: ena: update driver version from 2.0.3 to 2.1.0
Sameeh Jubran [Tue, 11 Jun 2019 11:58:11 +0000 (14:58 +0300)]
net: ena: update driver version from 2.0.3 to 2.1.0

Update driver version to match device specification.

Signed-off-by: Sameeh Jubran <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agonet: ena: remove inline keyword from functions in *.c
Sameeh Jubran [Tue, 11 Jun 2019 11:58:10 +0000 (14:58 +0300)]
net: ena: remove inline keyword from functions in *.c

Let the compiler decide if the function should be inline in *.c files

Signed-off-by: Sameeh Jubran <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agonet: ena: add ethtool function for changing io queue sizes
Sameeh Jubran [Tue, 11 Jun 2019 11:58:09 +0000 (14:58 +0300)]
net: ena: add ethtool function for changing io queue sizes

Implement the set_ringparam() function of the ethtool interface
to enable the changing of io queue sizes.

Signed-off-by: Arthur Kiyanovski <[email protected]>
Signed-off-by: Sameeh Jubran <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agonet: ena: allow queue allocation backoff when low on memory
Sameeh Jubran [Tue, 11 Jun 2019 11:58:08 +0000 (14:58 +0300)]
net: ena: allow queue allocation backoff when low on memory

If there is not enough memory to allocate io queues the driver will
try to allocate smaller queues.

The backoff algorithm is as follows:

1. Try to allocate TX and RX and if successful.
1.1. return success

2. Divide by 2 the size of the larger of RX and TX queues (or both if their size is the same).

3. If TX or RX is smaller than 256
3.1. return failure.
4. else
4.1. go back to 1.

Also change the tx_queue_size, rx_queue_size field names in struct
adapter to requested_tx_queue_size and requested_rx_queue_size, and
use RX and TX queue 0 for actual queue sizes.
Explanation:
The original fields were useless as they were simply used to assign
values once from them to each of the queues in the adapter in ena_probe().
They could simply be deleted. However now that we have a backoff
feature, we have use for them. In case of backoff there is a difference
between the requested queue sizes and the actual sizes. Therefore there
is a need to save the requested queue size for future retries of queue
allocation (for example if allocation failed and then ifdown + ifup was
called we want to start the allocation from the original requested size of
the queues).

Signed-off-by: Arthur Kiyanovski <[email protected]>
Signed-off-by: Sameeh Jubran <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agonet: ena: make ethtool show correct current and max queue sizes
Sameeh Jubran [Tue, 11 Jun 2019 11:58:07 +0000 (14:58 +0300)]
net: ena: make ethtool show correct current and max queue sizes

Currently ethtool -g shows the same size for current and max queue
sizes.

Signed-off-by: Arthur Kiyanovski <[email protected]>
Signed-off-by: Sameeh Jubran <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agonet: ena: enable negotiating larger Rx ring size
Sameeh Jubran [Tue, 11 Jun 2019 11:58:06 +0000 (14:58 +0300)]
net: ena: enable negotiating larger Rx ring size

Use MAX_QUEUES_EXT get feature capability to query the device.

Signed-off-by: Netanel Belgazal <[email protected]>
Signed-off-by: Sameeh Jubran <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agonet: ena: add MAX_QUEUES_EXT get feature admin command
Arthur Kiyanovski [Tue, 11 Jun 2019 11:58:05 +0000 (14:58 +0300)]
net: ena: add MAX_QUEUES_EXT get feature admin command

Add a new admin command to support different queue size for Tx/Rx
queues (the change also support different SQ/CQ sizes)

Signed-off-by: Arthur Kiyanovski <[email protected]>
Signed-off-by: Sameeh Jubran <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agoMerge branch 'dpaa2-eth-Add-support-for-MQPRIO-offloading'
David S. Miller [Wed, 12 Jun 2019 18:22:18 +0000 (11:22 -0700)]
Merge branch 'dpaa2-eth-Add-support-for-MQPRIO-offloading'

Ioana Radulescu says:

====================
dpaa2-eth: Add support for MQPRIO offloading

Add support for adding multiple TX traffic classes with mqprio. We can have
up to one netdev queue and hardware frame queue per TC per core.
====================

Signed-off-by: David S. Miller <[email protected]>
5 years agodpaa2-eth: Add mqprio support
Ioana Radulescu [Tue, 11 Jun 2019 11:50:03 +0000 (14:50 +0300)]
dpaa2-eth: Add mqprio support

Implement mqprio qdisc support by mapping traffic classes to
different hardware enqueue priorities. The maximum number of
supported traffic classes is an attribute of each DPNI object.

The traffic classes map to hardware priorities from highest (0)
to lowest (highest prio number). The skb priority information
received from the stack is used to select the hardware Tx queue
on which to enqueue the frame.

Signed-off-by: Ioana Radulescu <[email protected]>
Signed-off-by: Bogdan Purcareata <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agodpaa2-eth: Support multiple traffic classes on Tx
Ioana Radulescu [Tue, 11 Jun 2019 11:50:02 +0000 (14:50 +0300)]
dpaa2-eth: Support multiple traffic classes on Tx

DPNI objects can have multiple traffic classes, as reflected by
the num_tc attribute. Until now we ignored its value and only
used traffic class 0.

This patch adds support for multiple Tx traffic classes; we have
num_queues x num_tcs hardware queues available for each interface.

Signed-off-by: Ioana Radulescu <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agodpaa2-eth: Refactor xps code
Ioana Radulescu [Tue, 11 Jun 2019 11:50:01 +0000 (14:50 +0300)]
dpaa2-eth: Refactor xps code

Move the code configuring xps on the netdev TX queues to a
separate function. A subsequent patch will need to call
this in another context as well.

Signed-off-by: Ioana Radulescu <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agonet: ethernet: ti: cpts: fix build failure for powerpc
Grygorii Strashko [Tue, 11 Jun 2019 11:16:32 +0000 (14:16 +0300)]
net: ethernet: ti: cpts: fix build failure for powerpc

Add dependency to TI CPTS from Common CLK framework COMMON_CLK to fix
allyesconfig build for Powerpc:

drivers/net/ethernet/ti/cpts.c: In function 'cpts_of_mux_clk_setup':
drivers/net/ethernet/ti/cpts.c:567:2: error: implicit declaration of function 'of_clk_parent_fill'; did you mean 'of_clk_get_parent_name'? [-Werror=implicit-function-declaration]
  of_clk_parent_fill(refclk_np, parent_names, num_parents);
  ^~~~~~~~~~~~~~~~~~
  of_clk_get_parent_name

Fixes: a3047a81ba13 ("net: ethernet: ti: cpts: add support for ext rftclk selection")
Reported-by: Stephen Rothwell <[email protected]>
Signed-off-by: Grygorii Strashko <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agonet: dsa: Deal with non-existing PHY/fixed-link
Florian Fainelli [Mon, 10 Jun 2019 19:31:49 +0000 (12:31 -0700)]
net: dsa: Deal with non-existing PHY/fixed-link

We need to specifically deal with phylink_of_phy_connect() returning
-ENODEV, because this can happen when a CPU/DSA port does connect
neither to a PHY, nor has a fixed-link property. This is a valid use
case that is permitted by the binding and indicates to the switch:
auto-configure port with maximum capabilities.

Fixes: 0e27921816ad ("net: dsa: Use PHYLINK for the CPU/DSA ports")
Signed-off-by: Florian Fainelli <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agonet: dsa: mv88e6xxx: lock mutex in port_fdb_dump
Vivien Didelot [Wed, 12 Jun 2019 16:42:47 +0000 (12:42 -0400)]
net: dsa: mv88e6xxx: lock mutex in port_fdb_dump

During a port FDB dump operation, the mutex protecting the concurrent
access to the switch registers is currently held by the internal
mv88e6xxx_port_db_dump and mv88e6xxx_port_db_dump_fid helpers.

It must be held at the higher level in mv88e6xxx_port_fdb_dump which
is called directly by DSA through ds->ops->port_fdb_dump. Fix this.

Signed-off-by: Vivien Didelot <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This page took 0.113262 seconds and 4 git commands to generate.