Skip to content

Commit 5952b02

Browse files
committed
Merge tag 'batadv-next-for-davem-20170613' of git://git.open-mesh.org/linux-merge
Simon Wunderlich says: ==================== This feature/cleanup patchset includes the following patches: - bump version strings, by Simon Wunderlich - decrease maximum fragment size, by Matthias Schiffer - Clean up seqfile writing, by Markus Elfring (2 patches) - use __func__ in debug messages, by Sven Eckelmann - Mark tpmeter initializers with __init, by Antonio Quartulli - ignore loop detection MAC addresses, by Simon Wunderlich - clean up some return handling, by Simon Wunderlich - improve ELP throughput value handling for WiFi neighbors in BATMAN V/ELP, by Sven Eckelmann (2 patches) ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 5514174 + d628908 commit 5952b02

File tree

11 files changed

+72
-62
lines changed

11 files changed

+72
-62
lines changed

net/batman-adv/bat_iv_ogm.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,8 @@ batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv,
10221022
u8 tq_avg;
10231023

10241024
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
1025-
"update_originator(): Searching and updating originator entry of received packet\n");
1025+
"%s(): Searching and updating originator entry of received packet\n",
1026+
__func__);
10261027

10271028
rcu_read_lock();
10281029
hlist_for_each_entry_rcu(tmp_neigh_node,
@@ -1944,7 +1945,7 @@ static void batadv_iv_ogm_orig_print(struct batadv_priv *bat_priv,
19441945

19451946
batadv_iv_ogm_orig_print_neigh(orig_node, if_outgoing,
19461947
seq);
1947-
seq_puts(seq, "\n");
1948+
seq_putc(seq, '\n');
19481949
batman_count++;
19491950

19501951
next:

net/batman-adv/bat_v.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ static void batadv_v_orig_print(struct batadv_priv *bat_priv,
400400
neigh_node->if_incoming->net_dev->name);
401401

402402
batadv_v_orig_print_neigh(orig_node, if_outgoing, seq);
403-
seq_puts(seq, "\n");
403+
seq_putc(seq, '\n');
404404
batman_count++;
405405

406406
next:

net/batman-adv/bat_v_elp.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "main.h"
2020

2121
#include <linux/atomic.h>
22+
#include <linux/bitops.h>
2223
#include <linux/byteorder/generic.h>
2324
#include <linux/errno.h>
2425
#include <linux/etherdevice.h>
@@ -29,6 +30,7 @@
2930
#include <linux/kernel.h>
3031
#include <linux/kref.h>
3132
#include <linux/netdevice.h>
33+
#include <linux/nl80211.h>
3234
#include <linux/random.h>
3335
#include <linux/rculist.h>
3436
#include <linux/rcupdate.h>
@@ -109,8 +111,12 @@ static u32 batadv_v_elp_get_throughput(struct batadv_hardif_neigh_node *neigh)
109111
*/
110112
return 0;
111113
}
112-
if (!ret)
113-
return sinfo.expected_throughput / 100;
114+
if (ret)
115+
goto default_throughput;
116+
if (!(sinfo.filled & BIT(NL80211_STA_INFO_EXPECTED_THROUGHPUT)))
117+
goto default_throughput;
118+
119+
return sinfo.expected_throughput / 100;
114120
}
115121

