]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
batman-adv: Add support for jumbo frames
authorSven Eckelmann <sven@narfation.org>
Sun, 2 Feb 2025 11:39:57 +0000 (12:39 +0100)
committerSimon Wunderlich <sw@simonwunderlich.de>
Sat, 22 Feb 2025 10:34:52 +0000 (11:34 +0100)
Since batman-adv is not actually depending on hardware capabilities, it has
no limit on the MTU. Only the lower hard interfaces can limit it. In case
these have an high enough MTU or fragmentation is enabled, a higher MTU
than 1500 can be enabled.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
net/batman-adv/hard-interface.c
net/batman-adv/main.h
net/batman-adv/soft-interface.c

index 71b2236c00587156f93fd2f5a05980cfda659012..e7e7f14da03c977bd0662beb0c6f8d1b989cbc0d 100644 (file)
@@ -618,10 +618,8 @@ out:
 
        /* the real soft-interface MTU is computed by removing the payload
         * overhead from the maximum amount of bytes that was just computed.
-        *
-        * However batman-adv does not support MTUs bigger than ETH_DATA_LEN
         */
-       return min_t(int, min_mtu - batadv_max_header_len(), ETH_DATA_LEN);
+       return min_t(int, min_mtu - batadv_max_header_len(), BATADV_MAX_MTU);
 }
 
 /**
index 626618d0c366eeef0e3d4810288e1cc852699963..4ecc304eaddd7d64fbbc12336252028a9e0441d3 100644 (file)
@@ -22,6 +22,8 @@
 #define BATADV_THROUGHPUT_MAX_VALUE 0xFFFFFFFF
 #define BATADV_JITTER 20
 
+#define BATADV_MAX_MTU (ETH_MAX_MTU - batadv_max_header_len())
+
 /* Time To Live of broadcast messages */
 #define BATADV_TTL 50
 
index d893c80132616aa03c00dfe8de89b89607cd5228..b1127e6e8900aad340dbed9bdf3521f342649fc2 100644 (file)
@@ -790,7 +790,7 @@ static int batadv_softif_init_late(struct net_device *dev)
        atomic_set(&bat_priv->log_level, 0);
 #endif
        atomic_set(&bat_priv->fragmentation, 1);
-       atomic_set(&bat_priv->packet_size_max, ETH_DATA_LEN);
+       atomic_set(&bat_priv->packet_size_max, BATADV_MAX_MTU);
        atomic_set(&bat_priv->bcast_queue_left, BATADV_BCAST_QUEUE_LEN);
        atomic_set(&bat_priv->batman_queue_left, BATADV_BATMAN_QUEUE_LEN);
 
@@ -1043,6 +1043,7 @@ static void batadv_softif_init_early(struct net_device *dev)
         * have not been initialized yet
         */
        dev->mtu = ETH_DATA_LEN;
+       dev->max_mtu = BATADV_MAX_MTU;
 
        /* generate random address */
        eth_hw_addr_random(dev);