Commit Graph

26 Commits

Author SHA1 Message Date
Weiyi Chen
7ab163d7c4 rmnet_core: Data activity hooks
Add APS data activity hooks.

Change-Id: Ic9daabd18682b0691123f635348f25a2671cc3fa
Signed-off-by: Weiyi Chen <quic_weiyic@quicinc.com>
2023-02-14 17:49:02 -08:00
Raul Martinez
55822d308b qmi_rmnet: Fix PS off 1st session state notif
Previously the 1st traffic session would not notify shs of PS off
state leading to shs wq not starting up.
On subsequent sessions notification would be sent so state would be
corrected and this issue would go unnoticed.

This change should notify shs of power save state correctly for the
first data session.

CRs-Fixed: 3291630
Change-Id: I7cf9458f999adb1aa3c645ade29bb8c970aa495e
Signed-off-by: Raul Martinez <quic_mraul@quicinc.com>
2022-09-14 16:57:04 -07:00
Weiyi Chen
cdbf46091a dfc: not using alarm timer
Not using alarm timer for dfc powersave check and eliminate the need
for a wakelock. This allows AP to go to suspend quicker.

Change-Id: I7153055d0231a65125ad88808db9e1d0032f24d9
Signed-off-by: Weiyi Chen <quic_weiyic@quicinc.com>
2021-11-16 12:43:42 -08:00
Weiyi Chen
d8c9cb078a dfc: Bearer based QMI powersave
Support bearer based powersave mechanism through QMI WDA.

Change-Id: Ife0685aa56605bb1bb52dacd66a7d235dc3faba8
2021-10-28 12:43:57 -07:00
qctecmdr
16c9dc0982 Merge "dfc: reset tx queue" 2021-10-07 20:18:55 -07:00
Weiyi Chen
7a327bbae7 dfc: not caching grant for removed bearers
If a grant indication for a bearer has "removed" flag set, caching
the bearer could lead to data stall for the next data call because
modem will not send grant for this bearer during powersave.

Do not cache grant for the removed or disabled bearers. Also make sure
a bearer is flow enabled when it is associated with a tx queue.

Change-Id: I7eca597e3cc7d5a0bfe523201c454fb45e66a3a0
Signed-off-by: Weiyi Chen <quic_weiyic@quicinc.com>
2021-10-04 13:48:42 -07:00
Subash Abhinov Kasiviswanathan
c6de1facb0 dfc: reset tx queue
When a bearer is removed, calling qdisc reset on a tx queue
could have a race condition with qdisc dequeue for lockless
qdisc such as pfifo_fast.

This change uses a different mechanism not relying on qdisc
implementation to achieve packet purge on bearer remove.

Change-Id: I8f9201809853b07293896d6cb8e010e9e0904e46
Acked-by: Weiyi Chen <weiyic@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2021-10-03 22:25:40 -07:00
Subash Abhinov Kasiviswanathan
ef13a42ae2 dfc: fix spinlock leak
In the DFC powersave work, the separate spin lock and unlock
of multiple qos structures could be out of sync during SSR
and results in spinlock leak after exiting the work.

This change consolidated the spinlock operations to avoid
multiple locking and unlocking, and fixed below issue:

BUG: workqueue leaked lock or atomic: kworker/0:9/0x00000201/1361
     last function: qmi_rmnet_check_stats_2.cfi_jt [rmnet_core]
1 lock held by kworker/0:9/1361:
(&qos->qos_lock){....}-{2:2}, at: rmnet_lock_unlock_all_flows+0xa4/0xdc

Change-Id: I10c1687a4f9993363dc631dee0b347faaa1067ab
Acked-by: Weiyi Chen <weiyic@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2021-08-18 09:59:34 -07:00
Subash Abhinov Kasiviswanathan
bc43c8213e core: Update condition for identifying TCP ACKs
The current condition only looks for packets which have only the ACK flag set.
This can cause SYN ACKs to get stuck behind other queued data.
This potentially manifests as delayed TCP connection setup.

Update the condition to allow all control packets through.