116122
/* if not a wifi interface, check if this device provides data via

net/batman-adv/bridge_loop_avoidance.c

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, u8 *mac,
394394
*/
395395
ether_addr_copy(ethhdr->h_source, mac);
396396
batadv_dbg(BATADV_DBG_BLA, bat_priv,
397-
"bla_send_claim(): CLAIM %pM on vid %d\n", mac,
397+
"%s(): CLAIM %pM on vid %d\n", __func__, mac,
398398
batadv_print_vid(vid));
399399
break;
400400
case BATADV_CLAIM_TYPE_UNCLAIM:
@@ -403,7 +403,7 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, u8 *mac,
403403
*/
404404
ether_addr_copy(hw_src, mac);
405405
batadv_dbg(BATADV_DBG_BLA, bat_priv,
406-
"bla_send_claim(): UNCLAIM %pM on vid %d\n", mac,
406+
"%s(): UNCLAIM %pM on vid %d\n", __func__, mac,
407407
batadv_print_vid(vid));
408408
break;
409409
case BATADV_CLAIM_TYPE_ANNOUNCE:
@@ -412,7 +412,7 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, u8 *mac,
412412
*/
413413
ether_addr_copy(hw_src, mac);
414414
batadv_dbg(BATADV_DBG_BLA, bat_priv,
415-
"bla_send_claim(): ANNOUNCE of %pM on vid %d\n",
415+
"%s(): ANNOUNCE of %pM on vid %d\n", __func__,
416416
ethhdr->h_source, batadv_print_vid(vid));
417417
break;
418418
case BATADV_CLAIM_TYPE_REQUEST:
@@ -423,15 +423,15 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, u8 *mac,
423423
ether_addr_copy(hw_src, mac);
424424
ether_addr_copy(ethhdr->h_dest, mac);
425425
batadv_dbg(BATADV_DBG_BLA, bat_priv,
426-
"bla_send_claim(): REQUEST of %pM to %pM on vid %d\n",
426+
"%s(): REQUEST of %pM to %pM on vid %d\n", __func__,
427427
ethhdr->h_source, ethhdr->h_dest,
428428
batadv_print_vid(vid));
429429
break;
430430
case BATADV_CLAIM_TYPE_LOOPDETECT:
431431
ether_addr_copy(ethhdr->h_source, mac);
432432
batadv_dbg(BATADV_DBG_BLA, bat_priv,
433-
"bla_send_claim(): LOOPDETECT of %pM to %pM on vid %d\n",
434-
ethhdr->h_source, ethhdr->h_dest,
433+
"%s(): LOOPDETECT of %pM to %pM on vid %d\n",
434+
__func__, ethhdr->h_source, ethhdr->h_dest,
435435
batadv_print_vid(vid));
436436

