Netdev List
 help / color / mirror / Atom feed
* [PATCH 7/9] batman-adv: Distributed ARP Table - add compile option
From: Antonio Quartulli @ 2012-11-03 18:48 UTC (permalink / raw)
  To: davem; +Cc: netdev, b.a.t.m.a.n, Antonio Quartulli
In-Reply-To: <1351968514-12357-1-git-send-email-ordex@autistici.org>

This patch makes it possible to decide whether to include DAT within the
batman-adv binary or not.
It is extremely useful when the user wants to reduce the size of the resulting
module by cutting off any not needed feature.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
 net/batman-adv/Kconfig                 | 14 ++++++--
 net/batman-adv/Makefile                |  2 +-
 net/batman-adv/debugfs.c               |  7 +++-
 net/batman-adv/distributed-arp-table.h | 65 ++++++++++++++++++++++++++++++++++
 net/batman-adv/types.h                 | 10 ++++++
 5 files changed, 94 insertions(+), 4 deletions(-)

diff --git a/net/batman-adv/Kconfig b/net/batman-adv/Kconfig
index e77f805..250e0b5 100644
--- a/net/batman-adv/Kconfig
+++ b/net/batman-adv/Kconfig
@@ -4,7 +4,7 @@
 
 config BATMAN_ADV
 	tristate "B.A.T.M.A.N. Advanced Meshing Protocol"
-	depends on NET && INET
+	depends on NET
 	select CRC16
         default n
 	help
@@ -16,7 +16,7 @@ config BATMAN_ADV
 
 config BATMAN_ADV_BLA
 	bool "Bridge Loop Avoidance"
-	depends on BATMAN_ADV
+	depends on BATMAN_ADV && INET
 	default y
 	help
 	  This option enables BLA (Bridge Loop Avoidance), a mechanism
@@ -25,6 +25,16 @@ config BATMAN_ADV_BLA
 	  more than one mesh node in the same LAN, you can safely remove
 	  this feature and save some space.
 
+config BATMAN_ADV_DAT
+	bool "Distributed ARP Table"
+	depends on BATMAN_ADV && INET
+	default n
+	help
+	  This option enables DAT (Distributed ARP Table), a DHT based
+	  mechanism that increases ARP reliability on sparse wireless
+	  mesh networks. If you think that your network does not need
+	  this option you can safely remove it and save some space.
+
 config BATMAN_ADV_DEBUG
 	bool "B.A.T.M.A.N. debugging"
 	depends on BATMAN_ADV
diff --git a/net/batman-adv/Makefile b/net/batman-adv/Makefile
index 7604159..e45e3b4 100644
--- a/net/batman-adv/Makefile
+++ b/net/batman-adv/Makefile
@@ -23,7 +23,7 @@ batman-adv-y += bat_iv_ogm.o
 batman-adv-y += bitarray.o
 batman-adv-$(CONFIG_BATMAN_ADV_BLA) += bridge_loop_avoidance.o
 batman-adv-y += debugfs.o
-batman-adv-y += distributed-arp-table.o
+batman-adv-$(CONFIG_BATMAN_ADV_DAT) += distributed-arp-table.o
 batman-adv-y += gateway_client.o
 batman-adv-y += gateway_common.o
 batman-adv-y += hard-interface.o
