Commit Graph

1734 Commits

Author SHA1 Message Date
Linux Build Service Account
767adf23ae Merge "qcacmn: Return DP_SW2HW_MACID if per_pdev_lmac" 2020-04-08 15:48:31 -07:00
Linux Build Service Account
045f1d5432 Merge "qcacmn: Support for IPQ8074 2G PHYB mode 2/3" 2020-04-08 15:48:31 -07:00
Nandha Kishore Easwaran
3e4379cdd8 qcacmn: Return DP_SW2HW_MACID if per_pdev_lmac
Return DP_SW2HW_MACID if per_pdev_lmac is set.
This is needed when we need to get target pdev_id without
doing pdev lookup.

Change-Id: If83f29bbcf23175708ba7eaf58e01e040ccb5a45
2020-04-08 13:43:56 -07:00
Nandha Kishore Easwaran
1039ae6642 qcacmn: Support for IPQ8074 2G PHYB mode 2/3
This mode is supported through hw_mode_id 7. A special mode for
IPQ8074 platform alone to bring up single pdev alone on 2G mode.
FW would advertise the mode 7 support through the WMI service
ready message and this mode will be the default mode for AP-HK10 alone.

Added preferred_hw_mode and target_pdev_id into dp structures so that
they can be used to configure the dp rings for this particular mode.
Also changed the lmac_id to target_pdev_id mapping for mode 7.

Change-Id: I3aae46fea13132eebaf7d37cff68ef517253d229
2020-04-08 13:43:30 -07:00
Linux Build Service Account
782c0802c6 Merge "qcacmn: Enable SW2TCL_CMD ring for data" 2020-04-08 09:17:04 -07:00
Radha Krishna Simha Jiguru
bfbf27a6e6 qcacmn: Enable SW2TCL_CMD ring for data
Enable SW2TCL_CMD ring for data on QCN9000, QCA8074 V2/V1
and IPQ6018 targets.

Enabled 4th Tx ring for data enqueue to HW.
Transmit completions for packets from CPU0 and CPU3 are routed to
WBM2SW Completion ring 2.
WB2SW completion ring2 is mapped to CPU3.

Change-Id: Ied4c4704e1f8623e909ad45c547a611de26c7ec5
2020-04-08 08:19:05 -07:00
Tiger Yu
19c09f199a qcacmn: Use QDF_BUG instead of the qdf_assert
Use QDF_BUG instead of the qdf_assert. Since the qdf_assert is not
defined anymore.

Change-Id: I2bd46def51823829604b699321f9a02fcd3b07c6
CRs-Fixed: 2658545
2020-04-08 01:41:10 -07:00
Rakesh Pillai
962dd74800 qcacmn: Reap more monitor ring entries before rescheduling timer
Currently, in monitor mode, once the status ring is reaped
we do not check again if there are new entries added in the
ring during the monitor ring descriptor processing. This
can cause backpressure on monitor rings when there is very
high throughput or a bursty inflow of packets.

Add the logic to continue reaping the monitor rings, until
the work budget or a time quota is not exhausted.

Change-Id: Iee95ac8aec92eabb3a8037b1dd9cf0c6e1dbe10b
CRs-Fixed: 2650480
2020-04-07 20:19:53 -07:00
Rakesh Pillai
e0332f2ef5 qcacmn: Process only LMAC rings for monitor mode
Currently the timer handler, in monitor mode, is
try to process all the rings based on the mask. In
monitor mode only LMAC rings are to be processed
and the UMAC ring processing can be avoided.

Process only the LMAC rings for monitor mode.

Change-Id: Ie48722d80722350129b5c079b67ede06945f5849
CRs-Fixed: 2650480
2020-04-07 20:19:39 -07:00
Rakesh Pillai
590d880a1e qcacmn: Change the loglevel for link desc return failure
In monitor mode, the link descriptor return failure
can occur many times, due to the timer interval.
Logging each failure on the console floods it with
too many unnecessary logs.

Ratelimit the link descriptor return failure in monitor
mode and also change its log level to info.

Change-Id: I5709a33087c6d9271d4246f04ef1acd274fba0f1
CRs-Fixed: 2650480
2020-04-07 20:19:23 -07:00
Rakesh Pillai
726242759f qcacmn: Change the monitor mode timer interval to 5ms
The current time interval for monitor mode timer is
10 milliseconds. This time interval is a bit too high
in case of high throughput sniffing, thereby causes
the monitor rings to be full before the timer interrupt
comes and reaps the ring.

