Stephen Hemminger | 1 Jan 2011 02:34
Favicon

[PATCH net-next] sky2: implement 64 bit stats

This implements 64 bit statistics support and fixes races when reading
counter values. The PHY counters can only be accessed 16 bits at a time,
so they are subject to carry races.

NB:
  * TX/RX counters are maintained in software because the the hardware packet count
    is only a 32 bit value.

  * Error counters are really only 32 bit.

  * Old 32 bit counter fields in dev->stats still used for some
    software counters

Signed-off-by: Stephen Hemminger <shemminger <at> vyatta.com>

---
 drivers/net/sky2.c |  100 ++++++++++++++++++++++++++++++++++-------------------
 drivers/net/sky2.h |    9 ++++
 2 files changed, 74 insertions(+), 35 deletions(-)

--- a/drivers/net/sky2.c	2010-12-29 11:22:13.557333420 -0800
+++ b/drivers/net/sky2.c	2010-12-29 14:39:35.694667578 -0800
 <at>  <at>  -1917,8 +1917,10  <at>  <at>  static void sky2_tx_complete(struct sky2
 			netif_printk(sky2, tx_done, KERN_DEBUG, dev,
 				     "tx done %u\n", idx);

-			dev->stats.tx_packets++;
-			dev->stats.tx_bytes += skb->len;
+			u64_stats_update_begin(&sky2->tx_stats.syncp);
+			++sky2->tx_stats.packets;
(Continue reading)

Paul Gortmaker | 1 Jan 2011 05:59
Favicon

[PATCH net-next 00/20] Delete more semi-useless stuff from TIPC.

There really isn't a lot to see here technically.  There is a bunch of
stuff in TIPC that I guess falls into the category of "seemed like a
good idea at the time", but is now just inactive or at best unstable
prototype code for things like slave nodes and routing features and
mulitcluster support.  My favourite is this one:

 ----------
config TIPC_CLUSTERS
       int "Maximum number of clusters in a zone"
       depends on TIPC_ADVANCED
       range 1 1
       default "1"
       help
         Specifies how many clusters can be supported in a TIPC zone.

         *** Currently TIPC only supports a single cluster per zone. ***
 ----------

The remaining commits are just de-uglifying what is left, fixing whitespace
crimes and other common errors typically picked up in janitor patches.

Thanks,
Paul.

-----------------

Allan Stephens (19):
  tipc: Remove prototype code for supporting multiple zones
  tipc: Remove prototype code for supporting slave nodes
  tipc: Remove prototype code for supporting inter-cluster routing
(Continue reading)

Paul Gortmaker | 1 Jan 2011 05:59
Favicon

[PATCH net-next 02/20] tipc: Remove prototype code for supporting slave nodes

From: Allan Stephens <Allan.Stephens <at> windriver.com>

Simplifies routines and data structures that were intended to allow
TIPC to support slave nodes (i.e. nodes that did not have links to
all of the other nodes in its cluster, forcing TIPC to route messages
that it could not deliver directly through a non-slave node).

Currently, TIPC supports only networks containing non-slave nodes,
so this code is unnecessary.

Note: The latest edition of the TIPC 2.0 Specification has eliminated
the concept of slave nodes entirely.

Signed-off-by: Allan Stephens <Allan.Stephens <at> windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker <at> windriver.com>
---
 include/linux/tipc_config.h |    4 +-
 net/tipc/addr.c             |    2 -
 net/tipc/addr.h             |   10 ---
 net/tipc/cluster.c          |  166 +++++-------------------------------------
 net/tipc/cluster.h          |    7 --
 net/tipc/config.c           |   21 +-----
 net/tipc/core.c             |    6 --
 net/tipc/core.h             |    1 -
 net/tipc/discover.c         |    4 -
 net/tipc/msg.h              |    2 +-
 net/tipc/node.c             |   59 ++++------------
 net/tipc/port.c             |    5 +-
 12 files changed, 40 insertions(+), 247 deletions(-)

(Continue reading)

Paul Gortmaker | 1 Jan 2011 05:59
Favicon

[PATCH net-next 09/20] tipc: rename dbg.[ch] to log.[ch]

From: Allan Stephens <Allan.Stephens <at> windriver.com>

As the first step in removing obsolete debugging code from TIPC the
files that implement TIPC's non-debug-related log buffer subsystem
are renamed to better reflect their true nature.

Signed-off-by: Allan Stephens <Allan.Stephens <at> windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker <at> windriver.com>
---
 net/tipc/Makefile |    2 +-
 net/tipc/core.h   |    2 +-
 net/tipc/dbg.c    |  432 -----------------------------------------------------
 net/tipc/dbg.h    |   67 --------
 net/tipc/link.h   |    2 +-
 net/tipc/log.c    |  428 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 net/tipc/log.h    |   67 ++++++++
 7 files changed, 498 insertions(+), 502 deletions(-)
 delete mode 100644 net/tipc/dbg.c
 delete mode 100644 net/tipc/dbg.h
 create mode 100644 net/tipc/log.c
 create mode 100644 net/tipc/log.h

diff --git a/net/tipc/Makefile b/net/tipc/Makefile
index d41cd11..521d24d 100644
--- a/net/tipc/Makefile
+++ b/net/tipc/Makefile
 <at>  <at>  -8,6 +8,6  <at>  <at>  tipc-y	+= addr.o bcast.o bearer.o config.o \
 	   core.o handler.o link.o discover.o msg.o  \
 	   name_distr.o  subscr.o name_table.o net.o  \
 	   netlink.o node.o node_subscr.o port.o ref.o  \
(Continue reading)

Paul Gortmaker | 1 Jan 2011 05:59
Favicon

[PATCH net-next 05/20] tipc: Eliminate use of user registry by configuration service

From: Allan Stephens <Allan.Stephens <at> windriver.com>

Simplifies TIPC's configuration service so that it no longer registers
its port with the user registry, since the service doesn't take advantage
of any of the registry's capabilities.

Signed-off-by: Allan Stephens <Allan.Stephens <at> windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker <at> windriver.com>
---
 net/tipc/config.c |   26 +++++++-------------------
 1 files changed, 7 insertions(+), 19 deletions(-)

diff --git a/net/tipc/config.c b/net/tipc/config.c
index bc51210..322367b 100644
--- a/net/tipc/config.c
+++ b/net/tipc/config.c
 <at>  <at>  -38,15 +38,9  <at>  <at> 
 #include "port.h"
 #include "link.h"
 #include "name_table.h"
-#include "user_reg.h"
 #include "config.h"

-struct manager {
-	u32 user_ref;
-	u32 port_ref;
-};
-
-static struct manager mng = { 0};
+static u32 config_port_ref;
(Continue reading)

Paul Gortmaker | 1 Jan 2011 05:59
Favicon

[PATCH net-next 08/20] tipc: Remove internal linked list of node objects

From: Allan Stephens <Allan.Stephens <at> windriver.com>

Eliminates a sorted list TIPC uses to keep track of the neighboring
nodes it has links to, since this duplicates information already present
in the internal array of node object pointers.

Signed-off-by: Allan Stephens <Allan.Stephens <at> windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker <at> windriver.com>
---
 net/tipc/node.c |   43 ++++++++++++++++---------------------------
 1 files changed, 16 insertions(+), 27 deletions(-)

diff --git a/net/tipc/node.c b/net/tipc/node.c
index 58e189b..31dcca9 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
 <at>  <at>  -43,9 +43,6  <at>  <at> 
 static void node_lost_contact(struct tipc_node *n_ptr);
 static void node_established_contact(struct tipc_node *n_ptr);

-/* sorted list of nodes within cluster */
-static struct tipc_node *tipc_nodes = NULL;
-
 static DEFINE_SPINLOCK(node_create_lock);

 u32 tipc_own_tag = 0;
 <at>  <at>  -63,21 +60,17  <at>  <at>  u32 tipc_own_tag = 0;
 struct tipc_node *tipc_node_create(u32 addr)
 {
 	struct tipc_node *n_ptr;
(Continue reading)

Paul Gortmaker | 1 Jan 2011 05:59
Favicon

[PATCH net-next 14/20] tipc: remove redundant #includes

From: Allan Stephens <Allan.Stephens <at> windriver.com>

Eliminates a number of #include statements that no longer serve any
useful purpose.

Signed-off-by: Allan Stephens <Allan.Stephens <at> windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker <at> windriver.com>
---
 net/tipc/addr.c       |    1 -
 net/tipc/bcast.c      |    1 -
 net/tipc/bearer.c     |    1 -
 net/tipc/config.c     |    1 -
 net/tipc/core.c       |    6 ------
 net/tipc/discover.c   |    2 --
 net/tipc/eth_media.c  |    4 ----
 net/tipc/msg.c        |    1 -
 net/tipc/name_distr.c |    1 -
 net/tipc/net.c        |    2 --
 net/tipc/node.c       |    1 -
 net/tipc/socket.c     |   11 -----------
 12 files changed, 0 insertions(+), 32 deletions(-)

diff --git a/net/tipc/addr.c b/net/tipc/addr.c
index 483868a..88463d9 100644
--- a/net/tipc/addr.c
+++ b/net/tipc/addr.c
 <at>  <at>  -35,7 +35,6  <at>  <at> 
  */

 #include "core.h"
(Continue reading)

Paul Gortmaker | 1 Jan 2011 05:59
Favicon

[PATCH net-next 13/20] tipc: Finish streamlining of debugging code

From: Allan Stephens <Allan.Stephens <at> windriver.com>

Completes the simplification of TIPC's debugging capabilities. By default
TIPC includes no debugging code, and any debugging code added by developers
that calls the dbg() and dbg_macros() is compiled out. If debugging support
is enabled, TIPC prints out some additional data about its internal state
when certain abnormal conditions occur, and any developer-added calls to the
TIPC debug macros are compiled in.

Signed-off-by: Allan Stephens <Allan.Stephens <at> windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker <at> windriver.com>
---
 net/tipc/Kconfig |   11 +++++++----
 net/tipc/core.h  |   47 +++++++++--------------------------------------
 net/tipc/log.c   |    4 +---
 net/tipc/msg.c   |    1 +
 4 files changed, 18 insertions(+), 45 deletions(-)

diff --git a/net/tipc/Kconfig b/net/tipc/Kconfig
index c02d3e9..0e7ce30 100644
--- a/net/tipc/Kconfig
+++ b/net/tipc/Kconfig
 <at>  <at>  -67,12 +67,15  <at>  <at>  config TIPC_LOG
 	  managed remotely via TIPC.

 config TIPC_DEBUG
-	bool "Enable debug messages"
+	bool "Enable debugging support"
 	default n
 	help
(Continue reading)

Paul Gortmaker | 1 Jan 2011 05:59
Favicon

[PATCH net-next 20/20] tipc: remove extraneous braces from single statements

From: Allan Stephens <Allan.Stephens <at> windriver.com>

Cleans up TIPC's source code to eliminate the presence of unnecessary
use of {} around single statements.

These changes are purely cosmetic and do not alter the operation of TIPC
in any way.

Signed-off-by: Allan Stephens <Allan.Stephens <at> windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker <at> windriver.com>
---
 net/tipc/bcast.c      |    6 ++----
 net/tipc/bearer.c     |    3 +--
 net/tipc/link.c       |   25 +++++++++----------------
 net/tipc/msg.c        |   15 ++++++---------
 net/tipc/name_table.c |    6 ++----
 net/tipc/port.c       |    6 ++----
 net/tipc/socket.c     |   14 +++++---------
 7 files changed, 27 insertions(+), 48 deletions(-)

diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index 99a1469..70ab5ef 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
 <at>  <at>  -196,9 +196,8  <at>  <at>  static void bclink_retransmit_pkt(u32 after, u32 to)
 	struct sk_buff *buf;

 	buf = bcl->first_out;
-	while (buf && less_eq(buf_seqno(buf), after)) {
+	while (buf && less_eq(buf_seqno(buf), after))
(Continue reading)

Paul Gortmaker | 1 Jan 2011 05:59
Favicon

[PATCH net-next 16/20] tipc: recode getsockopt error handling for better readability

The existing code for the copy to user and error handling at the
end of getsockopt isn't easy to follow, due to the excessive use
of if/else.  By simply using return where appropriate, it can be
made smaller and easier to follow at the same time.

Signed-off-by: Paul Gortmaker <paul.gortmaker <at> windriver.com>
---
 net/tipc/socket.c |   22 +++++++++-------------
 1 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index f972c0b..1a2eb23 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
 <at>  <at>  -1755,20 +1755,16  <at>  <at>  static int getsockopt(struct socket *sock,

 	release_sock(sk);

-	if (res) {
-		/* "get" failed */
-	}
-	else if (len < sizeof(value)) {
-		res = -EINVAL;
-	}
-	else if (copy_to_user(ov, &value, sizeof(value))) {
-		res = -EFAULT;
-	}
-	else {
-		res = put_user(sizeof(value), ol);
-	}
(Continue reading)


Gmane