diff --git a/net/batman-adv/debugfs.c b/net/batman-adv/debugfs.c
index ebc5f4d..3f679cb 100644
--- a/net/batman-adv/debugfs.c
+++ b/net/batman-adv/debugfs.c
@@ -281,6 +281,7 @@ static int batadv_bla_backbone_table_open(struct inode *inode,
 
 #endif
 
+#ifdef CONFIG_BATMAN_ADV_DAT
 /**
  * batadv_dat_cache_open - Prepare file handler for reads from dat_chache
  * @inode: inode which was opened
@@ -291,7 +292,7 @@ static int batadv_dat_cache_open(struct inode *inode, struct file *file)
 	struct net_device *net_dev = (struct net_device *)inode->i_private;
 	return single_open(file, batadv_dat_cache_seq_print_text, net_dev);
 }
-
+#endif
 
 static int batadv_transtable_local_open(struct inode *inode, struct file *file)
 {
@@ -332,7 +333,9 @@ static BATADV_DEBUGINFO(bla_claim_table, S_IRUGO, batadv_bla_claim_table_open);
 static BATADV_DEBUGINFO(bla_backbone_table, S_IRUGO,
 			batadv_bla_backbone_table_open);
 #endif
+#ifdef CONFIG_BATMAN_ADV_DAT
 static BATADV_DEBUGINFO(dat_cache, S_IRUGO, batadv_dat_cache_open);
+#endif
 static BATADV_DEBUGINFO(transtable_local, S_IRUGO,
 			batadv_transtable_local_open);
 static BATADV_DEBUGINFO(vis_data, S_IRUGO, batadv_vis_data_open);
@@ -345,7 +348,9 @@ static struct batadv_debuginfo *batadv_mesh_debuginfos[] = {
 	&batadv_debuginfo_bla_claim_table,
 	&batadv_debuginfo_bla_backbone_table,
 #endif
+#ifdef CONFIG_BATMAN_ADV_DAT
 	&batadv_debuginfo_dat_cache,
+#endif
 	&batadv_debuginfo_transtable_local,
 	&batadv_debuginfo_vis_data,
 	NULL,
diff --git a/net/batman-adv/distributed-arp-table.h b/net/batman-adv/distributed-arp-table.h
index 01308ce..fdb3522 100644
--- a/net/batman-adv/distributed-arp-table.h
+++ b/net/batman-adv/distributed-arp-table.h
@@ -20,6 +20,8 @@
 #ifndef _NET_BATMAN_ADV_ARP_H_
 #define _NET_BATMAN_ADV_ARP_H_
 
+#ifdef CONFIG_BATMAN_ADV_DAT
+
 #include "types.h"
 #include "originator.h"
 
@@ -72,4 +74,67 @@ int batadv_dat_init(struct batadv_priv *bat_priv);
 void batadv_dat_free(struct batadv_priv *bat_priv);
 int batadv_dat_cache_seq_print_text(struct seq_file *seq, void *offset);
 
+#else
+
+static inline bool
+batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv,
+				      struct sk_buff *skb)
+{
+	return false;
+}
+
+static inline bool
+batadv_dat_snoop_incoming_arp_request(struct batadv_priv *bat_priv,
+				      struct sk_buff *skb, int hdr_size)
+{
+	return false;
+}
+
+static inline bool
+batadv_dat_snoop_outgoing_arp_reply(struct batadv_priv *bat_priv,
+				    struct sk_buff *skb)
+{
+	return false;
+}
+
+static inline bool
+batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv,
+				    struct sk_buff *skb, int hdr_size)
+{
+	return false;
+}
+
+static inline bool
+batadv_dat_drop_broadcast_packet(struct batadv_priv *bat_priv,
+				 struct batadv_forw_packet *forw_packet)
+{
+	return false;
+}
+
+static inline void
+batadv_dat_init_orig_node_addr(struct batadv_orig_node *orig_node)
+{
+}
+
+static inline void batadv_dat_init_own_addr(struct batadv_priv *bat_priv,
+					    struct batadv_hard_iface *iface)
+{
+}
+
+static inline void batadv_arp_change_timeout(struct net_device *soft_iface,
+					     const char *name)
+{
+}
+
+static inline int batadv_dat_init(struct batadv_priv *bat_priv)
+{
+	return 0;
+}
+
+static inline void batadv_dat_free(struct batadv_priv *bat_priv)
+{
+}
+
+#endif /* CONFIG_BATMAN_ADV_DAT */
+
 #endif /* _NET_BATMAN_ADV_ARP_H_ */
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 9ed1bb2..00d3093 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -28,6 +28,8 @@
 	(ETH_HLEN + max(sizeof(struct batadv_unicast_packet), \
 			sizeof(struct batadv_bcast_packet)))
 
+#ifdef CONFIG_BATMAN_ADV_DAT
+
 /* batadv_dat_addr_t is the type used for all DHT addresses. If it is changed,
  * BATADV_DAT_ADDR_MAX is changed as well.
  *
@@ -35,6 +37,8 @@
  */
 #define batadv_dat_addr_t uint16_t
 
+#endif /* CONFIG_BATMAN_ADV_DAT */
+
 /**
  * struct batadv_hard_iface_bat_iv - per hard interface B.A.T.M.A.N. IV data
  * @ogm_buff: buffer holding the OGM packet
@@ -80,7 +84,9 @@ struct batadv_orig_node {
 	uint8_t orig[ETH_ALEN];
 	uint8_t primary_addr[ETH_ALEN];
 	struct batadv_neigh_node __rcu *router; /* rcu protected pointer */
+#ifdef CONFIG_BATMAN_ADV_DAT
 	batadv_dat_addr_t dat_addr;
+#endif
 	unsigned long *bcast_own;
 	uint8_t *bcast_own_sum;
 	unsigned long last_seen;
@@ -252,11 +258,13 @@ struct batadv_priv_vis {
  * @hash: hashtable representing the local ARP cache
  * @work: work queue callback item for cache purging
  */
+#ifdef CONFIG_BATMAN_ADV_DAT
 struct batadv_priv_dat {
 	batadv_dat_addr_t addr;
 	struct batadv_hashtable *hash;
 	struct delayed_work work;
 };
+#endif
 
 struct batadv_priv {
 	atomic_t mesh_state;
@@ -295,7 +303,9 @@ struct batadv_priv {
 	struct batadv_priv_gw gw;
 	struct batadv_priv_tt tt;
 	struct batadv_priv_vis vis;
+#ifdef CONFIG_BATMAN_ADV_DAT
 	struct batadv_priv_dat dat;
+#endif
 };
 
 struct batadv_socket_client {
-- 
1.7.12.4

^ permalink raw reply related

* [PATCH 8/9] batman-adv: Distributed ARP Table - add runtime switch
From: Antonio Quartulli @ 2012-11-03 18:48 UTC (permalink / raw)
  To: davem; +Cc: netdev, b.a.t.m.a.n, Antonio Quartulli
In-Reply-To: <1351968514-12357-1-git-send-email-ordex@autistici.org>

This patch adds a runtime switch that enables the user to turn the DAT feature
on or off at runtime

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
 net/batman-adv/distributed-arp-table.c | 18 ++++++++++++++++++
 net/batman-adv/soft-interface.c        |  3 +++
 net/batman-adv/sysfs.c                 |  7 +++++++
 net/batman-adv/types.h                 |  3 +++
 4 files changed, 31 insertions(+)

diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
index f43bf8e..c1a74a1 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -621,6 +621,9 @@ out:
  */
 static void batadv_dat_hash_free(struct batadv_priv *bat_priv)
 {
+	if (!bat_priv->dat.hash)
+		return;
+
 	__batadv_dat_purge(bat_priv, NULL);
 
 	batadv_hash_destroy(bat_priv->dat.hash);
@@ -790,6 +793,9 @@ bool batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv,
 	struct sk_buff *skb_new;
 	struct batadv_hard_iface *primary_if = NULL;
 
+	if (!atomic_read(&bat_priv->distributed_arp_table))
+		goto out;
+
 	type = batadv_arp_get_type(bat_priv, skb, 0);
 	/* If the node gets an ARP_REQUEST it has to send a DHT_GET unicast
 	 * message to the selected DHT candidates
@@ -861,6 +867,9 @@ bool batadv_dat_snoop_incoming_arp_request(struct batadv_priv *bat_priv,
 	bool ret = false;
 	int err;
 
+	if (!atomic_read(&bat_priv->distributed_arp_table))
+		goto out;
+
 	type = batadv_arp_get_type(bat_priv, skb, hdr_size);
 	if (type != ARPOP_REQUEST)
 		goto out;
@@ -924,6 +933,9 @@ void batadv_dat_snoop_outgoing_arp_reply(struct batadv_priv *bat_priv,
 	__be32 ip_src, ip_dst;
 	uint8_t *hw_src, *hw_dst;
 
+	if (!atomic_read(&bat_priv->distributed_arp_table))
+		return;
+
 	type = batadv_arp_get_type(bat_priv, skb, 0);
 	if (type != ARPOP_REPLY)
 		return;
@@ -959,6 +971,9 @@ bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv,
 	uint8_t *hw_src, *hw_dst;
 	bool ret = false;
 
+	if (!atomic_read(&bat_priv->distributed_arp_table))
+		goto out;
+
 	type = batadv_arp_get_type(bat_priv, skb, hdr_size);
 	if (type != ARPOP_REPLY)
 		goto out;
@@ -1003,6 +1018,9 @@ bool batadv_dat_drop_broadcast_packet(struct batadv_priv *bat_priv,
 	bool ret = false;
 	const size_t bcast_len = sizeof(struct batadv_bcast_packet);
 
+	if (!atomic_read(&bat_priv->distributed_arp_table))
+		goto out;
+
 	/* If this packet is an ARP_REQUEST and the node already has the
 	 * information that it is going to ask, then the packet can be dropped
 	 */
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 9dc0ae1..7b4a3a3 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -480,6 +480,9 @@ struct net_device *batadv_softif_create(const char *name)
 	atomic_set(&bat_priv->aggregated_ogms, 1);
 	atomic_set(&bat_priv->bonding, 0);
 	atomic_set(&bat_priv->bridge_loop_avoidance, 0);
+#ifdef CONFIG_BATMAN_ADV_DAT
+	atomic_set(&bat_priv->distributed_arp_table, 1);
+#endif
 	atomic_set(&bat_priv->ap_isolation, 0);
 	atomic_set(&bat_priv->vis_mode, BATADV_VIS_TYPE_CLIENT_UPDATE);
 	atomic_set(&bat_priv->gw_mode, BATADV_GW_MODE_OFF);
diff --git a/net/batman-adv/sysfs.c b/net/batman-adv/sysfs.c
index 42cd09e..fa3cc1a 100644
--- a/net/batman-adv/sysfs.c
+++ b/net/batman-adv/sysfs.c
@@ -20,6 +20,7 @@
 #include "main.h"
 #include "sysfs.h"
 #include "translation-table.h"
+#include "distributed-arp-table.h"
 #include "originator.h"
 #include "hard-interface.h"
 #include "gateway_common.h"
@@ -420,6 +421,9 @@ BATADV_ATTR_SIF_BOOL(bonding, S_IRUGO | S_IWUSR, NULL);
 #ifdef CONFIG_BATMAN_ADV_BLA
 BATADV_ATTR_SIF_BOOL(bridge_loop_avoidance, S_IRUGO | S_IWUSR, NULL);
 #endif
+#ifdef CONFIG_BATMAN_ADV_DAT
+BATADV_ATTR_SIF_BOOL(distributed_arp_table, S_IRUGO | S_IWUSR, NULL);
+#endif
 BATADV_ATTR_SIF_BOOL(fragmentation, S_IRUGO | S_IWUSR, batadv_update_min_mtu);
 BATADV_ATTR_SIF_BOOL(ap_isolation, S_IRUGO | S_IWUSR, NULL);
 static BATADV_ATTR(vis_mode, S_IRUGO | S_IWUSR, batadv_show_vis_mode,
@@ -445,6 +449,9 @@ static struct batadv_attribute *batadv_mesh_attrs[] = {
 #ifdef CONFIG_BATMAN_ADV_BLA
 	&batadv_attr_bridge_loop_avoidance,
 #endif
+#ifdef CONFIG_BATMAN_ADV_DAT
+	&batadv_attr_distributed_arp_table,
+#endif
 	&batadv_attr_fragmentation,
 	&batadv_attr_ap_isolation,
 	&batadv_attr_vis_mode,
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 00d3093..0afeb2b 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -275,6 +275,9 @@ struct batadv_priv {
 	atomic_t fragmentation;		/* boolean */
 	atomic_t ap_isolation;		/* boolean */
 	atomic_t bridge_loop_avoidance;	/* boolean */
+#ifdef CONFIG_BATMAN_ADV_DAT
+	atomic_t distributed_arp_table;	/* boolean */
+#endif
 	atomic_t vis_mode;		/* VIS_TYPE_* */
 	atomic_t gw_mode;		/* GW_MODE_* */
 	atomic_t gw_sel_class;		/* uint */
-- 
1.7.12.4

^ permalink raw reply related

* [PATCH 9/9] batman-adv: Add get_ethtool_stats() support for DAT
From: Antonio Quartulli @ 2012-11-03 18:48 UTC (permalink / raw)
  To: davem; +Cc: netdev, b.a.t.m.a.n, Martin Hundebøll, Antonio Quartulli
In-Reply-To: <1351968514-12357-1-git-send-email-ordex@autistici.org>

From: Martin Hundebøll <martin@hundeboll.net>

Added additional counters for D.A.T.

Signed-off-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
 net/batman-adv/distributed-arp-table.c | 19 +++++++++++++++++--
 net/batman-adv/distributed-arp-table.h | 27 +++++++++++++++++++++++++++
 net/batman-adv/routing.c               |  8 +++++++-
 net/batman-adv/soft-interface.c        |  7 +++++++
 net/batman-adv/types.h                 |  7 +++++++
 5 files changed, 65 insertions(+), 3 deletions(-)

diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
index c1a74a1..8e1d89d 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -601,9 +601,22 @@ static bool batadv_dat_send_data(struct batadv_priv *bat_priv,
 		send_status = batadv_send_skb_packet(tmp_skb,
 						     neigh_node->if_incoming,
 						     neigh_node->addr);
-		if (send_status == NET_XMIT_SUCCESS)
+		if (send_status == NET_XMIT_SUCCESS) {
+			/* count the sent packet */
+			switch (packet_subtype) {
+			case BATADV_P_DAT_DHT_GET:
+				batadv_inc_counter(bat_priv,
+						   BATADV_CNT_DAT_GET_TX);
+				break;
+			case BATADV_P_DAT_DHT_PUT:
+				batadv_inc_counter(bat_priv,
+						   BATADV_CNT_DAT_PUT_TX);
+				break;
+			}
+
 			/* packet sent to a candidate: return true */
 			ret = true;
+		}
 free_neigh:
 		batadv_neigh_node_free_ref(neigh_node);
 free_orig:
@@ -909,8 +922,10 @@ bool batadv_dat_snoop_incoming_arp_request(struct batadv_priv *bat_priv,
 	else
 		err = batadv_unicast_send_skb(bat_priv, skb_new);
 
-	if (!err)
+	if (!err) {
+		batadv_inc_counter(bat_priv, BATADV_CNT_DAT_CACHED_REPLY_TX);
 		ret = true;
+	}
 out:
 	if (dat_entry)
 		batadv_dat_entry_free_ref(dat_entry);
diff --git a/net/batman-adv/distributed-arp-table.h b/net/batman-adv/distributed-arp-table.h
index fdb3522..d060c03 100644
--- a/net/batman-adv/distributed-arp-table.h
+++ b/net/batman-adv/distributed-arp-table.h
@@ -74,6 +74,28 @@ int batadv_dat_init(struct batadv_priv *bat_priv);
 void batadv_dat_free(struct batadv_priv *bat_priv);
 int batadv_dat_cache_seq_print_text(struct seq_file *seq, void *offset);
 
+/**
+ * batadv_dat_inc_counter - increment the correct DAT packet counter
+ * @bat_priv: the bat priv with all the soft interface information
+ * @subtype: the 4addr subtype of the packet to be counted
+ *
+ * Updates the ethtool statistics for the received packet if it is a DAT subtype
+ */
+static inline void batadv_dat_inc_counter(struct batadv_priv *bat_priv,
+					  uint8_t subtype)
+{
+	switch (subtype) {
+	case BATADV_P_DAT_DHT_GET:
+		batadv_inc_counter(bat_priv,
+				   BATADV_CNT_DAT_GET_RX);
+		break;
+	case BATADV_P_DAT_DHT_PUT:
+		batadv_inc_counter(bat_priv,
+				   BATADV_CNT_DAT_PUT_RX);
+		break;
+	}
+}
+
 #else
 
 static inline bool
@@ -135,6 +157,11 @@ static inline void batadv_dat_free(struct batadv_priv *bat_priv)
 {
 }
 
+static inline void batadv_dat_inc_counter(struct batadv_priv *bat_priv,
+					  uint8_t subtype)
+{
+}
+
 #endif /* CONFIG_BATMAN_ADV_DAT */
 
 #endif /* _NET_BATMAN_ADV_ARP_H_ */
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 1826699..3f21c09 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -985,15 +985,17 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,
 {
 	struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface);
 	struct batadv_unicast_packet *unicast_packet;
+	struct batadv_unicast_4addr_packet *unicast_4addr_packet;
 	int hdr_size = sizeof(*unicast_packet);
 	bool is4addr;
 
 	unicast_packet = (struct batadv_unicast_packet *)skb->data;
+	unicast_4addr_packet = (struct batadv_unicast_4addr_packet *)skb->data;
 
 	is4addr = unicast_packet->header.packet_type == BATADV_UNICAST_4ADDR;
 	/* the caller function should have already pulled 2 bytes */
 	if (is4addr)
-		hdr_size = sizeof(struct batadv_unicast_4addr_packet);
+		hdr_size = sizeof(*unicast_4addr_packet);
 
 	if (batadv_check_unicast_packet(skb, hdr_size) < 0)
 		return NET_RX_DROP;
@@ -1003,6 +1005,10 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,
 
 	/* packet for me */
 	if (batadv_is_my_mac(unicast_packet->dest)) {
+		if (is4addr)
+			batadv_dat_inc_counter(bat_priv,
+					       unicast_4addr_packet->subtype);
+
 		if (batadv_dat_snoop_incoming_arp_request(bat_priv, skb,
 							  hdr_size))
 			goto rx_success;
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 7b4a3a3..c283d87 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -625,6 +625,13 @@ static const struct {
 	{ "tt_response_rx" },
 	{ "tt_roam_adv_tx" },
 	{ "tt_roam_adv_rx" },
+#ifdef CONFIG_BATMAN_ADV_DAT
+	{ "dat_get_tx" },
+	{ "dat_get_rx" },
+	{ "dat_put_tx" },
+	{ "dat_put_rx" },
+	{ "dat_cached_reply_tx" },
+#endif
 };
 
 static void batadv_get_strings(struct net_device *dev, uint32_t stringset,
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 0afeb2b..8ce16c1 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -186,6 +186,13 @@ enum batadv_counters {
 	BATADV_CNT_TT_RESPONSE_RX,
 	BATADV_CNT_TT_ROAM_ADV_TX,
 	BATADV_CNT_TT_ROAM_ADV_RX,
+#ifdef CONFIG_BATMAN_ADV_DAT
+	BATADV_CNT_DAT_GET_TX,
+	BATADV_CNT_DAT_GET_RX,
+	BATADV_CNT_DAT_PUT_TX,
+	BATADV_CNT_DAT_PUT_RX,
+	BATADV_CNT_DAT_CACHED_REPLY_TX,
+#endif
 	BATADV_CNT_NUM,
 };
 
-- 
1.7.12.4

^ permalink raw reply related

* Re: [PATCH 0/4] usbnet: avoiding access auto-suspended device
From: David Miller @ 2012-11-03 18:52 UTC (permalink / raw)
  To: ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw
  Cc: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, oneukum-l3A5Bk7waGM,
	netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1351496709-26934-1-git-send-email-ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>

From: Ming Lei <ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Date: Mon, 29 Oct 2012 15:45:05 +0800

> Thip patchset avoids accessing auto-suspended device in ioctl path,
> which is generally triggered by some network utility(ethtool, ifconfig,
> ...)
> 
> Most of network devices have the problem, but as discussed in the
> thread:
> 
> 	http://marc.info/?t=135054860600003&r=1&w=2
> 
> the problem should be solved inside driver.
> 
> Considered that only smsc75xx and smsc95xx calls usbnet_read_cmd()
> and usbnet_write_cmd() inside its resume and suspend callback, the
> patcheset introduce the nopm version of the two functions which
> should be called only in the resume and suspend callback. So we
> can solve the problem by runtime resuming device before doing
> control message things.
> 
> The patchset is against 3.7.0-rc3-next-20121029, and has been tested
> OK on smsc95xx usbnet device.

This series doesn't apply against net-next, as there have been
changes to the smsc drivers meanwhile.

You'll need to respin this series against net-next.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [Patch net-next] ipv6: remove a useless NULL check
From: David Miller @ 2012-11-03 18:52 UTC (permalink / raw)
  To: amwang; +Cc: netdev
In-Reply-To: <1351482233-10712-1-git-send-email-amwang@redhat.com>

From: Cong Wang <amwang@redhat.com>
Date: Mon, 29 Oct 2012 11:43:53 +0800

> In dev_forward_change(), it is useless to check if idev->dev
> is NULL, it is always non-NULL here.
> 
> Reported-by: Fengguang Wu <fengguang.wu@intel.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <amwang@redhat.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] pktgen: clean up ktime_t helpers
From: David Miller @ 2012-11-03 18:52 UTC (permalink / raw)
  To: tglx; +Cc: dxchgb, xiyou.wangcong, shemminger, netdev
In-Reply-To: <alpine.LFD.2.02.1210281940220.2756@ionos>

From: Thomas Gleixner <tglx@linutronix.de>
Date: Sun, 28 Oct 2012 19:41:02 +0100 (CET)

> On Sun, 28 Oct 2012, Daniel Borkmann wrote:
> 
>> Some years ago, the ktime_t helper functions ktime_now() and ktime_lt()
>> have been introduced. Instead of defining them inside pktgen.c, they
>> should either use ktime_t library functions or, if not available, they
>> should be defined in ktime.h, so that also others can benefit from them.
>> ktime_compare() is introduced with a similar notion as in timespec_compare().
>> 
>> Signed-off-by: Daniel Borkmann <daniel.borkmann@tik.ee.ethz.ch>
>> Cc: Cong Wang <xiyou.wangcong@gmail.com>
>> Cc: Stephen Hemminger <shemminger@vyatta.com>
> 
> Acked-by: Thomas Gleixner <tglx@linutronix.de>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH v3] sctp: Clean up type-punning in sctp_cmd_t union
From: David Miller @ 2012-11-03 18:55 UTC (permalink / raw)
  To: nhorman; +Cc: netdev, vyasevich, linux-sctp
In-Reply-To: <1351535533-23402-1-git-send-email-nhorman@tuxdriver.com>

From: Neil Horman <nhorman@tuxdriver.com>
Date: Mon, 29 Oct 2012 14:32:13 -0400

> Lots of points in the sctp_cmd_interpreter function treat the sctp_cmd_t arg as
> a void pointer, even though they are written as various other types.  Theres no
> need for this as doing so just leads to possible type-punning issues that could
> cause crashes, and if we remain type-consistent we can actually just remove the
> void * member of the union entirely.
> 
> Change Notes:
> 
> v2)
> 	* Dropped chunk that modified SCTP_NULL to create a marker pattern
> 	 should anyone try to use a SCTP_NULL() assigned sctp_arg_t, Assigning
> 	 to .zero provides the same effect and should be faster, per Vlad Y.
> 
> v3)
> 	* Reverted part of V2, opting to use memset instead of .zero, so that
> 	 the entire union is initalized thus avoiding the i164 speculative load
> 	 problems previously encountered, per Dave M..  Also rewrote
> 	 SCTP_[NO]FORCE so as to use common infrastructure a little more
> 
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com

Applied, thanks.

^ permalink raw reply

* Re: [PATCH, RESEND] r8169: Kill SafeMtu macro
From: David Miller @ 2012-11-03 18:59 UTC (permalink / raw)
  To: kirr; +Cc: romieu, netdev
In-Reply-To: <20121029175512.GA13577@tugrik.mns.mnsspb.ru>

From: Kirill Smelkov <kirr@mns.spb.ru>
Date: Mon, 29 Oct 2012 21:55:12 +0400

> After d58d46b5 (r8169: jumbo fixes.) max frame len is stored in
> rtl_chip_infos[].jumbo_max for each chip and SafeMtu should be gone.
> 
> Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] ipv4: avoid a test in ip_rt_put()
From: David Miller @ 2012-11-03 19:00 UTC (permalink / raw)
  To: amwang; +Cc: eric.dumazet, netdev
In-Reply-To: <1351501746.8221.12.camel@cr0>

From: Cong Wang <amwang@redhat.com>
Date: Mon, 29 Oct 2012 17:09:06 +0800

> On Mon, 2012-10-29 at 09:33 +0100, Eric Dumazet wrote:
>> From: Eric Dumazet <edumazet@google.com>
>> 
>> We can save a test in ip_rt_put(), considering dst_release() accepts
>> a NULL parameter, and dst is first element in rtable.
>> 
>> Add a BUILD_BUG_ON() to catch any change that could break this
>> assertion.
>> 
>> Signed-off-by: Eric Dumazet <edumazet@google.com>
>> Cc: Cong Wang <amwang@redhat.com>
> 
> Acked-by: Cong Wang <amwang@redhat.com>

Applied.

^ permalink raw reply

* Re: [Patch net-next v2] ipv6: introduce ip6_rt_put()
From: David Miller @ 2012-11-03 19:00 UTC (permalink / raw)
  To: amwang; +Cc: netdev, eric.dumazet
In-Reply-To: <1351505599-21096-1-git-send-email-amwang@redhat.com>

From: Cong Wang <amwang@redhat.com>
Date: Mon, 29 Oct 2012 18:13:19 +0800

> V2:
> fix a typo
> more dst_release() -> ip6_rt_put()
> 
> As suggested by Eric, we could introduce a helper function
> for ipv6 too, to avoid checking if rt is NULL before
> dst_release().
> 
> Cc: Eric Dumazet <eric.dumazet@gmail.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <amwang@redhat.com>

Applied.

^ permalink raw reply

* Re: [Patch net-next] ipv6: use IS_ENABLED()
From: David Miller @ 2012-11-03 19:03 UTC (permalink / raw)
  To: amwang; +Cc: netdev
In-Reply-To: <1351563790-10445-1-git-send-email-amwang@redhat.com>

From: Cong Wang <amwang@redhat.com>
Date: Tue, 30 Oct 2012 10:23:10 +0800

> #if defined(CONFIG_FOO) || defined(CONFIG_FOO_MODULE)
> 
> can be replaced by
> 
> #if IS_ENABLED(CONFIG_FOO)
> 
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <amwang@redhat.com>

Applied.

^ permalink raw reply

* Re: [Patch net-next] vlan: use IS_ENABLED()
From: David Miller @ 2012-11-03 19:03 UTC (permalink / raw)
  To: amwang; +Cc: netdev
In-Reply-To: <1351567348-15229-1-git-send-email-amwang@redhat.com>

From: Cong Wang <amwang@redhat.com>
Date: Tue, 30 Oct 2012 11:22:28 +0800

> #if defined(CONFIG_FOO) || defined(CONFIG_FOO_MODULE)
> 
> can be replaced by
> 
> #if IS_ENABLED(CONFIG_FOO)
> 
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <amwang@redhat.com>

Applied.

^ permalink raw reply

* Re: [PATCH] net/at91_ether: fix the use of macb structure
From: David Miller @ 2012-11-03 19:04 UTC (permalink / raw)
  To: nicolas.ferre
  Cc: netdev, havard, bhutchings, linux-arm-kernel, plagnioj,
	patrice.vilchez, linux-kernel, manabian
In-Reply-To: <1351596628-3405-1-git-send-email-nicolas.ferre@atmel.com>

From: Nicolas Ferre <nicolas.ferre@atmel.com>
Date: Tue, 30 Oct 2012 12:30:28 +0100

> Due to the use of common structure in at91_ether and macb drivers,
> change the name of DMA descriptor structures in at91_ether as well:
> dma_desc => macb_dma_desc
> 
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>

This does not apply to net-next, respin it if this change is
still relevant.

^ permalink raw reply

* Re: [PATCH] if_ether.h: add B.A.T.M.A.N.-Advanced Ethertype
From: David Miller @ 2012-11-03 19:05 UTC (permalink / raw)
  To: ordex-GaUfNO9RBHfsrOwW+9ziJQ
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r
In-Reply-To: <1351606121-2405-1-git-send-email-ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>

From: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
Date: Tue, 30 Oct 2012 15:08:41 +0100

> Add Ethertype 0x4305 (not an officially registered id).
> This Ethertype is used by every frame generated by B.A.T.M.A.N.-Advanced. Its
> definition is currently batman-adv local only and since it is not officially
> registered it is better to make its definition kernel-wide so that we avoid
> collisions given by future unofficial uses of the same Ethertype.
> 
> Signed-off-by: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>

Applied.

^ permalink raw reply

* Re: [PATCH 3/3] tipc: do not use tasklet_disable before tasklet_kill
From: David Miller @ 2012-11-03 19:15 UTC (permalink / raw)
  To: xtfeng
  Cc: linux-kernel, dannyfeng, jon.maloy, allan.stephens, netdev,
	tipc-discussion
In-Reply-To: <1351670761-26749-3-git-send-email-xtfeng@gmail.com>

From: Xiaotian Feng <xtfeng@gmail.com>
Date: Wed, 31 Oct 2012 16:06:01 +0800

> If tasklet_disable() is called before related tasklet handled,
> tasklet_kill will never be finished. tasklet_kill is enough.
> 
> Signed-off-by: Xiaotian Feng <dannyfeng@tencent.com>

Applied.

^ permalink raw reply

* Re: [PATCH] drivers/net: use tasklet_kill in device remove/close process
From: David Miller @ 2012-11-03 19:16 UTC (permalink / raw)
  To: xtfeng; +Cc: linux-kernel, dannyfeng, netdev
In-Reply-To: <1351679397-26994-1-git-send-email-xtfeng@gmail.com>

From: Xiaotian Feng <xtfeng@gmail.com>
Date: Wed, 31 Oct 2012 18:29:57 +0800

> Some driver uses tasklet_disable in device remove/close process,
> tasklet_disable will inc tasklet->count and return. If the tasklet
> is not handled yet because some softirq pressure, the tasklet will
> placed on the tasklet_vec, never have a chance to excute. This might
> lead to ksoftirqd heavy loaded, wakeup with pending_softirq, but
> tasklet is disabled. tasklet_kill should be used in this case.
> 
> Signed-off-by: Xiaotian Feng <dannyfeng@tencent.com>

Applied.

^ permalink raw reply

* Re: [RFC] net: netlink -- Allow netlink_dump to return error code if protocol handler is missed
From: Cyrill Gorcunov @ 2012-11-03 19:16 UTC (permalink / raw)
  To: Pavel Emelyanov; +Cc: NETDEV, David Miller, Eric Dumazet
In-Reply-To: <20121103163958.GB6055@moon>

On Sat, Nov 03, 2012 at 08:39:58PM +0400, Cyrill Gorcunov wrote:
> On Sat, Nov 03, 2012 at 08:17:50PM +0400, Pavel Emelyanov wrote:
> > >  static int inet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb)
> > > Index: linux-2.6.git/net/netlink/af_netlink.c
> > > ===================================================================
> > > --- linux-2.6.git.orig/net/netlink/af_netlink.c
> > > +++ linux-2.6.git/net/netlink/af_netlink.c
> > > @@ -1740,6 +1740,10 @@ static int netlink_dump(struct sock *sk)
> > >  		else
> > >  			__netlink_sendskb(sk, skb);
> > >  		return 0;
> > > +	} else if (len < 0) {
> > > +		err = len;
> > > +		nlk->cb = NULL;
> > > +		goto errout_skb;
> > 
> > When family-level handler is absent and sock_diag returns error this error
> > gets propagated back to user without this fix. Why do we need it in case
> > we return error from protocol-level handler?
> 
> Because as far as I can say the family-level handler already has such error
> returning code in __sock_diag_rcv_msg. Or you mean something else?

OK, it seems I got what you mean, cooking/testing new patch.

^ permalink raw reply

* Re: [PATCH v2] r8169: Fix WoL on RTL8168d/8111d.
From: David Miller @ 2012-11-03 19:16 UTC (permalink / raw)
  To: romieu; +Cc: kibi, netdev, nic_swsd, hayeswang, linux-kernel, florent.fourcot
In-Reply-To: <20121101222113.GB7708@electric-eye.fr.zoreil.com>

From: Francois Romieu <romieu@fr.zoreil.com>
Date: Thu, 1 Nov 2012 23:21:13 +0100

> Cyril Brulebois <kibi@debian.org> :
>> This regression was spotted between Debian squeeze and Debian wheezy
>> kernels (respectively based on 2.6.32 and 3.2). More info about
>> Wake-on-LAN issues with Realtek's 816x chipsets can be found in the
>> following thread: http://marc.info/?t=132079219400004
> 
> David, please apply to -net.

Done.

^ permalink raw reply

* Re: [PATCH 1/9] batman-adv: add UNICAST_4ADDR packet type
From: David Miller @ 2012-11-03 19:22 UTC (permalink / raw)
  To: ordex-GaUfNO9RBHfsrOwW+9ziJQ
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r
In-Reply-To: <1351968514-12357-2-git-send-email-ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>

From: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
Date: Sat,  3 Nov 2012 19:48:26 +0100

> The current unicast packet type does not contain the orig source address. This
> patches add a new unicast packet (called UNICAST_4ADDR) which provides two new
> fields: the originator source address and the subtype (the type of the data
> contained in the packet payload). The former is useful to identify the node
> which injected the packet into the network and the latter is useful to avoid
> creating new unicast packet types in the future: a macro defining a new subtype
> will be enough.
> 
> Signed-off-by: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>

Your packet layouts are very poorly designed and I want you to stop
and think seriously about things before extending things further.

All of this __packed stuff is a serious problem.

It means that on RISC system, fields such as your 32-bit sequence
number, will be read and written using byte loads and stores.

This is terrible.

Instead, design the structures so that they are full filled out to
at least 4 byte boundaries, so that they and the contents after
them, are 4 byte aligned too.

Then you won't need to mark all of your packet header structs
with __packed, and therefore the compiler can use full 32-bit
loads and stores to access 32-bit fields.

I'm not applying this series, sorry, it just continues a major
problem that the batman-adv code already has.

^ permalink raw reply

* Re: [PATCH 1/1] smsc75xx: add wol support for more frame types
From: David Miller @ 2012-11-03 19:24 UTC (permalink / raw)
  To: steve.glendinning; +Cc: netdev
In-Reply-To: <1351619192-11022-2-git-send-email-steve.glendinning@shawell.net>

From: Steve Glendinning <steve.glendinning@shawell.net>
Date: Tue, 30 Oct 2012 17:46:32 +0000

> This patch adds support for wol wakeup on unicast, broadcast,
> multicast and arp frames.
> 
> Signed-off-by: Steve Glendinning <steve.glendinning@shawell.net>

Applied.

^ permalink raw reply

* Re: [PATCH] vxlan: allow a user to set TTL value
From: David Miller @ 2012-11-03 19:25 UTC (permalink / raw)
  To: bernat; +Cc: shemminger, netdev
In-Reply-To: <1351628836-23094-1-git-send-email-bernat@luffy.cx>

From: Vincent Bernat <bernat@luffy.cx>
Date: Tue, 30 Oct 2012 21:27:16 +0100

> "ip link add ... type vxlan ... ttl X" allows a user to set the TTL
> used by a VXLAN for encapsulation. The provided value was ignored by
> vxlan module and the default value of 1 was used when encapsulating
> multicast packets.
> 
> Signed-off-by: Vincent Bernat <bernat@luffy.cx>

Applied net-next.

^ permalink raw reply

* Re: [PATCH net-next V3] htb: improved accuracy at high rates
From: David Miller @ 2012-11-03 19:25 UTC (permalink / raw)
  To: j.vimal; +Cc: jhs, eric.dumazet, netdev
In-Reply-To: <1351699451-79317-1-git-send-email-j.vimal@gmail.com>

From: Vimalkumar <j.vimal@gmail.com>
Date: Wed, 31 Oct 2012 09:04:11 -0700

> Current HTB (and TBF) uses rate table computed by the "tc"
> userspace program, which has the following issue:
> 
> The rate table has 256 entries to map packet lengths
> to token (time units).  With TSO sized packets, the
> 256 entry granularity leads to loss/gain of rate,
> making the token bucket inaccurate.
> 
> Thus, instead of relying on rate table, this patch
> explicitly computes the time and accounts for packet
> transmission times with nanosecond granularity.
> 
> This greatly improves accuracy of HTB with a wide
> range of packet sizes.
 ...
> Signed-off-by: Vimalkumar <j.vimal@gmail.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH net 1/1] r8169: allow multicast packets on sub-8168f chipset.
From: David Miller @ 2012-11-03 19:27 UTC (permalink / raw)
  To: romieu; +Cc: netdev, hayeswang, faceprint
In-Reply-To: <20121101220847.GA7708@electric-eye.fr.zoreil.com>

From: Francois Romieu <romieu@fr.zoreil.com>
Date: Thu, 1 Nov 2012 23:08:47 +0100

> From: Nathan Walp <faceprint@faceprint.com>
> 
> RTL_GIGA_MAC_VER_35 includes no multicast hardware filter.
> 
> Signed-off-by: Nathan Walp <faceprint@faceprint.com>
> Suggested-by: Hayes Wang <hayeswang@realtek.com>
> Acked-by: Francois Romieu <romieu@fr.zoreil.com>

Applied.

^ permalink raw reply

* Re: [net] ptp: update adjfreq callback description
From: David Miller @ 2012-11-03 19:27 UTC (permalink / raw)
  To: jeffrey.t.kirsher
  Cc: jacob.e.keller, netdev, gospo, sassmann, stable, richard.cochran,
	john.stultz
In-Reply-To: <1351809016-29237-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu,  1 Nov 2012 15:30:16 -0700

> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> This patch updates the adjfreq callback description to include a note that the
> delta in ppb is always relative to the base frequency, and not to the current
> frequency of the hardware clock.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> CC: stable@vger.kernel.org [v3.5+]
> CC: Richard Cochran <richard.cochran@gmail.com>
> CC: John Stultz <john.stultz@linaro.org>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Applied.

^ permalink raw reply

* Re: [net PATCH] rtnetlink: Use nlmsg type RTM_NEWNEIGH from dflt fdb dump
From: David Miller @ 2012-11-03 19:27 UTC (permalink / raw)
  To: john.r.fastabend; +Cc: netdev
In-Reply-To: <20121102022310.2692.60718.stgit@jf-dev1-dcblab>

From: John Fastabend <john.r.fastabend@intel.com>
Date: Thu, 01 Nov 2012 19:23:10 -0700

> Change the dflt fdb dump handler to use RTM_NEWNEIGH to
> be compatible with bridge dump routines.
> 
> The dump reply from the network driver handlers should
> match the reply from bridge handler. The fact they were
> not in the ixgbe case was effectively a bug. This patch
> resolves it.
> 
> Applications that were not checking the nlmsg type will
> continue to work. And now applications that do check
> the type will work as expected.
> 
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>

Applied.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox