The following commit has been merged in the master branch: commit 5332174a83720921a5ef6db8080a8691f7ccbc27 Merge: e98a3aabf85f60b80c6ef93e509d38144ca434b1 64ae74455371a40bc9f9c8325eb4c37f2978c95f Author: David S. Miller davem@davemloft.net Date: Wed May 4 16:21:08 2016 -0400
Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge
Antonio Quartulli says:
==================== pull request: batman-adv 20160504
In this pull request you have: - two changes to the MAINTAINERS file where one marks our mailing list as moderated and the other adds a missing documentation file - kernel-doc fixes - code refactoring and various cleanups ====================
Signed-off-by: David S. Miller davem@davemloft.net
diff --combined MAINTAINERS index 867d6be,8f32094..2b74fde --- a/MAINTAINERS +++ b/MAINTAINERS @@@ -2203,10 -2203,13 +2203,13 @@@ BATMAN ADVANCE M: Marek Lindner mareklindner@neomailbox.ch M: Simon Wunderlich sw@simonwunderlich.de M: Antonio Quartulli a@unstable.cc - L: b.a.t.m.a.n@lists.open-mesh.org + L: b.a.t.m.a.n@lists.open-mesh.org (moderated for non-subscribers) W: https://www.open-mesh.org/ Q: https://patchwork.open-mesh.org/project/batman/list/ S: Maintained + F: Documentation/ABI/testing/sysfs-class-net-batman-adv + F: Documentation/ABI/testing/sysfs-class-net-mesh + F: Documentation/networking/batman-adv.txt F: net/batman-adv/
BAYCOM/HDLCDRV DRIVERS FOR AX.25 @@@ -4745,7 -4748,7 +4748,7 @@@ F: drivers/platform/x86/fujitsu-tablet.
FUSE: FILESYSTEM IN USERSPACE M: Miklos Szeredi miklos@szeredi.hu -L: fuse-devel@lists.sourceforge.net +L: linux-fsdevel@vger.kernel.org W: http://fuse.sourceforge.net/ T: git git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git S: Maintained @@@ -4904,7 -4907,7 +4907,7 @@@ F: net/ipv4/gre_offload. F: include/net/gre.h
GRETH 10/100/1G Ethernet MAC device driver -M: Kristoffer Glembo kristoffer@gaisler.com +M: Andreas Larsson andreas@gaisler.com L: netdev@vger.kernel.org S: Maintained F: drivers/net/ethernet/aeroflex/ @@@ -6028,7 -6031,7 +6031,7 @@@ F: include/scsi/*iscsi
ISCSI EXTENSIONS FOR RDMA (ISER) INITIATOR M: Or Gerlitz ogerlitz@mellanox.com -M: Sagi Grimberg sagig@mellanox.com +M: Sagi Grimberg sagi@grimberg.me M: Roi Dayan roid@mellanox.com L: linux-rdma@vger.kernel.org S: Supported @@@ -6038,7 -6041,7 +6041,7 @@@ Q: http://patchwork.kernel.org/project/ F: drivers/infiniband/ulp/iser/
ISCSI EXTENSIONS FOR RDMA (ISER) TARGET -M: Sagi Grimberg sagig@mellanox.com +M: Sagi Grimberg sagi@grimberg.me T: git git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git master L: linux-rdma@vger.kernel.org L: target-devel@vger.kernel.org @@@ -6401,7 -6404,7 +6404,7 @@@ F: mm/kmemleak. F: mm/kmemleak-test.c
KPROBES -M: Ananth N Mavinakayanahalli ananth@in.ibm.com +M: Ananth N Mavinakayanahalli ananth@linux.vnet.ibm.com M: Anil S Keshavamurthy anil.s.keshavamurthy@intel.com M: "David S. Miller" davem@davemloft.net M: Masami Hiramatsu mhiramat@kernel.org @@@ -10015,8 -10018,7 +10018,8 @@@ F: drivers/infiniband/hw/ocrdma
SFC NETWORK DRIVER M: Solarflare linux maintainers linux-net-drivers@solarflare.com -M: Shradha Shah sshah@solarflare.com +M: Edward Cree ecree@solarflare.com +M: Bert Kenward bkenward@solarflare.com L: netdev@vger.kernel.org S: Supported F: drivers/net/ethernet/sfc/ diff --combined net/batman-adv/bat_v.c index 4026f19,246f9e9..3ff8bd1 --- a/net/batman-adv/bat_v.c +++ b/net/batman-adv/bat_v.c @@@ -32,21 -32,10 +32,21 @@@
#include "bat_v_elp.h" #include "bat_v_ogm.h" +#include "hard-interface.h" #include "hash.h" #include "originator.h" #include "packet.h"
+static void batadv_v_iface_activate(struct batadv_hard_iface *hard_iface) +{ + /* B.A.T.M.A.N. V does not use any queuing mechanism, therefore it can + * set the interface as ACTIVE right away, without any risk of race + * condition + */ + if (hard_iface->if_status == BATADV_IF_TO_BE_ACTIVATED) + hard_iface->if_status = BATADV_IF_ACTIVE; +} + static int batadv_v_iface_enable(struct batadv_hard_iface *hard_iface) { int ret; @@@ -162,8 -151,8 +162,8 @@@ static void batadv_v_neigh_print(struc struct batadv_hard_iface *hard_iface; int batman_count = 0;
- seq_printf(seq, " %-15s %s (%11s) [%10s]\n", "Neighbor", - "last-seen", "throughput", "IF"); + seq_puts(seq, + " Neighbor last-seen ( throughput) [ IF]\n");
rcu_read_lock(); list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) { @@@ -202,9 -191,8 +202,8 @@@ static void batadv_v_orig_print(struct int batman_count = 0; u32 i;
- seq_printf(seq, " %-15s %s (%11s) %17s [%10s]: %20s ...\n", - "Originator", "last-seen", "throughput", "Nexthop", - "outgoingIF", "Potential nexthops"); + seq_puts(seq, + " Originator last-seen ( throughput) Nexthop [outgoingIF]: Potential nexthops ...\n");
for (i = 0; i < hash->size; i++) { head = &hash->table[i]; @@@ -285,7 -273,6 +284,7 @@@ static bool batadv_v_neigh_is_sob(struc
static struct batadv_algo_ops batadv_batman_v __read_mostly = { .name = "BATMAN_V", + .bat_iface_activate = batadv_v_iface_activate, .bat_iface_enable = batadv_v_iface_enable, .bat_iface_disable = batadv_v_iface_disable, .bat_iface_update_mac = batadv_v_iface_update_mac, diff --combined net/batman-adv/distributed-arp-table.c index 3e6b262,f0548b4..67f44f5 --- a/net/batman-adv/distributed-arp-table.c +++ b/net/batman-adv/distributed-arp-table.c @@@ -152,7 -152,7 +152,7 @@@ static void batadv_dat_purge(struct wor struct batadv_priv_dat *priv_dat; struct batadv_priv *bat_priv;
- delayed_work = container_of(work, struct delayed_work, work); + delayed_work = to_delayed_work(work); priv_dat = container_of(delayed_work, struct batadv_priv_dat, work); bat_priv = container_of(priv_dat, struct batadv_priv, dat);
@@@ -568,7 -568,6 +568,7 @@@ static void batadv_choose_next_candidat * be sent to * @bat_priv: the bat priv with all the soft interface information * @ip_dst: ipv4 to look up in the DHT + * @vid: VLAN identifier * * An originator O is selected if and only if its DHT_ID value is one of three * closest values (from the LEFT, with wrap around if needed) then the hash @@@ -577,8 -576,7 +577,8 @@@ * Return: the candidate array of size BATADV_DAT_CANDIDATE_NUM. */ static struct batadv_dat_candidate * -batadv_dat_select_candidates(struct batadv_priv *bat_priv, __be32 ip_dst) +batadv_dat_select_candidates(struct batadv_priv *bat_priv, __be32 ip_dst, + unsigned short vid) { int select; batadv_dat_addr_t last_max = BATADV_DAT_ADDR_MAX, ip_key; @@@ -594,7 -592,7 +594,7 @@@ return NULL;
dat.ip = ip_dst; - dat.vid = 0; + dat.vid = vid; ip_key = (batadv_dat_addr_t)batadv_hash_dat(&dat, BATADV_DAT_ADDR_MAX);
@@@ -614,7 -612,6 +614,7 @@@ * @bat_priv: the bat priv with all the soft interface information * @skb: payload to send * @ip: the DHT key + * @vid: VLAN identifier * @packet_subtype: unicast4addr packet subtype to use * * This function copies the skb with pskb_copy() and is sent as unicast packet @@@ -625,7 -622,7 +625,7 @@@ */ static bool batadv_dat_send_data(struct batadv_priv *bat_priv, struct sk_buff *skb, __be32 ip, - int packet_subtype) + unsigned short vid, int packet_subtype) { int i; bool ret = false; @@@ -634,7 -631,7 +634,7 @@@ struct sk_buff *tmp_skb; struct batadv_dat_candidate *cand;
- cand = batadv_dat_select_candidates(bat_priv, ip); + cand = batadv_dat_select_candidates(bat_priv, ip, vid); if (!cand) goto out;
@@@ -720,7 -717,7 +720,7 @@@ void batadv_dat_status_update(struct ne }
/** - * batadv_gw_tvlv_ogm_handler_v1 - process incoming dat tvlv container + * batadv_dat_tvlv_ogm_handler_v1 - process incoming dat tvlv container * @bat_priv: the bat priv with all the soft interface information * @orig: the orig_node of the ogm * @flags: flags indicating the tvlv state (see batadv_tvlv_handler_flags) @@@ -817,8 -814,8 +817,8 @@@ int batadv_dat_cache_seq_print_text(str goto out;
seq_printf(seq, "Distributed ARP Table (%s):\n", net_dev->name); - seq_printf(seq, " %-7s %-9s %4s %11s\n", "IPv4", - "MAC", "VID", "last-seen"); + seq_puts(seq, + " IPv4 MAC VID last-seen\n");
for (i = 0; i < hash->size; i++) { head = &hash->table[i]; @@@ -1025,7 -1022,7 +1025,7 @@@ bool batadv_dat_snoop_outgoing_arp_requ ret = true; } else { /* Send the request to the DHT */ - ret = batadv_dat_send_data(bat_priv, skb, ip_dst, + ret = batadv_dat_send_data(bat_priv, skb, ip_dst, vid, BATADV_P_DAT_DHT_GET); } out: @@@ -1153,8 -1150,8 +1153,8 @@@ void batadv_dat_snoop_outgoing_arp_repl /* Send the ARP reply to the candidates for both the IP addresses that * the node obtained from the ARP reply */ - batadv_dat_send_data(bat_priv, skb, ip_src, BATADV_P_DAT_DHT_PUT); - batadv_dat_send_data(bat_priv, skb, ip_dst, BATADV_P_DAT_DHT_PUT); + batadv_dat_send_data(bat_priv, skb, ip_src, vid, BATADV_P_DAT_DHT_PUT); + batadv_dat_send_data(bat_priv, skb, ip_dst, vid, BATADV_P_DAT_DHT_PUT); }
/** diff --combined net/batman-adv/originator.c index c355a82,155c1dd..f885a41 --- a/net/batman-adv/originator.c +++ b/net/batman-adv/originator.c @@@ -250,6 -250,7 +250,6 @@@ static void batadv_neigh_node_release(s { struct hlist_node *node_tmp; struct batadv_neigh_node *neigh_node; - struct batadv_hardif_neigh_node *hardif_neigh; struct batadv_neigh_ifinfo *neigh_ifinfo; struct batadv_algo_ops *bao;
@@@ -261,7 -262,13 +261,7 @@@ batadv_neigh_ifinfo_put(neigh_ifinfo); }
- hardif_neigh = batadv_hardif_neigh_get(neigh_node->if_incoming, - neigh_node->addr); - if (hardif_neigh) { - /* batadv_hardif_neigh_get() increases refcount too */ - batadv_hardif_neigh_put(hardif_neigh); - batadv_hardif_neigh_put(hardif_neigh); - } + batadv_hardif_neigh_put(neigh_node->hardif_neigh);
if (bao->bat_neigh_free) bao->bat_neigh_free(neigh_node); @@@ -282,7 -289,7 +282,7 @@@ void batadv_neigh_node_put(struct batad }
/** - * batadv_orig_node_get_router - router to the originator depending on iface + * batadv_orig_router_get - router to the originator depending on iface * @orig_node: the orig node for the router * @if_outgoing: the interface where the payload packet has been received or * the OGM should be sent to @@@ -656,11 -663,6 +656,11 @@@ batadv_neigh_node_new(struct batadv_ori ether_addr_copy(neigh_node->addr, neigh_addr); neigh_node->if_incoming = hard_iface; neigh_node->orig_node = orig_node; + neigh_node->last_seen = jiffies; + + /* increment unique neighbor refcount */ + kref_get(&hardif_neigh->refcount); + neigh_node->hardif_neigh = hardif_neigh;
/* extra reference for return */ kref_init(&neigh_node->refcount); @@@ -670,6 -672,9 +670,6 @@@ hlist_add_head_rcu(&neigh_node->list, &orig_node->neigh_list); spin_unlock_bh(&orig_node->neigh_list_lock);
- /* increment unique neighbor refcount */ - kref_get(&hardif_neigh->refcount); - batadv_dbg(BATADV_DBG_BATMAN, orig_node->bat_priv, "Creating new neighbor %pM for orig_node %pM on interface %s\n", neigh_addr, orig_node->orig, hard_iface->net_dev->name); @@@ -1217,7 -1222,7 +1217,7 @@@ static void batadv_purge_orig(struct wo struct delayed_work *delayed_work; struct batadv_priv *bat_priv;
- delayed_work = container_of(work, struct delayed_work, work); + delayed_work = to_delayed_work(work); bat_priv = container_of(delayed_work, struct batadv_priv, orig_work); _batadv_purge_orig(bat_priv); queue_delayed_work(batadv_event_workqueue, diff --combined net/batman-adv/send.c index 7641785,20076b4..99ea900 --- a/net/batman-adv/send.c +++ b/net/batman-adv/send.c @@@ -552,7 -552,7 +552,7 @@@ static void batadv_send_outstanding_bca struct net_device *soft_iface; struct batadv_priv *bat_priv;
- delayed_work = container_of(work, struct delayed_work, work); + delayed_work = to_delayed_work(work); forw_packet = container_of(delayed_work, struct batadv_forw_packet, delayed_work); soft_iface = forw_packet->if_incoming->soft_iface; @@@ -604,7 -604,7 +604,7 @@@ void batadv_send_outstanding_bat_ogm_pa struct batadv_forw_packet *forw_packet; struct batadv_priv *bat_priv;
- delayed_work = container_of(work, struct delayed_work, work); + delayed_work = to_delayed_work(work); forw_packet = container_of(delayed_work, struct batadv_forw_packet, delayed_work); bat_priv = netdev_priv(forw_packet->if_incoming->soft_iface); @@@ -675,9 -675,6 +675,9 @@@ batadv_purge_outstanding_packets(struc
if (pending) { hlist_del(&forw_packet->list); + if (!forw_packet->own) + atomic_inc(&bat_priv->bcast_queue_left); + batadv_forw_packet_free(forw_packet); } } @@@ -705,9 -702,6 +705,9 @@@
if (pending) { hlist_del(&forw_packet->list); + if (!forw_packet->own) + atomic_inc(&bat_priv->batman_queue_left); + batadv_forw_packet_free(forw_packet); } } diff --combined net/batman-adv/soft-interface.c index dcb16c3,d78c560..dfb4d56 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c @@@ -208,7 -208,7 +208,7 @@@ static int batadv_interface_tx(struct s if (atomic_read(&bat_priv->mesh_state) != BATADV_MESH_ACTIVE) goto dropped;
- soft_iface->trans_start = jiffies; + netif_trans_update(soft_iface); vid = batadv_get_vid(skb, 0); ethhdr = eth_hdr(skb);
@@@ -381,6 -381,24 +381,24 @@@ end return NETDEV_TX_OK; }
+ /** + * batadv_interface_rx - receive ethernet frame on local batman-adv interface + * @soft_iface: local interface which will receive the ethernet frame + * @skb: ethernet frame for @soft_iface + * @recv_if: interface on which the batman-adv packet was received + * @hdr_size: size of already parsed batman-adv header + * @orig_node: originator from which the batman-adv packet was sent + * + * Sends a ethernet frame to the receive path of the local @soft_iface. + * skb->data has still point to the batman-adv header with the size @hdr_size. + * The caller has to have parsed this header already and made sure that at least + * @hdr_size bytes are still available for pull in @skb. + * + * The packet may still get dropped. This can happen when the encapsulated + * ethernet frame is invalid or contains again an batman-adv packet. Also + * unicast packets will be dropped directly when it was sent between two + * isolated clients. + */ void batadv_interface_rx(struct net_device *soft_iface, struct sk_buff *skb, struct batadv_hard_iface *recv_if, int hdr_size, struct batadv_orig_node *orig_node) @@@ -408,17 -426,11 +426,17 @@@ */ nf_reset(skb);
+ if (unlikely(!pskb_may_pull(skb, ETH_HLEN))) + goto dropped; + vid = batadv_get_vid(skb, 0); ethhdr = eth_hdr(skb);
switch (ntohs(ethhdr->h_proto)) { case ETH_P_8021Q: + if (!pskb_may_pull(skb, VLAN_ETH_HLEN)) + goto dropped; + vhdr = (struct vlan_ethhdr *)skb->data;
if (vhdr->h_vlan_encapsulated_proto != ethertype) @@@ -430,6 -442,8 +448,6 @@@ }
/* skb->dev & skb->pkt_type are set here */ - if (unlikely(!pskb_may_pull(skb, ETH_HLEN))) - goto dropped; skb->protocol = eth_type_trans(skb, soft_iface);
/* should not be necessary anymore as we use skb_pull_rcsum() @@@ -543,7 -557,7 +561,7 @@@ struct batadv_softif_vlan *batadv_softi }
/** - * batadv_create_vlan - allocate the needed resources for a new vlan + * batadv_softif_create_vlan - allocate the needed resources for a new vlan * @bat_priv: the bat priv with all the soft interface information * @vid: the VLAN identifier * diff --combined net/batman-adv/translation-table.c index 9b4551a,d44ce84..942b3aa --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@@ -215,8 -215,6 +215,8 @@@ static void batadv_tt_local_entry_relea tt_local_entry = container_of(ref, struct batadv_tt_local_entry, common.refcount);
+ batadv_softif_vlan_put(tt_local_entry->vlan); + kfree_rcu(tt_local_entry, common.rcu); }
@@@ -675,7 -673,6 +675,7 @@@ bool batadv_tt_local_add(struct net_dev kref_get(&tt_local->common.refcount); tt_local->last_seen = jiffies; tt_local->common.added_at = tt_local->last_seen; + tt_local->vlan = vlan;
/* the batman interface mac and multicast addresses should never be * purged @@@ -994,6 -991,7 +994,6 @@@ int batadv_tt_local_seq_print_text(stru struct batadv_tt_common_entry *tt_common_entry; struct batadv_tt_local_entry *tt_local; struct batadv_hard_iface *primary_if; - struct batadv_softif_vlan *vlan; struct hlist_head *head; unsigned short vid; u32 i; @@@ -1010,8 -1008,8 +1010,8 @@@ seq_printf(seq, "Locally retrieved addresses (from %s) announced via TT (TTVN: %u):\n", net_dev->name, (u8)atomic_read(&bat_priv->tt.vn)); - seq_printf(seq, " %-13s %s %-8s %-9s (%-10s)\n", "Client", "VID", - "Flags", "Last seen", "CRC"); + seq_puts(seq, + " Client VID Flags Last seen (CRC )\n");
for (i = 0; i < hash->size; i++) { head = &hash->table[i]; @@@ -1029,6 -1027,14 +1029,6 @@@ last_seen_msecs = last_seen_msecs % 1000;
no_purge = tt_common_entry->flags & np_flag; - - vlan = batadv_softif_vlan_get(bat_priv, vid); - if (!vlan) { - seq_printf(seq, "Cannot retrieve VLAN %d\n", - BATADV_PRINT_VID(vid)); - continue; - } - seq_printf(seq, " * %pM %4i [%c%c%c%c%c%c] %3u.%03u (%#.8x)\n", tt_common_entry->addr, @@@ -1046,7 -1052,9 +1046,7 @@@ BATADV_TT_CLIENT_ISOLA) ? 'I' : '.'), no_purge ? 0 : last_seen_secs, no_purge ? 0 : last_seen_msecs, - vlan->tt.crc); - - batadv_softif_vlan_put(vlan); + tt_local->vlan->tt.crc); } rcu_read_unlock(); } @@@ -1091,6 -1099,7 +1091,6 @@@ u16 batadv_tt_local_remove(struct batad { struct batadv_tt_local_entry *tt_local_entry; u16 flags, curr_flags = BATADV_NO_FLAGS; - struct batadv_softif_vlan *vlan; void *tt_entry_exists;
tt_local_entry = batadv_tt_local_hash_find(bat_priv, addr, vid); @@@ -1130,6 -1139,14 +1130,6 @@@ /* extra call to free the local tt entry */ batadv_tt_local_entry_put(tt_local_entry);
- /* decrease the reference held for this vlan */ - vlan = batadv_softif_vlan_get(bat_priv, vid); - if (!vlan) - goto out; - - batadv_softif_vlan_put(vlan); - batadv_softif_vlan_put(vlan); - out: if (tt_local_entry) batadv_tt_local_entry_put(tt_local_entry); @@@ -1202,6 -1219,7 +1202,6 @@@ static void batadv_tt_local_table_free( spinlock_t *list_lock; /* protects write access to the hash lists */ struct batadv_tt_common_entry *tt_common_entry; struct batadv_tt_local_entry *tt_local; - struct batadv_softif_vlan *vlan; struct hlist_node *node_tmp; struct hlist_head *head; u32 i; @@@ -1223,6 -1241,14 +1223,6 @@@ struct batadv_tt_local_entry, common);
- /* decrease the reference held for this vlan */ - vlan = batadv_softif_vlan_get(bat_priv, - tt_common_entry->vid); - if (vlan) { - batadv_softif_vlan_put(vlan); - batadv_softif_vlan_put(vlan); - } - batadv_tt_local_entry_put(tt_local); } spin_unlock_bh(list_lock); @@@ -1680,9 -1706,8 +1680,8 @@@ int batadv_tt_global_seq_print_text(str seq_printf(seq, "Globally announced TT entries received via the mesh %s\n", net_dev->name); - seq_printf(seq, " %-13s %s %s %-15s %s (%-10s) %s\n", - "Client", "VID", "(TTVN)", "Originator", "(Curr TTVN)", - "CRC", "Flags"); + seq_puts(seq, + " Client VID (TTVN) Originator (Curr TTVN) (CRC ) Flags\n");
for (i = 0; i < hash->size; i++) { head = &hash->table[i]; @@@ -3201,7 -3226,7 +3200,7 @@@ static void batadv_tt_purge(struct work struct batadv_priv_tt *priv_tt; struct batadv_priv *bat_priv;
- delayed_work = container_of(work, struct delayed_work, work); + delayed_work = to_delayed_work(work); priv_tt = container_of(delayed_work, struct batadv_priv_tt, work); bat_priv = container_of(priv_tt, struct batadv_priv, tt);
@@@ -3283,6 -3308,7 +3282,6 @@@ static void batadv_tt_local_purge_pendi struct batadv_hashtable *hash = bat_priv->tt.local_hash; struct batadv_tt_common_entry *tt_common; struct batadv_tt_local_entry *tt_local; - struct batadv_softif_vlan *vlan; struct hlist_node *node_tmp; struct hlist_head *head; spinlock_t *list_lock; /* protects write access to the hash lists */ @@@ -3312,6 -3338,13 +3311,6 @@@ struct batadv_tt_local_entry, common);
- /* decrease the reference held for this vlan */ - vlan = batadv_softif_vlan_get(bat_priv, tt_common->vid); - if (vlan) { - batadv_softif_vlan_put(vlan); - batadv_softif_vlan_put(vlan); - } - batadv_tt_local_entry_put(tt_local); } spin_unlock_bh(list_lock);
linux-merge@lists.open-mesh.org