Decrease the timer interval to 5 milliseconds

Change-Id: Ib074ef0c09fde995a7481c056ad70eb809c5a89e
CRs-Fixed: 2650480
2020-04-07 20:19:16 -07:00
Himanshu Batra
d7e15e64e0 qcacmn: Drop FCS error frames in mon dest ring in mcopy mode
In mon dest ring, for m_copy mode, MGMT packets are received with
FCS error.Due to which multiple skbs (Head_skb with
attached frag_list) for single MPDU are sent to upper stack.
Add fix to drop FCS error frames in mcopy mode.

Change-Id: I6fbf2ea2bfdc489b56a412ece3c644ba2ce87929
2020-04-07 07:46:27 -07:00
Manjunathappa Prakash
25390a01c2 qcacmn: flow_ctrl_v2: decouple tx_desc from TCLring descs
Decouple software tx_descs from TCLring descriptors and Increase
TCLring descriptors max INI config limit to 2k to 32k.

Change-Id: I18d014cdb0c1e26b7661ff65aaa8dffe791d7163
CRs-Fixed: 2657056
2020-04-07 03:01:29 -07:00
Jingxiang Ge
e7d41574f3 qcacmn: Add dbgid for each runtime put/get
This is to enhance statics for runtime put/get, which is
to detect if there is mismatch for usage_count.

Change-Id: I24cddb9d10e4cb675c8375cbd0f589c7718bd680
CRs-Fixed: 2647972
2020-04-07 01:20:41 -07:00
Radha Krishna Simha Jiguru
1167fc9bd4 qcacmn: Restrict DMA Map/UnMap upto skb tail
Restrict DMA Map/UnMap upto tail of the packet during transmission
and transmit completion.

Change-Id: I5659d1bff967e529bb4408b5a7be5e6737726a32
2020-04-03 01:48:03 -07:00
Yu Tian
8abdbcc616 qcacmn: Implement send DELBA per HTT event
Is some cases, FW wants to adjust BA session parameters
FW sends a HTT event and HOST helps to send out DELBA
and modify BA win size in the next round of ADDBA req/resp
exchange to reduce following RX AMPDU aggr-size

Change-Id: I97777ff59a18346f2cd4e2e562c8ae6acdcd69d7
CRs-Fixed: 2644641
2020-04-02 00:12:42 -07:00
Yu Tian
22eed0e6af qcacmn: Limit the REO cmd number in batch operate
MCL path add the desc back to freelist when FLUSH
failed. It may cause the CMD pending in free list
is even larger than REO_CMD_RING max size and lead CMD
flood then cause REO HW in an unexpected condition.
So it's needed to limit the number REO cmds in a batch
operation.

Change-Id: Ib6b97f0693feb7bb5829bda4683248b495b6c7b3
CRs-Fixed: 2642516
2020-04-01 07:36:33 -07:00
Yeshwanth Sriram Guntuka
0ffde7142a qcacmn: Add support to track per peer no ack counts
Add support to track no ack count for different protocol
packets per peer.

Change-Id: I32f04eb3817c1b6c4806c8bb0230db3a71fadb5e
CRs-Fixed: 2643532
2020-04-01 00:21:41 -07:00
Tiger Yu
33bf405da4 qcacmn: Use dp_info_rl instead of QDF_TRACE to avoid aggressive logging
There might be aggressive error logging in the dmesg if wbm_desc_rel_ring
is hang. So use the dp_info_rl instead of QDF_TRACE to reduce aggressive
logging to avaoid spin lock huge delay when processing the
reo_exception_ring.

Change-Id: I4622f28cd6d8771cf27643a867892b62860d1ddc
CRs-Fixed: 2648149
2020-03-31 11:39:39 -07:00
aloksing
4b45241915 qcacmn: Add check for NULL pointer
Pointer rx_msdu_link_desc returned from call to function
dp_rx_cookie_2_mon_link_desc which may be NULL and may be
de-referenced latter

CR-Fixed: 2645199
Change-Id: I9ccba61df9571fcc99c5d5493194d5ae43a71a7f
2020-03-31 04:11:00 -07:00
Srinivas Pitla
ebf2f5aa58 qcacmn: update ba_size only when ba_size is 0
For ACK completion, update ba_size, ba_bitmap, ba_seqno
only if these are not updated earlier.

