For wearable line of devices derived from monaco, monaco will be used as
TARGET_BOARD_PLATFORM. Change removes others variants which were added
to support _go and _go_aon variants.
Change-Id: Id3ef3aa94ad0c80701260417d92eecf1b96558dd
Signed-off-by: Kaustubh Pandey <quic_kapandey@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>
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: Id12894a8f4cc3d7bec717413d48f2430e1c959cf
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
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>
add monaco_go_aon in RMNET_CORE_DLKM_PLATFORMS_LIST
add monaco_go_aon in DATA_DLKM_BOARD_PLATFORMS_LIST
Change-Id: I7df542c27d3070df98d12ba136508671dda8f469
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>
The tcp ancillary bit has been updated to be sent in almost all cases
unlike earlier where this was sent in case of TCP DL traffic.
This bit will now not be set only in case of adverse scenarios, so
this change ensures that the ACK queue state is updated in case the
ancillary bit is unset.
CRs-Fixed: 2957344
Change-Id: I4e1f26c9d3fabc64401284e36b48d82a4f3a5161
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Support added for monaco_go such that modules will be compiled
for monaco_go platform as well.
Change-Id: I84dcb542cef7ee88dbe1d61447512230819134c4
Signed-off-by: Kaustubh Pandey <kapandey@codeaurora.org>
Ensure that the generic netlink response has a memset payload
before sending to userspace.
Change-Id: Ie2fa92ce80bb3c0716e779cebeaedb2d31d759c1
Acked-by: Ryan Chapman <rchapman@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
During rmnet unregistration, the real device rx_handler is first cleared
followed by the removal of rx_handler_data after the rcu synchronization.
Any packets in the receive path may observe that the rx_handler is NULL.
However, there is no check when dereferencing this value to use the
rmnet_port information.
This fixes following splat by adding the NULL check.
Unable to handle kernel NULL pointer dereference at virtual
address 000000000000000d
pc : rmnet_rx_handler+0x124/0x284
lr : rmnet_rx_handler+0x124/0x284
rmnet_rx_handler+0x124/0x284
__netif_receive_skb_core+0x758/0xd74
__netif_receive_skb+0x50/0x17c
process_backlog+0x15c/0x1b8
napi_poll+0x88/0x284
net_rx_action+0xbc/0x23c
__do_softirq+0x20c/0x48c
CRs-Fixed: 2818544
Change-Id: I766db0b75469f2f049eb226daa7de9ba413d8f59
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Previously wq was designated as WQ_MEM_RECLAIM.
Remove this as it is unnessesary and will result in all notifier
queueing of work and to also be on wqs designated as WQ_MEM_RECLAIM.
Change-Id: I3248e3aef1594b93c16a1ab8c7c6740d53f68886
Acked-by: Raul Martinez <mraul@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Now that the hardware will coalesce additional flags into the RSC frame,
we must check the TCP flags explicitly and remove ones that make no sense
when segmenting the RSC frame for any reason.
In particular, we must check for TCP_FIN, and clear this flag from any
segmetents of the RSSC frame except the last to avoid breaking the TCP
stream integrity.
Change-Id: I7f80437991821ab29cd190a9d5bd45e9cdb4c333
Signed-off-by: Sean Tranchetti <stranche@codeaurora.org>
When copying the QMAP header during deaggregation, the size of the data
to copy was incorrectly passed to skb_copy_bits() as the size of the
pointer instead of the struct. This lead to copying more data onto the
stack than there was room for.
Change-Id: I19208a8df2d8ce25a22fff95b71f1c56dcddec89
Signed-off-by: Sean Tranchetti <stranche@codeaurora.org>
After the introduction of scatter gather support, it's possible that the
QMAP headers may be split across pages. This patch adds proper handling
for the headers during deaggregation from the original SKB from the
physical device when building the descriptors used elsewhere in the rmnet
driver.
Change-Id: If62cf8b4993fe01b6f43e9f16f08c134d18437b8
Signed-off-by: Sean Tranchetti <stranche@codeaurora.org>
This is done to randomize the IPv6 address generation.
This also assigns a different IID to every rmnet interface.
CRs-Fixed: 2771389
Change-Id: I427481f1eeda098a2ebbd0c8ce88030eb0cd6cfd
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Fix warnings introduced by the introduction of scatter-gather support.
Change-Id: I0a12f19a1572989d259e6d8b5b12146a7c5c7cd1
Signed-off-by: Sean Tranchetti <stranche@codeaurora.org>
This patch adds the necessary handling for the physical device driver to
use multiple pages to hold data in the SKBs. Essentially, the following
changes are implemented:
- rmnet_frag_descriptor struct now hold a list of frags, instead of a
single one. Pushing, pulling, and trimming APIs are updated to use
this new format.
- QMAP deaggregation now loops over each element in skb_shinfo->frags
looking for data. Packets are allowed to be split across mutliple
pages. All pages containing data for a particular packet will be added
to the frag_descriptor struct representing it.
- a new API, rmnet_frag_header_ptr() has been added for safely accessing
packet headers. This API, modeled after skb_header_pointer(), handles
the fact that headers could potentially be split across 2 pages. A
pointer to the location of the header is returned in the usual case
where the header is physically contiguous. If not, the header is
linearized into the user-provided buffer to allow normal header struct
read access.
- this new header access API is used in all places on the DL path when
headers are needed, including QMAP command processing, QMAPv1
handling, QMAPv5 checksum offload, and QMAPv5 coalescing.
- RSB/RSC segmentation handling is updated to add all necessary pages
containing packet data to the newly created descriptor. Additionally,
the pages containing L3 and L4 headers are added as well, as this
allows easier downstream processing, and guarantees that the header
data will not be freed until all packets that need them have been
converted into SKBs.
- as all frag_descriptors are now guaranteed to contain the L3 and L4
header data (and because they are no longer guaranteed to be on the
same page), the hdr_ptr member has been removed as it no longer serves
a purpose.
Change-Id: Iebb677a6ae7e442fa55e0d131af59cde1b5ce18a
Signed-off-by: Sean Tranchetti <stranche@codeaurora.org>
Re-send QMAP DFC_CONFIG command if no ack is received upon
first QMAP indication.
Change-Id: I33ec5cbbf3550d1df03ca1dd990bf8ad58ad9582
Acked-by: Weiyi Chen <weiyic@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
When calculating the length of the IPv6 header chain, lengths of the IPv6
extension headers are not checked against the overall packet lengths and
thus it's possible to parse past the end of the packet when the packet is
malformed.
This adds the necessary bounds checking to ensure that parsing stops if the
end of the packet is reached to avoid the following:
Unable to handle kernel paging request at virtual address
pc : rmnet_frag_ipv6_skip_exthdr+0xc0/0x108 [rmnet_core]
lr : rmnet_frag_ipv6_skip_exthdr+0x68/0x108 [rmnet_core]
Call trace:
rmnet_frag_ipv6_skip_exthdr+0xc0/0x108 [rmnet_core]
DATARMNET29e8d137c4+0x1a0/0x3e0 [rmnet_offload]
rmnet_frag_ingress_handler+0x294/0x404 [rmnet_core]
rmnet_rx_handler+0x1b4/0x284 [rmnet_core]
__netif_receive_skb_core+0x740/0xd2c
__netif_receive_skb+0x44/0x158
Change-Id: Ib2e2ebce733bd4d14a3dfc175133638b15015277
Signed-off-by: Sean Tranchetti <stranche@codeaurora.org>
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>
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>
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>
This patch adds trace events to help with debug for gso feature
by identifying the packets (and their lengths) that are using
the segmentation offload feature.
Adding source and destination port number info
in the gso trace events to differentiate between
the flows.
CRs-Fixed: 2697145
Change-Id: I4f9786afa799cb1589bd07393c0922913037390d
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Re-arrange ipa registration sequence to handle cases where rmnet_ctl
is being initialized before ipa is ready.
Change-Id: Ic8416ad8f96f818e32f1320e997287ebfe755d03
Acked-by: Weiyi Chen <weiyic@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Reduce the minimum allowed UL aggregation timeout to 1ms
as a lower limit might be preferable to reduce latency for
sporadic traffic scenarios.
CRs-fixed: 2692360
Change-Id: Iba1c02232fa83d7cac112bd4b3f625128e2da88b
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Cleanup entries in the task boost list when the pid becomes inactive.
Change-Id: I0b1b2ef81cda470cd08b31ab4e78f81d346b9b70
Acked-by: Ryan Chapman <rchapman@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Similar to the UL direction, allow the hardware checksum offload support
to be toggled off with the NETIF_F_RXCSUM flag though ethtool.
Change-Id: I38e43cf9c13363eee340793878be7639f18254e3
Signed-off-by: Sean Tranchetti <stranche@codeaurora.org>
Do not remove module if the dependent modules are removed.
CRs-Fixed: 2683697
Change-Id: I35539aff061fe57a85f0bb8eb3dcf40499eca760
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Kernel code should now use the timespec64 struct instead of the older
struct timespec and its APIs.
Change-Id: I2792b637bf1054521e3f1ff7c82d1cdbf4f3adea
Signed-off-by: Sean Tranchetti <stranche@codeaurora.org>
If the RmNet driver needs to transmit a packet marked as needing
prioritization, it should skip uplink aggregation of the packet to avoid
adding additional delay. Additionally, any aggregated packets should be
flushed prior to sending the prioritized packet to avoid any ordering
issues.
Change-Id: Ia3063ec3f0553693a0f66c8eb5bbb88d250f7523
Signed-off-by: Sean Tranchetti <stranche@codeaurora.org>