Skip to contentSkip to conversation

batman-adv: document num_packets use as aggregation stop marker

PATCH New Sven Eckelmann 1 participant 1 message Oct 27 Batman advanced

lore
Share & tools
lore

Sven Eckelmann

author maintainer
#0 lore raw

PATCH 1/1 batman-adv: document num_packets use as aggregation stop marker

The OGM send worker sets num_packets of a forw_packet to BATADV_MAX_AGGREGATION_PACKETS before emitting it. This marks the aggregate as full so that no further OGMs get appended while it is transmitted. After this, num_packets no longer holds the number of aggregated OGMs.

The kernel-doc still only describes the field as a plain counter. Document the second use so later readers don't rely on num_packets to be the actual number of aggregated OGMs.

---
 net/batman-adv/types.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
net/batman-adv/types.h +7 -1
index c19caa84..b3e6dbb3 100644
@@ -2047,7 +2047,13 @@ struct batadv_forw_packet {
 	/** @direct_link_flags: direct link flags for aggregated OGM packets */
 	DECLARE_BITMAP(direct_link_flags, BATADV_MAX_AGGREGATION_PACKETS);
 
-	/** @num_packets: counter for aggregated OGMv1 packets */
+	/**
+	 * @num_packets: counter for aggregated OGMv1 packets. Set to
+	 *  BATADV_MAX_AGGREGATION_PACKETS (independent of the real number of
+	 *  aggregated packets) by the send worker to prevent further
+	 *  aggregation while the packet is emitted. It must therefore not be
+	 *  used to iterate over the aggregated packets
+	 */
 	u8 num_packets;
 
 	/** @delayed_work: work queue callback item for packet sending */

---
base-commit: 08b79268afb43880f861c12ec9a34d1ccb85ab2f
change-id: 20261027-kdoc-num_packets-8f6d808fb90b

Best regards,

Signature · 1 line
Sven Eckelmann <[email protected]>