Re: [ath9k-devel] [PATCH 05/13] ath9k_htc: add rx header converter to make it usable by ath9k
Am 03.02.2014 13:07, schrieb Felix Fietkau: > On 2014-02-03 12:22, Oleksij Rempel wrote: >> Am 03.02.2014 03:09, schrieb Sujith Manoharan: >>> Oleksij Rempel wrote: + rx_stats = kzalloc(sizeof(struct ath_rx_status), GFP_KERNEL); + if (unlikely(rx_stats == NULL)) { + ath_err(common, "rx_stats allocation filed!\n"); + goto err_nofree; + } + rx_status_htc_to_ath(rx_stats, &rxbuf->rxstatus); + >> >>> This seems a little expensive, since this would happen for every packet, >>> and a memcpy is already done earlier, for storing the RX status in >>> rxbuf->rxstatus. Instead of using 'struct ath_htc_rx_status' in >>> 'struct ath9k_htc_rxbuf', why can't 'struct ath_rx_status' be used ? >>> The values can be converted and stored directly, avoiding this alloc. >> >> Do you mean kzalloc or converter? >> then memcpy is removed by patch 12/13. Converter is not effective but it >> should prevent from confusions. At least until FW use same flags and >> struct ath_rx_status do. >> But i'm open for other ideas too. > You should at least keep rx_stats on stack instead of using kzalloc, > that would make it much faster. You right, i'll do it. Beside what is the smallest stack size in kernel i need to count on? -- Regards, Oleksij signature.asc Description: OpenPGP digital signature ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
Re: [ath9k-devel] [PATCH 05/13] ath9k_htc: add rx header converter to make it usable by ath9k
On 2014-02-03 12:22, Oleksij Rempel wrote: > Am 03.02.2014 03:09, schrieb Sujith Manoharan: >> Oleksij Rempel wrote: >>> + rx_stats = kzalloc(sizeof(struct ath_rx_status), GFP_KERNEL); >>> + if (unlikely(rx_stats == NULL)) { >>> + ath_err(common, "rx_stats allocation filed!\n"); >>> + goto err_nofree; >>> + } >>> + rx_status_htc_to_ath(rx_stats, &rxbuf->rxstatus); >>> + > >> This seems a little expensive, since this would happen for every packet, >> and a memcpy is already done earlier, for storing the RX status in >> rxbuf->rxstatus. Instead of using 'struct ath_htc_rx_status' in >> 'struct ath9k_htc_rxbuf', why can't 'struct ath_rx_status' be used ? >> The values can be converted and stored directly, avoiding this alloc. > > Do you mean kzalloc or converter? > then memcpy is removed by patch 12/13. Converter is not effective but it > should prevent from confusions. At least until FW use same flags and > struct ath_rx_status do. > But i'm open for other ideas too. You should at least keep rx_stats on stack instead of using kzalloc, that would make it much faster. - Felix ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
Re: [ath9k-devel] [PATCH 05/13] ath9k_htc: add rx header converter to make it usable by ath9k
Am 03.02.2014 03:09, schrieb Sujith Manoharan: > Oleksij Rempel wrote: >> +rx_stats = kzalloc(sizeof(struct ath_rx_status), GFP_KERNEL); >> +if (unlikely(rx_stats == NULL)) { >> +ath_err(common, "rx_stats allocation filed!\n"); >> +goto err_nofree; >> +} >> +rx_status_htc_to_ath(rx_stats, &rxbuf->rxstatus); >> + > This seems a little expensive, since this would happen for every packet, > and a memcpy is already done earlier, for storing the RX status in > rxbuf->rxstatus. Instead of using 'struct ath_htc_rx_status' in > 'struct ath9k_htc_rxbuf', why can't 'struct ath_rx_status' be used ? > The values can be converted and stored directly, avoiding this alloc. Do you mean kzalloc or converter? then memcpy is removed by patch 12/13. Converter is not effective but it should prevent from confusions. At least until FW use same flags and struct ath_rx_status do. But i'm open for other ideas too. -- Regards, Oleksij signature.asc Description: OpenPGP digital signature ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
Re: [ath9k-devel] [PATCH 05/13] ath9k_htc: add rx header converter to make it usable by ath9k
Oleksij Rempel wrote: > + rx_stats = kzalloc(sizeof(struct ath_rx_status), GFP_KERNEL); > + if (unlikely(rx_stats == NULL)) { > + ath_err(common, "rx_stats allocation filed!\n"); > + goto err_nofree; > + } > + rx_status_htc_to_ath(rx_stats, &rxbuf->rxstatus); > + This seems a little expensive, since this would happen for every packet, and a memcpy is already done earlier, for storing the RX status in rxbuf->rxstatus. Instead of using 'struct ath_htc_rx_status' in 'struct ath9k_htc_rxbuf', why can't 'struct ath_rx_status' be used ? The values can be converted and stored directly, avoiding this alloc. Sujith ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel