Skip to contentSkip to conversation

NDP patches, first draft

B.A.T.M.A.N. In review Linus Lüssing 3 participants 26 messages Dec 7, 2010 – Dec 9, 2010 Kbuild

lore
Share & tools
lore
#0 lore raw

Hi everyone,

I've been working on those patches for seperating the link quality measurements from the OGMs and putting that into a seperate protocol with its own packets a little more. This Neighbour Discovery Protocol will allow us to have faster intervals for NDP or different intervals on different interface types, as well as creating individual convergence speed optimizations for the link quality measurements (NDP) or the path quality propagation (OGM) later.

This is a first draft and basically what we've been discussing on the WBMv3 in Italy and which was documented a little in our wiki.

I haven't added my Signed-off-by yet as I'd like to get some feedback first, especially for the last patch. Here I'm not sure if that's sufficient and ok to do it like that (the limit check seemed redundant to me) or if I'm missing something. Especially I'm not really sure what tq_own was representing as the link quality seemed to be substracted with the real_packet_count.

After the overall way of doing it is acknowledged, I'd start cleaning up the OGM handling and removing variables and redundant LQ measurements.

Cheers, Linus

#1 lore raw

PATCH 1/10 batman-adv: Creating new neighbor discovery packet

This patch creates the new neighbor discovery packet type (which is not actually being used with this patch). It will later be responsible to detect neighbors and calculate the link quality to them.

---
 aggregation.c       |   44 +++++++++++-----------
 aggregation.h       |    2 +-
 hard-interface.c    |   43 +++++++++++----------
 packet.h            |   28 ++++++++++----
 routing.c           |  101 ++++++++++++++++++++++++------------------------
 routing.h           |    2 +-
 send.c              |  106 ++++++++++++++++++++++++++-------------------------
 send.h              |    2 +-
 soft-interface.c    |   18 +++++----
 translation-table.c |    2 +-
 10 files changed, 183 insertions(+), 165 deletions(-)
aggregation.c +22 -22
index 0c92e3b..c158df2 100644
@@ -25,21 +25,21 @@
 #include "routing.h"
 
 /* calculate the size of the hna information for a given packet */
-static int hna_len(struct batman_packet *batman_packet)
+static int hna_len(struct batman_packet_ogm *batman_packet_ogm)
 {
-	return batman_packet->num_hna * ETH_ALEN;
+	return batman_packet_ogm->num_hna * ETH_ALEN;
 }
 
 /* return true if new_packet can be aggregated with forw_packet */