This fix updates ba_size, ba_bitmap, ba_seqno for QOS TID frames
in ACK completion handler, if these are not updated earlier.

CRs-Fixed: 2650482
Change-Id: I1d5f4bdb29a3d5194cd4a1544b39d6aa42903b1b
2020-03-30 17:11:16 -07:00
Saket Jha
07622e4108 qcacmn: Fix double unmap issue in HTC misc list
Add mutex protection while freeing pkts in HTC misc list to prevent
double unmap of netbuf.

Change-Id: I5c52324e382f8047037ca1d1a50367bc6052b737
CRs-Fixed: 2646771
2020-03-28 12:16:24 -07:00
Jinwei Chen
248f7bd35a qcacmn: fix invalid net_dev fetched from gro queue skb
Dp_rx_vdev_detach() will flush all gro skb to make sure the
net_dev stored in skb is valid before this vdev is down, but
dp_rx_vdev_detach() is only invoked at the end of function
dp_vdev_detach_wifi3(). for some case, if there is still dp_peer
pending when execute dp_vdev_detach_wifi3(), dp_rx_vdev_detach()
won't be invoked.
  Move dp_rx_vdev_detach() before pending peer detection in
dp_vdev_detach_wifi3() so that gro queue skb flushing can be
executed each time.

Change-Id: I0feea5b77de7efab884c0e5822c8671119892f7d
CRs-fixed: 2649385
2020-03-27 22:40:43 -07:00
Jinwei Chen
b3e587db52 qcacmn: Support RX 2K jump/OOR frame handling from REO2TCL ring
Support RX 2K jump/OOR frame handling from REO2TCL ring.
(a) configure REO error destination ring register to route 2K jump
/OOR frame to REO2TCL ring.
(b) for 2K jump RX frame, only accept ARP frame and drop others,
meanwhile, send delba action frame to remote peer once receive first
2K jump data.
(c) for OOR RX frame, accept ARP/EAPOL/DHCP/IPV6_DHCP frame, otherwise
drop it.

Change-Id: I7cb33279a8ba543686da4eba547e40f86813e057
CRs-Fixed: 2631949
2020-03-24 19:58:16 -07:00
Aniruddha Paul
b869cb0dde qcacmn: Add jitter stats to per tid Object
Add average jitter, average delay, and total success
packet count stats to per TID object.

Change-Id: Ic3ae6d4c090a5fe82e09c085e92cd5eaea4d2056
2020-03-24 19:57:54 -07:00
Wu Gao
577bdfe20e qcacmn: Add dp interface to enable/disable reap timer
Enhanced channel frequency response (CFR) based on monitor status
ring, need to enable mon reap timer before starting CFR and disable
the timer after stopping CFR capture. This change adds interface to
enable/disable monitor status ring's reap timer.

Change-Id: I843433ac07c4d55e14b42855ee22779eb7ecb678
CRs-Fixed: 2639307
2020-03-24 10:24:50 -07:00
Radha Krishna Simha Jiguru
351cdfe15f qcacmn: Clean up dp_tx_desc_alloc and dp_tx_desc_free API
Clean up dp_tx_desc_alloc and dp_tx_desc_free API to avoid array
dereferencing multiple times.

Change-Id: If84721cb2c6fe023d8008a97859bc88421b58e94
2020-03-24 02:42:09 -07:00
Radha Krishna Simha Jiguru
403408b8c9 qcacmn: rearrange initializations in dp_tx_send
Avoid memzeo of seg_info and msdu_info removing from default standard path
qdf_ktime_to_msg(qdf_ktime_get());  -- moved under a flag
Eth_hdr access made inside the Mcast enhancement check.

Change-Id: I12b6cc397d7eb626abdcdae001e92ef0d980e8a6
2020-03-24 02:41:53 -07:00
Radha Krishna Simha Jiguru
c13c930a62 qcacmn: Rearrange dp_tx_send_single
Rearrange dp_tx_send_single to avoid code duplication.

Change-Id: I35d9f9c36ffecd00931d58b9f66ebc809320963f
2020-03-24 02:41:37 -07:00
Neha Bisht
3b0a0f19ce qcacmn: Disable packet trace by default in per packet path
Disable packet trace by default in per packet path..

