Enable rmnet core and ctl drivers and update the kernel APIs to match
the appropriate kernel.
This change also adds support for the inclusion of the IPA kernel
headers from a non-core kernel location. This is achieved using the
flag KBUILD_REQUIRED_KOS.
Additionally, remove all deprecated code.
CRs-Fixed: 3311558
Change-Id: I9317f53ca8b1a370b6a5eb86734057399aee1d48
Signed-off-by: Subash Abhinov Kasiviswanathan <quic_subashab@quicinc.com>
Add support to compile datarmnet for Khaje/Bengal target.
Khaje is upgraded to latest APSS and bengal is used as board platform.
Change-Id: Ib0abfd64d13410913ea87b81a5d83406ea67e088
Signed-off-by: Kaustubh Pandey <quic_kapandey@quicinc.com>
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>
Add a specific trace path for arch uml.
This change assumes that the kernel and datarmnet source at the same
parent folder when compiling for UML.
Additionally, compilation is skipped for ipa and related low latency
modules for UML.
CRs-Fixed: 3237924
Change-Id: I6151578373b3822cade3fb7fd306390e99f617c4
Signed-off-by: Subash Abhinov Kasiviswanathan <quic_subashab@quicinc.com>
Add a hook into shs for LL traffic to go into.
CRs-Fixed: 3229047
Change-Id: I4b81c82f77d3aaf685e6c50106cd6e28d7c94753
Signed-off-by: Raul Martinez <quic_mraul@quicinc.com>
This function was otherwise exceeding the stack size limit as
notified during compile time-
ld.lld: warning: stack frame size (2112) exceeds limit (2048) in
function 'rmnet_descriptor_trace_pfn'
CRs-Fixed: 3221860
Change-Id: I162101b70a4a3d8bfa28fd73ca65a17e3bb6f0ca
Signed-off-by: Subash Abhinov Kasiviswanathan <quic_subashab@quicinc.com>
Add support for the new mapv5 command format which has to be
used for commands on default channel on uplink. mapv1 commands need
to be sent on the command channel only on uplink.
Additionally, update the dfc trace print format.
CRs-Fixed: 3214110
Change-Id: Ifed7d90d79b6f17d4104a26907667801f04040ce
Signed-off-by: Subash Abhinov Kasiviswanathan <quic_subashab@quicinc.com>
Adds a simple, tracepoint inspired hook definiton framework to centralize
all calls to rmnet support modules. Modules can set and unset these hooks
freely, and modules may call one another's hooks without being forced to
link against any module other than the core rmnet module.
Change-Id: I949f7a17c95003e0c79262c6611b0602c7189e0c
Signed-off-by: Sean Tranchetti <quic_stranche@quicinc.com>
Add ip_id field in UDP traces to assist in debug.
CRs-Fixed: 3179386
Change-Id: Iebc0e796dc79d0faa31ccccfa05869901b13ddba
Signed-off-by: Subash Abhinov Kasiviswanathan <quic_subashab@quicinc.com>
rmnet_dellink() will handle freeing the endpoint information, but as this
structure is accessed via RCU on the packet path, care must be taken. It
is dangerous to alter any fields inside of it until it is guaranteed that
no one is currently accessing it.
pc : rmnet_frag_process_next_hdr_packet
lr : rmnet_frag_process_next_hdr_packet
Call trace:
rmnet_frag_process_next_hdr_packet
rmnet_frag_ingress_handler
rmnet_rx_handler
Change-Id: I2410d941e370d1173eefd6e63049121285a1cb26
Signed-off-by: Sean Tranchetti <quic_stranche@quicinc.com>
This is needed to avoid any out of order transmits between
the UL aggregation workqueue context and the direct transmits from
application context. irq_save / restore variant of the lock cannot
be used as dev_queue_xmit() requires interrupts to be enabled.
CRs-Fixed: 3122333
Change-Id: Ie1020bf17e8c1d0e8fc14e999c21c3e007f4f183
Signed-off-by: Subash Abhinov Kasiviswanathan <quic_subashab@quicinc.com>
This change adds the event rmnet:print_pfn.
Note that this requires the udp / tcp rx trace to be enabled.
CRs-Fixed: 3139334
Change-Id: I3a0a26f517390e9861db37eddb5700cf94d54087
Signed-off-by: Subash Abhinov Kasiviswanathan <quic_subashab@quicinc.com>
In rmnet powersave work, rmnet_get_packets() could access NULL dev pointer
if rmnet_dellink() is nullifying the dev pointer at the same time.
18377 [ 72.651710][ T1527] Unable to handle kernel NULL pointer dereference
at virtual address 00000000000009d0
18424 [ 72.653999][ T1527] Call trace:
18425 [ 72.654085][ T1527] rmnet_get_packets+0xc4/0x11c [rmnet_core]
18426 [ 72.654170][ T1527] qmi_rmnet_check_stats_2+0x80/0x410 [rmnet_core]
18427 [ 72.654180][ T1527] process_one_work+0x260/0x804
This change Uses the rcu variant of the hlist traversal function in
rmnet_get_packet for safe concurrency with the hlist del primitives.
It also checks dev pointer before accessing the dev private structure.
The existing synchronize rcu call in rmnet_dellink ensures that the ep
and dev structure are not freed while being referenced in rcu read
session of rmnet_get_packets.
Change-Id: Ib5f5aff6e76f9fffd9110a2aa924ad6ab090991f
Signed-off-by: Weiyi Chen <quic_weiyic@quicinc.com>
ip_fast_csum() takes in the header length in 4-byte words, not the length
in bytes.
Change-Id: Ib3941876e21260aad32ed761427714e133220cfb
Signed-off-by: Sean Tranchetti <quic_stranche@quicinc.com>
When IPA failed to send a QMAP packet, the skb is freed in IPA so
accessing the skb after IPA failure will result in use-after-free.
Remove the skb access after IPA send failure.
Change-Id: Id5f876d68e8ecae6c8d7e07c99a9f842fbbf51c1
Signed-off-by: Weiyi Chen <quic_weiyic@quicinc.com>
Support auto switch of bearers to low latency channel.
Change-Id: I3bc029b9736b1c9f645db9f02a1d09ffe8bf1c2b
Signed-off-by: Weiyi Chen <quic_weiyic@quicinc.com>
Low latency treatment of UL packets based on priority.
Change-Id: Id7a7d990f05923aacb50901c0e09194155a3edf2
Signed-off-by: Weiyi Chen <quic_weiyic@quicinc.com>
Add new ingress and egress hooks to be used by rmnet modules.
CRs-Fixed: 3012130
Change-Id: I934a3933d4ea89ba1c4f5ef2f2589baf66c2d225
Signed-off-by: Subash Abhinov Kasiviswanathan <quic_subashab@quicinc.com>
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>
Support flow control with IPA on the low latency channel.
Change-Id: I1044abf3b8f59f928f9df3c29c50497b64b934a6
Signed-off-by: Weiyi Chen <quic_weiyic@quicinc.com>
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>
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>
Descriptors that came from coalesced frames will now carry usage info.
In order to prevent overcoutning, only the first segment from each frame
will report this information; the rest will report 0.
This allows a simple calculation of summing the coal_bytes and coal_bufsize
values reported and dividing to determine the total ratio over a given
period.
These values will be reported in the SKB via a new Control Block struct,
accessable via RMNET_SKB_CB(skb);
Change-Id: I8ea31921afa3afad4d2c570ec5728118bd635b86
Signed-off-by: Sean Tranchetti <stranche@codeaurora.org>
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>
Add traces to track TCP and UDP non fragmented packets in uplink and downlink.
CRs-Fixed: 3002908
Change-Id: I35643c38dff564964dcd9e04518cbe4655dd050b
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
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>
Keep count of single fragments and other fragment counts in increments
of 6 upto the maximum possible 16.
CRs-Fixed: 2992022
Change-Id: I1b1c474e51cf1fe8856d53511ae7c374caa0b4a2
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
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>
Keep a count in increments of 10 upto 60 and a count for greater
than 60.
CRs-Fixed: 2984565
Change-Id: I20d81e03b1a592e3e69c6e83d1a827ae0c72f6b9
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Add support for UDP_GSO and also print the address, port, ip family
and transport protocol in each trace.
CRs-Fixed: 2983027
Change-Id: If98c9423f77c0f566b004b167c2b45eca560b0d7
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
UDP GSO packets from network stack currently do not honor the
gso_max_size limits set in a driver. As a result, there needs
to be some enforcement done at the driver itself prior to the
transmit to hardware.
Instead of setting the gso_max_size on the rmnet devices, the
gso_max_size is instead set on the physical device. This
ensures that the network stack processing happens with the
maximum gso size possible for the TCP case.
CRs-Fixed: 2981039
Change-Id: I5280ea79f868e2b933f2604f8a33fbf33687f76c
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Add strings to display the cumulative result of the segmentation of
TSO packets on LL channel per rmnet device
CRs-Fixed: 2982506
Change-Id: I2454080d89c7a39a67004e0143463cd35772d45c
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
The csum_valid bit being set to zero in the v5 csum offload header has two
possible meanings. Either 1) the checksum is bad, or 2) the checksum was
not calculated. When a packet is received with such a header, we need to
manually checksum the packet to avoid reporting potentially valid packets
as having bad checksums.
Change-Id: I6a85d7a01c844be625c11c80ba381ac4dbd0366d
Signed-off-by: Sean Tranchetti <stranche@codeaurora.org>
maxtype should be set to the value of the highest attribute type that
is valid, not the number of valid attributes accepted. This ensures that
attributes with types higher than this number are ignored properly.
Change-Id: Ife53a4a9a7327a8d89e709320eb1c6cb50992922
Signed-off-by: Sean Tranchetti <stranche@codeaurora.org>
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>
Break dependency between rmnet_core and rmnet_ctl
so that we can compile rmnet_core without
rmnet_ctl on yocto based targets.
Change-Id: I3bfa3dbcd24f9343d073107f40b6d98c77aba881
Signed-off-by: Conner Huff <chuff@codeaurora.org>