Skip to contentSkip to conversation

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

PATCH In review Marek Lindner 2 participants 2 messages May 8, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 batman-adv: consider network coding overhead when calculating required mtu

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.

---
 types.h |    7 +++++++
 1 file changed, 7 insertions(+)
types.h +7 -0
index b2c94e1..8089bd6 100644
@@ -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
 
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Marek Lindner

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.

Quoted 26 lines
---
  types.h |    7 +++++++
  1 file changed, 7 insertions(+)
types.h +7 -0
index b2c94e1..8089bd6 100644
@@ -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
 
Signature · 8 lines
Kind Regards
Martin Hundebøll
Frederiks Allé 99, 1.th
8000 Aarhus C
Denmark

+45 61 65 54 61
[email protected]