Update QCA_NAPI_DEF_SCALE_BIN_SHIFT for defconfig builds to
the same value as the perf build.
Move the WLAN ext irqs to gold cores for defconfig builds.
Disable cpu isolation before moving the IRQs to gold cores.
Add the ability to move IRQs to gold cores when the cpus
hotplug in.
Change-Id: I4cfecd02a1a2200dc99adee9a324b90c877c13fd
CRs-Fixed: 2638820
Per the Linux Kernel coding style, as enforced by the kernel
checkpatch script, pointers should not be explicitly compared to
NULL. Therefore within hif replace any such comparisons with logical
operations performed on the pointer itself.
Change-Id: I929cb64ee0523d11bc86d5145aade1ec5a713071
CRs-Fixed: 2418257
In case NAPI is disabled on a CE (and tasklets are used instead), donot
update NAPI stats for the CE.
Change-Id: Iaf464df9a8520d705f73f7be355736ae2f1aaf5b
CRs-Fixed: 2412599
hdd_napi_serialize(0) will call hif_napi_event() with
NAPI_EVT_USR_NORMAL mode. But in this mode, blacklist_pending
is not set as BLACKLIST_OFF_PENDING, so the function
hif_napi_core_ctl_set_boost(false) is not called.
Then core_ctl can not resume to normal status, which
will result in performance and power issues.
Change-Id: Ia2084d9febab0ff4aadb0951bd3347f608a1d101
CRs-Fixed: 2381895
Local variable is used to store cpumask to send it to
irq_set_affinity_hint and qdf_dev_set_irq_affinity APIs.
This memory is used by the kernel later outside the
current contect resulting in invalid memory access.
Fix this by using global variables to store cpumask.
Change-Id: I086f40bf1b3499d2c2ccb1ce18140b2dc2761d04
CRs-Fixed: 2373548
Move WLAN fastpath featured CE service APIs to ce_service_legacy.c
since they are not used by any ce_service_srng.c APIs.
Change-Id: I7bb51025c477e8e2428479e41baed274ee4f7cae
CRs-Fixed: 2324003
Take care of corner case when normlized value is just
one more than QCA_NAPI_BUDGET and add normlized to debug prints.
Change-Id: Ife2010b0ada534a487639dbb780e24445d98c045
CRs-Fixed: 2286601
When new napi is added unique napi_id is assigned and an entry
is allocated in kernel napi hash table of size 256, vice versa
napi del will remove the entry from hash table. Currently during
driver unload dummy rx napi's(added for GRO case) are not deleted
which causes resource leakage in kernel napi hash table.
While adding new napi if napi_id exceeds hash table size,
then entry from zero index is accessed to find unclaimed
hash entry which trigger invalid entry access since previous
driver unload did not delete napis properly.
In use case where multiple wlan driver instances are used this issue
can be quickly reproducible since it triggers napi_id to exceed
hash table size within less number of driver load/unload.
Fix is to delete rx dummy napi's during driver unload
Change-Id: Idfb24c5c09ebc131c2b19d894d08a8ea34675ed6
CRs-Fixed: 2288118
Issue can be reproduced when test D0WOW ROME PCIE.
Multi interrupts may only trigger tasklet one time,
which will cause active_tasklet_cnt mismatch.
Check tasklet/napi scheduled state
Change-Id: I66b5544c4d57fe91eae75d4cf8578e30b498e1fd
CRs-Fixed: 2070872
NAPI context allocated during hif_napi_create is freed in
qca_napi_destroy path based on the conditions that NAPI state
is enabled and NAPI context is created for the CE.
There can be cases when the NAPI context is created for the CE
but the current NAPI state not be enable. In such scenarios, NAPI
context is not getting freed in the destroy path.
Add hif_napi_created API to check if NAPI context is created for CE,
and use it in destroy path.
Also, NAPI object allocated is not freed after alloc during cases
when there is a failure in subsequent operations. Free NAPI object
aptly as required.
Change-Id: Ifcc21d70ba52ca309a913ac564406db627e11249
CRs-Fixed: 2256037
Modify hif_update_napi_max_poll_time API to take ce_id instead of
pointer that is defined under feature flag to avoid compilation error.
Change-Id: Iec4a06e816ed1714ec5c00ecdc5a7c6d6eb217e3
CRs-Fixed: 2249802
GRO aggregations are hanging out of NAPI instance and we cannot use the
hif NAPI instance in Rx thread as gro_list inside NAPI is flushed out
at the start and end of NAPI poll, this will corrupt the gro_list on
which rx_thread is working. Address this concern by creating dummy
NAPI instances mapping to each hif NAPI and by not scheduling them.
Change-Id: I517c4c6158ed3ac073f5f617afde46c7ed07ff3e
CRs-Fixed: 2128457
Add API to get NAPI instance from NAPI ID. Handle to NAPI is required
for Rx processing via GRO.
Change-Id: I15535827a03953231670d4138235c4876b16e045
CRs-Fixed: 2062180
Add APIs to set/get ce service max yield time and update
max time taken in NAPI poll from the driver load time.
Change-Id: Idfd4a271ce13916f188c92ab3af32e1648f48c95
CRs-Fixed: 2055082
Store the Tx data buffer of MAX_DATA_SIZE bytes as part of CE descriptor
debug information. Add sysfs API to dump the CE descriptor+data debug
information on console.
The CE descriptor and MAX_DATA_SIZE bytes are stored for Tx packets which
would be used to debug any CE related issues.
Change-Id: I68a765c6219a2ff2a6a7adc7e8ed031f8957d243
Abstract NAPI's use of CPU hotplug events by using the new QDF CPU
hotplug APIs.
Change-Id: Iad590768476b4dc6bad63b3ee3b1b1bbf7698251
CRs-Fixed: 2141180
Spinlock "lro_unloading_lock" was required to synchronize the LRO
instance being deleted when there is LRO packet inflight.
With LRO moved to qdf and LRO is tied to hif_napi, LRO instance is
active with life time of the driver. So no need to protect via lock.
Change-Id: I06f7b43e80ddf0ce5e096351b38ce954eb634a95
CRs-Fixed: 2028318
Stats printing with excessive loops should not go to the console.
Avoids watch-dog bites.
Change-Id: I7b0f9d73139dff97c16f492cbd1cb2d255255b3e
CRs-Fixed: 2091039
Release napi spinlock only after performing napi state
comparison to avoid any race condition.
Change-Id: Icd7b713e474a818dfc6d0fa402496bbe06a3af66
CRs-Fixed: 2078294
Leave the duplicate logic in hif_napi.c until
more thorough cleanup can be done.
Also clean up the HELIUMPLUS macro dependency.
Change-Id: Idbfaacb3b74b358198691a288def07d454e17659
CRs-Fixed: 2051902
In current implementation, we may call core_ctl_set_boost(false) even
if its already been turned off an a previous occasion. This leads to
excessive prints in the kmsg "Error turning off boost. Boost already
turned off"
Fix the ref_count such that we donot call the API to turn
core_ctl_set_boost "off", if it is already off.
CRs-Fixed: 2034738
Change-Id: I6e0760c9e6778087f8de6e5329bcaf110c7b264b
The hif_napi_info structure has a dummy netdev included.
The dummy netdev is large. Avoiding unneeded allocation
save 30kb of memory. Dynamically allocating the
hif_napi_info structures also reduces the size of
the contiguous memory needed for the parent structure.
Change-Id: I58044e5b1d0a834b3b6d17f66d6f4b2462873f2a
CRs-Fixed: 2016355
Modify the legacy LRO implementation to use the implementation
in QDF instead. This is to avoid code duplication and to unify
the LRO implementations for Napier and Helium.
CRs-Fixed: 2042812
Change-Id: I38e9da3b54392a1c5781133916361aac3875d43d
In hif_napi.c, we are calling this kernel API core_ctl_set_boost. This
API is only present in the kernel if the feature CONFIG_SCHED_CORE_CTL
is present. In case the feature is not present in the kernel, it will
result in a compilation error.
Create a new internal API hif_napi_core_ctl_set_boost as a wrapper
around the kernel API. The new API is stubbed in case the kernel feature
is not present.
Change-Id: Ia52f1110304816670efe3480da3aa78d7b2ecb9e
CRs-Fixed: 2018089
The existing HIF NAPI blacklist feature uses irq_blacklist_on(off) APIs
which make a call to the userspace irq_balancer.
Replace these APIs with kernel API irq_modify_status to mark (or unmark) the
individual interrupts with IRQ_NO_BALANCING flag. Once marked, the
msm-irq-balancer will not be able to move the CE interrupts around.
Change-Id: I4d780fa8780b42a668006e13a49eb1299304e633
CRs-Fixed: 1114161
Interrupt blacklisting in kernel 4.4 happens through a user-space
entity. The kernel APIs irq_blacklist_on(off) essentially send
a message to the user space service(irq balancer) and
therefore are not synchronous and do not guarantee that blacklisting
has actually taken effect. It will be granted with some latency
(userspace entity's processing delay).
Make blacklisting more robust by:
a) move irq (if it has been moved around after blacklist_on call
has been made and not yet honored) to the designated CPU
on IRQ reception
b) stop cpu_isolation in blacklisting mode boost API
c) modify NAPI stats to indicate blacklisting mode
Change-Id: I13e478adbed1a6a66d320f69acdb012bee3dc1e8
CRs-Fixed: 1093770
NAPI bucket calculation was resulting in bucket number which was out of
bounds for the number of buckets.
Calculate bucket index correctly and check for out of bound
condition.
CRs-Fixed: 1091483
Change-Id: Ieb81b2eeec546a6128c6b878db4c65ccb8b62bda
Currently NAPI stats are retrieved as a part of iwpriv getStats command.
The buffer available for this command is limited and NAPI stats get
trucncated.
Add a new dumpStats parameter (9) to dump NAPI stats.
Change-Id: Iaf52a3dcecac2f7b24fde2f8220fbfddc767965b
CRs-Fixed: 1076563
Adding lock stats print upon spinlock & mutex destroy.
The spinlock destroy of the lro unloading lock in the
napi context did not match the create in location.
When a station adapter goes down and is brought back up,
the mismatch appears.
Change-Id: I137e6ffce3fb23f32a085b9fa36b065449a6d8a1
CRs-Fixed: 1111956
Adding lock stats print upon spinlock & mutex destroy.
Without the destroy api invoked the lock stats are not printed.
Change-Id: Id3c432e1f6982ea47bdf1de5c15f1a3568df4eb9
CRs-Fixed: 1100505
Make sure that NAPI event handler would handle events only
after it has been initialized. Check init flag before procesing
the event and emit a warning and return an error to the caller.
Change-Id: I9d2b84560ee2363ecf2a570dbef0275dfb87786a
CRs-Fixed: 1091678
Enable interrupts after processing the available
rx buffers on CE5 or complete napi after reaching the budget.
NAPI_YIELD_BUDGET_BASED:
This flag enables napi to return once the budget is exceeded,
or after processing the available packets and re-enables
interrupt and this feature doesn't honor the napi
yeild time configured.Napi budget will be configured as
256 for this feature
Change-Id: I75ac75ede46124bc773e3625173f33ca29da8142
CRs-fixed: 1094034
Instead of using cds to get the hif context in the notifier callback
rely on the context_of semantics to traverse back to the hif context.
Change-Id: I7d57f9dcf8c09836c34ce16a4acaa8c3bc1624b9
CRs-Fixed: 1092842
When NAPI is busy processing Rx, interrupt is not re-enabled
and this causes CE2 and other pipes to become full and target asserts.
This patch enables napi to return after processing half of the descriptors.
Change-Id: I2ba443c388f1a9d36331c632bfb2fbbbe876228f
Crs-fixed: 1094034