Commit gráf

79 Commit-ok

Szerző SHA1 Üzenet Dátum
Debasis Das
aebe51208d qcacmn: Update HIF to use non-inline OS abstraction
Use non-inline OS-abstraction APIs to avoid direct usage
of kernel API's.

Change-Id: I873f8eac38f11cdd2264db16b2dff0757186eb7a
2021-01-22 12:07:45 -08:00
Srinivas Girigowda
80c1b5a6c3 qcacmn: Replace obsolete HIF_DBG() with hif_debug()
Replace obsolete HIF_DBG() with hif_debug().

Change-Id: I462d75617359fd13eafa497045ddfb70c2025595
CRs-Fixed: 2779720
2020-10-01 14:41:39 -07:00
Srinivas Girigowda
94ea515d92 qcacmn: Replace obsolete HIF_WARN() with hif_warn()
Replace obsolete HIF_WARN() with hif_warn().

Change-Id: Idb72d684b9d05aab6cf55ee2608f47c04077d8f7
CRs-Fixed: 2779720
2020-10-01 14:41:01 -07:00
Srinivas Girigowda
9667b145c6 qcacmn: Replace obsolete HIF_ERROR() with hif_err()
Replace obsolete HIF_ERROR() with hif_err().

Change-Id: I9260b47d11c1820bb05d9a7e2bf50d5257ba85ae
CRs-Fixed: 2779720
2020-10-01 14:40:57 -07:00
Nisha Menon
046f3623de qcacmn: Back pressure in REO2SW1 ring resulting in REO panic
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
2020-04-09 05:21:20 -07:00
Jeff Johnson
8d639a00e4 qcacmn: hif: Replace explicit comparison to NULL
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
2019-03-28 13:13:29 -07:00
Mohit Khanna
513781344d qcacmn: Donot update NAPI stats for CE with NAPI disabled
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
2019-03-13 19:41:26 -07:00
Madhvapathi Sriram
bfb0112412 qcacmn: Remove error log for qdf_mem_malloc in hif/htc files
qdf layer already has the error trace

Change-Id: I83441fb5ab2e954f670f2891ecec8fccf5abf9a7
CRs-Fixed: 2376419
2019-02-12 04:47:40 -08:00
Jun Wang
62fe1e3f45 qcacmn: Fix core_ctl_set_boost not released issue
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
2019-01-22 05:06:39 -08:00
Rakshith Suresh Patkar
ee84fbeea2 qcacmn: Use global variable for cpumask
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
2019-01-02 03:53:07 -08:00
Aditya Sathish
80bbaef931 qcacmn: Separate WLAN fastpath featured CE service APIs
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
2018-10-29 03:11:50 -07:00
Manjunathappa Prakash
4a010f442d qcacmn: Use %pK to log kernel addresses
Use %pK format string to log kernel module data structure addresses.

Change-Id: Ifd343848d47e022e7cf4bb5832df4bcdc0764273
CRs-Fixed: 2321440
2018-09-25 05:33:44 -07:00
Venkateswara Swamy Bandaru
33b1bdd1b6 qcacmn: Fix bucket calculation in NAPI case
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
2018-09-17 04:27:02 -07:00
Debasis Das
0c88e0f704 qcacmn: Use wrappers for bus-oriented OS API's
Use appropriate wrappers for bus and platform related
OS API's.

Change-Id: I2b6d16f698816ef4851594717810bda6f167de32
CRs-Fixed: 2297169
2018-09-10 04:25:32 -07:00
Karthik Kantamneni
c1b9dcf734 qcacmn: Fix invalid memory access while adding napi
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
2018-08-07 08:41:31 -07:00
Rajeev Kumar
b2c14c4f0d qcacmn: Remove qdf_assert from hnc_link_clusters
Remove qdf_assert from hnc_link_clusters as it already
has required debug log.

Change-Id: Id11eb10ad7164ff5347260d3933d633242a8ddd1
CRs-Fixed: 2281122
2018-07-20 16:24:02 -07:00
Will Huang
d6c3b87fcd qcacmn: Fix active_tasklet_cnt mismatch issue
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
2018-07-11 14:29:10 -07:00
Manjunathappa Prakash
617ff247dd qcacmn: Affine NAPIs based INI CPU mask
Affine NAPI CPUs based CPU mask specified in INI config.

Change-Id: I0bea3389a7565f8ec157d4587a442b5e11c33fb2
CRs-Fixed: 2255756
2018-07-02 12:23:36 -07:00
Sathish Kumar
2318e0f0e7 qcacmn: Free napi context allocated during hif_napi_create
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
2018-06-18 16:33:45 -07:00
Kiran Venkatappa
d4a55e0c77 qcacmn: Fix compilation error when FEATURE_NAPI disabled
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
2018-06-08 10:12:07 -07:00
Jeff Johnson
5fb2e3d5f1 qcacmn: hif: Remove legacy markings
Per current guidance remove legacy markings.

Change-Id: I5d1411d241cfed4f50759960d18e9220f6c0da39
CRs-Fixed: 2230684
2018-05-18 02:17:27 -07:00
Manjunathappa Prakash
56023f5649 qcacmn: Add GRO support to NAPI+Rx_thread processing model
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
2018-05-04 20:43:09 -07:00
Manjunathappa Prakash
c3aeffb5e9 qcacmn: add API to get NAPI instance corresponding to NAPI ID
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
2018-05-02 04:35:02 -07:00
Himanshu Agarwal
d9d0e52555 qcacmn: Add APIs to set/get ce service max yield time
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
2018-04-26 13:12:16 -07:00
Pratik Gandhi
dc82a77896 qcacmn: Support to WIN for split of kernel modules
Add EXPORT_SYMBOLS to support modularization in WIN.