-static bool can_aggregate_with(struct batman_packet *new_batman_packet,
+static bool can_aggregate_with(struct batman_packet_ogm *new_batman_packet_ogm,
 			       int packet_len,
 			       unsigned long send_time,
 			       bool directlink,
 			       struct batman_if *if_incoming,
 			       struct forw_packet *forw_packet)
 {
-	struct batman_packet *batman_packet =
-		(struct batman_packet *)forw_packet->skb->data;
+	struct batman_packet_ogm *batman_packet_ogm =
+		(struct batman_packet_ogm *)forw_packet->skb->data;
 	int aggregated_bytes = forw_packet->packet_len + packet_len;
 
 	/**
@@ -68,8 +68,8 @@ static bool can_aggregate_with(struct batman_packet *new_batman_packet,
 		/* packets without direct link flag and high TTL
 		 * are flooded through the net  */
 		if ((!directlink) &&
-		    (!(batman_packet->flags & DIRECTLINK)) &&
-		    (batman_packet->ttl != 1) &&
+		    (!(batman_packet_ogm->flags & DIRECTLINK)) &&
+		    (batman_packet_ogm->ttl != 1) &&
 
 		    /* own packets originating non-primary
 		     * interfaces leave only that interface */
@@ -80,13 +80,13 @@ static bool can_aggregate_with(struct batman_packet *new_batman_packet,
 		/* if the incoming packet is sent via this one
 		 * interface only - we still can aggregate */
 		if ((directlink) &&
-		    (new_batman_packet->ttl == 1) &&
+		    (new_batman_packet_ogm->ttl == 1) &&
 		    (forw_packet->if_incoming == if_incoming) &&
 
 		    /* packets from direct neighbors or
 		     * own secondary interface packets
 		     * (= secondary interface packets in general) */
-		    (batman_packet->flags & DIRECTLINK ||
+		    (batman_packet_ogm->flags & DIRECTLINK ||
 		     (forw_packet->own &&
 		      forw_packet->if_incoming->if_num != 0)))
 			return true;
@@ -197,9 +197,9 @@ void add_bat_packet_to_list(struct bat_priv *bat_priv,
 	 */
 	struct forw_packet *forw_packet_aggr = NULL, *forw_packet_pos = NULL;
 	struct hlist_node *tmp_node;
-	struct batman_packet *batman_packet =
-		(struct batman_packet *)packet_buff;
-	bool direct_link = batman_packet->flags & DIRECTLINK ? 1 : 0;
+	struct batman_packet_ogm *batman_packet_ogm =
+		(struct batman_packet_ogm *)packet_buff;
+	bool direct_link = batman_packet_ogm->flags & DIRECTLINK ? 1 : 0;
 
 	/* find position for the packet in the forward queue */
 	spin_lock_bh(&bat_priv->forw_bat_list_lock);
@@ -207,7 +207,7 @@ void add_bat_packet_to_list(struct bat_priv *bat_priv,
 	if ((atomic_read(&bat_priv->aggregated_ogms)) && (!own_packet)) {
 		hlist_for_each_entry(forw_packet_pos, tmp_node,
 				     &bat_priv->forw_bat_list, list) {
-			if (can_aggregate_with(batman_packet,
+			if (can_aggregate_with(batman_packet_ogm,
 					       packet_len,
 					       send_time,
 					       direct_link,
@@ -249,25 +249,25 @@ void add_bat_packet_to_list(struct bat_priv *bat_priv,
 void receive_aggr_bat_packet(struct ethhdr *ethhdr, unsigned char *packet_buff,
 			     int packet_len, struct batman_if *if_incoming)
 {
-	struct batman_packet *batman_packet;
+	struct batman_packet_ogm *batman_packet_ogm;
 	int buff_pos = 0;
 	unsigned char *hna_buff;
 
-	batman_packet = (struct batman_packet *)packet_buff;
+	batman_packet_ogm = (struct batman_packet_ogm *)packet_buff;
 
 	do {
 		/* network to host order for our 32bit seqno, and the
 		   orig_interval. */
-		batman_packet->seqno = ntohl(batman_packet->seqno);
+		batman_packet_ogm->seqno = ntohl(batman_packet_ogm->seqno);
 
-		hna_buff = packet_buff + buff_pos + BAT_PACKET_LEN;
-		receive_bat_packet(ethhdr, batman_packet,
-				   hna_buff, hna_len(batman_packet),
+		hna_buff = packet_buff + buff_pos + BAT_PACKET_OGM_LEN;
+		receive_bat_packet(ethhdr, batman_packet_ogm,
+				   hna_buff, hna_len(batman_packet_ogm),
 				   if_incoming);
 
-		buff_pos += BAT_PACKET_LEN + hna_len(batman_packet);
-		batman_packet = (struct batman_packet *)
+		buff_pos += BAT_PACKET_OGM_LEN + hna_len(batman_packet_ogm);
+		batman_packet_ogm = (struct batman_packet_ogm *)
 			(packet_buff + buff_pos);
 	} while (aggregated_packet(buff_pos, packet_len,
-				   batman_packet->num_hna));
+				   batman_packet_ogm->num_hna));
 }
aggregation.h +1 -1
index 71a91b3..1a7a0b6 100644
@@ -27,7 +27,7 @@
 /* is there another aggregated packet here? */
 static inline int aggregated_packet(int buff_pos, int packet_len, int num_hna)
 {
-	int next_buff_pos = buff_pos + BAT_PACKET_LEN + (num_hna * ETH_ALEN);
+	int next_buff_pos = buff_pos + BAT_PACKET_OGM_LEN + (num_hna * ETH_ALEN);
 
 	return (next_buff_pos <= packet_len) &&
 		(next_buff_pos <= MAX_AGGREGATION_BYTES);
hard-interface.c +22 -21

102 lines not on this page · raw message

packet.h +20 -8
index b49fdf7..beb1b56 100644
@@ -24,12 +24,13 @@
 
 #define ETH_P_BATMAN  0x4305	/* unofficial/not registered Ethertype */
 
-#define BAT_PACKET       0x01
-#define BAT_ICMP         0x02
-#define BAT_UNICAST      0x03
-#define BAT_BCAST        0x04
-#define BAT_VIS          0x05
-#define BAT_UNICAST_FRAG 0x06
+#define BAT_PACKET_NDP   0x01
+#define BAT_PACKET_OGM   0x02
+#define BAT_ICMP         0x03
+#define BAT_UNICAST      0x04
+#define BAT_BCAST        0x05
+#define BAT_VIS          0x06
+#define BAT_UNICAST_FRAG 0x07
 
 /* this file is included by batctl which needs these defines */
 #define COMPAT_VERSION 12
@@ -51,7 +52,18 @@
 /* fragmentation defines */
 #define UNI_FRAG_HEAD 0x01
 
-struct batman_packet {
+/* Neighbor discovery packet */
+struct batman_packet_ndp {
+	uint8_t  packet_type;
+	uint8_t  version;  /* batman version field */
+	uint8_t  orig[6];
+	uint32_t seqno;
+	uint8_t  num_neighbors;
+	uint8_t  align[3];
+} __attribute__((packed));
+
+/* Originator message packet */
+struct batman_packet_ogm {
 	uint8_t  packet_type;
 	uint8_t  version;  /* batman version field */
 	uint8_t  flags;    /* 0x40: DIRECTLINK flag, 0x20 VIS_SERVER flag... */
@@ -65,7 +77,7 @@ struct batman_packet {
 	uint8_t  align;
 } __attribute__((packed));
 
-#define BAT_PACKET_LEN sizeof(struct batman_packet)
+#define BAT_PACKET_OGM_LEN sizeof(struct batman_packet_ogm)
 
 struct icmp_packet {
 	uint8_t  packet_type;
routing.c +51 -50

289 lines not on this page · raw message

routing.h +1 -1
index f108f23..81e27d5 100644
@@ -26,7 +26,7 @@
 
 void slide_own_bcast_window(struct batman_if *batman_if);
 void receive_bat_packet(struct ethhdr *ethhdr,
-				struct batman_packet *batman_packet,
+				struct batman_packet_ogm *batman_packet_ogm,
 				unsigned char *hna_buff, int hna_buff_len,
 				struct batman_if *if_incoming);
 void update_routes(struct bat_priv *bat_priv, struct orig_node *orig_node,
send.c +54 -52

243 lines not on this page · raw message

send.h +1 -1
index c4cefa8..acf59e7 100644
@@ -30,7 +30,7 @@ int send_skb_packet(struct sk_buff *skb,
 void schedule_own_packet(struct batman_if *batman_if);
 void schedule_forward_packet(struct orig_node *orig_node,
 			     struct ethhdr *ethhdr,
-			     struct batman_packet *batman_packet,
+			     struct batman_packet_ogm *batman_packet_ogm,
 			     uint8_t directlink, int hna_buff_len,
 			     struct batman_if *if_outgoing);
 int add_bcast_packet_to_list(struct bat_priv *bat_priv, struct sk_buff *skb);
soft-interface.c +10 -8
index e89ede1..ac65bc1 100644
@@ -221,28 +221,30 @@ static void softif_batman_recv(struct sk_buff *skb, struct net_device *dev,
 {
 	struct bat_priv *bat_priv = netdev_priv(dev);
 	struct ethhdr *ethhdr = (struct ethhdr *)skb->data;
-	struct batman_packet *batman_packet;
+	struct batman_packet_ogm *batman_packet_ogm;
 	struct softif_neigh *softif_neigh, *softif_neigh_tmp;
 
 	if (ntohs(ethhdr->h_proto) == ETH_P_8021Q)
-		batman_packet = (struct batman_packet *)
+		batman_packet_ogm = (struct batman_packet_ogm *)
 					(skb->data + ETH_HLEN + VLAN_HLEN);
 	else
-		batman_packet = (struct batman_packet *)(skb->data + ETH_HLEN);
+		batman_packet_ogm = (struct batman_packet_ogm *)
+					(skb->data + ETH_HLEN);
 
-	if (batman_packet->version != COMPAT_VERSION)
+	if (batman_packet_ogm->version != COMPAT_VERSION)
 		goto err;
 
-	if (batman_packet->packet_type != BAT_PACKET)
+	if (batman_packet_ogm->packet_type != BAT_PACKET_OGM)
 		goto err;
 
-	if (!(batman_packet->flags & PRIMARIES_FIRST_HOP))
+	if (!(batman_packet_ogm->flags & PRIMARIES_FIRST_HOP))
 		goto err;
 
-	if (is_my_mac(batman_packet->orig))
+	if (is_my_mac(batman_packet_ogm->orig))
 		goto err;
 
-	softif_neigh = softif_neigh_get(bat_priv, batman_packet->orig, vid);
+	softif_neigh = softif_neigh_get(bat_priv, batman_packet_ogm->orig,
+					vid);
 
 	if (!softif_neigh)
 		goto err;
translation-table.c +1 -1
index 4b0a107..6d5d3ec 100644
@@ -77,7 +77,7 @@ void hna_local_add(struct net_device *soft_iface, uint8_t *addr)
 	   space in batman_packet->num_hna That also should give a limit to
 	   MAC-flooding. */
 	required_bytes = (bat_priv->num_local_hna + 1) * ETH_ALEN;
-	required_bytes += BAT_PACKET_LEN;
+	required_bytes += BAT_PACKET_OGM_LEN;
 
 	if ((required_bytes > ETH_DATA_LEN) ||
 	    (atomic_read(&bat_priv->aggregated_ogms) &&
Signature · 1 line
1.7.1
#2 lore raw

PATCH 1/10 batman-adv: Creating new neighbor discovery packet

In reply to Linus Lüssing

This patch creates the new neighbor discovery packet type (which is not actually being used with this patch). It will later be responsible to detect neighbors and calculate the link quality to them.

---
 aggregation.c       |   44 +++++++++++-----------
 aggregation.h       |    2 +-
 hard-interface.c    |   43 +++++++++++----------
 packet.h            |   28 ++++++++++----
 routing.c           |  101 ++++++++++++++++++++++++------------------------
 routing.h           |    2 +-
 send.c              |  106 ++++++++++++++++++++++++++-------------------------
 send.h              |    2 +-
 soft-interface.c    |   18 +++++----
 translation-table.c |    2 +-
 10 files changed, 183 insertions(+), 165 deletions(-)
aggregation.c +22 -22
index 0c92e3b..c158df2 100644
@@ -25,21 +25,21 @@
 #include "routing.h"
 
 /* calculate the size of the hna information for a given packet */
-static int hna_len(struct batman_packet *batman_packet)
+static int hna_len(struct batman_packet_ogm *batman_packet_ogm)
 {
-	return batman_packet->num_hna * ETH_ALEN;
+	return batman_packet_ogm->num_hna * ETH_ALEN;
 }
 
 /* return true if new_packet can be aggregated with forw_packet */
-static bool can_aggregate_with(struct batman_packet *new_batman_packet,
+static bool can_aggregate_with(struct batman_packet_ogm *new_batman_packet_ogm,
 			       int packet_len,
 			       unsigned long send_time,
 			       bool directlink,
 			       struct batman_if *if_incoming,
 			       struct forw_packet *forw_packet)
 {
-	struct batman_packet *batman_packet =
-		(struct batman_packet *)forw_packet->skb->data;
+	struct batman_packet_ogm *batman_packet_ogm =
+		(struct batman_packet_ogm *)forw_packet->skb->data;
 	int aggregated_bytes = forw_packet->packet_len + packet_len;
 
 	/**
@@ -68,8 +68,8 @@ static bool can_aggregate_with(struct batman_packet *new_batman_packet,
 		/* packets without direct link flag and high TTL
 		 * are flooded through the net  */
 		if ((!directlink) &&
-		    (!(batman_packet->flags & DIRECTLINK)) &&
-		    (batman_packet->ttl != 1) &&
+		    (!(batman_packet_ogm->flags & DIRECTLINK)) &&
+		    (batman_packet_ogm->ttl != 1) &&
 
 		    /* own packets originating non-primary
 		     * interfaces leave only that interface */
@@ -80,13 +80,13 @@ static bool can_aggregate_with(struct batman_packet *new_batman_packet,
 		/* if the incoming packet is sent via this one
 		 * interface only - we still can aggregate */
 		if ((directlink) &&
-		    (new_batman_packet->ttl == 1) &&
+		    (new_batman_packet_ogm->ttl == 1) &&
 		    (forw_packet->if_incoming == if_incoming) &&
 
 		    /* packets from direct neighbors or
 		     * own secondary interface packets
 		     * (= secondary interface packets in general) */
-		    (batman_packet->flags & DIRECTLINK ||
+		    (batman_packet_ogm->flags & DIRECTLINK ||
 		     (forw_packet->own &&
 		      forw_packet->if_incoming->if_num != 0)))
 			return true;
@@ -197,9 +197,9 @@ void add_bat_packet_to_list(struct bat_priv *bat_priv,
 	 */
 	struct forw_packet *forw_packet_aggr = NULL, *forw_packet_pos = NULL;
 	struct hlist_node *tmp_node;
-	struct batman_packet *batman_packet =
-		(struct batman_packet *)packet_buff;
-	bool direct_link = batman_packet->flags & DIRECTLINK ? 1 : 0;
+	struct batman_packet_ogm *batman_packet_ogm =
+		(struct batman_packet_ogm *)packet_buff;
+	bool direct_link = batman_packet_ogm->flags & DIRECTLINK ? 1 : 0;
 
 	/* find position for the packet in the forward queue */
 	spin_lock_bh(&bat_priv->forw_bat_list_lock);
@@ -207,7 +207,7 @@ void add_bat_packet_to_list(struct bat_priv *bat_priv,
 	if ((atomic_read(&bat_priv->aggregated_ogms)) && (!own_packet)) {
 		hlist_for_each_entry(forw_packet_pos, tmp_node,
 				     &bat_priv->forw_bat_list, list) {
-			if (can_aggregate_with(batman_packet,
+			if (can_aggregate_with(batman_packet_ogm,
 					       packet_len,
 					       send_time,
 					       direct_link,
@@ -249,25 +249,25 @@ void add_bat_packet_to_list(struct bat_priv *bat_priv,
 void receive_aggr_bat_packet(struct ethhdr *ethhdr, unsigned char *packet_buff,
 			     int packet_len, struct batman_if *if_incoming)
 {
-	struct batman_packet *batman_packet;
+	struct batman_packet_ogm *batman_packet_ogm;
 	int buff_pos = 0;
 	unsigned char *hna_buff;
 
-	batman_packet = (struct batman_packet *)packet_buff;
+	batman_packet_ogm = (struct batman_packet_ogm *)packet_buff;
 
 	do {
 		/* network to host order for our 32bit seqno, and the
 		   orig_interval. */
-		batman_packet->seqno = ntohl(batman_packet->seqno);
+		batman_packet_ogm->seqno = ntohl(batman_packet_ogm->seqno);
 
-		hna_buff = packet_buff + buff_pos + BAT_PACKET_LEN;
-		receive_bat_packet(ethhdr, batman_packet,
-				   hna_buff, hna_len(batman_packet),
+		hna_buff = packet_buff + buff_pos + BAT_PACKET_OGM_LEN;
+		receive_bat_packet(ethhdr, batman_packet_ogm,
+				   hna_buff, hna_len(batman_packet_ogm),
 				   if_incoming);
 
-		buff_pos += BAT_PACKET_LEN + hna_len(batman_packet);
-		batman_packet = (struct batman_packet *)
+		buff_pos += BAT_PACKET_OGM_LEN + hna_len(batman_packet_ogm);
+		batman_packet_ogm = (struct batman_packet_ogm *)
 			(packet_buff + buff_pos);
 	} while (aggregated_packet(buff_pos, packet_len,
-				   batman_packet->num_hna));
+				   batman_packet_ogm->num_hna));
 }
aggregation.h +1 -1
index 71a91b3..1a7a0b6 100644
@@ -27,7 +27,7 @@
 /* is there another aggregated packet here? */
 static inline int aggregated_packet(int buff_pos, int packet_len, int num_hna)
 {
-	int next_buff_pos = buff_pos + BAT_PACKET_LEN + (num_hna * ETH_ALEN);
+	int next_buff_pos = buff_pos + BAT_PACKET_OGM_LEN + (num_hna * ETH_ALEN);
 
 	return (next_buff_pos <= packet_len) &&
 		(next_buff_pos <= MAX_AGGREGATION_BYTES);
hard-interface.c +22 -21

102 lines not on this page · raw message

packet.h +20 -8
index b49fdf7..beb1b56 100644
@@ -24,12 +24,13 @@
 
 #define ETH_P_BATMAN  0x4305	/* unofficial/not registered Ethertype */
 
-#define BAT_PACKET       0x01
-#define BAT_ICMP         0x02
-#define BAT_UNICAST      0x03
-#define BAT_BCAST        0x04
-#define BAT_VIS          0x05
-#define BAT_UNICAST_FRAG 0x06
+#define BAT_PACKET_NDP   0x01
+#define BAT_PACKET_OGM   0x02
+#define BAT_ICMP         0x03
+#define BAT_UNICAST      0x04
+#define BAT_BCAST        0x05
+#define BAT_VIS          0x06
+#define BAT_UNICAST_FRAG 0x07
 
 /* this file is included by batctl which needs these defines */
 #define COMPAT_VERSION 12
@@ -51,7 +52,18 @@
 /* fragmentation defines */
 #define UNI_FRAG_HEAD 0x01
 
-struct batman_packet {
+/* Neighbor discovery packet */
+struct batman_packet_ndp {
+	uint8_t  packet_type;
+	uint8_t  version;  /* batman version field */
+	uint8_t  orig[6];
+	uint32_t seqno;
+	uint8_t  num_neighbors;
+	uint8_t  align[3];
+} __attribute__((packed));
+
+/* Originator message packet */
+struct batman_packet_ogm {
 	uint8_t  packet_type;
 	uint8_t  version;  /* batman version field */
 	uint8_t  flags;    /* 0x40: DIRECTLINK flag, 0x20 VIS_SERVER flag... */
@@ -65,7 +77,7 @@ struct batman_packet {
 	uint8_t  align;
 } __attribute__((packed));
 
-#define BAT_PACKET_LEN sizeof(struct batman_packet)
+#define BAT_PACKET_OGM_LEN sizeof(struct batman_packet_ogm)
 
 struct icmp_packet {
 	uint8_t  packet_type;
routing.c +51 -50

289 lines not on this page · raw message

routing.h +1 -1
index f108f23..81e27d5 100644
@@ -26,7 +26,7 @@
 
 void slide_own_bcast_window(struct batman_if *batman_if);
 void receive_bat_packet(struct ethhdr *ethhdr,
-				struct batman_packet *batman_packet,
+				struct batman_packet_ogm *batman_packet_ogm,
 				unsigned char *hna_buff, int hna_buff_len,
 				struct batman_if *if_incoming);
 void update_routes(struct bat_priv *bat_priv, struct orig_node *orig_node,
send.c +54 -52

243 lines not on this page · raw message

send.h +1 -1
index c4cefa8..acf59e7 100644
@@ -30,7 +30,7 @@ int send_skb_packet(struct sk_buff *skb,
 void schedule_own_packet(struct batman_if *batman_if);
 void schedule_forward_packet(struct orig_node *orig_node,
 			     struct ethhdr *ethhdr,
-			     struct batman_packet *batman_packet,
+			     struct batman_packet_ogm *batman_packet_ogm,
 			     uint8_t directlink, int hna_buff_len,
 			     struct batman_if *if_outgoing);
 int add_bcast_packet_to_list(struct bat_priv *bat_priv, struct sk_buff *skb);
soft-interface.c +10 -8
index e89ede1..ac65bc1 100644
@@ -221,28 +221,30 @@ static void softif_batman_recv(struct sk_buff *skb, struct net_device *dev,
 {
 	struct bat_priv *bat_priv = netdev_priv(dev);
 	struct ethhdr *ethhdr = (struct ethhdr *)skb->data;
-	struct batman_packet *batman_packet;
+	struct batman_packet_ogm *batman_packet_ogm;
 	struct softif_neigh *softif_neigh, *softif_neigh_tmp;
 
 	if (ntohs(ethhdr->h_proto) == ETH_P_8021Q)
-		batman_packet = (struct batman_packet *)
+		batman_packet_ogm = (struct batman_packet_ogm *)
 					(skb->data + ETH_HLEN + VLAN_HLEN);
 	else
-		batman_packet = (struct batman_packet *)(skb->data + ETH_HLEN);
+		batman_packet_ogm = (struct batman_packet_ogm *)
+					(skb->data + ETH_HLEN);
 
-	if (batman_packet->version != COMPAT_VERSION)
+	if (batman_packet_ogm->version != COMPAT_VERSION)
 		goto err;
 
-	if (batman_packet->packet_type != BAT_PACKET)
+	if (batman_packet_ogm->packet_type != BAT_PACKET_OGM)
 		goto err;
 
-	if (!(batman_packet->flags & PRIMARIES_FIRST_HOP))
+	if (!(batman_packet_ogm->flags & PRIMARIES_FIRST_HOP))
 		goto err;
 
-	if (is_my_mac(batman_packet->orig))
+	if (is_my_mac(batman_packet_ogm->orig))
 		goto err;
 
-	softif_neigh = softif_neigh_get(bat_priv, batman_packet->orig, vid);
+	softif_neigh = softif_neigh_get(bat_priv, batman_packet_ogm->orig,
+					vid);
 
 	if (!softif_neigh)
 		goto err;
translation-table.c +1 -1
index 4b0a107..6d5d3ec 100644
@@ -77,7 +77,7 @@ void hna_local_add(struct net_device *soft_iface, uint8_t *addr)
 	   space in batman_packet->num_hna That also should give a limit to
 	   MAC-flooding. */
 	required_bytes = (bat_priv->num_local_hna + 1) * ETH_ALEN;
-	required_bytes += BAT_PACKET_LEN;
+	required_bytes += BAT_PACKET_OGM_LEN;
 
 	if ((required_bytes > ETH_DATA_LEN) ||
 	    (atomic_read(&bat_priv->aggregated_ogms) &&
Signature · 1 line
1.7.1
#3 lore raw

PATCH 2/10 batman-adv: Adding jittering methods for ndp

In reply to Linus Lüssing

This patch adds a function for fetching and jittering an ndp interval from batman-if structure. Needed later for timing the neighbor discovery packets.

---
 hard-interface.c |    2 +-
 routing.c        |    2 +-
 send.c           |   18 +++++++++++++-----
 send.h           |    3 ++-
 types.h          |    1 +
 5 files changed, 18 insertions(+), 8 deletions(-)
hard-interface.c +1 -1
index 784c475..da7b9a9 100644
@@ -360,7 +360,7 @@ int hardif_enable_interface(struct batman_if *batman_if, char *iface_name)
 			batman_if->net_dev->name);
 
 	/* begin scheduling originator messages on that interface */
-	schedule_own_packet(batman_if);
+	schedule_own_ogm_packet(batman_if);
 
 out:
 	return 0;
routing.c +1 -1
index a9406ba..7ebb631 100644
@@ -561,7 +561,7 @@ void receive_bat_packet(struct ethhdr *ethhdr,
 	if (batman_packet_ogm->packet_type != BAT_PACKET_OGM)
 		return;
 
-	/* could be changed by schedule_own_packet() */
+	/* could be changed by schedule_own_ogm_packet() */
 	if_incoming_seqno = atomic_read(&if_incoming->seqno);
 
 	has_directlink_flag = (batman_packet_ogm->flags & DIRECTLINK ? 1 : 0);
send.c +13 -5
index eb9c1e3..910411c 100644
@@ -40,8 +40,16 @@ static uint8_t hop_penalty(const uint8_t tq, struct bat_priv *bat_priv)
 	return (tq * (TQ_MAX_VALUE - hop_penalty)) / (TQ_MAX_VALUE);
 }
 
-/* when do we schedule our own packet to be sent */
-static unsigned long own_send_time(struct bat_priv *bat_priv)
+/* when do we schedule our own neighbor discovery packet to be sent */
+unsigned long own_ndp_send_time(struct batman_if *batman_if)
+{
+	return jiffies + msecs_to_jiffies(
+		   atomic_read(&batman_if->ndp_interval) -
+		   JITTER + (random32() % 2*JITTER));
+}
+
+/* when do we schedule our own originator packet to be sent */
+static unsigned long own_ogm_send_time(struct bat_priv *bat_priv)
 {
 	return jiffies + msecs_to_jiffies(
 		   atomic_read(&bat_priv->orig_interval) -
@@ -243,7 +251,7 @@ static void rebuild_batman_packet_ogm(struct bat_priv *bat_priv,
 	}
 }
 
-void schedule_own_packet(struct batman_if *batman_if)
+void schedule_own_ogm_packet(struct batman_if *batman_if)
 {
 	struct bat_priv *bat_priv = netdev_priv(batman_if->soft_iface);
 	unsigned long send_time;
@@ -296,7 +304,7 @@ void schedule_own_packet(struct batman_if *batman_if)
 	atomic_inc(&batman_if->seqno);
 
 	slide_own_bcast_window(batman_if);
-	send_time = own_send_time(bat_priv);
+	send_time = own_ogm_send_time(bat_priv);
 	add_bat_packet_to_list(bat_priv,
 			       batman_if->packet_buff,
 			       batman_if->packet_len,
@@ -513,7 +521,7 @@ void send_outstanding_bat_packet(struct work_struct *work)
 	 * shutting down
 	 */
 	if (forw_packet->own)
-		schedule_own_packet(forw_packet->if_incoming);
+		schedule_own_ogm_packet(forw_packet->if_incoming);
 
 out:
 	/* don't count own packet */
send.h +2 -1
index acf59e7..b626ddf 100644
@@ -27,7 +27,8 @@
 int send_skb_packet(struct sk_buff *skb,
 				struct batman_if *batman_if,
 				uint8_t *dst_addr);
-void schedule_own_packet(struct batman_if *batman_if);
+unsigned long own_ndp_send_time(struct batman_if *batman_if);
+void schedule_own_ogm_packet(struct batman_if *batman_if);
 void schedule_forward_packet(struct orig_node *orig_node,
 			     struct ethhdr *ethhdr,
 			     struct batman_packet_ogm *batman_packet_ogm,
types.h +1 -0
index 1d00849..8921e20 100644
@@ -47,6 +47,7 @@ struct batman_if {
 	struct packet_type batman_adv_ptype;
 	struct net_device *soft_iface;
 	struct rcu_head rcu;
+	atomic_t ndp_interval;
 };
 
 /**
Signature · 1 line
1.7.1
#4 lore raw

PATCH 2/10 batman-adv: Adding jittering methods for ndp

In reply to Linus Lüssing

This patch adds a function for fetching and jittering an ndp interval from batman-if structure. Needed later for timing the neighbor discovery packets.

---
 hard-interface.c |    2 +-
 routing.c        |    2 +-
 send.c           |   18 +++++++++++++-----
 send.h           |    3 ++-
 types.h          |    1 +
 5 files changed, 18 insertions(+), 8 deletions(-)
hard-interface.c +1 -1
index 784c475..da7b9a9 100644
@@ -360,7 +360,7 @@ int hardif_enable_interface(struct batman_if *batman_if, char *iface_name)
 			batman_if->net_dev->name);
 
 	/* begin scheduling originator messages on that interface */
-	schedule_own_packet(batman_if);
+	schedule_own_ogm_packet(batman_if);
 
 out:
 	return 0;
routing.c +1 -1
index a9406ba..7ebb631 100644
@@ -561,7 +561,7 @@ void receive_bat_packet(struct ethhdr *ethhdr,
 	if (batman_packet_ogm->packet_type != BAT_PACKET_OGM)
 		return;
 
-	/* could be changed by schedule_own_packet() */
+	/* could be changed by schedule_own_ogm_packet() */
 	if_incoming_seqno = atomic_read(&if_incoming->seqno);
 
 	has_directlink_flag = (batman_packet_ogm->flags & DIRECTLINK ? 1 : 0);
send.c +13 -5
index eb9c1e3..910411c 100644
@@ -40,8 +40,16 @@ static uint8_t hop_penalty(const uint8_t tq, struct bat_priv *bat_priv)
 	return (tq * (TQ_MAX_VALUE - hop_penalty)) / (TQ_MAX_VALUE);
 }
 
-/* when do we schedule our own packet to be sent */
-static unsigned long own_send_time(struct bat_priv *bat_priv)
+/* when do we schedule our own neighbor discovery packet to be sent */
+unsigned long own_ndp_send_time(struct batman_if *batman_if)
+{
+	return jiffies + msecs_to_jiffies(
+		   atomic_read(&batman_if->ndp_interval) -
+		   JITTER + (random32() % 2*JITTER));
+}
+
+/* when do we schedule our own originator packet to be sent */
+static unsigned long own_ogm_send_time(struct bat_priv *bat_priv)
 {
 	return jiffies + msecs_to_jiffies(
 		   atomic_read(&bat_priv->orig_interval) -
@@ -243,7 +251,7 @@ static void rebuild_batman_packet_ogm(struct bat_priv *bat_priv,
 	}
 }
 
-void schedule_own_packet(struct batman_if *batman_if)
+void schedule_own_ogm_packet(struct batman_if *batman_if)
 {
 	struct bat_priv *bat_priv = netdev_priv(batman_if->soft_iface);
 	unsigned long send_time;
@@ -296,7 +304,7 @@ void schedule_own_packet(struct batman_if *batman_if)
 	atomic_inc(&batman_if->seqno);
 
 	slide_own_bcast_window(batman_if);
-	send_time = own_send_time(bat_priv);
+	send_time = own_ogm_send_time(bat_priv);
 	add_bat_packet_to_list(bat_priv,
 			       batman_if->packet_buff,
 			       batman_if->packet_len,
@@ -513,7 +521,7 @@ void send_outstanding_bat_packet(struct work_struct *work)
 	 * shutting down
 	 */
 	if (forw_packet->own)
-		schedule_own_packet(forw_packet->if_incoming);
+		schedule_own_ogm_packet(forw_packet->if_incoming);
 
 out:
 	/* don't count own packet */
send.h +2 -1
index acf59e7..b626ddf 100644
@@ -27,7 +27,8 @@
 int send_skb_packet(struct sk_buff *skb,
 				struct batman_if *batman_if,
 				uint8_t *dst_addr);
-void schedule_own_packet(struct batman_if *batman_if);
+unsigned long own_ndp_send_time(struct batman_if *batman_if);
+void schedule_own_ogm_packet(struct batman_if *batman_if);
 void schedule_forward_packet(struct orig_node *orig_node,
 			     struct ethhdr *ethhdr,
 			     struct batman_packet_ogm *batman_packet_ogm,
types.h +1 -0
index 1d00849..8921e20 100644
@@ -47,6 +47,7 @@ struct batman_if {
 	struct packet_type batman_adv_ptype;
 	struct net_device *soft_iface;
 	struct rcu_head rcu;
+	atomic_t ndp_interval;
 };
 
 /**
Signature · 1 line
1.7.1
#5 lore raw

PATCH 3/10 batman-adv: Adding workqueue for new ndp packets

In reply to Linus Lüssing

The new neighbor discovery packets will later need their own interval per interface. For instance on a wifi interface which has regularly changing link qualities the ndp interval should be faster than on a static cable link where we would need some probes from time to time only.

This patch adds a workqueue per interface used by batman-adv. When an interface is active, a ndp_send() with the according batman_if structure will be called every second now.

---
 Makefile.kbuild  |    1 +
 hard-interface.c |    6 ++++++
 ndp.c            |   44 ++++++++++++++++++++++++++++++++++++++++++++
 ndp.h            |    6 ++++++
 types.h          |    2 ++
 5 files changed, 59 insertions(+), 0 deletions(-)
 create mode 100644 ndp.c
 create mode 100644 ndp.h
Makefile.kbuild +1 -0
index e99c198..094eb31 100644
@@ -42,6 +42,7 @@ batman-adv-y += hard-interface.o
 batman-adv-y += hash.o
 batman-adv-y += icmp_socket.o
 batman-adv-y += main.o
+batman-adv-y += ndp.o
 batman-adv-y += originator.o
 batman-adv-y += ring_buffer.o
 batman-adv-y += routing.o
hard-interface.c +6 -0
index da7b9a9..cb81c13 100644
@@ -26,6 +26,7 @@
 #include "translation-table.h"
 #include "routing.h"
 #include "bat_sysfs.h"
+#include "ndp.h"
 #include "originator.h"
 #include "hash.h"
 
@@ -260,6 +261,7 @@ static void hardif_activate_interface(struct batman_if *batman_if)
 		 batman_if->net_dev->name);
 
 	update_min_mtu(batman_if->soft_iface);
+	start_ndp_timer(batman_if);
 	return;
 }
 
@@ -274,6 +276,7 @@ static void hardif_deactivate_interface(struct batman_if *batman_if)
 	bat_info(batman_if->soft_iface, "Interface deactivated: %s\n",
 		 batman_if->net_dev->name);
 
+	stop_ndp_timer(batman_if);
 	update_min_mtu(batman_if->soft_iface);
 }
 
@@ -328,6 +331,8 @@ int hardif_enable_interface(struct batman_if *batman_if, char *iface_name)
 
 	atomic_set(&batman_if->seqno, 1);
 	atomic_set(&batman_if->frag_seqno, 1);
+	ndp_init(batman_if);
+
 	bat_info(batman_if->soft_iface, "Adding interface: %s\n",
 		 batman_if->net_dev->name);
 
@@ -381,6 +386,7 @@ void hardif_disable_interface(struct batman_if *batman_if)
 
 	bat_info(batman_if->soft_iface, "Removing interface: %s\n",
 		 batman_if->net_dev->name);
+	ndp_free(batman_if);
 	dev_remove_pack(&batman_if->batman_adv_ptype);
 	kref_put(&batman_if->refcount, hardif_free_ref);
 
ndp.c new file +44 -0

44 lines not on this page · raw message

ndp.h new file +6 -0
new file mode 100644
index 0000000..de85910
@@ -0,0 +1,6 @@
+
+void start_ndp_timer(struct batman_if *batman_if);
+void stop_ndp_timer(struct batman_if *batman_if);
+
+int ndp_init(struct batman_if *batman_if);
+void ndp_free(struct batman_if *batman_if);
types.h +2 -0
index 8921e20..e8dfdf6 100644
@@ -48,6 +48,8 @@ struct batman_if {
 	struct net_device *soft_iface;
 	struct rcu_head rcu;
 	atomic_t ndp_interval;
+	atomic_t ndp_seqno;
+	struct delayed_work ndp_wq;
 };
 
 /**
Signature · 1 line
1.7.1
#6 lore raw

PATCH 3/10 batman-adv: Adding workqueue for new ndp packets

In reply to Linus Lüssing

The new neighbor discovery packets will later need their own interval per interface. For instance on a wifi interface which has regularly changing link qualities the ndp interval should be faster than on a static cable link where we would need some probes from time to time only.

This patch adds a workqueue per interface used by batman-adv. When an interface is active, a ndp_send() with the according batman_if structure will be called every second now.

---
 Makefile.kbuild  |    1 +
 hard-interface.c |    6 ++++++
 ndp.c            |   44 ++++++++++++++++++++++++++++++++++++++++++++
 ndp.h            |    6 ++++++
 types.h          |    2 ++
 5 files changed, 59 insertions(+), 0 deletions(-)
 create mode 100644 ndp.c
 create mode 100644 ndp.h
Makefile.kbuild +1 -0
index e99c198..094eb31 100644
@@ -42,6 +42,7 @@ batman-adv-y += hard-interface.o
 batman-adv-y += hash.o
 batman-adv-y += icmp_socket.o
 batman-adv-y += main.o
+batman-adv-y += ndp.o
 batman-adv-y += originator.o
 batman-adv-y += ring_buffer.o
 batman-adv-y += routing.o
hard-interface.c +6 -0
index da7b9a9..cb81c13 100644
@@ -26,6 +26,7 @@
 #include "translation-table.h"
 #include "routing.h"
 #include "bat_sysfs.h"
+#include "ndp.h"
 #include "originator.h"
 #include "hash.h"
 
@@ -260,6 +261,7 @@ static void hardif_activate_interface(struct batman_if *batman_if)
 		 batman_if->net_dev->name);
 
 	update_min_mtu(batman_if->soft_iface);
+	start_ndp_timer(batman_if);
 	return;
 }
 
@@ -274,6 +276,7 @@ static void hardif_deactivate_interface(struct batman_if *batman_if)
 	bat_info(batman_if->soft_iface, "Interface deactivated: %s\n",
 		 batman_if->net_dev->name);
 
+	stop_ndp_timer(batman_if);
 	update_min_mtu(batman_if->soft_iface);
 }
 
@@ -328,6 +331,8 @@ int hardif_enable_interface(struct batman_if *batman_if, char *iface_name)
 
 	atomic_set(&batman_if->seqno, 1);
 	atomic_set(&batman_if->frag_seqno, 1);
+	ndp_init(batman_if);
+
 	bat_info(batman_if->soft_iface, "Adding interface: %s\n",
 		 batman_if->net_dev->name);
 
@@ -381,6 +386,7 @@ void hardif_disable_interface(struct batman_if *batman_if)
 
 	bat_info(batman_if->soft_iface, "Removing interface: %s\n",
 		 batman_if->net_dev->name);
+	ndp_free(batman_if);
 	dev_remove_pack(&batman_if->batman_adv_ptype);
 	kref_put(&batman_if->refcount, hardif_free_ref);
 
ndp.c new file +44 -0

44 lines not on this page · raw message

ndp.h new file +6 -0
new file mode 100644
index 0000000..de85910
@@ -0,0 +1,6 @@
+
+void start_ndp_timer(struct batman_if *batman_if);
+void stop_ndp_timer(struct batman_if *batman_if);
+
+int ndp_init(struct batman_if *batman_if);
+void ndp_free(struct batman_if *batman_if);
types.h +2 -0
index 8921e20..e8dfdf6 100644
@@ -48,6 +48,8 @@ struct batman_if {
 	struct net_device *soft_iface;
 	struct rcu_head rcu;
 	atomic_t ndp_interval;
+	atomic_t ndp_seqno;
+	struct delayed_work ndp_wq;
 };
 
 /**
Signature · 1 line
1.7.1
#7 lore raw

PATCH 4/10 batman-adv: Send neighbor discovery packets

In reply to Linus Lüssing

This patch makes use of the previously introduced periodic tasks per interface and actually sends neighbor discovery packets on these now.
Note: The TQ values of each neighbor are not being added yet to these NDPs and also no evaluation of these packets is being done.

---
 hard-interface.c |    5 ++++-
 ndp.c            |   37 ++++++++++++++++++++++++++++++++++++-
 types.h          |    5 +++++
 3 files changed, 45 insertions(+), 2 deletions(-)
hard-interface.c +4 -1
index cb81c13..887f794 100644
@@ -284,6 +284,7 @@ int hardif_enable_interface(struct batman_if *batman_if, char *iface_name)
 {
 	struct bat_priv *bat_priv;
 	struct batman_packet_ogm *batman_packet_ogm;
+	int ret;
 
 	if (batman_if->if_status != IF_NOT_IN_USE)
 		goto out;
@@ -331,7 +332,9 @@ int hardif_enable_interface(struct batman_if *batman_if, char *iface_name)
 
 	atomic_set(&batman_if->seqno, 1);
 	atomic_set(&batman_if->frag_seqno, 1);
-	ndp_init(batman_if);
+	ret = ndp_init(batman_if);
+	if (ret)
+		goto err;
 
 	bat_info(batman_if->soft_iface, "Adding interface: %s\n",
 		 batman_if->net_dev->name);
ndp.c +36 -1
index 2dfb06d..afdf249 100644
@@ -20,10 +20,24 @@ static void ndp_send(struct work_struct *work)
 	struct batman_if *batman_if = container_of(work, struct batman_if,
 							ndp_wq.work);
 	struct bat_priv *bat_priv = netdev_priv(batman_if->soft_iface);
+	struct batman_packet_ndp *ndp_packet = (struct batman_packet_ndp*)
+						batman_if->ndp_packet_buff;
+	int packet_len = sizeof(struct batman_packet_ndp);
+	struct sk_buff *skb;
+
+	ndp_packet->seqno = atomic_read(&batman_if->ndp_seqno);
 
 	bat_dbg(DBG_BATMAN, bat_priv,
 		"batman-adv:Sending ndp packet on interface %s, seqno %d\n",
-		batman_if->net_dev, atomic_read(&batman_if->ndp_seqno));
+		batman_if->net_dev, ntohl(ndp_packet->seqno));
+
+	skb = dev_alloc_skb(packet_len + sizeof(struct ethhdr));
+	skb_reserve(skb, sizeof(struct ethhdr));
+
+	memcpy(skb_put(skb, packet_len), batman_if->ndp_packet_buff,
+	       packet_len);
+
+	send_skb_packet(skb, batman_if, broadcast_addr);
 
 	atomic_inc(&batman_if->ndp_seqno);
 	start_ndp_timer(batman_if);
@@ -31,14 +45,35 @@ static void ndp_send(struct work_struct *work)
 
 int ndp_init(struct batman_if *batman_if)
 {
+	struct batman_packet_ndp *ndp_packet;
+
 	atomic_set(&batman_if->ndp_interval, 500);
 	atomic_set(&batman_if->ndp_seqno, 0);
+
+	batman_if->ndp_packet_buff =
+		kmalloc(ETH_DATA_LEN, GFP_ATOMIC);
+	if (!batman_if->ndp_packet_buff) {
+		printk(KERN_ERR "batman-adv: Can't add "
+			"local interface packet (%s): out of memory\n",
+			batman_if->net_dev->name);
+		goto err;
+	}
+	memset(batman_if->ndp_packet_buff, 0, batman_if->packet_len);
+	ndp_packet = (struct batman_packet_ndp*)
+			batman_if->ndp_packet_buff;
+
+	ndp_packet->packet_type = BAT_PACKET_NDP;
+	ndp_packet->version = COMPAT_VERSION;
+
 	INIT_DELAYED_WORK(&batman_if->ndp_wq, ndp_send);
 
 	return 0;
+err:
+	return 1;
 }
 
 void ndp_free(struct batman_if *batman_if)
 {
 	stop_ndp_timer(batman_if);
+	kfree(batman_if->ndp_packet_buff);
 }
types.h +5 -0
index e8dfdf6..3ea8f2a 100644
@@ -47,6 +47,7 @@ struct batman_if {
 	struct packet_type batman_adv_ptype;
 	struct net_device *soft_iface;
 	struct rcu_head rcu;
+	unsigned char *ndp_packet_buff;
 	atomic_t ndp_interval;
 	atomic_t ndp_seqno;
 	struct delayed_work ndp_wq;
@@ -122,6 +123,10 @@ struct neigh_node {
 	struct batman_if *if_incoming;
 };
 
+struct neigh_entry {
+	uint8_t addr[ETH_ALEN];
+	uint8_t rq;
+};
 
 struct bat_priv {
 	atomic_t mesh_state;
Signature · 1 line
1.7.1
#8 lore raw

Re: [B.A.T.M.A.N.] [PATCH 04/10] batman-adv: Send neighbor discovery packets

types.h struct batman_if { · line 50

Quoted 12 lines · On Tuesday 07 December 2010 15:39:32 Linus Lüssing wrote:
ndp.c +4 -0
+	memcpy(skb_put(skb, packet_len), batman_if->ndp_packet_buff,
+	       packet_len);
+
+	send_skb_packet(skb, batman_if, broadcast_addr);
types.h +1 -0
@@ -47,6 +47,7 @@ struct batman_if {
 	struct packet_type batman_adv_ptype;
 	struct net_device *soft_iface;
 	struct rcu_head rcu;
+	unsigned char *ndp_packet_buff;

Good way to never get included in the linux kernel by David S. Miller.

Best regards,
Sven

#9 lore raw

Re: [B.A.T.M.A.N.] [PATCH 04/10] batman-adv: Send neighbor discovery packets

Quoted 16 lines · Sven Eckelmann

types.h struct batman_if { · line 50

Quoted 12 lines · On Tuesday 07 December 2010 15:39:32 Linus Lüssing wrote:
ndp.c +4 -0
+	memcpy(skb_put(skb, packet_len), batman_if->ndp_packet_buff,
+	       packet_len);
+
+	send_skb_packet(skb, batman_if, broadcast_addr);
types.h +1 -0
@@ -47,6 +47,7 @@ struct batman_if {
 	struct packet_type batman_adv_ptype;
 	struct net_device *soft_iface;
 	struct rcu_head rcu;
+	unsigned char *ndp_packet_buff;

Good way to never get included in the linux kernel by David S. Miller.

Quoted 2 lines

Best regards,
Sven

Argh, damn it, you noticed my secret plan and attempt to sabotage batman-adv's inclussion into the linux kernel...

Well, anyway, thanks for having a glance at it, I'll send a fixup soon :).

Cheers, Linus

#10 lore raw

PATCH 4/10 batman-adv: Send neighbor discovery packets

In reply to Linus Lüssing

This patch makes use of the previously introduced periodic tasks per interface and actually sends neighbor discovery packets on these now.
Note: The TQ values of each neighbor are not being added yet to these NDPs and also no evaluation of these packets is being done.

---
 hard-interface.c |    5 ++++-
 ndp.c            |   36 +++++++++++++++++++++++++++++++++++-
 types.h          |    5 +++++
 3 files changed, 44 insertions(+), 2 deletions(-)
hard-interface.c +4 -1
index cb81c13..887f794 100644
@@ -284,6 +284,7 @@ int hardif_enable_interface(struct batman_if *batman_if, char *iface_name)
 {
 	struct bat_priv *bat_priv;
 	struct batman_packet_ogm *batman_packet_ogm;
+	int ret;
 
 	if (batman_if->if_status != IF_NOT_IN_USE)
 		goto out;
@@ -331,7 +332,9 @@ int hardif_enable_interface(struct batman_if *batman_if, char *iface_name)
 
 	atomic_set(&batman_if->seqno, 1);
 	atomic_set(&batman_if->frag_seqno, 1);
-	ndp_init(batman_if);
+	ret = ndp_init(batman_if);
+	if (ret)
+		goto err;
 
 	bat_info(batman_if->soft_iface, "Adding interface: %s\n",
 		 batman_if->net_dev->name);
ndp.c +35 -1
index 2dfb06d..94d1971 100644
@@ -20,10 +20,21 @@ static void ndp_send(struct work_struct *work)
 	struct batman_if *batman_if = container_of(work, struct batman_if,
 							ndp_wq.work);
 	struct bat_priv *bat_priv = netdev_priv(batman_if->soft_iface);
+	struct batman_packet_ndp *ndp_packet;
+	struct sk_buff *skb;
+
+	skb = skb_clone(batman_if->ndp_skb, GFP_ATOMIC);
+	ndp_packet = (struct batman_packet_ndp*)skb->data;
+	ndp_packet->seqno = htonl(atomic_read(&batman_if->ndp_seqno));
+	ndp_packet->num_neighbors = 0;
+	memcpy(ndp_packet->orig, bat_priv->primary_if->net_dev->dev_addr,
+	       ETH_ALEN);
 
 	bat_dbg(DBG_BATMAN, bat_priv,
 		"batman-adv:Sending ndp packet on interface %s, seqno %d\n",
-		batman_if->net_dev, atomic_read(&batman_if->ndp_seqno));
+		batman_if->net_dev, ntohl(ndp_packet->seqno));
+
+	send_skb_packet(skb, batman_if, broadcast_addr);
 
 	atomic_inc(&batman_if->ndp_seqno);
 	start_ndp_timer(batman_if);
@@ -31,14 +42,37 @@ static void ndp_send(struct work_struct *work)
 
 int ndp_init(struct batman_if *batman_if)
 {
+	struct batman_packet_ndp *ndp_packet;
+
 	atomic_set(&batman_if->ndp_interval, 500);
 	atomic_set(&batman_if->ndp_seqno, 0);
+
+	batman_if->ndp_skb =
+		dev_alloc_skb(ETH_DATA_LEN + sizeof(struct ethhdr));
+	if (!batman_if->ndp_skb) {
+		printk(KERN_ERR "batman-adv: Can't add "
+			"local interface packet (%s): out of memory\n",
+			batman_if->net_dev->name);
+		goto err;
+	}
+	skb_reserve(batman_if->ndp_skb, sizeof(struct ethhdr) +
+					sizeof(struct batman_packet_ndp));
+	ndp_packet = (struct batman_packet_ndp*)
+		skb_push(batman_if->ndp_skb, sizeof(struct batman_packet_ndp));
+	memset(ndp_packet, 0, sizeof(struct batman_packet_ndp));
+
+	ndp_packet->packet_type = BAT_PACKET_NDP;
+	ndp_packet->version = COMPAT_VERSION;
+
 	INIT_DELAYED_WORK(&batman_if->ndp_wq, ndp_send);
 
 	return 0;
+err:
+	return 1;
 }
 
 void ndp_free(struct batman_if *batman_if)
 {
 	stop_ndp_timer(batman_if);
+	dev_kfree_skb(batman_if->ndp_skb);
 }
types.h +5 -0
index e8dfdf6..c5a26a7 100644
@@ -49,6 +49,7 @@ struct batman_if {
 	struct rcu_head rcu;
 	atomic_t ndp_interval;
 	atomic_t ndp_seqno;
+	struct sk_buff *ndp_skb;
 	struct delayed_work ndp_wq;
 };
 
@@ -122,6 +123,10 @@ struct neigh_node {
 	struct batman_if *if_incoming;
 };
 
+struct neigh_entry {
+	uint8_t addr[ETH_ALEN];
+	uint8_t rq;
+};
 
 struct bat_priv {
 	atomic_t mesh_state;
Signature · 1 line
1.7.1
#11 lore raw

PATCH 5/10 batman-adv: Creating neighbor structures, updating LQs

In reply to Linus Lüssing

It will now be checked if a neighbor discovery packet from a new neighbor on a certain interface has been received. If so, structures in memory will be allocated for further seqno-tracking and RQ calculations, and TQ reception, which will be updated frequently from this commit on.

---
 hard-interface.c |    5 ++
 ndp.c            |  148 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
 ndp.h            |    5 ++
 routing.c        |   38 +++++++++++++-
 routing.h        |    1 +
 types.h          |    5 ++
 6 files changed, 200 insertions(+), 2 deletions(-)
hard-interface.c +5 -0
index 887f794..820121a 100644
@@ -608,6 +608,11 @@ int batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
 	 * the supplied skb. if not, we have to free the skb. */
 
 	switch (batman_packet_ogm->packet_type) {
+		/* batman neighbor discovery protocol packet */
+	case BAT_PACKET_NDP:
+		ret = recv_ndp_packet(skb, batman_if);
+		break;
+
 		/* batman originator packet */
 	case BAT_PACKET_OGM:
 		ret = recv_bat_packet(skb, batman_if);
ndp.c +147 -1

171 lines not on this page · raw message

ndp.h +5 -0
index de85910..35146ce 100644
@@ -4,3 +4,8 @@ void stop_ndp_timer(struct batman_if *batman_if);
 
 int ndp_init(struct batman_if *batman_if);
 void ndp_free(struct batman_if *batman_if);
+
+uint8_t ndp_fetch_tq(struct batman_packet_ndp *packet,
+		 uint8_t *my_if_addr);
+int ndp_update_neighbor(uint8_t my_tq, uint32_t seqno,
+			struct batman_if *batman_if, uint8_t *neigh_addr);
routing.c +37 -1
index 7ebb631..1972bb8 100644
@@ -27,6 +27,7 @@
 #include "hard-interface.h"
 #include "icmp_socket.h"
 #include "translation-table.h"
+#include "ndp.h"
 #include "originator.h"
 #include "types.h"
 #include "ring_buffer.h"
@@ -759,7 +760,42 @@ void receive_bat_packet(struct ethhdr *ethhdr,
 				0, hna_buff_len, if_incoming);
 }
 
-int recv_bat_packet(struct sk_buff *skb, struct batman_if *batman_if)
+int recv_ndp_packet(struct sk_buff *skb, struct batman_if *batman_if)
+{
+	struct ethhdr *ethhdr;
+	struct batman_packet_ndp *packet;
+	int ret;
+	uint8_t my_tq;
+
+	/* drop packet if it has not necessary minimum size */
+	if (unlikely(!pskb_may_pull(skb, sizeof(struct batman_packet_ndp))))
+		return NET_RX_DROP;
+
+	ethhdr = (struct ethhdr *)skb_mac_header(skb);
+
+	/* packet with broadcast indication but unicast recipient */
+	if (!is_broadcast_ether_addr(ethhdr->h_dest))
+		return NET_RX_DROP;
+
+	/* packet with broadcast sender address */
+	if (is_broadcast_ether_addr(ethhdr->h_source))
+		return NET_RX_DROP;
+
+	packet = (struct batman_packet_ndp*)(ethhdr + 1);
+
+	my_tq = ndp_fetch_tq(packet, batman_if->net_dev->dev_addr);
+
+	ret = ndp_update_neighbor(my_tq, ntohl(packet->seqno),
+					batman_if, ethhdr->h_source);
+	if (ret)
+		return NET_RX_DROP;
+
+	kfree_skb(skb);
+	return NET_RX_SUCCESS;
+}
+
+int recv_bat_packet(struct sk_buff *skb,
+				struct batman_if *batman_if)
 {
 	struct bat_priv *bat_priv = netdev_priv(batman_if->soft_iface);
 	struct ethhdr *ethhdr;
routing.h +1 -0
index 81e27d5..a319714 100644
@@ -39,6 +39,7 @@ int recv_unicast_packet(struct sk_buff *skb, struct batman_if *recv_if);
 int recv_ucast_frag_packet(struct sk_buff *skb, struct batman_if *recv_if);
 int recv_bcast_packet(struct sk_buff *skb, struct batman_if *recv_if);
 int recv_vis_packet(struct sk_buff *skb, struct batman_if *recv_if);
+int recv_ndp_packet(struct sk_buff *skb, struct batman_if *recv_if);
 int recv_bat_packet(struct sk_buff *skb, struct batman_if *recv_if);
 struct neigh_node *find_router(struct bat_priv *bat_priv,
 		struct orig_node *orig_node, struct batman_if *recv_if);
types.h +5 -0
index 3ea8f2a..d8494b3 100644
@@ -51,6 +51,8 @@ struct batman_if {
 	atomic_t ndp_interval;
 	atomic_t ndp_seqno;
 	struct delayed_work ndp_wq;
+	struct list_head neigh_list;
+	spinlock_t neigh_list_lock;
 };
 
 /**
@@ -112,6 +114,9 @@ struct neigh_node {
 	struct list_head list;
 	uint8_t addr[ETH_ALEN];
 	uint8_t real_packet_count;
+	uint8_t rq;
+	uint32_t last_rq_seqno;
+	TYPE_OF_WORD rq_real_bits[NUM_WORDS];
 	uint8_t tq_recv[TQ_GLOBAL_WINDOW_SIZE];
 	uint8_t tq_index;
 	uint8_t tq_avg;
Signature · 1 line
1.7.1
#12 lore raw

PATCH 5/10 batman-adv: Creating neighbor structures, updating LQs

In reply to Linus Lüssing

It will now be checked if a neighbor discovery packet from a new neighbor on a certain interface has been received. If so, structures in memory will be allocated for further seqno-tracking and RQ calculations, and TQ reception, which will be updated frequently from this commit on.

---
 hard-interface.c |    5 ++
 ndp.c            |  141 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ndp.h            |    5 ++
 routing.c        |   38 ++++++++++++++-
 routing.h        |    1 +
 types.h          |    5 ++
 6 files changed, 194 insertions(+), 1 deletions(-)
hard-interface.c +5 -0
index 887f794..820121a 100644
@@ -608,6 +608,11 @@ int batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
 	 * the supplied skb. if not, we have to free the skb. */
 
 	switch (batman_packet_ogm->packet_type) {
+		/* batman neighbor discovery protocol packet */
+	case BAT_PACKET_NDP:
+		ret = recv_ndp_packet(skb, batman_if);
+		break;
+
 		/* batman originator packet */
 	case BAT_PACKET_OGM:
 		ret = recv_bat_packet(skb, batman_if);
ndp.c +141 -0

168 lines not on this page · raw message

ndp.h +5 -0
index de85910..35146ce 100644
@@ -4,3 +4,8 @@ void stop_ndp_timer(struct batman_if *batman_if);
 
 int ndp_init(struct batman_if *batman_if);
 void ndp_free(struct batman_if *batman_if);
+
+uint8_t ndp_fetch_tq(struct batman_packet_ndp *packet,
+		 uint8_t *my_if_addr);
+int ndp_update_neighbor(uint8_t my_tq, uint32_t seqno,
+			struct batman_if *batman_if, uint8_t *neigh_addr);
routing.c +37 -1
index 7ebb631..1972bb8 100644
@@ -27,6 +27,7 @@
 #include "hard-interface.h"
 #include "icmp_socket.h"
 #include "translation-table.h"
+#include "ndp.h"
 #include "originator.h"
 #include "types.h"
 #include "ring_buffer.h"
@@ -759,7 +760,42 @@ void receive_bat_packet(struct ethhdr *ethhdr,
 				0, hna_buff_len, if_incoming);
 }
 
-int recv_bat_packet(struct sk_buff *skb, struct batman_if *batman_if)
+int recv_ndp_packet(struct sk_buff *skb, struct batman_if *batman_if)
+{
+	struct ethhdr *ethhdr;
+	struct batman_packet_ndp *packet;
+	int ret;
+	uint8_t my_tq;
+
+	/* drop packet if it has not necessary minimum size */
+	if (unlikely(!pskb_may_pull(skb, sizeof(struct batman_packet_ndp))))
+		return NET_RX_DROP;
+
+	ethhdr = (struct ethhdr *)skb_mac_header(skb);
+
+	/* packet with broadcast indication but unicast recipient */
+	if (!is_broadcast_ether_addr(ethhdr->h_dest))
+		return NET_RX_DROP;
+
+	/* packet with broadcast sender address */
+	if (is_broadcast_ether_addr(ethhdr->h_source))
+		return NET_RX_DROP;
+
+	packet = (struct batman_packet_ndp*)(ethhdr + 1);
+
+	my_tq = ndp_fetch_tq(packet, batman_if->net_dev->dev_addr);
+
+	ret = ndp_update_neighbor(my_tq, ntohl(packet->seqno),
+					batman_if, ethhdr->h_source);
+	if (ret)
+		return NET_RX_DROP;
+
+	kfree_skb(skb);
+	return NET_RX_SUCCESS;
+}
+
+int recv_bat_packet(struct sk_buff *skb,
+				struct batman_if *batman_if)
 {
 	struct bat_priv *bat_priv = netdev_priv(batman_if->soft_iface);
 	struct ethhdr *ethhdr;
routing.h +1 -0
index 81e27d5..a319714 100644
@@ -39,6 +39,7 @@ int recv_unicast_packet(struct sk_buff *skb, struct batman_if *recv_if);
 int recv_ucast_frag_packet(struct sk_buff *skb, struct batman_if *recv_if);
 int recv_bcast_packet(struct sk_buff *skb, struct batman_if *recv_if);
 int recv_vis_packet(struct sk_buff *skb, struct batman_if *recv_if);
+int recv_ndp_packet(struct sk_buff *skb, struct batman_if *recv_if);
 int recv_bat_packet(struct sk_buff *skb, struct batman_if *recv_if);
 struct neigh_node *find_router(struct bat_priv *bat_priv,
 		struct orig_node *orig_node, struct batman_if *recv_if);
types.h +5 -0
index c5a26a7..d3efb53 100644
@@ -51,6 +51,8 @@ struct batman_if {
 	atomic_t ndp_seqno;
 	struct sk_buff *ndp_skb;
 	struct delayed_work ndp_wq;
+	struct list_head neigh_list;
+	spinlock_t neigh_list_lock;
 };
 
 /**
@@ -112,6 +114,9 @@ struct neigh_node {
 	struct list_head list;
 	uint8_t addr[ETH_ALEN];
 	uint8_t real_packet_count;
+	uint8_t rq;
+	uint32_t last_rq_seqno;
+	TYPE_OF_WORD rq_real_bits[NUM_WORDS];
 	uint8_t tq_recv[TQ_GLOBAL_WINDOW_SIZE];
 	uint8_t tq_index;
 	uint8_t tq_avg;
Signature · 1 line
1.7.1
#13 lore raw

[B.A.T.M.A.N.] NDP patches v2

In reply to Linus Lüssing

Hi there,

The following points have been changed during the last series:
- Use SKBs instead of own packet buffer
(batman-adv: Send neighbor discovery packets)
- Also accept first packet for packet counting already
(batman-adv: Creating neighbor structures, updating LQs)
- Fixing the asymmetric penalty handling (no more changes since previous PATCHv2 10/10 though) (batman-adv: Use local tq values determined by NDP on OGMs)

I've also added my Signed-off-by now, as it seems to work fine here for me and the integration now makes more sense to me after PATCHv2 10/10 :). So for me, it'd be ok to add it upstream. Does it make sense to do the OGM cleanup with these patches already or would it be fine to do them after NDP got upstream? In the first case the maintenance/rebasing of the cleanup patches might be more effort until NDP gets upstream. In the latter case, there'd be no need to hurry for doing the cleanup then, reducing the chances of breaking something :). Or would you prefer to have the full batch including the cleanup for the OGMs already?

Cheers, Linus

#14 lore raw

PATCH 6/10 batman-adv: Purge outdated ndp neighbours

In reply to Linus Lüssing

If no new packet has been received from a neighbour for a while, then delete it from memory.

---
 ndp.c        |   25 +++++++++++++++++++++++++
 ndp.h        |    1 +
 originator.c |    2 ++
 3 files changed, 28 insertions(+), 0 deletions(-)
ndp.c +25 -0
index 3442e17..c1cd016 100644
@@ -189,6 +189,31 @@ static struct neigh_node *ndp_create_neighbor(uint8_t my_tq, uint32_t seqno,
 	return neigh_node;
 }
 
+void ndp_purge_neighbors(void)
+{
+	struct neigh_node *neigh_node, *neigh_node_tmp;
+	struct batman_if *batman_if;
+
+	rcu_read_lock();
+	list_for_each_entry_rcu(batman_if, &if_list, list) {
+		if (batman_if->if_status != IF_ACTIVE)
+			continue;
+
+		spin_lock_bh(&batman_if->neigh_list_lock);
+		list_for_each_entry_safe(neigh_node, neigh_node_tmp,
+					 &batman_if->neigh_list, list) {
+			if (time_before(jiffies,
+			    neigh_node->last_valid + PURGE_TIMEOUT * HZ))
+				continue;
+
+			list_del(&neigh_node->list);
+			kfree(neigh_node);
+		}
+		spin_unlock_bh(&batman_if->neigh_list_lock);
+	}
+	rcu_read_unlock();
+}
+
 int ndp_update_neighbor(uint8_t my_tq, uint32_t seqno,
 			struct batman_if *batman_if, uint8_t *neigh_addr)
 {
ndp.h +1 -0
index 35146ce..5679f36 100644
@@ -7,5 +7,6 @@ void ndp_free(struct batman_if *batman_if);
 
 uint8_t ndp_fetch_tq(struct batman_packet_ndp *packet,
 		 uint8_t *my_if_addr);
+void ndp_purge_neighbors(void);
 int ndp_update_neighbor(uint8_t my_tq, uint32_t seqno,
 			struct batman_if *batman_if, uint8_t *neigh_addr);
originator.c +2 -0
index 89ec021..ad31bf7 100644
@@ -22,6 +22,7 @@
 /* increase the reference counter for this originator */
 
 #include "main.h"
+#include "ndp.h"
 #include "originator.h"
 #include "hash.h"
 #include "translation-table.h"
@@ -307,6 +308,7 @@ static void purge_orig(struct work_struct *work)
 		container_of(delayed_work, struct bat_priv, orig_work);
 
 	_purge_orig(bat_priv);
+	ndp_purge_neighbors();
 	start_purge_timer(bat_priv);
 }
 
Signature · 1 line
1.7.1
#15 lore raw

PATCH 6/10 batman-adv: Purge outdated ndp neighbours

In reply to Linus Lüssing

If no new packet has been received from a neighbour for a while, then delete it from memory.

---
 ndp.c        |   25 +++++++++++++++++++++++++
 ndp.h        |    1 +
 originator.c |    2 ++
 3 files changed, 28 insertions(+), 0 deletions(-)
ndp.c +25 -0
index 96db80c..2d30d30 100644
@@ -183,6 +183,31 @@ static struct neigh_node *ndp_create_neighbor(uint8_t my_tq, uint32_t seqno,
 	return neigh_node;
 }
 
+void ndp_purge_neighbors(void)
+{
+	struct neigh_node *neigh_node, *neigh_node_tmp;
+	struct batman_if *batman_if;
+
+	rcu_read_lock();
+	list_for_each_entry_rcu(batman_if, &if_list, list) {
+		if (batman_if->if_status != IF_ACTIVE)
+			continue;
+
+		spin_lock_bh(&batman_if->neigh_list_lock);
+		list_for_each_entry_safe(neigh_node, neigh_node_tmp,
+					 &batman_if->neigh_list, list) {
+			if (time_before(jiffies,
+			    neigh_node->last_valid + PURGE_TIMEOUT * HZ))
+				continue;
+
+			list_del(&neigh_node->list);
+			kfree(neigh_node);
+		}
+		spin_unlock_bh(&batman_if->neigh_list_lock);
+	}
+	rcu_read_unlock();
+}
+
 int ndp_update_neighbor(uint8_t my_tq, uint32_t seqno,
 			struct batman_if *batman_if, uint8_t *neigh_addr)
 {
ndp.h +1 -0
index 35146ce..5679f36 100644
@@ -7,5 +7,6 @@ void ndp_free(struct batman_if *batman_if);
 
 uint8_t ndp_fetch_tq(struct batman_packet_ndp *packet,
 		 uint8_t *my_if_addr);
+void ndp_purge_neighbors(void);
 int ndp_update_neighbor(uint8_t my_tq, uint32_t seqno,
 			struct batman_if *batman_if, uint8_t *neigh_addr);
originator.c +2 -0
index 89ec021..ad31bf7 100644
@@ -22,6 +22,7 @@
 /* increase the reference counter for this originator */
 
 #include "main.h"
+#include "ndp.h"
 #include "originator.h"
 #include "hash.h"
 #include "translation-table.h"
@@ -307,6 +308,7 @@ static void purge_orig(struct work_struct *work)
 		container_of(delayed_work, struct bat_priv, orig_work);
 
 	_purge_orig(bat_priv);
+	ndp_purge_neighbors();
 	start_purge_timer(bat_priv);
 }
 
Signature · 1 line
1.7.1
#16 lore raw

PATCH 7/10 batman-adv: Adding ndp debugfs output

In reply to Linus Lüssing

Lists all neighbours and their tq/rq values detected and measured by the Neighbor Discovery Protocol (NDP).

---
 bat_debugfs.c |    9 ++++++++
 ndp.c         |   60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ndp.h         |    1 +
 3 files changed, 70 insertions(+), 0 deletions(-)
bat_debugfs.c +9 -0
index 0ae81d0..602aa15 100644
@@ -25,6 +25,7 @@
 
 #include "bat_debugfs.h"
 #include "translation-table.h"
+#include "ndp.h"
 #include "originator.h"
 #include "hard-interface.h"
 #include "gateway_common.h"
@@ -222,6 +223,12 @@ static void debug_log_cleanup(struct bat_priv *bat_priv)
 }
 #endif
 
+static int neighbors_open(struct inode *inode, struct file *file)
+{
+	struct net_device *net_dev = (struct net_device *)inode->i_private;
+	return single_open(file, ndp_seq_print_text, net_dev);
+}
+
 static int originators_open(struct inode *inode, struct file *file)
 {
 	struct net_device *net_dev = (struct net_device *)inode->i_private;
@@ -275,6 +282,7 @@ struct bat_debuginfo bat_debuginfo_##_name = {	\
 		}				\
 };
 
+static BAT_DEBUGINFO(neighbors, S_IRUGO, neighbors_open);
 static BAT_DEBUGINFO(originators, S_IRUGO, originators_open);
 static BAT_DEBUGINFO(gateways, S_IRUGO, gateways_open);
 static BAT_DEBUGINFO(softif_neigh, S_IRUGO, softif_neigh_open);
@@ -283,6 +291,7 @@ static BAT_DEBUGINFO(transtable_local, S_IRUGO, transtable_local_open);
 static BAT_DEBUGINFO(vis_data, S_IRUGO, vis_data_open);
 
 static struct bat_debuginfo *mesh_debuginfos[] = {
+	&bat_debuginfo_neighbors,
 	&bat_debuginfo_originators,
 	&bat_debuginfo_gateways,
 	&bat_debuginfo_softif_neigh,
ndp.c +60 -0

69 lines not on this page · raw message

ndp.h +1 -0
index 5679f36..26be41f 100644
@@ -10,3 +10,4 @@ uint8_t ndp_fetch_tq(struct batman_packet_ndp *packet,
 void ndp_purge_neighbors(void);
 int ndp_update_neighbor(uint8_t my_tq, uint32_t seqno,
 			struct batman_if *batman_if, uint8_t *neigh_addr);
+int ndp_seq_print_text(struct seq_file *seq, void *offset);
Signature · 1 line
1.7.1
#17 lore raw

PATCH 7/10 batman-adv: Adding ndp debugfs output

In reply to Linus Lüssing

Lists all neighbours and their tq/rq values detected and measured by the Neighbor Discovery Protocol (NDP).

---
 bat_debugfs.c |    9 ++++++++
 ndp.c         |   60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ndp.h         |    1 +
 3 files changed, 70 insertions(+), 0 deletions(-)
bat_debugfs.c +9 -0
index 0ae81d0..602aa15 100644
@@ -25,6 +25,7 @@
 
 #include "bat_debugfs.h"
 #include "translation-table.h"
+#include "ndp.h"
 #include "originator.h"
 #include "hard-interface.h"
 #include "gateway_common.h"
@@ -222,6 +223,12 @@ static void debug_log_cleanup(struct bat_priv *bat_priv)
 }
 #endif
 
+static int neighbors_open(struct inode *inode, struct file *file)
+{
+	struct net_device *net_dev = (struct net_device *)inode->i_private;
+	return single_open(file, ndp_seq_print_text, net_dev);
+}
+
 static int originators_open(struct inode *inode, struct file *file)
 {
 	struct net_device *net_dev = (struct net_device *)inode->i_private;
@@ -275,6 +282,7 @@ struct bat_debuginfo bat_debuginfo_##_name = {	\
 		}				\
 };
 
+static BAT_DEBUGINFO(neighbors, S_IRUGO, neighbors_open);
 static BAT_DEBUGINFO(originators, S_IRUGO, originators_open);
 static BAT_DEBUGINFO(gateways, S_IRUGO, gateways_open);
 static BAT_DEBUGINFO(softif_neigh, S_IRUGO, softif_neigh_open);
@@ -283,6 +291,7 @@ static BAT_DEBUGINFO(transtable_local, S_IRUGO, transtable_local_open);
 static BAT_DEBUGINFO(vis_data, S_IRUGO, vis_data_open);
 
 static struct bat_debuginfo *mesh_debuginfos[] = {
+	&bat_debuginfo_neighbors,
 	&bat_debuginfo_originators,
 	&bat_debuginfo_gateways,
 	&bat_debuginfo_softif_neigh,
ndp.c +60 -0

69 lines not on this page · raw message

ndp.h +1 -0
index 5679f36..26be41f 100644
@@ -10,3 +10,4 @@ uint8_t ndp_fetch_tq(struct batman_packet_ndp *packet,
 void ndp_purge_neighbors(void);
 int ndp_update_neighbor(uint8_t my_tq, uint32_t seqno,
 			struct batman_if *batman_if, uint8_t *neigh_addr);
+int ndp_seq_print_text(struct seq_file *seq, void *offset);
Signature · 1 line
1.7.1
#18 lore raw

PATCH 8/10 batman-adv: Adding batman_if specific sysfs wrapper macros for UINT

In reply to Linus Lüssing

This allows us to easily add a sysfs parameter for an unsigned int later, which is not for a batman mesh interface (e.g. bat0), but for a common interface instead. It allows reading and writing an atomic_t in batman_if (instead of bat_priv compared to the mesh variant).

---
 bat_sysfs.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)
bat_sysfs.c +27 -0
index cd7bb51..98c10a3 100644
@@ -94,6 +94,33 @@ ssize_t show_##_name(struct kobject *kobj, struct attribute *attr,	\
 	static BAT_ATTR(_name, _mode, show_##_name, store_##_name)
 
 
+#define BAT_ATTR_IF_STORE_UINT(_name, _min, _max, _post_func)		\
+ssize_t store_##_name(struct kobject *kobj, struct attribute *attr,	\
+			     char *buff, size_t count)			\
+{									\
+	struct net_device *net_dev = kobj_to_netdev(kobj);		\
+	struct batman_if *batman_if = get_batman_if_by_netdev(net_dev);	\
+	return __store_uint_attr(buff, count, _min, _max, _post_func,	\
+				 attr, &batman_if->_name, net_dev);	\
+}
+
+#define BAT_ATTR_IF_SHOW_UINT(_name)					\
+ssize_t show_##_name(struct kobject *kobj, struct attribute *attr,	\
+			    char *buff)					\
+{									\
+	struct net_device *net_dev = kobj_to_netdev(kobj);		\
+	struct batman_if *batman_if = get_batman_if_by_netdev(net_dev);	\
+	return sprintf(buff, "%i\n", atomic_read(&batman_if->_name));	\
+}									\
+
+/* Use this, if you are going to set [name] in batman_if to unsigned integer
+ * values only */
+#define BAT_ATTR_IF_UINT(_name, _mode, _min, _max, _post_func)		\
+	static BAT_ATTR_IF_STORE_UINT(_name, _min, _max, _post_func)	\
+	static BAT_ATTR_IF_SHOW_UINT(_name)				\
+	static BAT_ATTR(_name, _mode, show_##_name, store_##_name)
+
+
 static int store_bool_attr(char *buff, size_t count,
 			   struct net_device *net_dev,
 			   char *attr_name, atomic_t *attr)
Signature · 1 line
1.7.1
#19 lore raw

PATCH 8/10 batman-adv: Adding batman_if specific sysfs wrapper macros for UINT

In reply to Linus Lüssing

This allows us to easily add a sysfs parameter for an unsigned int later, which is not for a batman mesh interface (e.g. bat0), but for a common interface instead. It allows reading and writing an atomic_t in batman_if (instead of bat_priv compared to the mesh variant).

---
 bat_sysfs.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)
bat_sysfs.c +27 -0
index cd7bb51..98c10a3 100644
@@ -94,6 +94,33 @@ ssize_t show_##_name(struct kobject *kobj, struct attribute *attr,	\
 	static BAT_ATTR(_name, _mode, show_##_name, store_##_name)
 
 
+#define BAT_ATTR_IF_STORE_UINT(_name, _min, _max, _post_func)		\
+ssize_t store_##_name(struct kobject *kobj, struct attribute *attr,	\
+			     char *buff, size_t count)			\
+{									\
+	struct net_device *net_dev = kobj_to_netdev(kobj);		\
+	struct batman_if *batman_if = get_batman_if_by_netdev(net_dev);	\
+	return __store_uint_attr(buff, count, _min, _max, _post_func,	\
+				 attr, &batman_if->_name, net_dev);	\
+}
+
+#define BAT_ATTR_IF_SHOW_UINT(_name)					\
+ssize_t show_##_name(struct kobject *kobj, struct attribute *attr,	\
+			    char *buff)					\
+{									\
+	struct net_device *net_dev = kobj_to_netdev(kobj);		\
+	struct batman_if *batman_if = get_batman_if_by_netdev(net_dev);	\
+	return sprintf(buff, "%i\n", atomic_read(&batman_if->_name));	\
+}									\
+
+/* Use this, if you are going to set [name] in batman_if to unsigned integer
+ * values only */
+#define BAT_ATTR_IF_UINT(_name, _mode, _min, _max, _post_func)		\
+	static BAT_ATTR_IF_STORE_UINT(_name, _min, _max, _post_func)	\
+	static BAT_ATTR_IF_SHOW_UINT(_name)				\
+	static BAT_ATTR(_name, _mode, show_##_name, store_##_name)
+
+
 static int store_bool_attr(char *buff, size_t count,
 			   struct net_device *net_dev,
 			   char *attr_name, atomic_t *attr)
Signature · 1 line
1.7.1
#20 lore raw

PATCH 9/10 batman-adv: Adding sysfs parameter for ndp interval

In reply to Linus Lüssing

This parameter can be set individually on each interface and allows the configuration of the ndp interval for the link quality measurements during runtime. Usually it is desirable to set it to a higher (= slower) value on interfaces which have a more static characteristic (e.g. wired interfaces) or very dense neighbourhoods to reduce overhead.

---
 bat_sysfs.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
bat_sysfs.c +2 -0
index 98c10a3..1dcd986 100644
@@ -572,10 +572,12 @@ static ssize_t show_iface_status(struct kobject *kobj, struct attribute *attr,
 static BAT_ATTR(mesh_iface, S_IRUGO | S_IWUSR,
 		show_mesh_iface, store_mesh_iface);
 static BAT_ATTR(iface_status, S_IRUGO, show_iface_status, NULL);
+BAT_ATTR_IF_UINT(ndp_interval, S_IRUGO | S_IWUSR, 2 * JITTER, INT_MAX, NULL);
 
 static struct bat_attribute *batman_attrs[] = {
 	&bat_attr_mesh_iface,
 	&bat_attr_iface_status,
+	&bat_attr_ndp_interval,
 	NULL,
 };
 
Signature · 1 line
1.7.1
#21 lore raw

PATCH 9/10 batman-adv: Adding sysfs parameter for ndp interval

In reply to Linus Lüssing

This parameter can be set individually on each interface and allows the configuration of the ndp interval for the link quality measurements during runtime. Usually it is desirable to set it to a higher (= slower) value on interfaces which have a more static characteristic (e.g. wired interfaces) or very dense neighbourhoods to reduce overhead.

---
 bat_sysfs.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
bat_sysfs.c +2 -0
index 98c10a3..1dcd986 100644
@@ -572,10 +572,12 @@ static ssize_t show_iface_status(struct kobject *kobj, struct attribute *attr,
 static BAT_ATTR(mesh_iface, S_IRUGO | S_IWUSR,
 		show_mesh_iface, store_mesh_iface);
 static BAT_ATTR(iface_status, S_IRUGO, show_iface_status, NULL);
+BAT_ATTR_IF_UINT(ndp_interval, S_IRUGO | S_IWUSR, 2 * JITTER, INT_MAX, NULL);
 
 static struct bat_attribute *batman_attrs[] = {
 	&bat_attr_mesh_iface,
 	&bat_attr_iface_status,
+	&bat_attr_ndp_interval,
 	NULL,
 };
 
Signature · 1 line
1.7.1
#22 lore raw

PATCH 10/10 batman-adv: Use local tq values determined by NDP on OGMs

In reply to Linus Lüssing

With this commit not the local transmit quality values determined by the OGMs themselves are applied on received OGMs, but the local transmit quality detemined by NDP instead. Usually the link quality measurements of NDP are more up-to-date than the one of the OGMs, as NDP is using a more frequent interval because NDP's packets are not being flooded through the whole mesh.

---
 routing.c |   53 ++++++++++++++++++++++-------------------------------
 1 files changed, 22 insertions(+), 31 deletions(-)
routing.c +22 -31
index 1972bb8..8830129 100644
@@ -136,7 +136,7 @@ static int is_bidirectional_neigh(struct orig_node *orig_node,
 {
 	struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
 	struct neigh_node *neigh_node = NULL, *tmp_neigh_node = NULL;
-	unsigned char total_count;
+	uint8_t local_tq = 0;
 
 	if (orig_node == orig_neigh_node) {
 		list_for_each_entry(tmp_neigh_node,
@@ -180,25 +180,19 @@ static int is_bidirectional_neigh(struct orig_node *orig_node,
 			return 0;
 	}
 
-	orig_node->last_valid = jiffies;
+	spin_lock_bh(&if_incoming->neigh_list_lock);
+	list_for_each_entry(neigh_node, &if_incoming->neigh_list, list) {
+		if (!compare_orig(neigh_node->addr, orig_neigh_node->orig))
+			continue;
 
-	/* pay attention to not get a value bigger than 100 % */
-	total_count = (orig_neigh_node->bcast_own_sum[if_incoming->if_num] >
-		       neigh_node->real_packet_count ?
-		       neigh_node->real_packet_count :
-		       orig_neigh_node->bcast_own_sum[if_incoming->if_num]);
+		orig_node->last_valid = jiffies;
+		local_tq = neigh_node->tq_avg;
+		break;
+	}
+	spin_unlock_bh(&if_incoming->neigh_list_lock);
 
-	/* if we have too few packets (too less data) we set tq_own to zero */
-	/* if we receive too few packets it is not considered bidirectional */
-	if ((total_count < TQ_LOCAL_BIDRECT_SEND_MINIMUM) ||
-	    (neigh_node->real_packet_count < TQ_LOCAL_BIDRECT_RECV_MINIMUM))
-		orig_neigh_node->tq_own = 0;
-	else
-		/* neigh_node->real_packet_count is never zero as we
-		 * only purge old information when getting new
-		 * information */
-		orig_neigh_node->tq_own = (TQ_MAX_VALUE * total_count) /
-			neigh_node->real_packet_count;
+	if (local_tq == 0)
+		return 0;
 
 	/*
 	 * 1 - ((1-x) ** 3), normalized to TQ_MAX_VALUE this does
@@ -209,25 +203,22 @@ static int is_bidirectional_neigh(struct orig_node *orig_node,
 	orig_neigh_node->tq_asym_penalty =
 		TQ_MAX_VALUE -
 		(TQ_MAX_VALUE *
-		 (TQ_LOCAL_WINDOW_SIZE - neigh_node->real_packet_count) *
-		 (TQ_LOCAL_WINDOW_SIZE - neigh_node->real_packet_count) *
-		 (TQ_LOCAL_WINDOW_SIZE - neigh_node->real_packet_count)) /
-		(TQ_LOCAL_WINDOW_SIZE *
-		 TQ_LOCAL_WINDOW_SIZE *
-		 TQ_LOCAL_WINDOW_SIZE);
+		 (TQ_MAX_VALUE - local_tq) *
+		 (TQ_MAX_VALUE - local_tq) *
+		 (TQ_MAX_VALUE - local_tq)) /
+		(TQ_MAX_VALUE *
+		 TQ_MAX_VALUE *
+		 TQ_MAX_VALUE);
 
 	batman_packet_ogm->tq = ((batman_packet_ogm->tq *
-			      orig_neigh_node->tq_own *
 			      orig_neigh_node->tq_asym_penalty) /
-			     (TQ_MAX_VALUE * TQ_MAX_VALUE));
+			      TQ_MAX_VALUE);
 
 	bat_dbg(DBG_BATMAN, bat_priv,
 		"bidirectional: "
-		"orig = %-15pM neigh = %-15pM => own_bcast = %2i, "
-		"real recv = %2i, local tq: %3i, asym_penalty: %3i, "
-		"total tq: %3i\n",
-		orig_node->orig, orig_neigh_node->orig, total_count,
-		neigh_node->real_packet_count, orig_neigh_node->tq_own,
+		"orig = %-15pM neigh = %-15pM => real recv = %2i, "
+	        "local tq: %3i, asym_penalty: %3i, total tq: %3i\n",
+		orig_node->orig, orig_neigh_node->orig, local_tq,
 		orig_neigh_node->tq_asym_penalty, batman_packet_ogm->tq);
 
 	/* if link has the minimum required transmission quality
Signature · 1 line
1.7.1
#23 lore raw

[B.A.T.M.A.N.] (no subject)

Fixing a mixup with the link quality used for the asymmetric hop penalty. This should be the local_rq, not local_tq.

Cheers, Linus

#24 lore raw

PATCH v2 10/10 batman-adv: Use local tq values determined by NDP on OGMs

In reply to Linus Lüssing

With this commit not the local transmit quality values determined by the OGMs themselves are applied on received OGMs, but the local transmit quality detemined by NDP instead. Usually the link quality measurements of NDP are more up-to-date than the one of the OGMs, as NDP is using a more frequent interval because NDP's packets are not being flooded through the whole mesh.

---
 routing.c |   55 ++++++++++++++++++++++++-------------------------------
 1 files changed, 24 insertions(+), 31 deletions(-)
routing.c +24 -31
index 1972bb8..d33680d 100644
@@ -136,7 +136,7 @@ static int is_bidirectional_neigh(struct orig_node *orig_node,
 {
 	struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
 	struct neigh_node *neigh_node = NULL, *tmp_neigh_node = NULL;
-	unsigned char total_count;
+	uint8_t local_tq = 0, local_rq = 0;
 
 	if (orig_node == orig_neigh_node) {
 		list_for_each_entry(tmp_neigh_node,
@@ -180,25 +180,20 @@ static int is_bidirectional_neigh(struct orig_node *orig_node,
 			return 0;
 	}
 
-	orig_node->last_valid = jiffies;
+	spin_lock_bh(&if_incoming->neigh_list_lock);
+	list_for_each_entry(neigh_node, &if_incoming->neigh_list, list) {
+		if (!compare_orig(neigh_node->addr, orig_neigh_node->orig))
+			continue;
 
-	/* pay attention to not get a value bigger than 100 % */
-	total_count = (orig_neigh_node->bcast_own_sum[if_incoming->if_num] >
-		       neigh_node->real_packet_count ?
-		       neigh_node->real_packet_count :
-		       orig_neigh_node->bcast_own_sum[if_incoming->if_num]);
+		orig_node->last_valid = jiffies;
+		local_tq = neigh_node->tq_avg;
+		local_rq = neigh_node->rq;
+		break;
+	}
+	spin_unlock_bh(&if_incoming->neigh_list_lock);
 
-	/* if we have too few packets (too less data) we set tq_own to zero */
-	/* if we receive too few packets it is not considered bidirectional */
-	if ((total_count < TQ_LOCAL_BIDRECT_SEND_MINIMUM) ||
-	    (neigh_node->real_packet_count < TQ_LOCAL_BIDRECT_RECV_MINIMUM))
-		orig_neigh_node->tq_own = 0;
-	else
-		/* neigh_node->real_packet_count is never zero as we
-		 * only purge old information when getting new
-		 * information */
-		orig_neigh_node->tq_own = (TQ_MAX_VALUE * total_count) /
-			neigh_node->real_packet_count;
+	if (local_tq == 0)
+		return 0;
 
 	/*
 	 * 1 - ((1-x) ** 3), normalized to TQ_MAX_VALUE this does
@@ -209,25 +204,23 @@ static int is_bidirectional_neigh(struct orig_node *orig_node,
 	orig_neigh_node->tq_asym_penalty =
 		TQ_MAX_VALUE -
 		(TQ_MAX_VALUE *
-		 (TQ_LOCAL_WINDOW_SIZE - neigh_node->real_packet_count) *
-		 (TQ_LOCAL_WINDOW_SIZE - neigh_node->real_packet_count) *
-		 (TQ_LOCAL_WINDOW_SIZE - neigh_node->real_packet_count)) /
-		(TQ_LOCAL_WINDOW_SIZE *
-		 TQ_LOCAL_WINDOW_SIZE *
-		 TQ_LOCAL_WINDOW_SIZE);
+		 (TQ_MAX_VALUE - local_rq) *
+		 (TQ_MAX_VALUE - local_rq) *
+		 (TQ_MAX_VALUE - local_rq)) /
+		(TQ_MAX_VALUE *
+		 TQ_MAX_VALUE *
+		 TQ_MAX_VALUE);
 
 	batman_packet_ogm->tq = ((batman_packet_ogm->tq *
-			      orig_neigh_node->tq_own *
+			      local_tq *
 			      orig_neigh_node->tq_asym_penalty) /
-			     (TQ_MAX_VALUE * TQ_MAX_VALUE));
+			      (TQ_MAX_VALUE * TQ_MAX_VALUE));
 
 	bat_dbg(DBG_BATMAN, bat_priv,
 		"bidirectional: "
-		"orig = %-15pM neigh = %-15pM => own_bcast = %2i, "
-		"real recv = %2i, local tq: %3i, asym_penalty: %3i, "
-		"total tq: %3i\n",
-		orig_node->orig, orig_neigh_node->orig, total_count,
-		neigh_node->real_packet_count, orig_neigh_node->tq_own,
+		"orig = %-15pM neigh = %-15pM => local tq = %3i, "
+	        "local rq: %3i, asym_penalty: %3i, total tq: %3i\n",
+		orig_node->orig, orig_neigh_node->orig, local_tq, local_rq,
 		orig_neigh_node->tq_asym_penalty, batman_packet_ogm->tq);
 
 	/* if link has the minimum required transmission quality
Signature · 1 line
1.7.1
#25 lore raw

PATCH 10/10 batman-adv: Use local tq values determined by NDP on OGMs

In reply to Linus Lüssing

With this commit not the local transmit quality values determined by the OGMs themselves are applied on received OGMs, but the local transmit quality detemined by NDP instead. Usually the link quality measurements of NDP are more up-to-date than the one of the OGMs, as NDP is using a more frequent interval because NDP's packets are not being flooded through the whole mesh.

---
 routing.c |   55 ++++++++++++++++++++++++-------------------------------
 1 files changed, 24 insertions(+), 31 deletions(-)
routing.c +24 -31
index 1972bb8..d33680d 100644
@@ -136,7 +136,7 @@ static int is_bidirectional_neigh(struct orig_node *orig_node,
 {
 	struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
 	struct neigh_node *neigh_node = NULL, *tmp_neigh_node = NULL;
-	unsigned char total_count;
+	uint8_t local_tq = 0, local_rq = 0;
 
 	if (orig_node == orig_neigh_node) {
 		list_for_each_entry(tmp_neigh_node,
@@ -180,25 +180,20 @@ static int is_bidirectional_neigh(struct orig_node *orig_node,
 			return 0;
 	}
 
-	orig_node->last_valid = jiffies;
+	spin_lock_bh(&if_incoming->neigh_list_lock);
+	list_for_each_entry(neigh_node, &if_incoming->neigh_list, list) {
+		if (!compare_orig(neigh_node->addr, orig_neigh_node->orig))
+			continue;
 
-	/* pay attention to not get a value bigger than 100 % */
-	total_count = (orig_neigh_node->bcast_own_sum[if_incoming->if_num] >
-		       neigh_node->real_packet_count ?
-		       neigh_node->real_packet_count :
-		       orig_neigh_node->bcast_own_sum[if_incoming->if_num]);
+		orig_node->last_valid = jiffies;
+		local_tq = neigh_node->tq_avg;
+		local_rq = neigh_node->rq;
+		break;
+	}
+	spin_unlock_bh(&if_incoming->neigh_list_lock);
 
-	/* if we have too few packets (too less data) we set tq_own to zero */
-	/* if we receive too few packets it is not considered bidirectional */
-	if ((total_count < TQ_LOCAL_BIDRECT_SEND_MINIMUM) ||
-	    (neigh_node->real_packet_count < TQ_LOCAL_BIDRECT_RECV_MINIMUM))
-		orig_neigh_node->tq_own = 0;
-	else
-		/* neigh_node->real_packet_count is never zero as we
-		 * only purge old information when getting new
-		 * information */
-		orig_neigh_node->tq_own = (TQ_MAX_VALUE * total_count) /
-			neigh_node->real_packet_count;
+	if (local_tq == 0)
+		return 0;
 
 	/*
 	 * 1 - ((1-x) ** 3), normalized to TQ_MAX_VALUE this does
@@ -209,25 +204,23 @@ static int is_bidirectional_neigh(struct orig_node *orig_node,
 	orig_neigh_node->tq_asym_penalty =
 		TQ_MAX_VALUE -
 		(TQ_MAX_VALUE *
-		 (TQ_LOCAL_WINDOW_SIZE - neigh_node->real_packet_count) *
-		 (TQ_LOCAL_WINDOW_SIZE - neigh_node->real_packet_count) *
-		 (TQ_LOCAL_WINDOW_SIZE - neigh_node->real_packet_count)) /
-		(TQ_LOCAL_WINDOW_SIZE *
-		 TQ_LOCAL_WINDOW_SIZE *
-		 TQ_LOCAL_WINDOW_SIZE);
+		 (TQ_MAX_VALUE - local_rq) *
+		 (TQ_MAX_VALUE - local_rq) *
+		 (TQ_MAX_VALUE - local_rq)) /
+		(TQ_MAX_VALUE *
+		 TQ_MAX_VALUE *
+		 TQ_MAX_VALUE);
 
 	batman_packet_ogm->tq = ((batman_packet_ogm->tq *
-			      orig_neigh_node->tq_own *
+			      local_tq *
 			      orig_neigh_node->tq_asym_penalty) /
-			     (TQ_MAX_VALUE * TQ_MAX_VALUE));
+			      (TQ_MAX_VALUE * TQ_MAX_VALUE));
 
 	bat_dbg(DBG_BATMAN, bat_priv,
 		"bidirectional: "
-		"orig = %-15pM neigh = %-15pM => own_bcast = %2i, "
-		"real recv = %2i, local tq: %3i, asym_penalty: %3i, "
-		"total tq: %3i\n",
-		orig_node->orig, orig_neigh_node->orig, total_count,
-		neigh_node->real_packet_count, orig_neigh_node->tq_own,
+		"orig = %-15pM neigh = %-15pM => local tq = %3i, "
+	        "local rq: %3i, asym_penalty: %3i, total tq: %3i\n",
+		orig_node->orig, orig_neigh_node->orig, local_tq, local_rq,
 		orig_neigh_node->tq_asym_penalty, batman_packet_ogm->tq);
 
 	/* if link has the minimum required transmission quality
Signature · 1 line
1.7.1