linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] mac80211: Fix MAX MTU Calculation
       [not found] <201212201236.qBKCakFZ011657@chaitanya-desktop>
@ 2012-12-20 12:43 ` Chaitanya
  2012-12-20 13:07   ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Chaitanya @ 2012-12-20 12:43 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

Fix the MTU calculation, we should check for data_len+ mesh hdr len
and shouldn't include any header lengths.

ToDo: Get the MAX_DATA_LEN based on driver's AMSDU capability.

Signed-off-by: T Krishna Chaitanya <chaitanyatk@posedge.com>

---

 net/mac80211/iface.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 54fb7f9..da74ef9 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -214,8 +214,23 @@ static int ieee80211_change_mtu(struct net_device *dev, int new_mtu)
 
 	/* FIX: what would be proper limits for MTU?
 	 * This interface uses 802.3 frames. */
+	/* Fixed: MTU needn't worry about headers*/
+
+	/* 802.11-2012: 8.2.3: The maximum frame body size is determined by
+	1. The maximum MSDU size (2304 octets),
+	2. plus the length of the Mesh Control field (6, 12, or 18 octets)
+		if present,
+	3. the maximum unencrypted MMPDU size excluding the MAC header and
+		FCS (2304 octets) or
+	4. the maximum A- MSDU size (3839 or 7935 octets),
+		plus any overhead from security encapsulation.
+	Note1: IEEE80211_MAX_DATA_LEN doesnt include any headers (2304),
+		so it can be used directly+ Mesh HDR Len
+	Note2: In Other places (like skb_alloc) its handled properly.
+	 */
+
 	if (new_mtu < 256 ||
-	    new_mtu > IEEE80211_MAX_DATA_LEN - 24 - 6 - meshhdrlen) {
+	    new_mtu > IEEE80211_MAX_DATA_LEN + meshhdrlen) {
 		return -EINVAL;
 	}
 





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

* Re: [RFC] mac80211: Fix MAX MTU Calculation
  2012-12-20 12:43 ` [RFC] mac80211: Fix MAX MTU Calculation Chaitanya
@ 2012-12-20 13:07   ` Johannes Berg
  2012-12-20 13:17     ` Chaitanya
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2012-12-20 13:07 UTC (permalink / raw)
  To: Chaitanya; +Cc: linux-wireless

On Thu, 2012-12-20 at 18:13 +0530, Chaitanya wrote:
> Fix the MTU calculation, we should check for data_len+ mesh hdr len
> and shouldn't include any header lengths.
> 
> ToDo: Get the MAX_DATA_LEN based on driver's AMSDU capability.
> 
> Signed-off-by: T Krishna Chaitanya <chaitanyatk@posedge.com>
> 
> ---
> 
>  net/mac80211/iface.c |   17 ++++++++++++++++-
>  1 files changed, 16 insertions(+), 1 deletions(-)
> 
> diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
> index 54fb7f9..da74ef9 100644
> --- a/net/mac80211/iface.c
> +++ b/net/mac80211/iface.c
> @@ -214,8 +214,23 @@ static int ieee80211_change_mtu(struct net_device *dev, int new_mtu)
>  
>  	/* FIX: what would be proper limits for MTU?
>  	 * This interface uses 802.3 frames. */
> +	/* Fixed: MTU needn't worry about headers*/
> +
> +	/* 802.11-2012: 8.2.3: The maximum frame body size is determined by
> +	1. The maximum MSDU size (2304 octets),
> +	2. plus the length of the Mesh Control field (6, 12, or 18 octets)
> +		if present,
> +	3. the maximum unencrypted MMPDU size excluding the MAC header and
> +		FCS (2304 octets) or
> +	4. the maximum A- MSDU size (3839 or 7935 octets),
> +		plus any overhead from security encapsulation.
> +	Note1: IEEE80211_MAX_DATA_LEN doesnt include any headers (2304),
> +		so it can be used directly+ Mesh HDR Len
> +	Note2: In Other places (like skb_alloc) its handled properly.
> +	 */
> +

ok so the comment style is wrong, you shouldn't list changelog-type
things in comments ("Fixed: ...") etc.

I also don't understand why we should add the mesh length? It seems that
this is really just the maximum MSDU size, i.e. 2304 octets.

johannes


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

* Re: [RFC] mac80211: Fix MAX MTU Calculation
  2012-12-20 13:07   ` Johannes Berg
@ 2012-12-20 13:17     ` Chaitanya
  0 siblings, 0 replies; 3+ messages in thread
From: Chaitanya @ 2012-12-20 13:17 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

On Thursday 20 December 2012 06:37 PM, Johannes Berg wrote:
> On Thu, 2012-12-20 at 18:13 +0530, Chaitanya wrote:
>> Fix the MTU calculation, we should check for data_len+ mesh hdr len
>> and shouldn't include any header lengths.
>>
>> ToDo: Get the MAX_DATA_LEN based on driver's AMSDU capability.
>>
>> Signed-off-by: T Krishna Chaitanya <chaitanyatk@posedge.com>
>>
>> ---
>>
>>  net/mac80211/iface.c |   17 ++++++++++++++++-
>>  1 files changed, 16 insertions(+), 1 deletions(-)
>>
>> diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
>> index 54fb7f9..da74ef9 100644
>> --- a/net/mac80211/iface.c
>> +++ b/net/mac80211/iface.c
>> @@ -214,8 +214,23 @@ static int ieee80211_change_mtu(struct net_device *dev, int new_mtu)
>>  
>>  	/* FIX: what would be proper limits for MTU?
>>  	 * This interface uses 802.3 frames. */
>> +	/* Fixed: MTU needn't worry about headers*/
>> +
>> +	/* 802.11-2012: 8.2.3: The maximum frame body size is determined by
>> +	1. The maximum MSDU size (2304 octets),
>> +	2. plus the length of the Mesh Control field (6, 12, or 18 octets)
>> +		if present,
>> +	3. the maximum unencrypted MMPDU size excluding the MAC header and
>> +		FCS (2304 octets) or
>> +	4. the maximum A- MSDU size (3839 or 7935 octets),
>> +		plus any overhead from security encapsulation.
>> +	Note1: IEEE80211_MAX_DATA_LEN doesnt include any headers (2304),
>> +		so it can be used directly+ Mesh HDR Len
>> +	Note2: In Other places (like skb_alloc) its handled properly.
>> +	 */
>> +
> ok so the comment style is wrong, you shouldn't list changelog-type
> things in comments ("Fixed: ...") etc.
>
> I also don't understand why we should add the mesh length? It seems that
> this is really just the maximum MSDU size, i.e. 2304 octets.
>
> johannes
>
Ok, will change the comments.  So shall i remove the comments
for FIX as well (or) should i retain them?

As for WLAN is concerned the mesh
header is part of data (MSDU) hence the standard says the MSDU
can be Maximum of 2304 + Any Mesh Control Field. (#2 above).



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

end of thread, other threads:[~2012-12-20 13:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <201212201236.qBKCakFZ011657@chaitanya-desktop>
2012-12-20 12:43 ` [RFC] mac80211: Fix MAX MTU Calculation Chaitanya
2012-12-20 13:07   ` Johannes Berg
2012-12-20 13:17     ` Chaitanya

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).