Change-Id: I04e998a997edac33eaf1328b71fb6eba675e54c7
2020-03-24 02:41:23 -07:00
Radha Krishna Simha Jiguru
d78c96c67c qcacmn: Restrict lock hold time in tx path
Restrict lock hold time in transmit path to only ring access time.
Also store lmac_id in vdev to avoid multi indirection.
Arrange fields in data structure for better alignment in data path access.

Change-Id: I1d32880ed88be486171be46281ec180d2a4906bf
2020-03-24 02:41:07 -07:00
Mainak Sen
aceafadc2e qcacmn: WBM msdu continuation for SG in QCN9000
In QCN9000, wbm release ring has msdu continuation bit
support for invld peer MPDUs. Host needs to form SG
buffer for packets with msdu continuation bit set

Change-Id: Ica03c78068d32d2c8dc609b9a50298b91dd48c0a
2020-03-23 16:07:47 -07:00
Basamma Yakkanahalli
9def5df14a qcacmn: device ID and target type checks for ipq5018 target
Initial changes for ipq5018 compilation.
Added device ID and target type checks for ipq5018 traget.

Change-Id: Ib86a371fbe66749fcb6d114e7a4a9931b684e03d
2020-03-20 23:45:43 -07:00
Amir Patel
925a7d389c qcacmn: Add full monitor mode changes
Add following changes:
	a. Add CDP API to config full monitor mode
	b. HTT configuration changes
	c. Init/Deinit changes for full monitor mode resources

CRs-Fixed: 2632442
Change-Id: I06db5194031b3ea0f0c1e5deda20df4bc0faa0b9
2020-03-20 22:16:00 -07:00
Sravan Goud
35b8f761f9 qcacmn: Return correct rx refill buf ring
In dp_rxdma_get_mon_buf_ring returns mac id index of
rx_refill_buf_ring array. But for targets with only one
pdev only the zeroth index is initialized. This will lead
to replenish failures in case of monitor mode when mon dest
process of lmac ring with mac id 1. So return only index 0 of
rx refill buf ring.

Change-Id: I03a7e19ea8d976e19fe6482aff0080dfa4d5ec45
CRs-Fixed: 2638655
2020-03-20 20:37:05 -07:00
Srinivas Pitla
cd32eed2af qcacmn: Drop mgmt nbuf in tx_capture disabled case
If tx_capture is disabled, the frames notified to tx_capture
module needs to be freed.

This change frees mgmt frames in tx capture module, if the feature
is disabled

Change-Id: I5f9ced69246c2b712d76f2f3cc61b5c386b703ec
CRs-Fixed: 2644025
2020-03-20 20:36:47 -07:00
Vevek Venkatesan
a62641c747 qcacmn: add synchronous timer stop to avoid race condition
Change the qdf_timer_stop to qdf_timer_sync_cancel (synchronized
timer stop), so it can wait till previous handler is completed
and then stop/delete the timer, to avoid race condition.
Also, call this qdf_timer_sync_cancel in dp_vdev_detach_wifi3,
to be symmetry with timer start in dp_vdev_attach_wifi3.

Change-Id: I3e975554b5492ccfc684ffe8b021c62ef39bf4d7
CRs-Fixed: 2644432
2020-03-19 22:25:27 -07:00
Amit Shukla
a700ecf10e qcacmn: Fix rate and PHY type for disassoc retry packets
In tx capture feature, the last retry packet has wrong rate.
This is because the peer is invalid at the time rate TLV is processed
for retries.

Change-Id: I0eb9a8c80f8ea0dde60fe819c7e667293630a379
CRs-Fixed: 2633669
2020-03-19 01:36:55 -07:00
Chaithanya Garrepalli
f9eb64de02 qcacmn: handle decrypt error on in case of peer invalid
In case of decrypt de-auth need to be sent in case of
invalid. In valid peer case no action needed

Change-Id: I355093734c20a113fc1df0306b426eeb4f92ac88
2020-03-17 05:15:09 -07:00
Pavankumar Nandeshwar
9b0c1271ed qcacmn: Initialized pdev id with default value 0xFF
pdev_id is being initialized with 0. Since 0 is valid pdev_id, though
pdev is not present for that id, it is being accessed.

Initialized pdev_id to 0xFF by default. Added checks on API to
detect valid pdev_id value corresponding to lmac_id

Change-Id: I2b2a38783615494ccc08e265702815f7e562214b
2020-03-17 03:11:13 -07:00
Pavankumar Nandeshwar
9afaef18bf qcacmn: Assign soc to dp_pdev soon after allocation
Assign soc to dp_pdev soon after allocation, since the
soc pointer is required during deinit if pdev attach fails.

