[next] batman-adv: consider network coding overhead when calculating required mtu

Message ID 1367991380-30270-1-git-send-email-lindner_marek@yahoo.de (mailing list archive)
State Superseded, archived
Headers

Commit Message

Marek Lindner May 8, 2013, 5:36 a.m. UTC
  The module prints a warning when the MTU on the hard interface is too
small to transfer payload traffic without fragmentation. The required
MTU is calculated based on the encapsulation header size. If network
coding is compild into the module its header size is taken into
account as well.

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
---
 types.h |    7 +++++++
 1 file changed, 7 insertions(+)
  

Comments

Martin Hundebøll May 8, 2013, 5:51 a.m. UTC | #1
On 2013-05-08 07:36, Marek Lindner wrote:
> The module prints a warning when the MTU on the hard interface is too
> small to transfer payload traffic without fragmentation. The required
> MTU is calculated based on the encapsulation header size. If network
> coding is compild into the module its header size is taken into
> account as well.
>
> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>

Acked-by: Martin Hundebøll <martin@hundeboll.net>

> ---
>   types.h |    7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/types.h b/types.h
> index b2c94e1..8089bd6 100644
> --- a/types.h
> +++ b/types.h
> @@ -27,9 +27,16 @@
>   /**
>    * Maximum overhead for the encapsulation for a payload packet
>    */
> +#ifdef CONFIG_BATMAN_ADV_NC
> +#define BATADV_HEADER_LEN \
> +	(ETH_HLEN + max3(sizeof(struct batadv_unicast_packet), \
> +			 sizeof(struct batadv_bcast_packet),   \
> +			 sizeof(struct batadv_coded_packet)))
> +#else
>   #define BATADV_HEADER_LEN \
>   	(ETH_HLEN + max(sizeof(struct batadv_unicast_packet), \
>   			sizeof(struct batadv_bcast_packet)))
> +#endif /* CONFIG_BATMAN_ADV_NC */
>
>   #ifdef CONFIG_BATMAN_ADV_DAT
>
>
  

Patch

diff --git a/types.h b/types.h
index b2c94e1..8089bd6 100644
--- a/types.h
+++ b/types.h
@@ -27,9 +27,16 @@ 
 /**
  * Maximum overhead for the encapsulation for a payload packet
  */
+#ifdef CONFIG_BATMAN_ADV_NC
+#define BATADV_HEADER_LEN \
+	(ETH_HLEN + max3(sizeof(struct batadv_unicast_packet), \
+			 sizeof(struct batadv_bcast_packet),   \
+			 sizeof(struct batadv_coded_packet)))
+#else
 #define BATADV_HEADER_LEN \
 	(ETH_HLEN + max(sizeof(struct batadv_unicast_packet), \
 			sizeof(struct batadv_bcast_packet)))
+#endif /* CONFIG_BATMAN_ADV_NC */
 
 #ifdef CONFIG_BATMAN_ADV_DAT