Change-Id: I587fe6f2c5cce4b54756358de5c488b146f61850
CRs-Fixed: 2179854
2018-02-08 06:58:35 -08:00
c_cgodav
fda96ad28f qcacmn: Add additional CE Tx descriptor debug
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
2018-02-07 02:15:30 -08:00
Dustin Brown
5d0d104798 qcacmn: Use qdf_cpuhp APIs for NAPI
Abstract NAPI's use of CPU hotplug events by using the new QDF CPU
hotplug APIs.

Change-Id: Iad590768476b4dc6bad63b3ee3b1b1bbf7698251
CRs-Fixed: 2141180
2017-11-15 15:53:37 -08:00
Manjunathappa Prakash
96713609aa qcacmn: Get rid of spinlock lro_unloading_lock
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
2017-10-26 23:48:06 -07:00
Jeff Johnson
b945021c30 qcacmn: hif: Replace instances of unadorned %p
Replace instances of unadorned %p in hif.

Change-Id: I282573452a2c12b4bccdbdaab611dcd6f84a6240
CRs-Fixed: 2111274
2017-10-03 16:02:39 -07:00
Dustin Brown
49a8f6e37e qcacmn: Prepend kernel includes with "kernel/"
To avoid include conflicts, prepend all kernel includes with "kernel/"

Change-Id: I1c3ae9078d5537b03486afff9c2491881c9f694c
CRs-Fixed: 2098814
2017-09-15 12:22:51 -07:00
psimha
a079b8c678 qcacmn: Deregister HIF ext groups on rmmod
- Deregister & free the hif ext ctx when detaching DP interrupts.
- Unregister the hotcpu_notifier during rmmod.

Change-Id: Icbd3c6cee70b6b224059a4b301b9840485a96d11
CRs-Fixed: 2086729
2017-09-08 19:40:02 -07:00
Houston Hoffman
5645dd2803 qcacmn: Use qdf_dbg instead of qdf_print for non-error logs
Stats printing with excessive loops should not go to the console.
Avoids watch-dog bites.

Change-Id: I7b0f9d73139dff97c16f492cbd1cb2d255255b3e
CRs-Fixed: 2091039
2017-09-08 02:37:26 -07:00
Poddar, Siddarth
0efe289db5 qcacmn: Perform napi state comparison before releasing napi lock
Release napi spinlock only after performing napi state
comparison to avoid any race condition.

Change-Id: Icd7b713e474a818dfc6d0fa402496bbe06a3af66
CRs-Fixed: 2078294
2017-08-09 19:36:57 -07:00
Houston Hoffman
b3497c0daf qcacmn: Strip hif_irq_afinity of duplicate logic
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
2017-07-13 03:38:01 -07:00
Mohit Khanna
5d6386f288 qcacmn: Fix core_ctl_set_boost "off" ref count
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
2017-06-21 19:40:50 -07:00
Houston Hoffman
eab19b3b61 qcacmn: Allocate hif_napi_info structures dynamically
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
2017-06-08 15:23:21 -07:00
Dhanashri Atre
991ee4defc qcacmn: Modify legacy LRO implementation to use QDF
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
2017-05-26 16:11:22 -07:00
Srinivas Girigowda
6e0cfd9494 qcacmn: HIF: Reduce the log spam in kmsg
Move the logs to appropriate log levels to reduce the log spam in kmsg.

Change-Id: I29121bb4cc1272aa1fb88183914530dd21c64272
CRs-Fixed: 2017427
2017-05-08 16:51:52 -07:00
Manikandan Mohan
bd0ef8a249 qcacmn: Fix kernel module check patch warnings in HIF files
Fix kernel module check patch warnings in HIF files

Change-Id: I3ddc76399004f15f325b56709e4f2e96bf4cda96
CRs-fixed: 2033001
2017-05-02 13:29:28 -07:00
Mohit Khanna
4a76dde9ad qcacmn: stub core_ctl_set_boost if not defined
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
2017-04-11 11:04:31 -07:00
Mohit Khanna
012bfe3098 qcacmn: modify HIF NAPI blacklist mechanism
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
2017-04-11 11:04:31 -07:00
Orhan K AKYILDIZ
5bfbc5b35b qcacmn: Make interrupt blacklisting robust
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
2017-04-11 11:04:30 -07:00
Mohit Khanna
200e660f21 qcacmn: correct napi bucket calculation
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
2017-04-11 11:04:29 -07:00
Mohit Khanna
518eb5092e qcacmn: Add NAPI statistics to dumpstats
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
2017-04-11 11:04:27 -07:00
Houston Hoffman
d2e9dcd716 qcacmn: balance spin_lock_create (lro)
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
2017-01-31 18:53:06 -08:00
Houston Hoffman
3c84105dc1 qcacmn: balance spin_lock_create (napi)
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
2017-01-31 18:53:02 -08:00
Orhan K AKYILDIZ
0f521bf9be qcacmn: Harden NAPI event handler
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
2017-01-31 13:14:49 -08:00
Nandha Kishore Easwaran
858a769d6b qcacmn: Fix and Clean up code under NAPI_YIELD_BUDGET_BASED
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
2016-12-15 03:44:06 -08:00
Houston Hoffman
fec8ed1234 qcacmn: Remove cds from napi hot_plug_notifier functionality
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
2016-11-28 14:09:48 -08:00
Nandha Kishore Easwaran
cbff9c9090 qcacmn: Enable napi to re-enable interrupts
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
2016-11-25 11:00:24 -08:00