Change-Id: I87789deb82efe9f554b3310a904dd340c5eb9f7a
CRs-fixed: 2638378
2020-03-17 01:06:23 -07:00
Saket Jha
42f305e423 qcacmn: Avoid accessing invalid cookie rx_descriptor
Remove debug dump call to dp_rx_desc_dump() as cookie rx_descriptor is
invalid.

Change-Id: I106ebc2f872e43079abd6e6e493c90022fd09c3b
CRs-Fixed: 2638059
2020-03-16 19:55:12 -07:00
Chaithanya Garrepalli
1da6b755af qcacmn: drop nbufs in WBM error with sa_idx out of range
In some cases we are seeing sa as valid and sa_idx out of
range. Drop nbufs in this case

Change-Id: I17c4ff41817a77f0eb8fcdf77fa17d4d3197f97b
2020-03-16 08:05:48 -07:00
Rakesh Pillai
f2e0f22bf7 qcacmn: Fix stack frame overflow for dp_rx_process
dp_rx_process stack frame has grown to exceed the
stack frame size of 4096. dp_rx_deliver_to_stack_no_peer
is a big function which should not be inline. Calling it
in other function increases the stack size consumed by the
caller function a lot.

Since dp_rx_deliver_to_stack_no_peer is not called very
frequently from dp_rx_process, changing its type to non-inline
function does not hit the core rx datapath much. Hence
change dp_rx_deliver_to_stack_no_peer to a non-inline
function.

Change-Id: Ib042f74c1f5a9cbe5fd947a24f004bb2fecf1fb1
CRs-Fixed: 2636365
2020-03-16 03:47:48 -07:00
Kai Chen
b1a940fa76 qcacmn: Fix issue on block ACK on response to BAR
Fix the issue on block ACK on response to BAR frame.
Parse BAR frame received from monitor destination ring and
generate block ack frame from BAR frame and previous block
ACK frame.

Change-Id: Ifc242b3850630aa25827b003a1e2078a9228358a
2020-03-11 01:47:02 -07:00
Nisha Menon
af7af90906 qcacmn: SMMU fault as iova to phy address is invalid
IPA pipes are not disconnected successfully when the last
client disconnects and despite that smmu mappings given
to IPA for the buffers are released.
Assert instead of releasing the smmu buffer mappings as
IPA has stalled and is in a non-recoverable state.

Change-Id: I9a9a35a4019726421d7435b62defe8da4907d4e0
CRs-Fixed: 2627889
2020-03-09 20:58:50 -07:00
Mohit Khanna
b4429e8278 qcacmn: Add delayed register write support in HAL
In case the bus is in low power mode, the register writes (followed by a
memory barrier) may take a long time (~4ms). This can cause the caller
to block till the PCIe write is completed. Thus, even though PCI
writes are posted, it can still block the caller.

Hence, in case the bus is in low power mode (not in M0), or not in high
throughput scenarios, queue the register write in a workqueue. The
register write will happen in the delayed work context. In other cases,
i.e ,when the bus is not in low power mode or in high thoughput
scenarios, do the register writes in caller context.

Change-Id: Idf218e4581545bc6ac67b91d0f70d495387ca90e
CRs-Fixed: 2602029
2020-03-09 20:58:23 -07:00
Amir Patel
d5a7a4ca89 qcacmn: Revert "qcacmn: Replenish last entry in monitor status ring"
This reverts commit I7da6cd6006243cbca2151da22a31a6f5ed0015f3

Change-Id: I04ceeeeabb5f94bfcd81e10280dcd017da537c81
2020-03-09 14:52:57 -07:00
Ankit Kumar
673a66042b qcacmn: Retrieve peer from mac based search
Use mac based search to avoid use after free Peer.

Change-Id: Ie6c3e82f3bb95cdf4c6504e95704e821bbd19e24
2020-03-09 08:24:21 -07:00
Saket Jha
d364435727 qcacmn: Validate rx return_buffer_manager
Host rx return_buffer_manager should always be 4 or 6. Add check for
invalid return_buffer_manager value in ring descriptor.

Change-Id: I509dd58ddd89e6a0ce1bffa509dcfabbd0fbc975
CRs-Fixed: 2632372
2020-03-06 18:52:30 -08:00