All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mac80211: Store max_mtu in ieee80211_hw
@ 2019-09-04  6:15 ` Wen Gong
  0 siblings, 0 replies; 6+ messages in thread
From: Wen Gong @ 2019-09-04  6:15 UTC (permalink / raw)
  To: ath10k, johannes; +Cc: linux-wireless

Make it possibly for drivers to adjust the default mat_mtu
by storing it in the hardware struct.

Signed-off-by: Wen Gong <wgong@codeaurora.org>
---
 include/net/mac80211.h | 3 +++
 net/mac80211/iface.c   | 5 ++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index d26da01..8545b03 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -2454,6 +2454,8 @@ enum ieee80211_hw_flags {
  *
  * @weight_multiplier: Driver specific airtime weight multiplier used while
  *	refilling deficit of each TXQ.
+ *
+ * @max_mtu: the max mtu could be set.
  */
 struct ieee80211_hw {
 	struct ieee80211_conf conf;
@@ -2491,6 +2493,7 @@ struct ieee80211_hw {
 	u8 max_nan_de_entries;
 	u8 tx_sk_pacing_shift;
 	u8 weight_multiplier;
+	u32 max_mtu;
 };
 
 static inline bool _ieee80211_hw_check(struct ieee80211_hw *hw,
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 06aac0a..00c33e6 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -1877,7 +1877,10 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
 
 		/* MTU range: 256 - 2304 */
 		ndev->min_mtu = 256;
-		ndev->max_mtu = IEEE80211_MAX_DATA_LEN;
+		if (local->hw.max_mtu)
+			ndev->max_mtu = local->hw.max_mtu;
+		else
+			ndev->max_mtu = IEEE80211_MAX_DATA_LEN;
 
 		ret = register_netdevice(ndev);
 		if (ret) {
-- 
1.9.1


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

* [PATCH] mac80211: Store max_mtu in ieee80211_hw
@ 2019-09-04  6:15 ` Wen Gong
  0 siblings, 0 replies; 6+ messages in thread
From: Wen Gong @ 2019-09-04  6:15 UTC (permalink / raw)
  To: ath10k, johannes; +Cc: linux-wireless

Make it possibly for drivers to adjust the default mat_mtu
by storing it in the hardware struct.

