Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kernel: ath10k: provide a build variant for small RAM devices
Based on: 1ac6270 ("kernel: ath10k-ct: provide a build variant for small RAM devices") Like described in the ath10k-ct-smallbuffers version, oom-killer gets triggered frequently by devices with small RAM. That change is necessary for many community mesh networks which use ath10k based devices with too little RAM. The -ct driver has been proven unstable if used with 11s meshing and only wave2 chipsets are supporting 11s. Freifunk Berlin is nowadays assembling its firmware-based completely of vanilla OpenWRT with some package additions which are made through the imagebuilder. Therefore we cannot take the approach other freifunk communities have taken to maintain that patch downstream [1]. Other communities consider these devices as broken and that change would pretty much give those devices a second life [2]. [1] - https://git.freifunk-franken.de/mirror/openwrt/commit/450b306e540bc0f2c8a8841bbe4d9612f2b8cdea [2] - freifunk-gluon/gluon#1988 (comment) Signed-off-by: Simon Polack <spolack+git@mailbox.org> Signed-off-by: Nick Hainke <vincent@systemli.org>
- Loading branch information
1 parent
65974aa
commit 694757a
Showing
3 changed files
with
82 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
package/kernel/mac80211/patches/ath10k/990-ath10k-small-buffers.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- a/drivers/net/wireless/ath/ath10k/htt.h | ||
+++ b/drivers/net/wireless/ath/ath10k/htt.h | ||
@@ -235,7 +235,11 @@ enum htt_rx_ring_flags { | ||
}; | ||
|
||
#define HTT_RX_RING_SIZE_MIN 128 | ||
+#ifndef CONFIG_ATH10K_SMALLBUFFERS | ||
#define HTT_RX_RING_SIZE_MAX 2048 | ||
+#else | ||
+#define HTT_RX_RING_SIZE_MAX 512 | ||
+#endif | ||
#define HTT_RX_RING_SIZE HTT_RX_RING_SIZE_MAX | ||
#define HTT_RX_RING_FILL_LEVEL (((HTT_RX_RING_SIZE) / 2) - 1) | ||
#define HTT_RX_RING_FILL_LEVEL_DUAL_MAC (HTT_RX_RING_SIZE - 1) | ||
--- a/drivers/net/wireless/ath/ath10k/pci.c | ||
+++ b/drivers/net/wireless/ath/ath10k/pci.c | ||
@@ -131,7 +131,11 @@ static const struct ce_attr pci_host_ce_ | ||
.flags = CE_ATTR_FLAGS, | ||
.src_nentries = 0, | ||
.src_sz_max = 2048, | ||
+#ifndef CONFIG_ATH10K_SMALLBUFFERS | ||
.dest_nentries = 512, | ||
+#else | ||
+ .dest_nentries = 128, | ||
+#endif | ||
.recv_cb = ath10k_pci_htt_htc_rx_cb, | ||
}, | ||
|
||
@@ -140,7 +144,11 @@ static const struct ce_attr pci_host_ce_ | ||
.flags = CE_ATTR_FLAGS, | ||
.src_nentries = 0, | ||
.src_sz_max = 2048, | ||
+#ifndef CONFIG_ATH10K_SMALLBUFFERS | ||
.dest_nentries = 128, | ||
+#else | ||
+ .dest_nentries = 64, | ||
+#endif | ||
.recv_cb = ath10k_pci_htc_rx_cb, | ||
}, | ||
|
||
@@ -167,7 +175,11 @@ static const struct ce_attr pci_host_ce_ | ||
.flags = CE_ATTR_FLAGS, | ||
.src_nentries = 0, | ||
.src_sz_max = 512, | ||
+#ifndef CONFIG_ATH10K_SMALLBUFFERS | ||
.dest_nentries = 512, | ||
+#else | ||
+ .dest_nentries = 128, | ||
+#endif | ||
.recv_cb = ath10k_pci_htt_rx_cb, | ||
}, | ||
|
||
@@ -192,7 +204,11 @@ static const struct ce_attr pci_host_ce_ | ||
.flags = CE_ATTR_FLAGS, | ||
.src_nentries = 0, | ||
.src_sz_max = 2048, | ||
+#ifndef CONFIG_ATH10K_SMALLBUFFERS | ||
.dest_nentries = 128, | ||
+#else | ||
+ .dest_nentries = 96, | ||
+#endif | ||
.recv_cb = ath10k_pci_pktlog_rx_cb, | ||
}, | ||
|
694757a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PolynomialDivision Is this working as intended when building for multiple devices?
Cause, if both
ath10k
andath10k-smallbuffers
are selected then you are just gonna get:And
-DCONFIG_ATH10K_SMALLBUFFERS
won't be passed toEXTRA_CFLAGS
so you are not actually applying these buffer restrictions at all.694757a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should
CONFIG_ATH10K_SMALLBUFFERS
not be passed?694757a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because both
ath10k
andath10k-smallbuffers
are selected, try building it yourself and check the passedCFLAGS
.The symbol will just reassigned.
694757a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. :/ But if smallbuffers is the only selected one, it works.
Not sure how to repair that.
694757a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Felix proposed using module parameters instead of a compile-time
ifdef
and then in preinit you can pass it via /etc/modules.d only for the boards that require it694757a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. :)
694757a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw. I am working on this. I think I will soon can create a PR after testing everything. (PolynomialDivision/linux@4a10490)