diff mbox series

[RFC,2/2] ath11k: drop memset in tx status hotpath

Message ID 20190628101127.6044-2-john@phrozen.org (mailing list archive)
State RFC
Delegated to: Kalle Valo
Headers show
Series [RFC,1/2] ath11k: drop tx_status_fifo | expand

Commit Message

John Crispin June 28, 2019, 10:11 a.m. UTC
This in a small but measurable performance increase.

Signed-off-by: John Crispin <john@phrozen.org>
---
 drivers/net/wireless/ath/ath11k/dp_tx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Kalle Valo June 28, 2019, 11:21 a.m. UTC | #1
John Crispin <john@phrozen.org> writes:

> This in a small but measurable performance increase.
>
> Signed-off-by: John Crispin <john@phrozen.org>
> ---
>  drivers/net/wireless/ath/ath11k/dp_tx.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath11k/dp_tx.c b/drivers/net/wireless/ath/ath11k/dp_tx.c
> index b3d5995fc657..8c5db3c88a87 100644
> --- a/drivers/net/wireless/ath/ath11k/dp_tx.c
> +++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
> @@ -448,7 +448,6 @@ void ath11k_dp_tx_completion_handler(struct ath11k_base *ab, int ring_id)
>  	int hal_ring_id = dp->tx_ring[ring_id].tcl_comp_ring.ring_id;
>  	struct hal_srng *status_ring = &ab->hal.srng_list[hal_ring_id];
>  	struct sk_buff *msdu;
> -	struct hal_tx_status ts;
>  	struct dp_tx_ring *tx_ring = &dp->tx_ring[ring_id];
>  	u32 msdu_id;
>  	u32 *desc;
> @@ -459,7 +458,8 @@ void ath11k_dp_tx_completion_handler(struct ath11k_base *ab, int ring_id)
>  	ath11k_hal_srng_access_begin(ab, status_ring);
>  
>  	while ((desc = ath11k_hal_srng_dst_get_next_entry(ab, status_ring))) {
> -		memset(&ts, 0, sizeof(ts));
> +		struct hal_tx_status ts = { 0 };

Very interesting, so a compiler zeroes memory from stack faster than
memset() from "heap" (or whatever kmalloced memory should be called)?
Just out of curiosity, any ideas why memset() is so slow?

Also some kind of numbers (before and after) would be nice to have in
the commit log. It's not uncommon that years after we investigate why a
certain change was made.
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath11k/dp_tx.c b/drivers/net/wireless/ath/ath11k/dp_tx.c
index b3d5995fc657..8c5db3c88a87 100644
--- a/drivers/net/wireless/ath/ath11k/dp_tx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
@@ -448,7 +448,6 @@  void ath11k_dp_tx_completion_handler(struct ath11k_base *ab, int ring_id)
 	int hal_ring_id = dp->tx_ring[ring_id].tcl_comp_ring.ring_id;
 	struct hal_srng *status_ring = &ab->hal.srng_list[hal_ring_id];
 	struct sk_buff *msdu;
-	struct hal_tx_status ts;
 	struct dp_tx_ring *tx_ring = &dp->tx_ring[ring_id];
 	u32 msdu_id;
 	u32 *desc;
@@ -459,7 +458,8 @@  void ath11k_dp_tx_completion_handler(struct ath11k_base *ab, int ring_id)
 	ath11k_hal_srng_access_begin(ab, status_ring);
 
 	while ((desc = ath11k_hal_srng_dst_get_next_entry(ab, status_ring))) {
-		memset(&ts, 0, sizeof(ts));
+		struct hal_tx_status ts = { 0 };
+
 		ath11k_hal_tx_status_parse(ab,
 					   (struct hal_wbm_release_ring *)desc,
 					   &ts);