CRs-Fixed: 3001492
Change-Id: I0baab53bf4226eb891919040ee1c37c7b17d2910
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2021-07-29 02:07:58 -06:00
Subash Abhinov Kasiviswanathan
1667d90ff5 dfc: hold wakelock while powersave timer is running
Powersave alarm timer could fail and delay suspend for 2 seconds
if the timer expires in 2 seconds. Change to hold a wakelock for
the actual duration of the timer so the suspend can be triggered
after timer expiration without delay.

Change-Id: Icc3cb835d4e174955e128c5a0c80198513213b2d
Acked-by: Weiyi Chen <weiyic@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2021-07-07 19:25:46 -07:00
Subash Abhinov Kasiviswanathan
0ad2e0e18b qmi_rmnet: Dissect the ACKs rather than relying on helpers
Some drivers may not set the transport header when queueing packets
to the network stack. Network stack will end up setting the
transport offset to 0 in this case.

When these packets arrive in rmnet and have to be checked for
TCP ACKs, usage of standard helpers for tcp header is not possible
as it relies on the transport header offset to be set.

CRs-Fixed: 2965067
Change-Id: I50d53b7762fd75d1b17ccc6765abe65568aaa4e0
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2021-06-09 11:48:18 -06:00
Subash Abhinov Kasiviswanathan
b5f52b0fe3 dfc: QMAP based powersave
Support DFC powersave using extended QMAP powersave command.

Change-Id: I3055212d8ecfe461bf9a6b35488269a59d4dec52
Acked-by: Weiyi Chen <weiyic@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2021-06-01 16:52:50 -07:00
Subash Abhinov Kasiviswanathan
0a575cfcbf rmnet_core: Send LLC acks in workqueue context
LLC acks are now sent in a workqueue context.

Change-Id: Ic162e6ad7575f9a6e73e5c96d7bc14c26c8ffe61
Acked-by: Weiyi Chen <weiyic@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2021-05-14 10:31:16 -07:00
Subash Abhinov Kasiviswanathan
b8552944d5 rmnet_core: support low latency channel switch
Add support to switch bearers between default and lower latency
channels via QMAP commands.

Change-Id: I6662f59c713e8e3ab7409f50871bec11d9908c67
Acked-by: Weiyi Chen <weiyic@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2021-05-12 17:03:12 -07:00
Sean Tranchetti
b38dff7d79 rmnet_core: Add Low Latency framework
Packets are now sent over a dedicated MHI channel when indicated by the
DFC driver.

New dedicated channel is controlled by rmnet driver. Buffers are allocated
and supplied to it as needed from a recyclable pool for RX on the channel,
and packets will be sent to it and freed manually once the channel
indicates that they have been sent.

Low latency packets can be aggregated like standard QMAP packets, but have
their own aggregation state to prevent mixing default and low latency
flows, and to allow each type of flow to use their own send functions
(i.e. dev_queue_xmit() versus rmnet_ll_send_skb()).

Low latency packets also have their own load-balancing scheme, and do not
need to use the SHS module for balancing. To facilitate this, we mark the
low latency packets with a non-zero priority value upon receipt from the
MHI chainnel and avoid sending any such marked packets to the SHS ingress
hook.

DFC has been updated with a new netlink message type to handle swapping a
list of bearers from one channel to another. The actual swap is performed
asynchronously, and separate netlink ACKs will be sent to the userspace
socket when the switch has been completed.

Change-Id: I93861d4b004f399ba203d76a71b2f01fa5c0d5d2
Signed-off-by: Sean Tranchetti <stranche@codeaurora.org>
2021-05-12 17:02:51 -07:00
Conner Huff
4fe7a4add4 datarmnet: Fastforward core from data-kernel.lnx.1.1 to data-kernel.lnx.1.2
Catches up to commit b4d76675a6feeb57f7188d5354e1cf82b7adb012.

Change-Id: Ib1f00be9799712bd4ab0381cde648287f98a61a1
Signed-off-by: Conner Huff <chuff@codeaurora.org>
2021-02-01 18:46:12 -08:00
Conner Huff
738e8c0abc rmnet_core: Move away from relative path for qmi headers
Include in .bb recipe file mention of kernel header files
so that we no longer need to put a relative path to include
qmi header.

