[OpenWrt-Devel] [PATCH v3] kernel: ath10k-ct: provide a build variant for small RAM devices

Paul Fertser fercerpav at gmail.com
Mon Dec 23 14:57:02 EST 2019


Hi Bjørn,

On Mon, Dec 23, 2019 at 10:17:11AM +0100, Bjørn Mork wrote:
> Paul Fertser <fercerpav at gmail.com> writes:
> > --- /dev/null
> > +++ b/package/kernel/ath10k-ct/patches/960-0011-ath10k-limit-pci-buffer-size.patch
> > @@ -0,0 +1,100 @@
> > +--- a/ath10k-4.19/pci.c
> > ++++ b/ath10k-4.19/pci.c
> > +@@ -142,7 +142,11 @@ static struct ce_attr host_ce_config_wla
> > + 		.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,
> > + 	},
> > + 
> 
> Why not replace the magic numbers with a macro?  Then you could get away
> with *one* "if configx then this else that"?  And preferably put it in a
> header file.

There're different values for different buffers so there can't be a
single number to fit them all. And I do not see how adding 4 different
defines just for the sake of it would make sense there.

> Or maybe these things even could be made runtime configurable?  Buffers
> of this size really should be IMHO, as there is no way to make one size
> fit all.  As demonstrated...

This was already discussed, please see [0]. I think adding a kernel
module parameter would make sense for this but it's also much more
complicated than just adding two patches that were already used in
OpenWrt for many years. So far nobody volunteered to do that, and I
wanted to provide at least some semi-sane solution for the upcoming
release.

[0] https://patchwork.ozlabs.org/comment/2322701/
-- 
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:fercerpav at gmail.com

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list