Avraham Stern [Thu, 26 Aug 2021 19:47:37 +0000 (22:47 +0300)]
iwlwifi: mvm: add support for range request command version 13
This version adds the following configuration options:
1. Set the BSS color for NDP ranging
2. Set the minimum and maximum time between measurements for
non trigger based NDP ranging.
3. Terminate the session in case the responder requests LMR feedback.
Johannes Berg [Thu, 19 Aug 2021 15:40:35 +0000 (18:40 +0300)]
iwlwifi: allow debug init in RF-kill
We can send this even if initializing in RF-kill, thus
suppressing a bunch of error messages about it. In fact,
we _want_ to, since we might still want to debug the
firmware even if in RF-kill.
Avraham Stern [Thu, 19 Aug 2021 15:40:34 +0000 (18:40 +0300)]
iwlwifi: mvm: don't schedule the roc_done_wk if it is already running
When P2P roc is removed, the IWL_MVM_STATUS_NEED_FLUSH_P2P bit is set
to indicate to iwl_mvm_roc_done_wk() that the removed roc is a P2P
one, so it will flush the broadcast station and not the aux station.
However, since setting this bit and scheduling the worker is done
in roc ended flow as well as in case the roc is removed, there is
a race where the worker has already started running (but did not
test this bit yet) and then it is scheduled again. In this case,
the first run of the worker will clear this bit, and thus the second
run will find it already cleared and will try to flush and remove
the aux station by mistake.
Fix it by scheduling the worker only if this bit is not yet set. In
case this bit is already set, the worker is either running or
scheduled, so there is no need to re-schedule it.
Johannes Berg [Thu, 19 Aug 2021 15:40:31 +0000 (18:40 +0300)]
iwlwifi: fw: fix debug dump data declarations
The debug dump ranges aren't just an array of such ranges
since each range has a variable size. Therefore, the use
of a struct array is misleading at best.
Change it to be a u8 data[] instead of the struct array,
the code doesn't significantly change since it's actually
doing things correctly now.
Johannes Berg [Thu, 19 Aug 2021 15:40:30 +0000 (18:40 +0300)]
iwlwifi: api: remove datamember from struct
We don't use this, but we embed this struct elsewhere and
having structs with flexible arrays embedded isn't quite
right, with sparse (for example) complaining. Remove the
data[] member in this case.
Johannes Berg [Thu, 19 Aug 2021 15:40:28 +0000 (18:40 +0300)]
iwlwifi: pcie: avoid dma unmap/remap in crash dump
DMA-API debug code pointed out that in this code path we
never check the return value of dma_map_page(), which could
fail.
However, we don't really even want to unmap/remap, we just
want to ensure that we can actually access the last version
of the data that the (now-dead) device may have written, so
only need to dma_sync_single_for_cpu() instead.
Luca Coelho [Thu, 19 Aug 2021 15:40:27 +0000 (18:40 +0300)]
iwlwifi: acpi: fill in SAR tables with defaults
If the tables we get in the iwl_sar_set_profile() is smaller than the
revision we support, we need to fill the values with 0. Make sure
that's the case.
Miri Korenblit [Thu, 5 Aug 2021 11:21:57 +0000 (14:21 +0300)]
iwlwifi: mvm: load regdomain at INIT stage
We used to load the regdomain only in the load stage,
this caused the 'iw phy phy0 reg get' command to fail if we
booted a machine with wifi off.
Therefor we should load it in INIT stage already.
Miri Korenblit [Thu, 5 Aug 2021 11:21:56 +0000 (14:21 +0300)]
iwlwifi: mvm: Read the PPAG and SAR tables at INIT stage
We used to read the PPAG, WRDS, EWRD, WGDS tables from ACPI
in the load stage only. This prevented vendor commands from
being executed before bringing the interface up. Move reading those tables
to INIT stage.
Johannes Berg [Thu, 5 Aug 2021 11:21:54 +0000 (14:21 +0300)]
iwlwifi: fw: correctly limit to monitor dump
In commit 79f033f6f229 ("iwlwifi: dbg: don't limit dump decisions
to all or monitor") we changed the code to pass around a bitmap,
but in the monitor_only case, one place accidentally used the bit
number, not the bit mask, resulting in CSR and FW_INFO getting
dumped instead of monitor data. Fix that.
Abhishek Naik [Thu, 5 Aug 2021 11:21:53 +0000 (14:21 +0300)]
iwlwifi: skip first element in the WTAS ACPI table
By mistake we were considering the first element of the WTAS wifi
package as part of the data we want to rid, but that element is the wifi
package signature (always 0x07), so it should be skipped.
Change the code to read the data starting from element 1 instead.
iwlwifi: mvm: support version 11 of wowlan statuses notification
The new version of the command has same size and layout as
version 10. It just sends corresponding station id in one
of the reserved fields. It's not used in the driver, so just
be ready to accept version 11.
Luca Coelho [Thu, 5 Aug 2021 11:21:51 +0000 (14:21 +0300)]
iwlwifi: convert flat GEO profile table to a struct version
The GEO profiles have been stored in single-dimension arrays and the
access has been done via a single index. We will soon need to support
different revisions of this table, which will make the flat array even
harder to handle. To prepare for that, convert the single-dimension
array to a struct with substructures.
Luca Coelho [Thu, 5 Aug 2021 11:21:49 +0000 (14:21 +0300)]
iwlwifi: support reading and storing EWRD revisions 1 and 2
As an extension to the WRDS support for revisions 1 and 2, do the same
for the EWRD tables. These tables have a very similar format to the
WRDS table, so most of the code is similar.
Luca Coelho [Thu, 5 Aug 2021 11:21:48 +0000 (14:21 +0300)]
iwlwifi: acpi: support reading and storing WRDS revision 1 and 2
Change the SAR profile tables storage to revision 2 regardless of the
revision we read from ACPI. Revision 2 is a superset of revision 1,
which is in turn a superset of revision 0, so they can all be stored
inside revision 2.
Add support for reading and storing also revisions 1 and 2, whose only
difference is the number of chains and number of sub-bands. So most
of the code revolves around passing different chain and sub-band
sizes.
With this patch we still pass only revision 0 to the firmware, but
that will be changed in a separate patch.
Luca Coelho [Thu, 5 Aug 2021 11:21:47 +0000 (14:21 +0300)]
iwlwifi: pass number of chains and sub-bands to iwl_sar_set_profile()
The number of chains and sub-bands read from the ACPI tables varies
depending on the revision. Pass these numbers to the
iwl_sar_set_profile() function in order to make using different
revisions easier.
Luca Coelho [Thu, 5 Aug 2021 10:19:34 +0000 (13:19 +0300)]
iwlwifi: remove ACPI_SAR_NUM_TABLES definition
This definition was only used to pass the size of the tables in the FW
API to the iwl_sar_select_profile() function, but we should actually
pass the definition from the FW API file. We don't have the concept
of tables in the ACPI definition, so we can remove it.
Luca Coelho [Thu, 5 Aug 2021 10:19:33 +0000 (13:19 +0300)]
iwlwifi: convert flat SAR profile table to a struct version
The SAR profiles have been stored in single-dimension arrays and the
access has been done via a single index. We will soon need to support
different revisions of this table, which will make the flat array even
harder to handle. To prepare for that, convert the single-dimension
array to a struct with substructures.
Luca Coelho [Thu, 5 Aug 2021 10:19:32 +0000 (13:19 +0300)]
iwlwifi: rename ACPI_SAR_NUM_CHAIN_LIMITS to ACPI_SAR_NUM_CHAINS
The "LIMITS" in the macro name don't have much meaning, so remove it
to make the macro shorter and better reflect that this is the number
of chains that we have limits for.
Ilan Peer [Thu, 5 Aug 2021 10:19:30 +0000 (13:19 +0300)]
iwlwifi: mvm: Refactor setting of SSIDs for 6GHz scan
- Short SSIDs should always be added for direct SSIDs included
in the scan request. However, this was not done in case that
information for collocated APs was included. Fix this.
- With the above fix, if the FW also supports discovery of hidden
APs over the 6GHz band, also set the corresponding full SSID
information.
Avraham Stern [Thu, 5 Aug 2021 10:19:29 +0000 (13:19 +0300)]
iwlwifi: mvm: silently drop encrypted frames for unknown station
When a station is removed, the driver-mac80211 station mapping is removed
before the station is actually deleted from the FW. As a result, it is
reasonable that the FW will continue to pass frames although the driver
doesn't have a station for them anymore. Thus change the message
severity level from ERR to DEBUG_DROP.
Johannes Berg [Thu, 5 Aug 2021 10:19:28 +0000 (13:19 +0300)]
iwlwifi: mvm: d3: implement RSC command version 5
In later firmware we haven't needed the TSC anyway since
we have it already (and firmware image doesn't change),
but the new version adds the ability to send down replay
counters for more than one GTK. Implement that.
Johannes Berg [Thu, 5 Aug 2021 10:19:27 +0000 (13:19 +0300)]
iwlwifi: mvm: d3: make key reprogramming iteration optional
Now that only reprogramming is left in the initial key iteration,
skip it entirely on unified firmware images instead of skipping
only the command sending inside of it.
Johannes Berg [Thu, 5 Aug 2021 10:19:26 +0000 (13:19 +0300)]
iwlwifi: mvm: d3: add separate key iteration for GTK type
If we're sending the KEK/KCK data we also need the GTK and
IGTK type, add a separate key iteration for that so we can
make the configure_key iteration optional later.
Johannes Berg [Thu, 5 Aug 2021 10:19:25 +0000 (13:19 +0300)]
iwlwifi: mvm: d3: refactor TSC/RSC configuration
Refactor the TSC/RSC configuration out from the normal wowlan
key iteration so we can replace it later with a different one
adapted to a different firmware API.
Johannes Berg [Thu, 5 Aug 2021 10:19:23 +0000 (13:19 +0300)]
iwlwifi: mvm: d3: separate TKIP data from key iteration
We do a key iteration to program the keys, and while at it
we also collect the data necessary for TKIP. This code has
all kinds of dependencies on the firmware API though, so
take out the TKIP phase 1 key generation and do that in a
separate key iteration only if necessary.
Both 'iwl_scan_probe_params_v3' and 'iwl_scan_probe_params_v4'
wrongly addressed the 'bssid_array' field which should supposed
to be any array of BSSIDs each of size ETH_ALEN and not the
opposite. Fix it.
Johannes Berg [Mon, 2 Aug 2021 18:58:50 +0000 (21:58 +0300)]
iwlwifi: read MAC address from correct place on Bz
On Bz devices, the MAC address CSRs changed from 0x380 to 0x30.
Change the boolean configuration "mac_addr_from_csr" to hold the
base address instead, and set it correctly for the different
devices using this feature.
Johannes Berg [Mon, 2 Aug 2021 14:28:29 +0000 (17:28 +0300)]
iwlwifi: mvm: treat MMPDUs in iwl_mvm_mac_tx() as bcast
There's no need for all the complicated conditions here, any
bufferable MMPDUs or MMPDUs for client interfaces are already
coming through the TXQ interface, not iwl_mvm_mac_tx().
Johannes Berg [Mon, 2 Aug 2021 14:28:28 +0000 (17:28 +0300)]
iwlwifi: mvm: clean up number of HW queues
Since switching to mac80211 TXQs, we no longer need to
advertise more hardware queues than ACs, since we don't
even set QUEUE_CONTROL anyway, so the vif->hw_queue[]
mapping array won't be used.
All we need (at least for now) is for hw->queues to
indicate that we have enough queues to handle QoS.
Johannes Berg [Mon, 2 Aug 2021 14:28:27 +0000 (17:28 +0300)]
iwlwifi: mvm: avoid static queue number aliasing
When TVQM is enabled (iwl_mvm_has_new_tx_api() is true), then
queue numbers are just sequentially assigned 0, 1, 2, ...
Prior to TVQM, in DQA, there were some statically allocated
queue numbers:
* IWL_MVM_DQA_AUX_QUEUE == 1,
* both IWL_MVM_DQA_INJECT_MONITOR_QUEUE and
IWL_MVM_DQA_P2P_DEVICE_QUEUE == 2, and
* IWL_MVM_DQA_AP_PROBE_RESP_QUEUE == 9.
Now, these values are assigned to the members mvm->aux_queue,
mvm->snif_queue, mvm->probe_queue and mvm->p2p_dev_queue by
default. Normally, this doesn't really matter, and if TVQM is
in fact available we override them to the real values after
allocating a queue for use there.
However, this allocation doesn't always happen. For example,
for mvm->p2p_dev_queue (== 2) it only happens when the P2P
Device interface is started, if any. If it's not started, the
value in mvm->p2p_dev_queue remains 2. This wouldn't really
matter all that much if it weren't for iwl_mvm_is_static_queue()
which checks a queue number against one of those four static
numbers.
Now, if no P2P Device or monitor interface is added then queue
2 may be dynamically allocated, yet alias mvm->p2p_dev_queue or
mvm->snif_queue, and thus iwl_mvm_is_static_queue() erroneously
returns true for it. If it then gets full, all interface queues
are stopped, instead of just backpressuring against the one TXQ
that's really the only affected one.
This clearly can lead to issues, as everything is stopped even
if just a single TXQ filled its corresponding HW queue, if it
happens to have an appropriate number (2 or 9, AUX is always
reassigned.) Due to a mac80211 bug, this also led to a situation
in which the queues remained stopped across a deauthentication
and then attempts to connect to a new AP started failing, but
that's fixed separately.
Fix all of this by simply initializing the queue numbers to
the invalid value until they're used, if TVQM is enabled, and
also setting them back to that value when the queues are later
freed again.
Luca Coelho [Mon, 2 Aug 2021 14:28:22 +0000 (17:28 +0300)]
iwlwifi: mvm: remove check for vif in iwl_mvm_vif_from_mac80211()
This check is useless, because we would return NULL in that case and
none of the callers actually check that the return value was not NULL
before accessing it.
Johannes Berg [Mon, 2 Aug 2021 14:28:20 +0000 (17:28 +0300)]
iwlwifi: mvm: restrict FW SMPS request
The firmware SMPS request should only be honoured if the
connection is currently with HE and on 160 MHz, so check
that and then potentially reapply any request if the BW
changes.
Johannes Berg [Mon, 2 Aug 2021 14:28:19 +0000 (17:28 +0300)]
iwlwifi: mvm: set replay counter on key install
When installing a (new) key, set the replay counter so that
after FW restart the firmware has the correct value of the
replay counters.
This doesn't have a large effect - for frames that reach
the driver, it will do a replay check, and when installing
a new key, the counter is normally zero to start with (not
for GTK though, if joining the BSS for the first time).
Since this only affects frames handled entirely by the FW,
and that's restricted to a few unicast management frames,
the only affect here is for those after a firmware restart.
EAPOL failure results in deauthentication with various reasons, not
related to AUTH failure specifically, so we just merge AUTH failure
with failed to assoc to AP.
Ilan Peer [Mon, 2 Aug 2021 14:09:43 +0000 (17:09 +0300)]
iwlwifi: mvm: Add support for hidden network scan on 6GHz band
Add support for discovery of hidden networks on the 6GHz band,
by including the scan request direct SSIDs in the FW scan request
command:
- In case a short SSID matches one of the direct SSIDs in the scan
request command, add the matching SSID in the same offset in the
'direct_ssids' array.
- Otherwise, add the SSID in one of the available slots.
Additionally, as a preparation to handle hidden APs, refactor
iwl_mvm_umac_scan_cfg_channels_v6_6g() the function.
Ilan Peer [Mon, 2 Aug 2021 14:09:42 +0000 (17:09 +0300)]
iwlwifi: mvm: Do not use full SSIDs in 6GHz scan
The scan request processing populated the direct SSIDs
in the FW scan request command also for 6GHz scan, which is not
needed and might result in unexpected behavior.
Fix the code to add the direct SSIDs only in case the scan
is not a 6GHz scan.
Luca Coelho [Mon, 2 Aug 2021 14:09:41 +0000 (17:09 +0300)]
iwlwifi: print PNVM complete notification status in hexadecimal
This value is not a simple incrementing integer, it contains some
flags as well, so reading it in hexadecimal is easier. Change the
print to do it in hex instead of decimal.
Johannes Berg [Mon, 2 Aug 2021 14:09:40 +0000 (17:09 +0300)]
iwlwifi: pcie: dump error on FW reset handshake failures
If the firmware crashes while we're waiting for the reset
handshake then it cannot possibly make progress anymore,
and we will just time out the wait. That's pointless, so
just stop waiting at that point.
Additionally, if it never acknowledges the reset handshake,
something went wrong.
Dump an error in both of these cases, but we need to do it
synchronously here since the device will be turned off.
Johannes Berg [Mon, 2 Aug 2021 14:09:38 +0000 (17:09 +0300)]
iwlwifi: pcie: free RBs during configure
When switching op-modes, or more generally when reconfiguring,
we might switch the RB size. In _iwl_pcie_rx_init() we have a
comment saying we must free all RBs since we might switch the
size, but this is actually too late: the switch has been done
and we'll free the buffers with the wrong size.
Fix this by always freeing the buffers, if any, at the start
of configure, instead of only after the size may have changed.
On 64-bit machines, struct iwl_rx_mem_buffer has a lot of
padding due to the use of pointers after the small items.
Move the list entry before them, and while at it also add
documentation for it.
Johannes Berg [Mon, 2 Aug 2021 14:09:36 +0000 (17:09 +0300)]
iwlwifi: mvm: avoid FW restart while shutting down
If the firmware crashes while we're already shutting down
the system, there isn't much we can do since the shutdown
process is continuing and we wanted to do that. Don't do
a FW restart, with the implied debug collection, in this
case.
David S. Miller [Wed, 25 Aug 2021 12:44:30 +0000 (13:44 +0100)]
Merge branch 'pktgen-samples-next'
Juhee Kang says:
====================
samples: pktgen: enhance the ability to print the execution results of samples
This patch series improves the ability to print the execution result of pktgen
samples by adding a line which calls the function before termination and adding
trap SIGINT. Also, this series documents the latest pktgen usage options.
Currently, pktgen samples print the execution result when terminated usually.
However, sample03 is not working properly.
Because sample03 doesn't call the function which prints the execution result
when terminated normally, unlike other samples. So the first commit solves
this issue by adding a line which calls the function before termination.
Also, all pktgen samples are able to send infinite messages per thread by
setting the count option to 0, and pktgen is stopped by Ctrl-C. However,
the sample besides sample{3...5} don't work appropriately because Ctrl-C stops
the script, not just pktgen.
So the second commit solves this issue by adding trap SIGINT. Also, changes
control_c function to print_results to maintain consistency with other samples
on the first commit and second commit.
And current pktgen.rst documentation doesn't add the latest pktgen sample
usage options such as count and IPv6, and so on. Also, the old pktgen
sample scripts are still included in the document. The old scripts were removed
by the commit a4b6ade8359f ("samples/pktgen: remove remaining old pktgen
sample scripts").
Thus, the last commit documents the latest pktgen sample usage and removes
old sample scripts. And fixes a minor typo.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Juhee Kang [Wed, 25 Aug 2021 10:57:17 +0000 (19:57 +0900)]
pktgen: document the latest pktgen usage options
Currently, the pktgen.rst documentation doesn't cover the latest pktgen
sample usage options such as count and IPv6, and so on. Also, this
documentation includes the old sample scripts which are no longer use
because it was removed by the commit a4b6ade8359f ("samples/pktgen :
remove remaining old pktgen sample scripts")
Thus, this commit documents pktgen sample usage using the latest options
and removes old sample scripts, and fixes a minor typo.
Signed-off-by: Juhee Kang <claudiajkang@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Juhee Kang [Wed, 25 Aug 2021 10:57:16 +0000 (19:57 +0900)]
samples: pktgen: add trap SIGINT for printing execution result
All pktgen samples can send indefinitely num messages per thread by
setting the count option to 0(-n 0). If running sample with setting
count 0 and press Ctrl-C to stop this program, the program prints the
result of the execution so far. Currently, the samples besides
sample{3...5} don't work properly. Because Ctrl-C stops the script, not
just pktgen.
In order to solve this, this commit adds trap SIGINT. Also, this commit
changes control_c function to print_result to maintain consistency with
other samples.
Signed-off-by: Juhee Kang <claudiajkang@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
The reason why it doesn't print the execution result when the program is
terminated usually is that sample03 doesn't call the function which
prints the result, unlike other samples.
So, this commit solves this issue by calling the function before
termination. Also, this commit changes control_c function to
print_result to maintain consistency with other samples.
Signed-off-by: Juhee Kang <claudiajkang@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Wed, 25 Aug 2021 12:39:02 +0000 (13:39 +0100)]
Merge branch 'octeontx2-traffic-shaping'
Sunil Goutham says:
====================
Octeontx2: Traffic shaping and SDP link config support
This patch series adds support for traffic shaping configuration
on all silicons available after 96xx C0. And also adds SDP link
related configuration needed when Octeon is connected as an end-point
and traffic needs to flow from end-point to host and vice versa.
Series also has other changes like
- New mbox messages in admin function driver for PF/VF drivers
to retrieve available HW resource count. HW resources like block LFs,
bandwidth profiles etc are covered.
- Added PTP device ID for new CN10K and 95O silicons.
- etc
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Sunil Goutham [Wed, 25 Aug 2021 12:18:46 +0000 (17:48 +0530)]
octeontx2-af: Add mbox to retrieve bandwidth profile free count
Added mbox for PF/VF drivers to retrieve current ingress bandwidth
profile free count. Also added current policer timeunit
configuration info based on which ratelimiting decisions can be
taken by PF/VF drivers.
Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Sunil Goutham [Wed, 25 Aug 2021 12:18:45 +0000 (17:48 +0530)]
octeontx2-af: Remove channel verification while installing MCAM rules
New usecases are popping up where in user wants to install common MCAM
filters for all interfaces. Having channel verification will result in
duplicating such MCAM filters for each of the ingress interface. Hence
removed channel verification.
Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
octeontx2-af: Add PTP device id for CN10K and 95O silcons
CN10K slicon has different device id for PTP device.
Hence this patch updates the driver with new id.
Though ptp driver being a separate driver AF manages
configuring PTP block by all PFs. To manage ptp, AF
driver checks in its probe whether
1. ptp hardware device found on silicon
2. A driver is bound to ptp device
3. The ptp driver probe is successful
In failure of cases 1 and 3, AF proceeds with out ptp
and for case 2 defers the probe. This patch refactors
code also to check for all the PTP device ids given in
ptp device ids table for case 1.
Also added PTP device ID for 95O silicon
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com> Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
George Cherian [Wed, 25 Aug 2021 12:18:43 +0000 (17:48 +0530)]
octeontx2-af: Add free rsrc count mbox msg
Upon receiving the MBOX_MSG_FREE_RSRC_CNT, the AF will find out the
current number of free resources and reply it back to the requester. No
guarantee is given on the future state of the free resources yet.
If another requester sends MBOX_MSG_ATTACH_RESOURCES after this call,
the number of available resources might change.
Signed-off-by: George Cherian <george.cherian@marvell.com> Signed-off-by: Stanislaw Kardach <skardach@marvell.com> Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Added support for packet IO via SDK links which is used when
Octeon is connected as a end-point. Traffic host to end-point
and vice versa flow through SDP links. This patch also support
dual SDP blocks supported in 98xx silicon.
Signed-off-by: Radha Mohan Chintakuntla <radhac@marvell.com> Signed-off-by: Nalla Pradeep <pnalla@marvell.com> Signed-off-by: Subrahmanyam Nilla <snilla@marvell.com> Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Harman Kalra [Wed, 25 Aug 2021 12:18:41 +0000 (17:48 +0530)]
octeontx2-af: nix and lbk in loop mode in 98xx
In 98xx, there are 2 NIX blocks and 4 LBK blocks present. The way
these NIX-LBK should be configured depends on the use case. By
default loopback functionality is supported in AF VF pairs which
are attached to NIX0 and NIX1 LFs alternatively to ensure load
balancing. NIX0 transmits a packet to LBK1 which will be received
by NIX1 and packet transmitted by NIX1 will get received by NIX0 via
LBK2.
There are some requirements where only one AF VF is used and respective
NIX is expected to operate in a mode where it can receive it own packet
back. This can be achieved if NIX0 sends packet to LBK0 and not LBK1.
Adding a flag in LF alloc request mailbox which can setup NIX0 to use
LBK0 and NIX1 can use LBK3.
Signed-off-by: Harman Kalra <hkalra@marvell.com> Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
octeontx2-pf: cleanup transmit link deriving logic
Unlike OcteonTx2, the channel numbers used by CGX/RPM
and LBK on CN10K silicons aren't fixed in HW. They are
SW programmable, hence we cannot derive transmit link
from static channel numbers anymore. Get the same from
admin function via mailbox.
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com> Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
The above scheme has the following drawbacks:
1) It is not in line with other standard NIC behavior.
2) There can be an SW use case where SW can compute the hash
upfront using Toeplitz function and predict the queue selection
to optimize some packet lookup function. The nonstandard
way of doing XOR makes the consumer to not predict the queue selection.
C0 HW revision onwards, The HW can configure the
rss_adder<7:0> as flow_tag<7:0> to align with standard NICs.
This patch adds an option to select legacy RSS adder mode
vs standard NIC behavior by setting NIX_LF_RSS_TAG_LSB_AS_ADDER flag.
Since this bit field is used as reserved in old HW revisions,
No need to have an additional HW version check.
Signed-off-by: Jerin Jacob <jerinj@marvell.com> Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
octeontx2-af: enable tx shaping feature for 96xx C0
Starting from 96xx C0 onwards all silicons support traffic shaping.
This patch enables that feature along with other changes
- When PIR/CIR shaping config is modified, toggle SW_XOFF
for config to take effect
- Before SMQ flush, clear SW_XOFF at all parent schedulers
- Support to read current transmit scheduler configuration via mbox
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com> Signed-off-by: Geetha sowjanya <gakula@marvell.com> Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com> Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
octeontx2-af: Wait for TX link idle for credits change
NIX_AF_TX_LINKX_NORM_CREDIT holds running counter of
tx credits available per link. But, tx credits should be
configured based on MTU config. So MTU change needs tx
credit count update.
An issue exists whereby when both PF & VF are enabled and
PF traffic is flowing, if VF requests for MTU update,
updating the NORM_CREDIT register will lead to corruption
of credit count and subsequent deadlock of tx link as
the NORM_CREDIT register holds running count.
This patch provides workaround by pausing link traffic
using NIX_AF_TL1X_SW_XOFF, waiting for existing packets to
drain, and used credits be returned before updating new
credit count.
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com> Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Signed-off-by: Geetha sowjanya <gakula@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
octeontx2-af: Change the order of queue work and interrupt disable
Clear and disable interrupt before queueing work as there might be
a chance that work gets completed on other core faster and
interrupt enable as a part of the work completes before
interrupt disable in the interrupt context. This leads to
permanent disable of interrupt.
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com> Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Signed-off-by: Geetha sowjanya <gakula@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Geetha sowjanya [Wed, 25 Aug 2021 05:35:03 +0000 (11:05 +0530)]
octeontx2-af: cn10k: Set cache lines for NPA batch alloc
Set NPA batch allocation engine to process 35 cache lines
per turn on CN10k platform.
Signed-off-by: Geetha sowjanya <gakula@marvell.com> Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Shaokun Zhang [Wed, 25 Aug 2021 06:34:31 +0000 (14:34 +0800)]
mctp: Remove the repeated declaration
Function 'mctp_dev_get_rtnl' is declared twice, so remove the
repeated declaration.
Cc: Jeremy Kerr <jk@codeconstruct.com.au> Cc: Matt Johnston <matt@codeconstruct.com.au> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com> Signed-off-by: David S. Miller <davem@davemloft.net>
this is a pull request of 4 patches for net-next/master.
The first patch is by Cai Huoqing, and enables COMPILE_TEST for the
rcar CAN drivers.
Lad Prabhakar contributes a patch for the rcar_canfd driver, fixing a
redundant assignment.
The last 2 patches are by Tang Bin, target the mscan driver, and clean
up the driver by converting it to of_device_get_match_data() and
removing a useless BUG_ON.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Wed, 25 Aug 2021 10:18:17 +0000 (11:18 +0100)]
Merge branch 'ravb-gbit-refactor'
Biju Das says:
====================
Add Factorisation code to support Gigabit Ethernet driver
The DMAC and EMAC blocks of Gigabit Ethernet IP found on RZ/G2L SoC are
similar to the R-Car Ethernet AVB IP.
The Gigabit Ethernet IP consists of Ethernet controller (E-MAC), Internal
TCP/IP Offload Engine (TOE) and Dedicated Direct memory access controller
(DMAC).
With a few changes in the driver we can support both IPs.
This patch series aims to add factorisation code to support RZ/G2L SoC,
hardware feature bits for gPTP feature, Multiple irq feature and
optional reset support.
Biju Das [Wed, 25 Aug 2021 07:01:54 +0000 (08:01 +0100)]
ravb: Add reset support
Reset support is present on R-Car. Let's support it, if it is
available.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Biju Das [Wed, 25 Aug 2021 07:01:53 +0000 (08:01 +0100)]
ravb: Factorise ravb_emac_init function
The E-MAC IP on the R-Car AVB module has different initialization
parameters for RX frame size, duplex settings, different offset
for transfer speed setting and has magic packet detection support
compared to E-MAC on RZ/G2L Gigabit Ethernet module. Factorise
the ravb_emac_init function to support the later SoC.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Biju Das [Wed, 25 Aug 2021 07:01:52 +0000 (08:01 +0100)]
ravb: Factorise ravb_dmac_init function
The DMAC IP on the R-Car AVB module has different initialization
parameters for RCR, TGC, TCCR, RIC0, RIC2, and TIC compared to
DMAC IP on the RZ/G2L Gigabit Ethernet module. Factorise the
ravb_dmac_init function to support the later SoC.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Biju Das [Wed, 25 Aug 2021 07:01:51 +0000 (08:01 +0100)]
ravb: Factorise ravb_set_features
RZ/G2L supports HW checksum on RX and TX whereas R-Car supports on RX.
Factorise ravb_set_features to support this feature.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Biju Das [Wed, 25 Aug 2021 07:01:50 +0000 (08:01 +0100)]
ravb: Factorise ravb_adjust_link function
R-Car supports 100 and 1000 Mbps transfer speed whereas RZ/G2L
in addition support 10Mbps. Factorise ravb_adjust_link function
in order to support 10Mbps speed.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Biju Das [Wed, 25 Aug 2021 07:01:49 +0000 (08:01 +0100)]
ravb: Factorise ravb_rx function
R-Car uses an extended descriptor in RX whereas, RZ/G2L uses
normal descriptor in RX. Factorise the ravb_rx function to
support the later SoC.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Biju Das [Wed, 25 Aug 2021 07:01:48 +0000 (08:01 +0100)]
ravb: Factorise ravb_ring_init function
The ravb_ring_init function uses an extended descriptor in RX for
R-Car and normal descriptor for RZ/G2L. Add a helper function
for RX ring buffer allocation to support later SoC.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Biju Das [Wed, 25 Aug 2021 07:01:47 +0000 (08:01 +0100)]
ravb: Factorise ravb_ring_format function
The ravb_ring_format function uses an extended descriptor in RX
for R-Car compared to the normal descriptor for RZ/G2L. Factorise
RX ring buffer buildup to extend the support for later SoC.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Biju Das [Wed, 25 Aug 2021 07:01:46 +0000 (08:01 +0100)]
ravb: Factorise ravb_ring_free function
R-Car uses extended descriptor in RX, whereas RZ/G2L uses normal
descriptor. Factorise ravb_ring_free function so that it can
support later SoC.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: David S. Miller <davem@davemloft.net>