Change-Id: I266e167eb5970da3cd9206d289135248ddc4f791
Signed-off-by: Conner Huff <chuff@codeaurora.org>
2020-10-16 16:30:31 -07:00
Conner Huff
2f6f9ae7ff rmnet_core: point includes to relative path
Relative path is required for now for compilation
to work for both ftraces and qmi headers.

Also introduce Makefile.am for autotools compilation
and make changes to Makefile structure.

Change-Id: Iff673d79c5424c78e4d9763517c18dff5c731e95
Signed-off-by: Conner Huff <chuff@codeaurora.org>
2020-09-01 00:05:09 -06:00
Subash Abhinov Kasiviswanathan
1dda7d60a5 dfc: TCP pure acks
Detects TCP pure acks so they can be put into the dedicated TX queues
even if they contains various options.

Change-Id: I6a9b714ccb58616ff49a150467d33a348d88ec64
Acked-by: Weiyi Chen <weiyic@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2020-07-17 17:06:09 -07:00
Subash Abhinov Kasiviswanathan
1842e30e8a dfc: add stall recovery timer
Add watchdog timer to recover potential data stall when data is
not going to the expected DRB and no DFC indication is received.

Change-Id: Iaa4b4814967cf9400c36115a083922376d23928d
Acked-by: Weiyi Chen <weiyic@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2020-07-14 17:01:27 -07:00
Subash Abhinov Kasiviswanathan
aeca58ead5 dfc: fix null pointer access
Fix a null pointer dereference issue when data packets trigger the
queuing of powersave work before the powersave workqueue is initialized.

Change-Id: Ia3515a7aaa47cb41568c39462bca73ceae11ea9c
Acked-by: Weiyi Chen <weiyic@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2020-07-07 20:38:20 -07:00
Subash Abhinov Kasiviswanathan
fa1352fa7a dfc: remove unsupported modes
Removes DFC modes that no longer supported.

Change-Id: I86c5d549ca02b0313dc89ed9e12d770323e55a9e
Acked-by: Weiyi Chen <weiyic@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2020-04-29 11:33:47 -07:00
Subash Abhinov Kasiviswanathan
2724751ae6 dfc: port the latest fixes
Port the latest fixes from msm-4.19. This includes:
- Clear status flags when entering powersave (Ifc6457f1696ef)
- Adjust QMAP query grants (I9da42a9d2425)
- fix use-after-free (I76ab4a99b3f4)

Change-Id: I1beb93d1f6fdf214c8756bd0e488914bf876aa5e
Acked-by: Weiyi Chen <weiyic@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2020-04-10 15:27:23 -07:00
Subash Abhinov Kasiviswanathan
1d2f235dc4 dfc: Not flow control NDP packets
Allow all NDP packets to be sent regardless of flow control state.
These packets are needed for address configuration even if the default
flow is disabled from the beginning of the call such as in 5G SA.

Change-Id: Ia10e41c5ec8e163b9682c6b4f553f9b102020042
Acked-by: Weiyi Chen <weiyic@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2020-02-21 16:12:11 -07:00
Sean Tranchetti
eeb4944964 core: rmnet: Fastforward to 4.19 tip
This brings the RmNet and DFC modules up to date with the 4.19 tip as of
commit 9b38611ea527 ("rmnet: Reduce synchronize_rcu calls").

As part of this, the rmnet_ctl driver was also incorporated, using commit
4ceee3aafb7d ("rmnet_ctl: Add IPC logging and optimizations")

Change-Id: Ic45d46074c7401dfed408c769cfb6462dac0d4ee
Signed-off-by: Sean Tranchetti <stranche@codeaurora.org>
2020-01-23 13:31:14 -07:00
Subash Abhinov Kasiviswanathan
08d4972b2a core: Rmnet initial commit
Inital commit of rmnet_core net device driver in dlkm form
in datarmnet. This requires rmnet to be disabled in the
kernel and for it to be loaded before dependent modules.

CRs-Fixed: 2558810
Change-Id: I742e85033fa0999bf9069d43ce73ab9a622a8388
Acked-by: Raul Martinez <mraul@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2019-12-10 15:22:43 -07:00