Signed-off-by: Wen Gong <wgong@codeaurora.org>
---
 include/net/mac80211.h | 3 +++
 net/mac80211/iface.c   | 5 ++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index d26da01..8545b03 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -2454,6 +2454,8 @@ enum ieee80211_hw_flags {
  *
  * @weight_multiplier: Driver specific airtime weight multiplier used while
  *	refilling deficit of each TXQ.
+ *
+ * @max_mtu: the max mtu could be set.
  */
 struct ieee80211_hw {
 	struct ieee80211_conf conf;
@@ -2491,6 +2493,7 @@ struct ieee80211_hw {
 	u8 max_nan_de_entries;
 	u8 tx_sk_pacing_shift;
 	u8 weight_multiplier;
+	u32 max_mtu;
 };
 
 static inline bool _ieee80211_hw_check(struct ieee80211_hw *hw,
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 06aac0a..00c33e6 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -1877,7 +1877,10 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
 
 		/* MTU range: 256 - 2304 */
 		ndev->min_mtu = 256;
-		ndev->max_mtu = IEEE80211_MAX_DATA_LEN;
+		if (local->hw.max_mtu)
+			ndev->max_mtu = local->hw.max_mtu;
+		else
+			ndev->max_mtu = IEEE80211_MAX_DATA_LEN;
 
 		ret = register_netdevice(ndev);
 		if (ret) {
-- 
1.9.1


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* Re: [PATCH] mac80211: Store max_mtu in ieee80211_hw
  2019-09-04  6:15 ` Wen Gong
@ 2019-09-04  7:03   ` Johannes Berg
  -1 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2019-09-04  7:03 UTC (permalink / raw)
  To: Wen Gong, ath10k; +Cc: linux-wireless

On Wed, 2019-09-04 at 14:15 +0800, Wen Gong wrote:
> Make it possibly for drivers to adjust the default mat_mtu
> by storing it in the hardware struct.
> 
> +++ b/net/mac80211/iface.c
> @@ -1877,7 +1877,10 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
>  
>  		/* MTU range: 256 - 2304 */
>  		ndev->min_mtu = 256;
> -		ndev->max_mtu = IEEE80211_MAX_DATA_LEN;
> +		if (local->hw.max_mtu)
> +			ndev->max_mtu = local->hw.max_mtu;
> +		else
> +			ndev->max_mtu = IEEE80211_MAX_DATA_LEN;

It seems (slightly) preferable to me to just initialize the value in
local->hw.max_mtu in alloc_hw(), so the driver can override it before
register_hw(), and then use it here unconditionally. Any particular
reason for it being this way?

johannes


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

* Re: [PATCH] mac80211: Store max_mtu in ieee80211_hw
@ 2019-09-04  7:03   ` Johannes Berg
  0 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2019-09-04  7:03 UTC (permalink / raw)
  To: Wen Gong, ath10k; +Cc: linux-wireless

On Wed, 2019-09-04 at 14:15 +0800, Wen Gong wrote:
> Make it possibly for drivers to adjust the default mat_mtu
> by storing it in the hardware struct.
> 
> +++ b/net/mac80211/iface.c
> @@ -1877,7 +1877,10 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
>  
>  		/* MTU range: 256 - 2304 */
>  		ndev->min_mtu = 256;
> -		ndev->max_mtu = IEEE80211_MAX_DATA_LEN;
> +		if (local->hw.max_mtu)
> +			ndev->max_mtu = local->hw.max_mtu;
> +		else
> +			ndev->max_mtu = IEEE80211_MAX_DATA_LEN;

It seems (slightly) preferable to me to just initialize the value in
local->hw.max_mtu in alloc_hw(), so the driver can override it before
register_hw(), and then use it here unconditionally. Any particular
reason for it being this way?

johannes


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* RE: [PATCH] mac80211: Store max_mtu in ieee80211_hw
  2019-09-04  7:03   ` Johannes Berg
@ 2019-09-04  9:16     ` Wen Gong
  -1 siblings, 0 replies; 6+ messages in thread
From: Wen Gong @ 2019-09-04  9:16 UTC (permalink / raw)
  To: Johannes Berg, Wen Gong, ath10k; +Cc: linux-wireless

> -----Original Message-----
> From: ath10k <ath10k-bounces@lists.infradead.org> On Behalf Of Johannes
> Berg
> Sent: Wednesday, September 4, 2019 3:04 PM
> To: Wen Gong <wgong@codeaurora.org>; ath10k@lists.infradead.org
> Cc: linux-wireless@vger.kernel.org
> Subject: [EXT] Re: [PATCH] mac80211: Store max_mtu in ieee80211_hw
> 
Patch v2 sent, https://patchwork.kernel.org/patch/11129707/
> _______________________________________________
> ath10k mailing list
> ath10k@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/ath10k

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

* RE: [PATCH] mac80211: Store max_mtu in ieee80211_hw
@ 2019-09-04  9:16     ` Wen Gong
  0 siblings, 0 replies; 6+ messages in thread
From: Wen Gong @ 2019-09-04  9:16 UTC (permalink / raw)
  To: Johannes Berg, Wen Gong, ath10k; +Cc: linux-wireless

> -----Original Message-----
> From: ath10k <ath10k-bounces@lists.infradead.org> On Behalf Of Johannes
> Berg
> Sent: Wednesday, September 4, 2019 3:04 PM
> To: Wen Gong <wgong@codeaurora.org>; ath10k@lists.infradead.org
> Cc: linux-wireless@vger.kernel.org
> Subject: [EXT] Re: [PATCH] mac80211: Store max_mtu in ieee80211_hw
> 
Patch v2 sent, https://patchwork.kernel.org/patch/11129707/
> _______________________________________________
> ath10k mailing list
> ath10k@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/ath10k

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

end of thread, other threads:[~2019-09-04  9:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-04  6:15 [PATCH] mac80211: Store max_mtu in ieee80211_hw Wen Gong
2019-09-04  6:15 ` Wen Gong
2019-09-04  7:03 ` Johannes Berg
2019-09-04  7:03   ` Johannes Berg
2019-09-04  9:16   ` Wen Gong
2019-09-04  9:16     ` Wen Gong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.