The following commit has been merged in the master branch:
commit a2f8a49168d145e30f12523badfaaea32207ddf4
Author: Andrew Lunn <andrew(a)lunn.ch>
Date: Mon Mar 21 21:31:44 2011 +0100
batman-adv: Set the txqueuelen to zero when creating soft interface.
Like other virtual interfaces, e.g. br0, we don't need a transmit
queue. Packets should only be queued on real interfaces which are
underneath. In practice this patch makes little difference since the
virtual interfaces can accept packets as fast as they come, but the
patch will avoid bufferbloat questions to the mailling lists in the
future.
Signed-off-by: Andrew Lunn <andrew(a)lunn.ch>
Tested-by: Linus Luesing <linus.luessing(a)web.de>
diff --git a/soft-interface.c b/soft-interface.c
index cdc165e..599b668 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -584,6 +584,7 @@ static void interface_setup(struct net_device *dev)
dev->hard_start_xmit = interface_tx;
#endif
dev->destructor = free_netdev;
+ dev->tx_queue_len = 0;
/**
* can't call min_mtu, because the needed variables
--
batman-adv
The annotated tag, v2.6.39-rc1 has been created
at 5cb75c01f17f69d6ac102d58766f7fb30269a5c9 (tag)
tagging 0ce790e7d736cedc563e1fb4e998babf5a4dbc3d (commit)
replaces v2.6.38
tagged by Linus Torvalds
on Tue Mar 29 12:10:03 2011 -0700
- Shortlog ------------------------------------------------------------
Linux 2.6.39-rc1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
iEYEABECAAYFAk2SLo8ACgkQF3YsRnbiHLsrPgCdFyBjeZkygjGmtFgZ9zgMVT1c
504AoIv+MMQo0yKjuVjlv9JyGb5M3ze2
=h6kQ
-----END PGP SIGNATURE-----
David S. Miller (4):
Merge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-merge
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Merge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-merge
Merge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-merge
Jesper Juhl (1):
batman-adv: Remove two duplicate includes.
Linus Lüssing (6):
batman-adv: Remove duplicate types.h inclusions
batman-adv: Disallow originator addressing within mesh layer
batman-adv: Make bat_priv->curr_gw an rcu protected pointer
batman-adv: Increase orig_node refcount before releasing rcu read lock
batman-adv: Fix possible buffer overflow in softif neigh list output
batman-adv: Remove unused hdr_size variable in route_unicast_packet()
Marek Lindner (22):
batman-adv: Split combined variable declarations
batman-adv: protect neighbor nodes with reference counters
batman-adv: convert neighbor list to hlist
batman-adv: protect neighbor list with rcu locks
batman-adv: free neighbors when an interface is deactivated
batman-adv: protect neigh_nodes used outside of rcu_locks with refcounting
batman-adv: protect each hash row with rcu locks
batman-adv: protect originator nodes with reference counters
batman-adv: protect ogm counter arrays with spinlock
batman-adv: Correct rcu refcounting for neigh_node
batman-adv: Correct rcu refcounting for gw_node
batman-adv: Correct rcu refcounting for softif_neigh
batman-adv: Correct rcu refcounting for batman_if
batman-adv: protect bit operations to count OGMs with spinlock
batman-adv: make broadcast seqno operations atomic
batman-adv: separate ethernet comparing calls from hash functions
batman-adv: remove extra layer between hash and hash element - hash bucket
batman-adv: Correct rcu refcounting for orig_node
batman-adv: increase refcount in create_neighbor to be consistent
batman-adv: remove orig_hash spinlock
batman-adv: rename global if_list to hardif_list
batman-adv: rename batman_if struct to hard_iface
Simon Wunderlich (2):
batman-adv: remove unused parameters
batman-adv: protect bonding with rcu locks
Sven Eckelmann (9):
batman-adv: Create roughly equal sized fragments
batman-adv: Calculate correct size for merged packets
batman-adv: Remove dangling declaration of hash_remove_element
batman-adv: Remove unused definitions
batman-adv: Remove declaration of batman_skb_recv
batman-adv: Remove unused variables
batman-adv: Update copyright years
batman-adv: Use successive sequence numbers for fragments
batman-adv: Disallow regular interface as mesh device
-----------------------------------------------------------------------
--
linux integration
The annotated tag, v2.6.38 has been created
at fbeb94b65cf784ed8bf852131e28c9fb5c4c760f (tag)
tagging 521cb40b0c44418a4fd36dc633f575813d59a43d (commit)
replaces v2.6.38-rc8
tagged by Linus Torvalds
on Mon Mar 14 18:20:39 2011 -0700
- Shortlog ------------------------------------------------------------
Linux 2.6.38
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
iEYEABECAAYFAk1+vvAACgkQF3YsRnbiHLv73wCfd0FfWxbeALVU+DIXWKsjcS75
g1wAn1/01UHks0YLYZ74FUKOEK7gZQtP
=I8+2
-----END PGP SIGNATURE-----
-----------------------------------------------------------------------
--
linux integration
The following commit has been merged in the master branch:
commit cea7f61cc02ca8dc5a5eeb333b7870fc9db1dd19
Author: Linus Lüssing <linus.luessing(a)web.de>
Date: Mon Mar 14 22:43:27 2011 +0000
batman-adv: Move bonding / iface alternating router search to own functions
This decreases the size of find_router() by outsourcing the router
search for the bonding and interface alternating modes to their own sub
functions. This shall make it easier to keep track of the correct
refcounting later.
Signed-off-by: Linus Lüssing <linus.luessing(a)web.de>
diff --git a/routing.c b/routing.c
index c172f5d..f212abe 100644
--- a/routing.c
+++ b/routing.c
@@ -1092,6 +1092,106 @@ out:
return ret;
}
+/* In the bonding case, send the packets in a round
+ * robin fashion over the remaining interfaces.
+ *
+ * This method rotates the bonding list and increases the
+ * returned router's refcount. */
+static struct neigh_node *find_bond_router(struct orig_node *primary_orig,
+ struct hard_iface *recv_if)
+{
+ struct neigh_node *tmp_neigh_node;
+ struct neigh_node *router = NULL, *first_candidate = NULL;
+
+ rcu_read_lock();
+ list_for_each_entry_rcu(tmp_neigh_node, &primary_orig->bond_list,
+ bonding_list) {
+ if (!first_candidate)
+ first_candidate = tmp_neigh_node;
+
+ /* recv_if == NULL on the first node. */
+ if (tmp_neigh_node->if_incoming == recv_if)
+ continue;
+
+ if (!atomic_inc_not_zero(&tmp_neigh_node->refcount))
+ continue;
+
+ router = tmp_neigh_node;
+ break;
+ }
+
+ /* use the first candidate if nothing was found. */
+ if (!router && first_candidate &&
+ atomic_inc_not_zero(&first_candidate->refcount))
+ router = first_candidate;
+
+ if (!router)
+ goto out;
+
+ /* selected should point to the next element
+ * after the current router */
+ spin_lock_bh(&primary_orig->neigh_list_lock);
+ /* this is a list_move(), which unfortunately
+ * does not exist as rcu version */
+ list_del_rcu(&primary_orig->bond_list);
+ list_add_rcu(&primary_orig->bond_list,
+ &router->bonding_list);
+ spin_unlock_bh(&primary_orig->neigh_list_lock);
+
+out:
+ rcu_read_unlock();
+ return router;
+}
+
+/* Interface Alternating: Use the best of the
+ * remaining candidates which are not using
+ * this interface.
+ *
+ * Increases the returned router's refcount */
+static struct neigh_node *find_ifalter_router(struct orig_node *primary_orig,
+ struct hard_iface *recv_if)
+{
+ struct neigh_node *tmp_neigh_node;
+ struct neigh_node *router = NULL, *first_candidate = NULL;
+
+ rcu_read_lock();
+ list_for_each_entry_rcu(tmp_neigh_node, &primary_orig->bond_list,
+ bonding_list) {
+ if (!first_candidate)
+ first_candidate = tmp_neigh_node;
+
+ /* recv_if == NULL on the first node. */
+ if (tmp_neigh_node->if_incoming == recv_if)
+ continue;
+
+ if (!atomic_inc_not_zero(&tmp_neigh_node->refcount))
+ continue;
+
+ /* if we don't have a router yet
+ * or this one is better, choose it. */
+ if ((!router) ||
+ (tmp_neigh_node->tq_avg > router->tq_avg)) {
+ /* decrement refcount of
+ * previously selected router */
+ if (router)
+ neigh_node_free_ref(router);
+
+ router = tmp_neigh_node;
+ atomic_inc_not_zero(&router->refcount);
+ }
+
+ neigh_node_free_ref(tmp_neigh_node);
+ }
+
+ /* use the first candidate if nothing was found. */
+ if (!router && first_candidate &&
+ atomic_inc_not_zero(&first_candidate->refcount))
+ router = first_candidate;
+
+ rcu_read_unlock();
+ return router;
+}
+
/* find a suitable router for this originator, and use
* bonding if possible. increases the found neighbors
* refcount.*/
@@ -1101,7 +1201,7 @@ struct neigh_node *find_router(struct bat_priv *bat_priv,
{
struct orig_node *primary_orig_node;
struct orig_node *router_orig;
- struct neigh_node *router, *first_candidate, *tmp_neigh_node;
+ struct neigh_node *router;
static uint8_t zero_mac[ETH_ALEN] = {0, 0, 0, 0, 0, 0};
int bonding_enabled;
@@ -1157,82 +1257,12 @@ struct neigh_node *find_router(struct bat_priv *bat_priv,
* in. */
neigh_node_free_ref(router);
- first_candidate = NULL;
- router = NULL;
-
- if (bonding_enabled) {
- /* in the bonding case, send the packets in a round
- * robin fashion over the remaining interfaces. */
-
- list_for_each_entry_rcu(tmp_neigh_node,
- &primary_orig_node->bond_list, bonding_list) {
- if (!first_candidate)
- first_candidate = tmp_neigh_node;
- /* recv_if == NULL on the first node. */
- if (tmp_neigh_node->if_incoming != recv_if &&
- atomic_inc_not_zero(&tmp_neigh_node->refcount)) {
- router = tmp_neigh_node;
- break;
- }
- }
-
- /* use the first candidate if nothing was found. */
- if (!router && first_candidate &&
- atomic_inc_not_zero(&first_candidate->refcount))
- router = first_candidate;
- if (!router) {
- rcu_read_unlock();
- return NULL;
- }
-
- /* selected should point to the next element
- * after the current router */
- spin_lock_bh(&primary_orig_node->neigh_list_lock);
- /* this is a list_move(), which unfortunately
- * does not exist as rcu version */
- list_del_rcu(&primary_orig_node->bond_list);
- list_add_rcu(&primary_orig_node->bond_list,
- &router->bonding_list);
- spin_unlock_bh(&primary_orig_node->neigh_list_lock);
-
- } else {
- /* if bonding is disabled, use the best of the
- * remaining candidates which are not using
- * this interface. */
- list_for_each_entry_rcu(tmp_neigh_node,
- &primary_orig_node->bond_list, bonding_list) {
- if (!first_candidate)
- first_candidate = tmp_neigh_node;
-
- /* recv_if == NULL on the first node. */
- if (tmp_neigh_node->if_incoming == recv_if)
- continue;
-
- if (!atomic_inc_not_zero(&tmp_neigh_node->refcount))
- continue;
-
- /* if we don't have a router yet
- * or this one is better, choose it. */
- if ((!router) ||
- (tmp_neigh_node->tq_avg > router->tq_avg)) {
- /* decrement refcount of
- * previously selected router */
- if (router)
- neigh_node_free_ref(router);
-
- router = tmp_neigh_node;
- atomic_inc_not_zero(&router->refcount);
- }
-
- neigh_node_free_ref(tmp_neigh_node);
- }
+ if (bonding_enabled)
+ router = find_bond_router(primary_orig_node, recv_if);
+ else
+ router = find_ifalter_router(primary_orig_node, recv_if);
- /* use the first candidate if nothing was found. */
- if (!router && first_candidate &&
- atomic_inc_not_zero(&first_candidate->refcount))
- router = first_candidate;
- }
return_router:
rcu_read_unlock();
return router;
--
batman-adv