linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath10k: set a-mpdu reference number in ath10k (receiver)
@ 2017-07-05 18:34 Matthias Frei
  2017-07-06  7:42 ` Kalle Valo
  2017-08-03 11:30 ` Kalle Valo
  0 siblings, 2 replies; 4+ messages in thread
From: Matthias Frei @ 2017-07-05 18:34 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless

Set the a-mpdu reference number in ath10k to make it accessible in the receivers radiotap header. Implemented as in ath9k. 
The reference number is needed for troubleshooting and research at the receivers site (e.g. to identify mpdu's that were aggregated in an a-mpdu)

Signed-off-by: Matthias Frei <mf@frei.media>
---
 drivers/net/wireless/ath/ath10k/core.h   |  3 +++
 drivers/net/wireless/ath/ath10k/htt_rx.c | 14 +++++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index bf09151..82adf55 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -989,6 +989,9 @@ struct ath10k {
 		u32 reg_ack_cts_timeout_orig;
 	} fw_coverage;
 
+	/* AMPDU */
+	u32 ampdu_ref;
+
 	/* must be last */
 	u8 drv_priv[0] __aligned(sizeof(void *));
 };
diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c
index 84b6067..a4de02b 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -877,16 +877,24 @@ static void ath10k_htt_rx_h_ppdu(struct ath10k *ar,
 		status->nss = 0;
 		status->encoding = RX_ENC_LEGACY;
 		status->bw = RATE_INFO_BW_20;
-		status->flag &= ~RX_FLAG_MACTIME_END;
-		status->flag |= RX_FLAG_NO_SIGNAL_VAL;
+		status->flag &= ~(RX_FLAG_MACTIME_END | RX_FLAG_AMPDU_IS_LAST);
+		status->flag |= RX_FLAG_NO_SIGNAL_VAL | RX_FLAG_AMPDU_DETAILS | RX_FLAG_AMPDU_LAST_KNOWN;
+
+		/* set ampdu ref */
+		status->ampdu_reference = ar->ampdu_ref;
 
 		ath10k_htt_rx_h_signal(ar, status, rxd);
 		ath10k_htt_rx_h_channel(ar, status, rxd, vdev_id);
 		ath10k_htt_rx_h_rates(ar, status, rxd);
 	}
 