437437
break;
@@ -509,7 +509,7 @@ batadv_bla_get_backbone_gw(struct batadv_priv *bat_priv, u8 *orig,
509509
return entry;
510510

511511
batadv_dbg(BATADV_DBG_BLA, bat_priv,
512-
"bla_get_backbone_gw(): not found (%pM, %d), creating new entry\n",
512+
"%s(): not found (%pM, %d), creating new entry\n", __func__,
513513
orig, batadv_print_vid(vid));
514514

515515
entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
@@ -605,7 +605,8 @@ static void batadv_bla_answer_request(struct batadv_priv *bat_priv,
605605
int i;
606606

607607
batadv_dbg(BATADV_DBG_BLA, bat_priv,
608-
"bla_answer_request(): received a claim request, send all of our own claims again\n");
608+
"%s(): received a claim request, send all of our own claims again\n",
609+
__func__);
609610

610611
backbone_gw = batadv_backbone_hash_find(bat_priv,
611612
primary_if->net_dev->dev_addr,
@@ -718,8 +719,8 @@ static void batadv_bla_add_claim(struct batadv_priv *bat_priv,
718719
kref_init(&claim->refcount);
719720

720721
batadv_dbg(BATADV_DBG_BLA, bat_priv,
721-
"bla_add_claim(): adding new entry %pM, vid %d to hash ...\n",
722-
mac, batadv_print_vid(vid));
722+
"%s(): adding new entry %pM, vid %d to hash ...\n",
723+
__func__, mac, batadv_print_vid(vid));
723724

724725
kref_get(&claim->refcount);
725726
hash_added = batadv_hash_add(bat_priv->bla.claim_hash,
@@ -739,8 +740,9 @@ static void batadv_bla_add_claim(struct batadv_priv *bat_priv,
739740
goto claim_free_ref;
740741

741742
batadv_dbg(BATADV_DBG_BLA, bat_priv,
742-
"bla_add_claim(): changing ownership for %pM, vid %d to gw %pM\n",
743-
mac, batadv_print_vid(vid), backbone_gw->orig);
743+
"%s(): changing ownership for %pM, vid %d to gw %pM\n",
744+
__func__, mac, batadv_print_vid(vid),
745+
backbone_gw->orig);
744746

745747
remove_crc = true;
746748
}
@@ -808,7 +810,7 @@ static void batadv_bla_del_claim(struct batadv_priv *bat_priv,
808810
if (!claim)
809811
return;
810812

811-
batadv_dbg(BATADV_DBG_BLA, bat_priv, "bla_del_claim(): %pM, vid %d\n",
813+
batadv_dbg(BATADV_DBG_BLA, bat_priv, "%s(): %pM, vid %d\n", __func__,
812814
mac, batadv_print_vid(vid));
813815

814816
batadv_hash_remove(bat_priv->bla.claim_hash, batadv_compare_claim,
@@ -848,17 +850,17 @@ static bool batadv_handle_announce(struct batadv_priv *bat_priv, u8 *an_addr,
848850
crc = ntohs(*((__be16 *)(&an_addr[4])));
849851

850852
batadv_dbg(BATADV_DBG_BLA, bat_priv,
851-
"handle_announce(): ANNOUNCE vid %d (sent by %pM)... CRC = %#.4x\n",
852-
batadv_print_vid(vid), backbone_gw->orig, crc);
853+
"%s(): ANNOUNCE vid %d (sent by %pM)... CRC = %#.4x\n",
854+
__func__, batadv_print_vid(vid), backbone_gw->orig, crc);
853855

854856
spin_lock_bh(&backbone_gw->crc_lock);
855857
backbone_crc = backbone_gw->crc;
856858
spin_unlock_bh(&backbone_gw->crc_lock);
857859

858860
if (backbone_crc != crc) {
859861
batadv_dbg(BATADV_DBG_BLA, backbone_gw->bat_priv,
860-
"handle_announce(): CRC FAILED for %pM/%d (my = %#.4x, sent = %#.4x)\n",
861-
backbone_gw->orig,
862+
"%s(): CRC FAILED for %pM/%d (my = %#.4x, sent = %#.4x)\n",
863+
__func__, backbone_gw->orig,
862864
batadv_print_vid(backbone_gw->vid),
863865
backbone_crc, crc);
864866

@@ -903,8 +905,8 @@ static bool batadv_handle_request(struct batadv_priv *bat_priv,
903905
return true;
904906

905907
batadv_dbg(BATADV_DBG_BLA, bat_priv,
906-
"handle_request(): REQUEST vid %d (sent by %pM)...\n",
907-
batadv_print_vid(vid), ethhdr->h_source);
908+
"%s(): REQUEST vid %d (sent by %pM)...\n",
909+
__func__, batadv_print_vid(vid), ethhdr->h_source);
908910

909911
batadv_bla_answer_request(bat_priv, primary_if, vid);
910912
return true;
@@ -940,7 +942,7 @@ static bool batadv_handle_unclaim(struct batadv_priv *bat_priv,
940942

941943
/* this must be an UNCLAIM frame */
942944
batadv_dbg(BATADV_DBG_BLA, bat_priv,
943-
"handle_unclaim(): UNCLAIM %pM on vid %d (sent by %pM)...\n",
945+
"%s(): UNCLAIM %pM on vid %d (sent by %pM)...\n", __func__,
944946
claim_addr, batadv_print_vid(vid), backbone_gw->orig);
945947

946948
batadv_bla_del_claim(bat_priv, claim_addr, vid);
@@ -1160,9 +1162,9 @@ static bool batadv_bla_process_claim(struct batadv_priv *bat_priv,
11601162
ethhdr);
11611163
if (ret == 1)
11621164
batadv_dbg(BATADV_DBG_BLA, bat_priv,
1163-
"bla_process_claim(): received a claim frame from another group. From: %pM on vid %d ...(hw_src %pM, hw_dst %pM)\n",
1164-
ethhdr->h_source, batadv_print_vid(vid), hw_src,
1165-
hw_dst);
1165+
"%s(): received a claim frame from another group. From: %pM on vid %d ...(hw_src %pM, hw_dst %pM)\n",
1166+
__func__, ethhdr->h_source, batadv_print_vid(vid),
1167+
hw_src, hw_dst);
11661168

11671169
if (ret < 2)
11681170
return !!ret;
@@ -1196,8 +1198,9 @@ static bool batadv_bla_process_claim(struct batadv_priv *bat_priv,
11961198
}
11971199

11981200
batadv_dbg(BATADV_DBG_BLA, bat_priv,
1199-
"bla_process_claim(): ERROR - this looks like a claim frame, but is useless. eth src %pM on vid %d ...(hw_src %pM, hw_dst %pM)\n",
1200-
ethhdr->h_source, batadv_print_vid(vid), hw_src, hw_dst);
1201+
"%s(): ERROR - this looks like a claim frame, but is useless. eth src %pM on vid %d ...(hw_src %pM, hw_dst %pM)\n",
1202+
__func__, ethhdr->h_source, batadv_print_vid(vid), hw_src,
1203+
hw_dst);
12011204
return true;
12021205
}
12031206

@@ -1237,8 +1240,8 @@ static void batadv_bla_purge_backbone_gw(struct batadv_priv *bat_priv, int now)
12371240
continue;
12381241

12391242
batadv_dbg(BATADV_DBG_BLA, backbone_gw->bat_priv,
1240-
"bla_purge_backbone_gw(): backbone gw %pM timed out\n",
1241-
backbone_gw->orig);
1243+
"%s(): backbone gw %pM timed out\n",
1244+
__func__, backbone_gw->orig);
12421245

12431246
purge_now:
12441247
/* don't wait for the pending request anymore */
@@ -1295,11 +1298,11 @@ static void batadv_bla_purge_claims(struct batadv_priv *bat_priv,
12951298
goto skip;
12961299

12971300
batadv_dbg(BATADV_DBG_BLA, bat_priv,
1298-
"bla_purge_claims(): timed out.\n");
1301+
"%s(): timed out.\n", __func__);
12991302

13001303
purge_now:
13011304
batadv_dbg(BATADV_DBG_BLA, bat_priv,
1302-
"bla_purge_claims(): %pM, vid %d\n",
1305+
"%s(): %pM, vid %d\n", __func__,
13031306
claim->addr, claim->vid);
13041307

13051308
batadv_handle_unclaim(bat_priv, primary_if,
@@ -1851,8 +1854,8 @@ bool batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb,
18511854
*/
18521855

18531856
batadv_dbg(BATADV_DBG_BLA, bat_priv,
1854-
"bla_rx(): Unclaimed MAC %pM found. Claim it. Local: %s\n",
1855-
ethhdr->h_source,
1857+
"%s(): Unclaimed MAC %pM found. Claim it. Local: %s\n",
1858+
__func__, ethhdr->h_source,
18561859
batadv_is_my_client(bat_priv,
18571860
ethhdr->h_source, vid) ?
18581861
"yes" : "no");
@@ -1978,15 +1981,15 @@ bool batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb,
19781981
* older than 100 ms to make sure we really
19791982
* have a roaming client here.
19801983
*/
1981-
batadv_dbg(BATADV_DBG_BLA, bat_priv, "bla_tx(): Roaming client %pM detected. Unclaim it.\n",
1982-
ethhdr->h_source);
1984+
batadv_dbg(BATADV_DBG_BLA, bat_priv, "%s(): Roaming client %pM detected. Unclaim it.\n",
1985+
__func__, ethhdr->h_source);
19831986
batadv_handle_unclaim(bat_priv, primary_if,
19841987
primary_if->net_dev->dev_addr,
19851988
ethhdr->h_source, vid);
19861989
goto allow;
19871990
} else {
1988-
batadv_dbg(BATADV_DBG_BLA, bat_priv, "bla_tx(): Race for claim %pM detected. Drop packet.\n",
1989-
ethhdr->h_source);
1991+
batadv_dbg(BATADV_DBG_BLA, bat_priv, "%s(): Race for claim %pM detected. Drop packet.\n",
1992+
__func__, ethhdr->h_source);
19901993
goto handled;
19911994
}
19921995
}

net/batman-adv/distributed-arp-table.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ batadv_dat_select_candidates(struct batadv_priv *bat_priv, __be32 ip_dst,
601601
BATADV_DAT_ADDR_MAX);
602602

603603
batadv_dbg(BATADV_DBG_DAT, bat_priv,
604-
"dat_select_candidates(): IP=%pI4 hash(IP)=%u\n", &ip_dst,
604+
"%s(): IP=%pI4 hash(IP)=%u\n", __func__, &ip_dst,
605605
ip_key);
606606

607607
for (select = 0; select < BATADV_DAT_CANDIDATES_NUM; select++)

net/batman-adv/main.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#define BATADV_DRIVER_DEVICE "batman-adv"
2525

2626
#ifndef BATADV_SOURCE_VERSION
27-
#define BATADV_SOURCE_VERSION "2017.1"
27+
#define BATADV_SOURCE_VERSION "2017.2"
2828
#endif
2929

3030
/* B.A.T.M.A.N. parameters */
@@ -168,7 +168,7 @@ enum batadv_uev_type {
168168
/* Maximum number of fragments for one packet */
169169
#define BATADV_FRAG_MAX_FRAGMENTS 16
170170
/* Maxumim size of each fragment */
171-
#define BATADV_FRAG_MAX_FRAG_SIZE 1400
171+
#define BATADV_FRAG_MAX_FRAG_SIZE 1280
172172
/* Time to keep fragments while waiting for rest of the fragments */
173173
#define BATADV_FRAG_TIMEOUT 10000
174174

net/batman-adv/network-coding.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1935,9 +1935,7 @@ int batadv_nc_nodes_seq_print_text(struct seq_file *seq, void *offset)
19351935
list)
19361936
seq_printf(seq, "%pM ",
19371937
nc_node->addr);
1938-
seq_puts(seq, "\n");
1939-
1940-
seq_puts(seq, " Outgoing: ");
1938+
seq_puts(seq, "\n Outgoing: ");
19411939
/* For out_nc_node to this orig_node */
19421940
list_for_each_entry_rcu(nc_node,
19431941
&orig_node->out_coding_list,

net/batman-adv/routing.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -985,8 +985,8 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,
985985
batadv_orig_node_put(orig_node_gw);
986986
if (is_gw) {
987987
batadv_dbg(BATADV_DBG_BLA, bat_priv,
988-
"recv_unicast_packet(): Dropped unicast pkt received from another backbone gw %pM.\n",
989-
orig_addr_gw);
988+
"%s(): Dropped unicast pkt received from another backbone gw %pM.\n",
989+
__func__, orig_addr_gw);
990990
return NET_RX_DROP;
991991
}
992992
}

net/batman-adv/send.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -971,11 +971,11 @@ batadv_purge_outstanding_packets(struct batadv_priv *bat_priv,
971971

972972
if (hard_iface)
973973
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
974-
"purge_outstanding_packets(): %s\n",
975-
hard_iface->net_dev->name);
974+
"%s(): %s\n",
975+
__func__, hard_iface->net_dev->name);
976976
else
977977
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
978-
"purge_outstanding_packets()\n");
978+
"%s()\n", __func__);
979979

980980
/* claim bcast list for free() */
981981
spin_lock_bh(&bat_priv->forw_bcast_list_lock);

net/batman-adv/tp_meter.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <linux/etherdevice.h>
2828
#include <linux/fs.h>
2929
#include <linux/if_ether.h>
30+
#include <linux/init.h>
3031
#include <linux/jiffies.h>
3132
#include <linux/kernel.h>
3233
#include <linux/kref.h>
@@ -1497,7 +1498,7 @@ void batadv_tp_meter_recv(struct batadv_priv *bat_priv, struct sk_buff *skb)
14971498
/**
14981499
* batadv_tp_meter_init - initialize global tp_meter structures
14991500
*/
1500-
void batadv_tp_meter_init(void)
1501+
void __init batadv_tp_meter_init(void)
15011502
{
15021503
get_random_bytes(batadv_tp_prerandom, sizeof(batadv_tp_prerandom));
15031504
}

0 commit comments

Comments
 (0)