-	if (is_last_ppdu)
+	if (is_last_ppdu) {
 		ath10k_htt_rx_h_mactime(ar, status, rxd);
+
+		/* set ampdu last segment flag */
+		status->flag |= RX_FLAG_AMPDU_IS_LAST;
+		ar->ampdu_ref++;
+	}
 }
 
 static const char * const tid_to_ac[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ath10k: set a-mpdu reference number in ath10k (receiver)
  2017-07-05 18:34 [PATCH] ath10k: set a-mpdu reference number in ath10k (receiver) Matthias Frei
@ 2017-07-06  7:42 ` Kalle Valo
  2017-07-07 12:12   ` Matthias Frei
  2017-08-03 11:30 ` Kalle Valo
  1 sibling, 1 reply; 4+ messages in thread
From: Kalle Valo @ 2017-07-06  7:42 UTC (permalink / raw)
  To: Matthias Frei; +Cc: ath10k, linux-wireless

Matthias Frei <mf@frei.media> writes:

> Set the a-mpdu reference number in ath10k to make it accessible in the re=
ceivers radiotap header. Implemented as in ath9k.=20
> The reference number is needed for troubleshooting and research at the re=
ceivers site (e.g. to identify mpdu's that were aggregated in an a-mpdu)
>
> Signed-off-by: Matthias Frei <mf@frei.media>

I did some changes in pending branch, please review them:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=3Dp=
ending&id=3Df722728460a5c9e9200a7f1362fa605a714c1968

> --- a/drivers/net/wireless/ath/ath10k/core.h
> +++ b/drivers/net/wireless/ath/ath10k/core.h
> @@ -989,6 +989,9 @@ struct ath10k {
>  		u32 reg_ack_cts_timeout_orig;
>  	} fw_coverage;
> =20
> +	/* AMPDU */
> +	u32 ampdu_ref;

The comment is not providing any extra value, I'll remove that.

What about locking? How is this protected or doesn't it need anything?

Also I renamed this to ampdu_reference just to be consistent with the
mac80211 name.

> --- a/drivers/net/wireless/ath/ath10k/htt_rx.c
> +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
> @@ -877,16 +877,24 @@ static void ath10k_htt_rx_h_ppdu(struct ath10k *ar,
>  		status->nss =3D 0;
>  		status->encoding =3D RX_ENC_LEGACY;
>  		status->bw =3D RATE_INFO_BW_20;
> -		status->flag &=3D ~RX_FLAG_MACTIME_END;
> -		status->flag |=3D RX_FLAG_NO_SIGNAL_VAL;
> +		status->flag &=3D ~(RX_FLAG_MACTIME_END | RX_FLAG_AMPDU_IS_LAST);
> +		status->flag |=3D RX_FLAG_NO_SIGNAL_VAL | RX_FLAG_AMPDU_DETAILS | RX_F=
LAG_AMPDU_LAST_KNOWN;

This added a new warning:

drivers/net/wireless/ath/ath10k/htt_rx.c:894: line over 90 characters

I fixed that by separating the setting of ampdu flags.

> +		/* set ampdu ref */
> +		status->ampdu_reference =3D ar->ampdu_ref;

The comment is not telling anything new so removed it.

> -	if (is_last_ppdu)
> +	if (is_last_ppdu) {
>  		ath10k_htt_rx_h_mactime(ar, status, rxd);
> +
> +		/* set ampdu last segment flag */
> +		status->flag |=3D RX_FLAG_AMPDU_IS_LAST;
> +		ar->ampdu_ref++;
> +	}

So this counter is per wiphy, not per vdev. Is that ok?

--=20
Kalle Valo=

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ath10k: set a-mpdu reference number in ath10k (receiver)
  2017-07-06  7:42 ` Kalle Valo
@ 2017-07-07 12:12   ` Matthias Frei
  0 siblings, 0 replies; 4+ messages in thread
From: Matthias Frei @ 2017-07-07 12:12 UTC (permalink / raw)
  To: Kalle Valo; +Cc: ath10k, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 3587 bytes --]

> So this counter is per wiphy, not per vdev. Is that ok?


Well, I think this should be okay.
The counter depends on the point of view. Counting per wiphy and looking on the physical transmission it counts every incoming ampdu that was received by the physical wireless card. On the other hand, looking „down the network stack“ from the application layer, you may want a consistent ampdu reference number.
I think doing the counting per wiphy should be okay, because it is still a virtual counter on the receivers site. Doing the counting per wiphy still allows to identify aggregated mpdu’s on the application layer, as you just search for mpdus with the same reference number. Additionally, counting per whipy enables you to get a feeling on the application layer, how much incoming load the wiphy has to handle at the moment. Considering this counter is only used for debugging and research, this additional information can be useful or if not, it does not change anything.


> What about locking? How is this protected or doesn't it need anything?
I don’t think locking is needed here since the counter is per wiphy and it is only incremented on the last mpdu of a ampdu. Additionally, locking is also not used in ath9k.

Thanks!
Best,
Matthias Frei



> Am 06.07.2017 um 09:42 schrieb Kalle Valo <kvalo@qca.qualcomm.com>:
> 
> Matthias Frei <mf@frei.media> writes:
> 
>> Set the a-mpdu reference number in ath10k to make it accessible in the receivers radiotap header. Implemented as in ath9k.
>> The reference number is needed for troubleshooting and research at the receivers site (e.g. to identify mpdu's that were aggregated in an a-mpdu)
>> 
>> Signed-off-by: Matthias Frei <mf@frei.media>
> 
> I did some changes in pending branch, please review them:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=f722728460a5c9e9200a7f1362fa605a714c1968
> 
>> --- a/drivers/net/wireless/ath/ath10k/core.h
>> +++ b/drivers/net/wireless/ath/ath10k/core.h
>> @@ -989,6 +989,9 @@ struct ath10k {
>> 		u32 reg_ack_cts_timeout_orig;
>> 	} fw_coverage;
>> 
>> +	/* AMPDU */
>> +	u32 ampdu_ref;
> 
> The comment is not providing any extra value, I'll remove that.
> 
> What about locking? How is this protected or doesn't it need anything?
> 
> Also I renamed this to ampdu_reference just to be consistent with the
> mac80211 name.
> 
>> --- a/drivers/net/wireless/ath/ath10k/htt_rx.c
>> +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
>> @@ -877,16 +877,24 @@ static void ath10k_htt_rx_h_ppdu(struct ath10k *ar,
>> 		status->nss = 0;
>> 		status->encoding = RX_ENC_LEGACY;
>> 		status->bw = RATE_INFO_BW_20;
>> -		status->flag &= ~RX_FLAG_MACTIME_END;
>> -		status->flag |= RX_FLAG_NO_SIGNAL_VAL;
>> +		status->flag &= ~(RX_FLAG_MACTIME_END | RX_FLAG_AMPDU_IS_LAST);
>> +		status->flag |= RX_FLAG_NO_SIGNAL_VAL | RX_FLAG_AMPDU_DETAILS | RX_FLAG_AMPDU_LAST_KNOWN;
> 
> This added a new warning:
> 
> drivers/net/wireless/ath/ath10k/htt_rx.c:894: line over 90 characters
> 
> I fixed that by separating the setting of ampdu flags.
> 
>> +		/* set ampdu ref */
>> +		status->ampdu_reference = ar->ampdu_ref;
> 
> The comment is not telling anything new so removed it.
> 
>> -	if (is_last_ppdu)
>> +	if (is_last_ppdu) {
>> 		ath10k_htt_rx_h_mactime(ar, status, rxd);
>> +
>> +		/* set ampdu last segment flag */
>> +		status->flag |= RX_FLAG_AMPDU_IS_LAST;
>> +		ar->ampdu_ref++;
>> +	}
> 
> So this counter is per wiphy, not per vdev. Is that ok?
> 
> --
> Kalle Valo


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 821 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ath10k: set a-mpdu reference number in ath10k (receiver)
  2017-07-05 18:34 [PATCH] ath10k: set a-mpdu reference number in ath10k (receiver) Matthias Frei
  2017-07-06  7:42 ` Kalle Valo
@ 2017-08-03 11:30 ` Kalle Valo
  1 sibling, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2017-08-03 11:30 UTC (permalink / raw)
  To: Matthias Frei; +Cc: ath10k, linux-wireless

Matthias Frei <mf@frei.media> wrote:

> Set the a-mpdu reference number in ath10k to make it accessible in the
> receivers radiotap header. Implemented as in ath9k.  The reference number is
> needed for troubleshooting and research at the receivers site (e.g. to identify
> mpdu's that were aggregated in an a-mpdu)
> 
> Signed-off-by: Matthias Frei <mf@frei.media>
> [kvalo@qca.qualcomm.com: fix checkpatch warning, commit log cleanup]
> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>

Patch applied to ath-next branch of ath.git, thanks.

47cc0ca91c9e ath10k: set a-mpdu receiver reference number

-- 
https://patchwork.kernel.org/patch/9826931/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-08-03 11:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-05 18:34 [PATCH] ath10k: set a-mpdu reference number in ath10k (receiver) Matthias Frei
2017-07-06  7:42 ` Kalle Valo
2017-07-07 12:12   ` Matthias Frei
2017-08-03 11:30 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).