* [PATCH 0/14] TIPC updates
@ 2006-10-13 11:37 Per Liden
2006-10-13 11:37 ` [PATCH 1/14] [TIPC] Add missing unlock in port timeout code Per Liden
` (14 more replies)
0 siblings, 15 replies; 34+ messages in thread
From: Per Liden @ 2006-10-13 11:37 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Per Liden, Jon Maloy, Allan Stephens
Hi David,
This patch set includes a number TIPC fixes/cleanups. Please see each
individual patch for further description.
Please pull from:
git://tipc.cslab.ericsson.net/pub/git/tipc.git
(rebased on linux/kernel/git/davem/net-2.6.git)
Summary:
include/linux/tipc.h | 1
net/tipc/bearer.c | 8 +--
net/tipc/config.c | 5 +-
net/tipc/core.c | 4 +
net/tipc/core.h | 30 ++++++-----
net/tipc/dbg.c | 136 ++++++++++++++++++++++++++++++++-----------------
net/tipc/dbg.h | 15 +++++
net/tipc/discover.c | 39 +++++++++++++-
net/tipc/link.c | 8 +--
net/tipc/name_distr.c | 2 -
net/tipc/node.c | 2 -
net/tipc/port.c | 7 ++-
net/tipc/socket.c | 53 +++++++++++++------
net/tipc/subscr.c | 99 ++++++++++++++++++++++++++++++------
14 files changed, 296 insertions(+), 113 deletions(-)
Allan Stephens:
[TIPC] Add missing unlock in port timeout code.
[TIPC] Debug print buffer enhancements and fixes
[TIPC] Stream socket can now send > 66000 bytes at a time
[TIPC] Added duplicate node address detection capability
[TIPC] Optimize wakeup logic when socket has no waiting processes
[TIPC] Remove code bloat introduced by print buffer rework
[TIPC] Add support for Ethernet VLANs
[TIPC] Name publication events now delivered in chronological order
[TIPC] Fixed slow link reactivation when link tolerance is large
[TIPC] Can now list multicast link on an isolated network node
[TIPC] Unrecognized configuration command now returns error message
[TIPC] Updated TIPC version number to 1.6.2
Lijun Chen:
[TIPC] Added subscription cancellation capability
P Litov:
[TIPC] Fix socket receive queue NULL pointer dereference on SMP systems
/Per
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 1/14] [TIPC] Add missing unlock in port timeout code.
2006-10-13 11:37 [PATCH 0/14] TIPC updates Per Liden
@ 2006-10-13 11:37 ` Per Liden
2006-10-17 4:39 ` David Miller
2006-10-13 11:37 ` [PATCH 2/14] [TIPC] Debug print buffer enhancements and fixes Per Liden
` (13 subsequent siblings)
14 siblings, 1 reply; 34+ messages in thread
From: Per Liden @ 2006-10-13 11:37 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Allan Stephens
From: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
---
net/tipc/port.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/net/tipc/port.c b/net/tipc/port.c
index b9c8c6b..c1a1a76 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -505,8 +505,13 @@ static void port_timeout(unsigned long r
struct port *p_ptr = tipc_port_lock(ref);
struct sk_buff *buf = NULL;
- if (!p_ptr || !p_ptr->publ.connected)
+ if (!p_ptr)
+ return;
+
+ if (!p_ptr->publ.connected) {
+ tipc_port_unlock(p_ptr);
return;
+ }
/* Last probe answered ? */
if (p_ptr->probing_state == PROBING) {
--
1.4.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 2/14] [TIPC] Debug print buffer enhancements and fixes
2006-10-13 11:37 [PATCH 0/14] TIPC updates Per Liden
2006-10-13 11:37 ` [PATCH 1/14] [TIPC] Add missing unlock in port timeout code Per Liden
@ 2006-10-13 11:37 ` Per Liden
2006-10-17 4:43 ` David Miller
2006-10-13 11:37 ` [PATCH 3/14] [TIPC] Stream socket can now send > 66000 bytes at a time Per Liden
` (12 subsequent siblings)
14 siblings, 1 reply; 34+ messages in thread
From: Per Liden @ 2006-10-13 11:37 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Allan Stephens
From: Allan Stephens <allan.stephens@windriver.com>
This change modifies TIPC's print buffer code as follows:
1) Now supports small print buffers (min. size reduced from 512 bytes to 64)
2) Now uses TIPC_NULL print buffer structure to indicate null device
instead of NULL pointer (this simplified error handling)
3) Fixed misuse of console buffer structure by tipc_dump()
4) Added and corrected comments in various places
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
---
net/tipc/core.h | 16 +++---
net/tipc/dbg.c | 136 ++++++++++++++++++++++++++++++++++++-------------------
net/tipc/dbg.h | 15 +++++-
3 files changed, 110 insertions(+), 57 deletions(-)
diff --git a/net/tipc/core.h b/net/tipc/core.h
index 762aac2..31331e8 100644
--- a/net/tipc/core.h
+++ b/net/tipc/core.h
@@ -65,7 +65,7 @@ #include <linux/vmalloc.h>
#define assert(i) BUG_ON(!(i))
struct tipc_msg;
-extern struct print_buf *TIPC_CONS, *TIPC_LOG;
+extern struct print_buf *TIPC_NULL, *TIPC_CONS, *TIPC_LOG;
extern struct print_buf *TIPC_TEE(struct print_buf *, struct print_buf *);
void tipc_msg_print(struct print_buf*,struct tipc_msg *,const char*);
void tipc_printf(struct print_buf *, const char *fmt, ...);
@@ -94,11 +94,11 @@ #define dump(fmt, arg...) do {if (DBG_OU
* here, or on a per .c file basis, by redefining these symbols. The following
* print buffer options are available:
*
- * NULL : Output to null print buffer (i.e. print nowhere)
- * TIPC_CONS : Output to system console
- * TIPC_LOG : Output to TIPC log buffer
- * &buf : Output to user-defined buffer (struct print_buf *)
- * TIPC_TEE(&buf_a,&buf_b) : Output to two print buffers (eg. TIPC_TEE(TIPC_CONS,TIPC_LOG) )
+ * TIPC_NULL : null buffer (i.e. print nowhere)
+ * TIPC_CONS : system console
+ * TIPC_LOG : TIPC log buffer
+ * &buf : user-defined buffer (struct print_buf *)
+ * TIPC_TEE(&buf_a,&buf_b) : list of buffers (eg. TIPC_TEE(TIPC_CONS,TIPC_LOG))
*/
#ifndef TIPC_OUTPUT
@@ -106,7 +106,7 @@ #define TIPC_OUTPUT TIPC_TEE(TIPC_CONS,T
#endif
#ifndef DBG_OUTPUT
-#define DBG_OUTPUT NULL
+#define DBG_OUTPUT TIPC_NULL
#endif
#else
@@ -136,7 +136,7 @@ #undef TIPC_OUTPUT
#define TIPC_OUTPUT TIPC_CONS
#undef DBG_OUTPUT
-#define DBG_OUTPUT NULL
+#define DBG_OUTPUT TIPC_NULL
#endif
diff --git a/net/tipc/dbg.c b/net/tipc/dbg.c
index 5513065..48e33ab 100644
--- a/net/tipc/dbg.c
+++ b/net/tipc/dbg.c
@@ -1,8 +1,8 @@
/*
- * net/tipc/dbg.c: TIPC print buffer routines for debuggign
+ * net/tipc/dbg.c: TIPC print buffer routines for debugging
*
* Copyright (c) 1996-2006, Ericsson AB
- * Copyright (c) 2005, Wind River Systems
+ * Copyright (c) 2005-2006, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -38,11 +38,12 @@ #include "core.h"
#include "config.h"
#include "dbg.h"
-#define MAX_STRING 512
-
-static char print_string[MAX_STRING];
+static char print_string[TIPC_PB_MAX_STR];
static DEFINE_SPINLOCK(print_lock);
+static struct print_buf null_buf = { NULL, 0, NULL, NULL };
+struct print_buf *TIPC_NULL = &null_buf;
+
static struct print_buf cons_buf = { NULL, 0, NULL, NULL };
struct print_buf *TIPC_CONS = &cons_buf;
@@ -62,68 +63,83 @@ #define FORMAT(PTR,LEN,FMT) \
/*
* Locking policy when using print buffers.
*
- * 1) Routines of the form printbuf_XXX() rely on the caller to prevent
- * simultaneous use of the print buffer(s) being manipulated.
- * 2) tipc_printf() uses 'print_lock' to prevent simultaneous use of
- * 'print_string' and to protect its print buffer(s).
- * 3) TIPC_TEE() uses 'print_lock' to protect its print buffer(s).
- * 4) Routines of the form log_XXX() uses 'print_lock' to protect TIPC_LOG.
+ * The following routines use 'print_lock' for protection:
+ * 1) tipc_printf() - to protect its print buffer(s) and 'print_string'
+ * 2) TIPC_TEE() - to protect its print buffer(s)
+ * 3) tipc_dump() - to protect its print buffer(s) and 'print_string'
+ * 4) tipc_log_XXX() - to protect TIPC_LOG
+ *
+ * All routines of the form tipc_printbuf_XXX() rely on the caller to prevent
+ * simultaneous use of the print buffer(s) being manipulated.
*/
/**
* tipc_printbuf_init - initialize print buffer to empty
+ * @pb: pointer to print buffer structure
+ * @raw: pointer to character array used by print buffer
+ * @size: size of character array
+ *
+ * Makes the print buffer a null device that discards anything written to it
+ * if the character array is too small (or absent).
*/
-void tipc_printbuf_init(struct print_buf *pb, char *raw, u32 sz)
+void tipc_printbuf_init(struct print_buf *pb, char *raw, u32 size)
{
- if (!pb || !raw || (sz < (MAX_STRING + 1)))
- return;
-
- pb->crs = pb->buf = raw;
- pb->size = sz;
+ pb->buf = raw;
+ pb->crs = raw;
+ pb->size = size;
pb->next = NULL;
- pb->buf[0] = 0;
- pb->buf[sz-1] = ~0;
+
+ if (size < TIPC_PB_MIN_SIZE) {
+ pb->buf = NULL;
+ } else if (raw) {
+ pb->buf[0] = 0;
+ pb->buf[size-1] = ~0;
+ }
}
/**
* tipc_printbuf_reset - reinitialize print buffer to empty state
+ * @pb: pointer to print buffer structure
*/
void tipc_printbuf_reset(struct print_buf *pb)
{
- if (pb && pb->buf)
- tipc_printbuf_init(pb, pb->buf, pb->size);
+ tipc_printbuf_init(pb, pb->buf, pb->size);
}
/**
* tipc_printbuf_empty - test if print buffer is in empty state
+ * @pb: pointer to print buffer structure
+ *
+ * Returns non-zero if print buffer is empty.
*/
int tipc_printbuf_empty(struct print_buf *pb)
{
- return (!pb || !pb->buf || (pb->crs == pb->buf));
+ return (!pb->buf || (pb->crs == pb->buf));
}
/**
* tipc_printbuf_validate - check for print buffer overflow
+ * @pb: pointer to print buffer structure
*
* Verifies that a print buffer has captured all data written to it.
* If data has been lost, linearize buffer and prepend an error message
*
- * Returns length of print buffer data string (including trailing NULL)
+ * Returns length of print buffer data string (including trailing NUL)
*/
int tipc_printbuf_validate(struct print_buf *pb)
{
- char *err = " *** PRINT BUFFER WRAPPED AROUND ***\n";
+ char *err = "\n\n*** PRINT BUFFER OVERFLOW ***\n\n";
char *cp_buf;
struct print_buf cb;
- if (!pb || !pb->buf)
+ if (!pb->buf)
return 0;
- if (pb->buf[pb->size - 1] == '\0') {
+ if (pb->buf[pb->size - 1] == 0) {
cp_buf = kmalloc(pb->size, GFP_ATOMIC);
if (cp_buf != NULL){
tipc_printbuf_init(&cb, cp_buf, pb->size);
@@ -141,6 +157,8 @@ int tipc_printbuf_validate(struct print_
/**
* tipc_printbuf_move - move print buffer contents to another print buffer
+ * @pb_to: pointer to destination print buffer structure
+ * @pb_from: pointer to source print buffer structure
*
* Current contents of destination print buffer (if any) are discarded.
* Source print buffer becomes empty if a successful move occurs.
@@ -152,21 +170,22 @@ void tipc_printbuf_move(struct print_buf
/* Handle the cases where contents can't be moved */
- if (!pb_to || !pb_to->buf)
+ if (!pb_to->buf)
return;
- if (!pb_from || !pb_from->buf) {
+ if (!pb_from->buf) {
tipc_printbuf_reset(pb_to);
return;
}
if (pb_to->size < pb_from->size) {
tipc_printbuf_reset(pb_to);
- tipc_printf(pb_to, "*** PRINT BUFFER OVERFLOW ***");
+ tipc_printf(pb_to, "*** PRINT BUFFER MOVE ERROR ***");
return;
}
/* Copy data from char after cursor to end (if used) */
+
len = pb_from->buf + pb_from->size - pb_from->crs - 2;
if ((pb_from->buf[pb_from->size-1] == 0) && (len > 0)) {
strcpy(pb_to->buf, pb_from->crs + 1);
@@ -175,6 +194,7 @@ void tipc_printbuf_move(struct print_buf
pb_to->crs = pb_to->buf;
/* Copy data from start to cursor (always) */
+
len = pb_from->crs - pb_from->buf;
strcpy(pb_to->crs, pb_from->buf);
pb_to->crs += len;
@@ -184,6 +204,8 @@ void tipc_printbuf_move(struct print_buf
/**
* tipc_printf - append formatted output to print buffer chain
+ * @pb: pointer to chain of print buffers (may be NULL)
+ * @fmt: formatted info to be printed
*/
void tipc_printf(struct print_buf *pb, const char *fmt, ...)
@@ -195,8 +217,8 @@ void tipc_printf(struct print_buf *pb, c
spin_lock_bh(&print_lock);
FORMAT(print_string, chars_to_add, fmt);
- if (chars_to_add >= MAX_STRING)
- strcpy(print_string, "*** STRING TOO LONG ***");
+ if (chars_to_add >= TIPC_PB_MAX_STR)
+ strcpy(print_string, "*** PRINT BUFFER STRING TOO LONG ***");
while (pb) {
if (pb == TIPC_CONS)
@@ -206,6 +228,10 @@ void tipc_printf(struct print_buf *pb, c
if (chars_to_add <= chars_left) {
strcpy(pb->crs, print_string);
pb->crs += chars_to_add;
+ } else if (chars_to_add >= (pb->size - 1)) {
+ strcpy(pb->buf, print_string + chars_to_add + 1
+ - pb->size);
+ pb->crs = pb->buf + pb->size - 1;
} else {
strcpy(pb->buf, print_string + chars_left);
save_char = print_string[chars_left];
@@ -224,6 +250,10 @@ void tipc_printf(struct print_buf *pb, c
/**
* TIPC_TEE - perform next output operation on both print buffers
+ * @b0: pointer to chain of print buffers (may be NULL)
+ * @b1: pointer to print buffer to add to chain
+ *
+ * Returns pointer to print buffer chain.
*/
struct print_buf *TIPC_TEE(struct print_buf *b0, struct print_buf *b1)
@@ -232,8 +262,6 @@ struct print_buf *TIPC_TEE(struct print_
if (!b0 || (b0 == b1))
return b1;
- if (!b1)
- return b0;
spin_lock_bh(&print_lock);
while (pb->next) {
@@ -256,7 +284,7 @@ static void print_to_console(char *crs,
int rest = len;
while (rest > 0) {
- int sz = rest < MAX_STRING ? rest : MAX_STRING;
+ int sz = rest < TIPC_PB_MAX_STR ? rest : TIPC_PB_MAX_STR;
char c = crs[sz];
crs[sz] = 0;
@@ -275,36 +303,48 @@ static void printbuf_dump(struct print_b
{
int len;
+ if (!pb->buf) {
+ printk("*** PRINT BUFFER NOT ALLOCATED ***");
+ return;
+ }
+
/* Dump print buffer from char after cursor to end (if used) */
+
len = pb->buf + pb->size - pb->crs - 2;
if ((pb->buf[pb->size - 1] == 0) && (len > 0))
print_to_console(pb->crs + 1, len);
/* Dump print buffer from start to cursor (always) */
+
len = pb->crs - pb->buf;
print_to_console(pb->buf, len);
}
/**
* tipc_dump - dump non-console print buffer(s) to console
+ * @pb: pointer to chain of print buffers
*/
void tipc_dump(struct print_buf *pb, const char *fmt, ...)
{
+ struct print_buf *pb_next;
int len;
spin_lock_bh(&print_lock);
- FORMAT(TIPC_CONS->buf, len, fmt);
- printk(TIPC_CONS->buf);
+ FORMAT(print_string, len, fmt);
+ printk(print_string);
for (; pb; pb = pb->next) {
- if (pb == TIPC_CONS)
- continue;
- printk("\n---- Start of dump,%s log ----\n\n",
- (pb == TIPC_LOG) ? "global" : "local");
- printbuf_dump(pb);
- tipc_printbuf_reset(pb);
- printk("\n-------- End of dump --------\n");
+ if (pb != TIPC_CONS) {
+ printk("\n---- Start of %s log dump ----\n\n",
+ (pb == TIPC_LOG) ? "global" : "local");
+ printbuf_dump(pb);
+ tipc_printbuf_reset(pb);
+ printk("\n---- End of dump ----\n");
+ }
+ pb_next = pb->next;
+ pb->next = NULL;
+ pb = pb_next;
}
spin_unlock_bh(&print_lock);
}
@@ -324,7 +364,8 @@ void tipc_log_stop(void)
}
/**
- * tipc_log_reinit - set TIPC log print buffer to specified size
+ * tipc_log_reinit - (re)initialize TIPC log print buffer
+ * @log_size: print buffer size to use
*/
void tipc_log_reinit(int log_size)
@@ -332,10 +373,11 @@ void tipc_log_reinit(int log_size)
tipc_log_stop();
if (log_size) {
- if (log_size <= MAX_STRING)
- log_size = MAX_STRING + 1;
+ if (log_size < TIPC_PB_MIN_SIZE)
+ log_size = TIPC_PB_MIN_SIZE;
spin_lock_bh(&print_lock);
- tipc_printbuf_init(TIPC_LOG, kmalloc(log_size, GFP_ATOMIC), log_size);
+ tipc_printbuf_init(TIPC_LOG, kmalloc(log_size, GFP_ATOMIC),
+ log_size);
spin_unlock_bh(&print_lock);
}
}
diff --git a/net/tipc/dbg.h b/net/tipc/dbg.h
index 227f050..382afdc 100644
--- a/net/tipc/dbg.h
+++ b/net/tipc/dbg.h
@@ -2,7 +2,7 @@
* net/tipc/dbg.h: Include file for TIPC print buffer routines
*
* Copyright (c) 1997-2006, Ericsson AB
- * Copyright (c) 2005, Wind River Systems
+ * Copyright (c) 2005-2006, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -37,6 +37,14 @@
#ifndef _TIPC_DBG_H
#define _TIPC_DBG_H
+/**
+ * struct print_buf - TIPC print buffer structure
+ * @buf: pointer to character array containing print buffer contents
+ * @size: size of character array
+ * @crs: pointer to first unused space in character array (i.e. final NUL)
+ * @next: used to link print buffers when printing to more than one at a time
+ */
+
struct print_buf {
char *buf;
u32 size;
@@ -44,7 +52,10 @@ struct print_buf {
struct print_buf *next;
};
-void tipc_printbuf_init(struct print_buf *pb, char *buf, u32 sz);
+#define TIPC_PB_MIN_SIZE 64 /* minimum size for a print buffer's array */
+#define TIPC_PB_MAX_STR 512 /* max printable string (with trailing NUL) */
+
+void tipc_printbuf_init(struct print_buf *pb, char *buf, u32 size);
void tipc_printbuf_reset(struct print_buf *pb);
int tipc_printbuf_empty(struct print_buf *pb);
int tipc_printbuf_validate(struct print_buf *pb);
--
1.4.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 3/14] [TIPC] Stream socket can now send > 66000 bytes at a time
2006-10-13 11:37 [PATCH 0/14] TIPC updates Per Liden
2006-10-13 11:37 ` [PATCH 1/14] [TIPC] Add missing unlock in port timeout code Per Liden
2006-10-13 11:37 ` [PATCH 2/14] [TIPC] Debug print buffer enhancements and fixes Per Liden
@ 2006-10-13 11:37 ` Per Liden
2006-10-17 4:44 ` David Miller
2006-10-13 11:37 ` [PATCH 4/14] [TIPC] Added duplicate node address detection capability Per Liden
` (11 subsequent siblings)
14 siblings, 1 reply; 34+ messages in thread
From: Per Liden @ 2006-10-13 11:37 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Allan Stephens
From: Allan Stephens <allan.stephens@windriver.com>
The stream socket send code was not initializing some required fields
of the temporary msghdr structure it was utilizing; this is now fixed.
A check has also been added to detect if a user illegally specifies
a destination address when sending on an established stream connection.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
---
net/tipc/socket.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index acfb852..ed900fe 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -2,7 +2,7 @@
* net/tipc/socket.c: TIPC socket API
*
* Copyright (c) 2001-2006, Ericsson AB
- * Copyright (c) 2004-2005, Wind River Systems
+ * Copyright (c) 2004-2006, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -629,6 +629,9 @@ static int send_stream(struct kiocb *ioc
return -ENOTCONN;
}
+ if (unlikely(m->msg_name))
+ return -EISCONN;
+
/*
* Send each iovec entry using one or more messages
*
@@ -641,6 +644,8 @@ static int send_stream(struct kiocb *ioc
curr_iovlen = m->msg_iovlen;
my_msg.msg_iov = &my_iov;
my_msg.msg_iovlen = 1;
+ my_msg.msg_flags = m->msg_flags;
+ my_msg.msg_name = NULL;
bytes_sent = 0;
while (curr_iovlen--) {
--
1.4.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 4/14] [TIPC] Added duplicate node address detection capability
2006-10-13 11:37 [PATCH 0/14] TIPC updates Per Liden
` (2 preceding siblings ...)
2006-10-13 11:37 ` [PATCH 3/14] [TIPC] Stream socket can now send > 66000 bytes at a time Per Liden
@ 2006-10-13 11:37 ` Per Liden
2006-10-17 4:45 ` David Miller
2006-10-13 11:37 ` [PATCH 5/14] [TIPC] Optimize wakeup logic when socket has no waiting processes Per Liden
` (10 subsequent siblings)
14 siblings, 1 reply; 34+ messages in thread
From: Per Liden @ 2006-10-13 11:37 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Allan Stephens
From: Allan Stephens <allan.stephens@windriver.com>
TIPC now rejects and logs link setup requests from node <Z.C.N> if the
receiving node already has a functional link to that node on the associated
interface, or if the requestor is using the same <Z.C.N> as the receiver.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
---
net/tipc/bearer.c | 8 ++++----
net/tipc/discover.c | 32 +++++++++++++++++++++++++++++++-
2 files changed, 35 insertions(+), 5 deletions(-)
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index 75a5968..fc85a12 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -2,7 +2,7 @@
* net/tipc/bearer.c: TIPC bearer code
*
* Copyright (c) 1996-2006, Ericsson AB
- * Copyright (c) 2004-2005, Wind River Systems
+ * Copyright (c) 2004-2006, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -191,14 +191,14 @@ void tipc_media_addr_printf(struct print
if ((i < media_count) && (m_ptr->addr2str != NULL)) {
char addr_str[MAX_ADDR_STR];
- tipc_printf(pb, "%s(%s) ", m_ptr->name,
+ tipc_printf(pb, "%s(%s)", m_ptr->name,
m_ptr->addr2str(a, addr_str, sizeof(addr_str)));
} else {
unchar *addr = (unchar *)&a->dev_addr;
- tipc_printf(pb, "UNKNOWN(%u):", media_type);
+ tipc_printf(pb, "UNKNOWN(%u)", media_type);
for (i = 0; i < (sizeof(*a) - sizeof(a->type)); i++) {
- tipc_printf(pb, "%02x ", addr[i]);
+ tipc_printf(pb, "-%02x", addr[i]);
}
}
}
diff --git a/net/tipc/discover.c b/net/tipc/discover.c
index ee94de9..f58cc3c 100644
--- a/net/tipc/discover.c
+++ b/net/tipc/discover.c
@@ -132,6 +132,28 @@ static struct sk_buff *tipc_disc_init_ms
}
/**
+ * disc_dupl_alert - issue node address duplication alert
+ * @b_ptr: pointer to bearer detecting duplication
+ * @node_addr: duplicated node address
+ * @media_addr: media address advertised by duplicated node
+ */
+
+static void disc_dupl_alert(struct bearer *b_ptr, u32 node_addr,
+ struct tipc_media_addr *media_addr)
+{
+ char node_addr_str[16];
+ char media_addr_str[64];
+ struct print_buf pb;
+
+ addr_string_fill(node_addr_str, node_addr);
+ tipc_printbuf_init(&pb, media_addr_str, sizeof(media_addr_str));
+ tipc_media_addr_printf(&pb, media_addr);
+ tipc_printbuf_validate(&pb);
+ warn("Duplicate %s using %s seen on <%s>\n",
+ node_addr_str, media_addr_str, b_ptr->publ.name);
+}
+
+/**
* tipc_disc_recv_msg - handle incoming link setup message (request or response)
* @buf: buffer containing message
*/
@@ -157,8 +179,11 @@ void tipc_disc_recv_msg(struct sk_buff *
return;
if (!tipc_addr_node_valid(orig))
return;
- if (orig == tipc_own_addr)
+ if (orig == tipc_own_addr) {
+ if (memcmp(&media_addr, &b_ptr->publ.addr, sizeof(media_addr)))
+ disc_dupl_alert(b_ptr, tipc_own_addr, &media_addr);
return;
+ }
if (!in_scope(dest, tipc_own_addr))
return;
if (is_slave(tipc_own_addr) && is_slave(orig))
@@ -190,6 +215,11 @@ void tipc_disc_recv_msg(struct sk_buff *
}
addr = &link->media_addr;
if (memcmp(addr, &media_addr, sizeof(*addr))) {
+ if (tipc_link_is_up(link) || (!link->started)) {
+ disc_dupl_alert(b_ptr, orig, &media_addr);
+ spin_unlock_bh(&n_ptr->lock);
+ return;
+ }
warn("Resetting link <%s>, peer interface address changed\n",
link->name);
memcpy(addr, &media_addr, sizeof(*addr));
--
1.4.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 5/14] [TIPC] Optimize wakeup logic when socket has no waiting processes
2006-10-13 11:37 [PATCH 0/14] TIPC updates Per Liden
` (3 preceding siblings ...)
2006-10-13 11:37 ` [PATCH 4/14] [TIPC] Added duplicate node address detection capability Per Liden
@ 2006-10-13 11:37 ` Per Liden
2006-10-17 4:48 ` David Miller
2006-10-13 11:37 ` [PATCH 6/14] [TIPC] Remove code bloat introduced by print buffer rework Per Liden
` (9 subsequent siblings)
14 siblings, 1 reply; 34+ messages in thread
From: Per Liden @ 2006-10-13 11:37 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Allan Stephens
From: Allan Stephens <allan.stephens@windriver.com>
This patch adds a simple test so TIPC doesn't try waking up processes
waiting on a socket if there are none waiting.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
---
net/tipc/socket.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index ed900fe..2a6a5a6 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -1208,7 +1208,8 @@ static u32 dispatch(struct tipc_port *tp
atomic_inc(&tipc_queue_size);
skb_queue_tail(&sock->sk->sk_receive_queue, buf);
- wake_up_interruptible(sock->sk->sk_sleep);
+ if (waitqueue_active(sock->sk->sk_sleep))
+ wake_up_interruptible(sock->sk->sk_sleep);
return TIPC_OK;
}
@@ -1223,7 +1224,8 @@ static void wakeupdispatch(struct tipc_p
{
struct tipc_sock *tsock = (struct tipc_sock *)tport->usr_handle;
- wake_up_interruptible(tsock->sk.sk_sleep);
+ if (waitqueue_active(tsock->sk.sk_sleep))
+ wake_up_interruptible(tsock->sk.sk_sleep);
}
/**
--
1.4.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 6/14] [TIPC] Remove code bloat introduced by print buffer rework
2006-10-13 11:37 [PATCH 0/14] TIPC updates Per Liden
` (4 preceding siblings ...)
2006-10-13 11:37 ` [PATCH 5/14] [TIPC] Optimize wakeup logic when socket has no waiting processes Per Liden
@ 2006-10-13 11:37 ` Per Liden
2006-10-17 4:49 ` David Miller
2006-10-13 11:37 ` [PATCH 7/14] [TIPC] Add support for Ethernet VLANs Per Liden
` (8 subsequent siblings)
14 siblings, 1 reply; 34+ messages in thread
From: Per Liden @ 2006-10-13 11:37 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Allan Stephens
From: Allan Stephens <allan.stephens@windriver.com>
This patch allows the compiler to optimize out any code that tries to
send debugging output to the null print buffer (TIPC_NULL), a capability
that was unintentionally broken during the recent print buffer rework.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
---
net/tipc/core.h | 6 +++---
net/tipc/link.c | 8 ++++----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/net/tipc/core.h b/net/tipc/core.h
index 31331e8..e3a74a3 100644
--- a/net/tipc/core.h
+++ b/net/tipc/core.h
@@ -83,9 +83,9 @@ #define err(fmt, arg...) tipc_printf(TI
#define warn(fmt, arg...) tipc_printf(TIPC_OUTPUT, KERN_WARNING "TIPC: " fmt, ## arg)
#define info(fmt, arg...) tipc_printf(TIPC_OUTPUT, KERN_NOTICE "TIPC: " fmt, ## arg)
-#define dbg(fmt, arg...) do {if (DBG_OUTPUT) tipc_printf(DBG_OUTPUT, fmt, ## arg);} while(0)
-#define msg_dbg(msg, txt) do {if (DBG_OUTPUT) tipc_msg_print(DBG_OUTPUT, msg, txt);} while(0)
-#define dump(fmt, arg...) do {if (DBG_OUTPUT) tipc_dump(DBG_OUTPUT, fmt, ##arg);} while(0)
+#define dbg(fmt, arg...) do {if (DBG_OUTPUT != TIPC_NULL) tipc_printf(DBG_OUTPUT, fmt, ## arg);} while(0)
+#define msg_dbg(msg, txt) do {if (DBG_OUTPUT != TIPC_NULL) tipc_msg_print(DBG_OUTPUT, msg, txt);} while(0)
+#define dump(fmt, arg...) do {if (DBG_OUTPUT != TIPC_NULL) tipc_dump(DBG_OUTPUT, fmt, ##arg);} while(0)
/*
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 53bc8cb..1bb983c 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -132,7 +132,7 @@ static void link_print(struct link *l_pt
* allow the output from multiple links to be intermixed. For this reason
* routines of the form "dbg_link_XXX()" have been created that will capture
* debug info into a link's personal print buffer, which can then be dumped
- * into the TIPC system log (LOG) upon request.
+ * into the TIPC system log (TIPC_LOG) upon request.
*
* To enable per-link debugging, use LINK_LOG_BUF_SIZE to specify the size
* of the print buffer used by each link. If LINK_LOG_BUF_SIZE is set to 0,
@@ -141,7 +141,7 @@ static void link_print(struct link *l_pt
* when there is only a single link in the system being debugged.
*
* Notes:
- * - When enabled, LINK_LOG_BUF_SIZE should be set to at least 1000 (bytes)
+ * - When enabled, LINK_LOG_BUF_SIZE should be set to at least TIPC_PB_MIN_SIZE
* - "l_ptr" must be valid when using dbg_link_XXX() macros
*/
@@ -159,13 +159,13 @@ #define dbg_link_dump() do { \
static void dbg_print_link(struct link *l_ptr, const char *str)
{
- if (DBG_OUTPUT)
+ if (DBG_OUTPUT != TIPC_NULL)
link_print(l_ptr, DBG_OUTPUT, str);
}
static void dbg_print_buf_chain(struct sk_buff *root_buf)
{
- if (DBG_OUTPUT) {
+ if (DBG_OUTPUT != TIPC_NULL) {
struct sk_buff *buf = root_buf;
while (buf) {
--
1.4.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 7/14] [TIPC] Add support for Ethernet VLANs
2006-10-13 11:37 [PATCH 0/14] TIPC updates Per Liden
` (5 preceding siblings ...)
2006-10-13 11:37 ` [PATCH 6/14] [TIPC] Remove code bloat introduced by print buffer rework Per Liden
@ 2006-10-13 11:37 ` Per Liden
2006-10-17 4:50 ` David Miller
2006-10-13 11:37 ` [PATCH 8/14] [TIPC] Fix socket receive queue NULL pointer dereference on SMP systems Per Liden
` (7 subsequent siblings)
14 siblings, 1 reply; 34+ messages in thread
From: Per Liden @ 2006-10-13 11:37 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Allan Stephens
From: Allan Stephens <allan.stephens@windriver.com>
This patch enhances TIPC's Ethernet support to include VLAN interfaces.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
---
net/tipc/core.c | 2 +-
net/tipc/core.h | 8 ++++++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/net/tipc/core.c b/net/tipc/core.c
index 0539a83..7f3f693 100644
--- a/net/tipc/core.c
+++ b/net/tipc/core.c
@@ -90,7 +90,7 @@ int tipc_random;
atomic_t tipc_user_count = ATOMIC_INIT(0);
const char tipc_alphabet[] =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.";
/* configurable TIPC parameters */
diff --git a/net/tipc/core.h b/net/tipc/core.h
index e3a74a3..a0cc1d2 100644
--- a/net/tipc/core.h
+++ b/net/tipc/core.h
@@ -275,11 +275,15 @@ static inline void k_term_timer(struct t
/*
* TIPC message buffer code
*
- * TIPC message buffer headroom leaves room for 14 byte Ethernet header,
+ * TIPC message buffer headroom reserves space for a link-level header
+ * (in case the message is sent off-node),
* while ensuring TIPC header is word aligned for quicker access
+ *
+ * The largest header currently supported is 18 bytes, which is used when
+ * the standard 14 byte Ethernet header has 4 added bytes for VLAN info
*/
-#define BUF_HEADROOM 16u
+#define BUF_HEADROOM 20u
struct tipc_skb_cb {
void *handle;
--
1.4.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 8/14] [TIPC] Fix socket receive queue NULL pointer dereference on SMP systems
2006-10-13 11:37 [PATCH 0/14] TIPC updates Per Liden
` (6 preceding siblings ...)
2006-10-13 11:37 ` [PATCH 7/14] [TIPC] Add support for Ethernet VLANs Per Liden
@ 2006-10-13 11:37 ` Per Liden
2006-10-17 4:55 ` David Miller
2006-10-13 11:37 ` [PATCH 9/14] [TIPC] Name publication events now delivered in chronological order Per Liden
` (6 subsequent siblings)
14 siblings, 1 reply; 34+ messages in thread
From: Per Liden @ 2006-10-13 11:37 UTC (permalink / raw)
To: David Miller; +Cc: netdev, P Litov
From: P Litov <xpl@amln.net>
This patch corrects an SMP system-specific race condition which allowed
TIPC to prematurely dereference the first sk_buff in a socket receive
queue that was changing from empty to non-empty state.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
---
net/tipc/socket.c | 40 ++++++++++++++++++++++++++--------------
1 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 2a6a5a6..827f204 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -82,6 +82,18 @@ static int sockets_enabled = 0;
static atomic_t tipc_queue_size = ATOMIC_INIT(0);
+/*
+ * Notes on receive queue locking:
+ *
+ * 1) Routines called from an application thread that examine the socket
+ * receive queue must typically use skb_queue_empty() rather than
+ * skb_queue_len() to determine if the queue has a message in it; otherwise,
+ * a race condition can arise on SMP systems wherein skb_queue_len() indicates
+ * the presence of a message that is not yet on the queue. (This race could
+ * be avoided by taking the queue lock before examining the queue, but this
+ * would complicate the code and impact performance.)
+ */
+
/*
* sock_lock(): Lock a port/socket pair. lock_sock() can
* not be used here, since the same lock must protect ports
@@ -123,7 +135,7 @@ static u32 pollmask(struct socket *sock)
{
u32 mask;
- if ((skb_queue_len(&sock->sk->sk_receive_queue) != 0) ||
+ if (!skb_queue_empty(&sock->sk->sk_receive_queue) ||
(sock->state == SS_UNCONNECTED) ||
(sock->state == SS_DISCONNECTING))
mask = (POLLRDNORM | POLLIN);
@@ -809,7 +821,7 @@ static int recv_msg(struct kiocb *iocb,
struct tipc_sock *tsock = tipc_sk(sock->sk);
struct sk_buff *buf;
struct tipc_msg *msg;
- unsigned int q_len;
+ int q_empty;
unsigned int sz;
u32 err;
int res;
@@ -828,7 +840,7 @@ static int recv_msg(struct kiocb *iocb,
if (unlikely(sock->state == SS_UNCONNECTED))
return -ENOTCONN;
if (unlikely((sock->state == SS_DISCONNECTING) &&
- (skb_queue_len(&sock->sk->sk_receive_queue) == 0)))
+ (skb_queue_empty(&sock->sk->sk_receive_queue))))
return -ENOTCONN;
}
@@ -838,7 +850,7 @@ static int recv_msg(struct kiocb *iocb,
return -ERESTARTSYS;
restart:
- if (unlikely((skb_queue_len(&sock->sk->sk_receive_queue) == 0) &&
+ if (unlikely(skb_queue_empty(&sock->sk->sk_receive_queue) &&
(flags & MSG_DONTWAIT))) {
res = -EWOULDBLOCK;
goto exit;
@@ -846,7 +858,7 @@ restart:
if ((res = wait_event_interruptible(
*sock->sk->sk_sleep,
- ((q_len = skb_queue_len(&sock->sk->sk_receive_queue)) ||
+ (!(q_empty = skb_queue_empty(&sock->sk->sk_receive_queue)) ||
(sock->state == SS_DISCONNECTING))) )) {
goto exit;
}
@@ -854,7 +866,7 @@ restart:
/* Catch attempt to receive on an already terminated connection */
/* [THIS CHECK MAY OVERLAP WITH AN EARLIER CHECK] */
- if (!q_len) {
+ if (q_empty) {
res = -ENOTCONN;
goto exit;
}
@@ -941,7 +953,7 @@ static int recv_stream(struct kiocb *ioc
struct tipc_sock *tsock = tipc_sk(sock->sk);
struct sk_buff *buf;
struct tipc_msg *msg;
- unsigned int q_len;
+ int q_empty;
unsigned int sz;
int sz_to_copy;
int sz_copied = 0;
@@ -962,7 +974,7 @@ static int recv_stream(struct kiocb *ioc
return -EINVAL;
if (unlikely(sock->state == SS_DISCONNECTING)) {
- if (skb_queue_len(&sock->sk->sk_receive_queue) == 0)
+ if (skb_queue_empty(&sock->sk->sk_receive_queue))
return -ENOTCONN;
} else if (unlikely(sock->state != SS_CONNECTED))
return -ENOTCONN;
@@ -973,7 +985,7 @@ static int recv_stream(struct kiocb *ioc
return -ERESTARTSYS;
restart:
- if (unlikely((skb_queue_len(&sock->sk->sk_receive_queue) == 0) &&
+ if (unlikely(skb_queue_empty(&sock->sk->sk_receive_queue) &&
(flags & MSG_DONTWAIT))) {
res = -EWOULDBLOCK;
goto exit;
@@ -981,7 +993,7 @@ restart:
if ((res = wait_event_interruptible(
*sock->sk->sk_sleep,
- ((q_len = skb_queue_len(&sock->sk->sk_receive_queue)) ||
+ (!(q_empty = skb_queue_empty(&sock->sk->sk_receive_queue)) ||
(sock->state == SS_DISCONNECTING))) )) {
goto exit;
}
@@ -989,7 +1001,7 @@ restart:
/* Catch attempt to receive on an already terminated connection */
/* [THIS CHECK MAY OVERLAP WITH AN EARLIER CHECK] */
- if (!q_len) {
+ if (q_empty) {
res = -ENOTCONN;
goto exit;
}
@@ -1287,7 +1299,7 @@ static int connect(struct socket *sock,
/* Wait for destination's 'ACK' response */
res = wait_event_interruptible_timeout(*sock->sk->sk_sleep,
- skb_queue_len(&sock->sk->sk_receive_queue),
+ (!skb_queue_empty(&sock->sk->sk_receive_queue)),
sock->sk->sk_rcvtimeo);
buf = skb_peek(&sock->sk->sk_receive_queue);
if (res > 0) {
@@ -1349,7 +1361,7 @@ static int accept(struct socket *sock, s
if (sock->state != SS_LISTENING)
return -EINVAL;
- if (unlikely((skb_queue_len(&sock->sk->sk_receive_queue) == 0) &&
+ if (unlikely(skb_queue_empty(&sock->sk->sk_receive_queue) &&
(flags & O_NONBLOCK)))
return -EWOULDBLOCK;
@@ -1357,7 +1369,7 @@ static int accept(struct socket *sock, s
return -ERESTARTSYS;
if (wait_event_interruptible(*sock->sk->sk_sleep,
- skb_queue_len(&sock->sk->sk_receive_queue))) {
+ (!skb_queue_empty(&sock->sk->sk_receive_queue)))) {
res = -ERESTARTSYS;
goto exit;
}
--
1.4.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 9/14] [TIPC] Name publication events now delivered in chronological order
2006-10-13 11:37 [PATCH 0/14] TIPC updates Per Liden
` (7 preceding siblings ...)
2006-10-13 11:37 ` [PATCH 8/14] [TIPC] Fix socket receive queue NULL pointer dereference on SMP systems Per Liden
@ 2006-10-13 11:37 ` Per Liden
2006-10-13 23:13 ` Bill Fink
2006-10-17 4:56 ` David Miller
2006-10-13 11:37 ` [PATCH 10/14] [TIPC] Fixed slow link reactivation when link tolerance is large Per Liden
` (5 subsequent siblings)
14 siblings, 2 replies; 34+ messages in thread
From: Per Liden @ 2006-10-13 11:37 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Allan Stephens
From: Allan Stephens <allan.stephens@windriver.com>
This patch tivially re-orders the entries in TIPC's list of local
publications so that applications will receive publication events
in the order they were published.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
---
net/tipc/name_distr.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
index f0b063b..03bd659 100644
--- a/net/tipc/name_distr.c
+++ b/net/tipc/name_distr.c
@@ -122,7 +122,7 @@ void tipc_named_publish(struct publicati
struct sk_buff *buf;
struct distr_item *item;
- list_add(&publ->local_list, &publ_root);
+ list_add_tail(&publ->local_list, &publ_root);
publ_cnt++;
buf = named_prepare_buf(PUBLICATION, ITEM_SIZE, 0);
--
1.4.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 10/14] [TIPC] Fixed slow link reactivation when link tolerance is large
2006-10-13 11:37 [PATCH 0/14] TIPC updates Per Liden
` (8 preceding siblings ...)
2006-10-13 11:37 ` [PATCH 9/14] [TIPC] Name publication events now delivered in chronological order Per Liden
@ 2006-10-13 11:37 ` Per Liden
2006-10-17 4:57 ` David Miller
2006-10-13 11:37 ` [PATCH 11/14] [TIPC] Can now list multicast link on an isolated network node Per Liden
` (4 subsequent siblings)
14 siblings, 1 reply; 34+ messages in thread
From: Per Liden @ 2006-10-13 11:37 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Allan Stephens
From: Allan Stephens <allan.stephens@windriver.com>
This patch corrects an issue wherein a previouly failed node could
not reestablish a links to a non-failing node in the TIPC network
until the latter node detected the link failure itself (which might
be configured to take up to 30 seconds). The non-failing node now
responds to link setup requests from a previously failed node in at
most 1 second, allowing it to detect the link failure more quickly.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
---
net/tipc/discover.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/tipc/discover.c b/net/tipc/discover.c
index f58cc3c..7ea4c12 100644
--- a/net/tipc/discover.c
+++ b/net/tipc/discover.c
@@ -195,7 +195,8 @@ void tipc_disc_recv_msg(struct sk_buff *
struct sk_buff *rbuf;
struct tipc_media_addr *addr;
struct node *n_ptr = tipc_node_find(orig);
- int link_up;
+ int link_fully_up;
+
dbg(" in own cluster\n");
if (n_ptr == NULL) {
n_ptr = tipc_node_create(orig);
@@ -225,9 +226,9 @@ void tipc_disc_recv_msg(struct sk_buff *
memcpy(addr, &media_addr, sizeof(*addr));
tipc_link_reset(link);
}
- link_up = tipc_link_is_up(link);
+ link_fully_up = (link->state == WORKING_WORKING);
spin_unlock_bh(&n_ptr->lock);
- if ((type == DSC_RESP_MSG) || link_up)
+ if ((type == DSC_RESP_MSG) || link_fully_up)
return;
rbuf = tipc_disc_init_msg(DSC_RESP_MSG, 1, orig, b_ptr);
if (rbuf != NULL) {
--
1.4.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 11/14] [TIPC] Can now list multicast link on an isolated network node
2006-10-13 11:37 [PATCH 0/14] TIPC updates Per Liden
` (9 preceding siblings ...)
2006-10-13 11:37 ` [PATCH 10/14] [TIPC] Fixed slow link reactivation when link tolerance is large Per Liden
@ 2006-10-13 11:37 ` Per Liden
2006-10-17 4:58 ` David Miller
2006-10-13 11:37 ` [PATCH 12/14] [TIPC] Added subscription cancellation capability Per Liden
` (3 subsequent siblings)
14 siblings, 1 reply; 34+ messages in thread
From: Per Liden @ 2006-10-13 11:37 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Allan Stephens
From: Allan Stephens <allan.stephens@windriver.com>
This patch fixes a minor bug that prevents "tipc-config -l" from
displaying the multicast link if a TIPC node has never successfully
established at least one unicast link.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
---
net/tipc/node.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/tipc/node.c b/net/tipc/node.c
index fc6d096..886bda5 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -648,7 +648,7 @@ struct sk_buff *tipc_node_get_links(cons
return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
" (network address)");
- if (!tipc_nodes)
+ if (tipc_mode != TIPC_NET_MODE)
return tipc_cfg_reply_none();
/* Get space for all unicast links + multicast link */
--
1.4.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 12/14] [TIPC] Added subscription cancellation capability
2006-10-13 11:37 [PATCH 0/14] TIPC updates Per Liden
` (10 preceding siblings ...)
2006-10-13 11:37 ` [PATCH 11/14] [TIPC] Can now list multicast link on an isolated network node Per Liden
@ 2006-10-13 11:37 ` Per Liden
2006-10-17 5:00 ` David Miller
2006-10-13 11:37 ` [PATCH 13/14] [TIPC] Unrecognized configuration command now returns error message Per Liden
` (2 subsequent siblings)
14 siblings, 1 reply; 34+ messages in thread
From: Per Liden @ 2006-10-13 11:37 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Lijun Chen
From: Lijun Chen <chenli@nortel.com>
This patch allows a TIPC application to cancel an existing
topology service subscription by re-requesting the subscription
with the TIPC_SUB_CANCEL filter bit set. (All other bits of
the cancel request must match the original subscription request.)
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
---
include/linux/tipc.h | 1 +
net/tipc/subscr.c | 99 ++++++++++++++++++++++++++++++++++++++++++--------
2 files changed, 85 insertions(+), 15 deletions(-)
diff --git a/include/linux/tipc.h b/include/linux/tipc.h
index 243a15f..bea4694 100644
--- a/include/linux/tipc.h
+++ b/include/linux/tipc.h
@@ -129,6 +129,7 @@ #define TIPC_CONN_SHUTDOWN 5
#define TIPC_SUB_PORTS 0x01 /* filter for port availability */
#define TIPC_SUB_SERVICE 0x02 /* filter for service availability */
+#define TIPC_SUB_CANCEL 0x04 /* cancel a subscription */
#if 0
/* The following filter options are not currently implemented */
#define TIPC_SUB_NO_BIND_EVTS 0x04 /* filter out "publish" events */
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c
index c51600b..77a87c2 100644
--- a/net/tipc/subscr.c
+++ b/net/tipc/subscr.c
@@ -155,7 +155,7 @@ void tipc_subscr_report_overlap(struct s
sub->seq.upper, found_lower, found_upper);
if (!tipc_subscr_overlap(sub, found_lower, found_upper))
return;
- if (!must && (sub->filter != TIPC_SUB_PORTS))
+ if (!must && !(sub->filter & TIPC_SUB_PORTS))
return;
subscr_send_event(sub, found_lower, found_upper, event, port_ref, node);
}
@@ -176,6 +176,13 @@ static void subscr_timeout(struct subscr
if (subscriber == NULL)
return;
+ /* Validate timeout (in case subscription is being cancelled) */
+
+ if (sub->timeout == TIPC_WAIT_FOREVER) {
+ tipc_ref_unlock(subscriber_ref);
+ return;
+ }
+
/* Unlink subscription from name table */
tipc_nametbl_unsubscribe(sub);
@@ -199,6 +206,20 @@ static void subscr_timeout(struct subscr
}
/**
+ * subscr_del - delete a subscription within a subscription list
+ *
+ * Called with subscriber locked.
+ */
+
+static void subscr_del(struct subscription *sub)
+{
+ tipc_nametbl_unsubscribe(sub);
+ list_del(&sub->subscription_list);
+ kfree(sub);
+ atomic_dec(&topsrv.subscription_count);
+}
+
+/**
* subscr_terminate - terminate communication with a subscriber
*
* Called with subscriber locked. Routine must temporarily release this lock
@@ -227,12 +248,9 @@ static void subscr_terminate(struct subs
k_cancel_timer(&sub->timer);
k_term_timer(&sub->timer);
}
- tipc_nametbl_unsubscribe(sub);
- list_del(&sub->subscription_list);
- dbg("Term: Removed sub %u,%u,%u from subscriber %x list\n",
+ dbg("Term: Removing sub %u,%u,%u from subscriber %x list\n",
sub->seq.type, sub->seq.lower, sub->seq.upper, subscriber);
- kfree(sub);
- atomic_dec(&topsrv.subscription_count);
+ subscr_del(sub);
}
/* Sever connection to subscriber */
@@ -253,6 +271,49 @@ static void subscr_terminate(struct subs
}
/**
+ * subscr_cancel - handle subscription cancellation request
+ *
+ * Called with subscriber locked. Routine must temporarily release this lock
+ * to enable the subscription timeout routine to finish without deadlocking;
+ * the lock is then reclaimed to allow caller to release it upon return.
+ *
+ * Note that fields of 's' use subscriber's endianness!
+ */
+
+static void subscr_cancel(struct tipc_subscr *s,
+ struct subscriber *subscriber)
+{
+ struct subscription *sub;
+ struct subscription *sub_temp;
+ int found = 0;
+
+ /* Find first matching subscription, exit if not found */
+
+ list_for_each_entry_safe(sub, sub_temp, &subscriber->subscription_list,
+ subscription_list) {
+ if (!memcmp(s, &sub->evt.s, sizeof(struct tipc_subscr))) {
+ found = 1;
+ break;
+ }
+ }
+ if (!found)
+ return;
+
+ /* Cancel subscription timer (if used), then delete subscription */
+
+ if (sub->timeout != TIPC_WAIT_FOREVER) {
+ sub->timeout = TIPC_WAIT_FOREVER;
+ spin_unlock_bh(subscriber->lock);
+ k_cancel_timer(&sub->timer);
+ k_term_timer(&sub->timer);
+ spin_lock_bh(subscriber->lock);
+ }
+ dbg("Cancel: removing sub %u,%u,%u from subscriber %x list\n",
+ sub->seq.type, sub->seq.lower, sub->seq.upper, subscriber);
+ subscr_del(sub);
+}
+
+/**
* subscr_subscribe - create subscription for subscriber
*
* Called with subscriber locked
@@ -263,6 +324,21 @@ static void subscr_subscribe(struct tipc
{
struct subscription *sub;
+ /* Determine/update subscriber's endianness */
+
+ if (s->filter & (TIPC_SUB_PORTS | TIPC_SUB_SERVICE))
+ subscriber->swap = 0;
+ else
+ subscriber->swap = 1;
+
+ /* Detect & process a subscription cancellation request */
+
+ if (s->filter & htohl(TIPC_SUB_CANCEL, subscriber->swap)) {
+ s->filter &= ~htohl(TIPC_SUB_CANCEL, subscriber->swap);
+ subscr_cancel(s, subscriber);
+ return;
+ }
+
/* Refuse subscription if global limit exceeded */
if (atomic_read(&topsrv.subscription_count) >= tipc_max_subscriptions) {
@@ -281,13 +357,6 @@ static void subscr_subscribe(struct tipc
return;
}
- /* Determine/update subscriber's endianness */
-
- if ((s->filter == TIPC_SUB_PORTS) || (s->filter == TIPC_SUB_SERVICE))
- subscriber->swap = 0;
- else
- subscriber->swap = 1;
-
/* Initialize subscription object */
memset(sub, 0, sizeof(*sub));
@@ -296,8 +365,8 @@ static void subscr_subscribe(struct tipc
sub->seq.upper = htohl(s->seq.upper, subscriber->swap);
sub->timeout = htohl(s->timeout, subscriber->swap);
sub->filter = htohl(s->filter, subscriber->swap);
- if ((((sub->filter != TIPC_SUB_PORTS)
- && (sub->filter != TIPC_SUB_SERVICE)))
+ if ((!(sub->filter & TIPC_SUB_PORTS)
+ == !(sub->filter & TIPC_SUB_SERVICE))
|| (sub->seq.lower > sub->seq.upper)) {
warn("Subscription rejected, illegal request\n");
kfree(sub);
--
1.4.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 13/14] [TIPC] Unrecognized configuration command now returns error message
2006-10-13 11:37 [PATCH 0/14] TIPC updates Per Liden
` (11 preceding siblings ...)
2006-10-13 11:37 ` [PATCH 12/14] [TIPC] Added subscription cancellation capability Per Liden
@ 2006-10-13 11:37 ` Per Liden
2006-10-17 5:01 ` David Miller
2006-10-13 11:37 ` [PATCH 14/14] [TIPC] Updated TIPC version number to 1.6.2 Per Liden
2006-10-17 5:04 ` [PATCH 0/14] TIPC updates David Miller
14 siblings, 1 reply; 34+ messages in thread
From: Per Liden @ 2006-10-13 11:37 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Allan Stephens
From: Allan Stephens <allan.stephens@windriver.com>
This patch causes TIPC to return an error message when it receives
an unrecognized configuration command. (Previously, the sender
received no feedback.)
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
---
net/tipc/config.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/tipc/config.c b/net/tipc/config.c
index 285e1bc..ed1351e 100644
--- a/net/tipc/config.c
+++ b/net/tipc/config.c
@@ -2,7 +2,7 @@
* net/tipc/config.c: TIPC configuration management code
*
* Copyright (c) 2002-2006, Ericsson AB
- * Copyright (c) 2004-2005, Wind River Systems
+ * Copyright (c) 2004-2006, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -613,7 +613,8 @@ #endif
rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_net_id);
break;
default:
- rep_tlv_buf = NULL;
+ rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
+ " (unknown command)");
break;
}
--
1.4.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 14/14] [TIPC] Updated TIPC version number to 1.6.2
2006-10-13 11:37 [PATCH 0/14] TIPC updates Per Liden
` (12 preceding siblings ...)
2006-10-13 11:37 ` [PATCH 13/14] [TIPC] Unrecognized configuration command now returns error message Per Liden
@ 2006-10-13 11:37 ` Per Liden
2006-10-17 5:01 ` David Miller
2006-10-17 5:04 ` [PATCH 0/14] TIPC updates David Miller
14 siblings, 1 reply; 34+ messages in thread
From: Per Liden @ 2006-10-13 11:37 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Allan Stephens
From: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
---
net/tipc/core.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/tipc/core.c b/net/tipc/core.c
index 7f3f693..6f5b7ee 100644
--- a/net/tipc/core.c
+++ b/net/tipc/core.c
@@ -57,7 +57,7 @@ void tipc_socket_stop(void);
int tipc_netlink_start(void);
void tipc_netlink_stop(void);
-#define TIPC_MOD_VER "1.6.1"
+#define TIPC_MOD_VER "1.6.2"
#ifndef CONFIG_TIPC_ZONES
#define CONFIG_TIPC_ZONES 3
--
1.4.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* Re: [PATCH 9/14] [TIPC] Name publication events now delivered in chronological order
2006-10-13 11:37 ` [PATCH 9/14] [TIPC] Name publication events now delivered in chronological order Per Liden
@ 2006-10-13 23:13 ` Bill Fink
2006-10-16 8:50 ` Per Liden
2006-10-17 4:56 ` David Miller
1 sibling, 1 reply; 34+ messages in thread
From: Bill Fink @ 2006-10-13 23:13 UTC (permalink / raw)
To: Per Liden; +Cc: David Miller, netdev, Allan Stephens
FYI,
At least here, I received two copies of patch 9/14 and no copy
of patch 10/14.
-Bill
On Fri, 13 Oct 2006 13:37:50 +0200, Per Liden wrote:
> From: Allan Stephens <allan.stephens@windriver.com>
>
> This patch tivially re-orders the entries in TIPC's list of local
> publications so that applications will receive publication events
> in the order they were published.
>
> Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
> Signed-off-by: Per Liden <per.liden@ericsson.com>
> ---
> net/tipc/name_distr.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
> index f0b063b..03bd659 100644
> --- a/net/tipc/name_distr.c
> +++ b/net/tipc/name_distr.c
> @@ -122,7 +122,7 @@ void tipc_named_publish(struct publicati
> struct sk_buff *buf;
> struct distr_item *item;
>
> - list_add(&publ->local_list, &publ_root);
> + list_add_tail(&publ->local_list, &publ_root);
> publ_cnt++;
>
> buf = named_prepare_buf(PUBLICATION, ITEM_SIZE, 0);
> --
> 1.4.1
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 9/14] [TIPC] Name publication events now delivered in chronological order
2006-10-13 23:13 ` Bill Fink
@ 2006-10-16 8:50 ` Per Liden
2006-10-16 20:59 ` David Miller
0 siblings, 1 reply; 34+ messages in thread
From: Per Liden @ 2006-10-16 8:50 UTC (permalink / raw)
To: Bill Fink; +Cc: David Miller, netdev, Allan Stephens
I'm fairly sure this is a problem on your side. I received patch 10/14
from the netdev list and the two list archives I checked also had it.
/Per
On Fri, 13 Oct 2006, Bill Fink wrote:
> FYI,
>
> At least here, I received two copies of patch 9/14 and no copy
> of patch 10/14.
>
> -Bill
>
>
>
> On Fri, 13 Oct 2006 13:37:50 +0200, Per Liden wrote:
>
> > From: Allan Stephens <allan.stephens@windriver.com>
> >
> > This patch tivially re-orders the entries in TIPC's list of local
> > publications so that applications will receive publication events
> > in the order they were published.
> >
> > Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
> > Signed-off-by: Per Liden <per.liden@ericsson.com>
> > ---
> > net/tipc/name_distr.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
> > index f0b063b..03bd659 100644
> > --- a/net/tipc/name_distr.c
> > +++ b/net/tipc/name_distr.c
> > @@ -122,7 +122,7 @@ void tipc_named_publish(struct publicati
> > struct sk_buff *buf;
> > struct distr_item *item;
> >
> > - list_add(&publ->local_list, &publ_root);
> > + list_add_tail(&publ->local_list, &publ_root);
> > publ_cnt++;
> >
> > buf = named_prepare_buf(PUBLICATION, ITEM_SIZE, 0);
> > --
> > 1.4.1
>
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 9/14] [TIPC] Name publication events now delivered in chronological order
2006-10-16 8:50 ` Per Liden
@ 2006-10-16 20:59 ` David Miller
0 siblings, 0 replies; 34+ messages in thread
From: David Miller @ 2006-10-16 20:59 UTC (permalink / raw)
To: per.liden; +Cc: billfink, netdev, allan.stephens
From: Per Liden <per.liden@ericsson.com>
Date: Mon, 16 Oct 2006 10:50:40 +0200 (CEST)
> I'm fairly sure this is a problem on your side. I received patch 10/14
> from the netdev list and the two list archives I checked also had it.
I also got 2 copies which means it hit netdev for me too.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 1/14] [TIPC] Add missing unlock in port timeout code.
2006-10-13 11:37 ` [PATCH 1/14] [TIPC] Add missing unlock in port timeout code Per Liden
@ 2006-10-17 4:39 ` David Miller
0 siblings, 0 replies; 34+ messages in thread
From: David Miller @ 2006-10-17 4:39 UTC (permalink / raw)
To: per.liden; +Cc: netdev, allan.stephens
From: Per Liden <per.liden@ericsson.com>
Date: Fri, 13 Oct 2006 13:37:42 +0200
> From: Allan Stephens <allan.stephens@windriver.com>
>
> Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
> Signed-off-by: Per Liden <per.liden@ericsson.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 2/14] [TIPC] Debug print buffer enhancements and fixes
2006-10-13 11:37 ` [PATCH 2/14] [TIPC] Debug print buffer enhancements and fixes Per Liden
@ 2006-10-17 4:43 ` David Miller
0 siblings, 0 replies; 34+ messages in thread
From: David Miller @ 2006-10-17 4:43 UTC (permalink / raw)
To: per.liden; +Cc: netdev, allan.stephens
From: Per Liden <per.liden@ericsson.com>
Date: Fri, 13 Oct 2006 13:37:43 +0200
> From: Allan Stephens <allan.stephens@windriver.com>
>
> This change modifies TIPC's print buffer code as follows:
> 1) Now supports small print buffers (min. size reduced from 512 bytes to 64)
> 2) Now uses TIPC_NULL print buffer structure to indicate null device
> instead of NULL pointer (this simplified error handling)
> 3) Fixed misuse of console buffer structure by tipc_dump()
> 4) Added and corrected comments in various places
>
> Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
> Signed-off-by: Per Liden <per.liden@ericsson.com>
Applied, please run trailing-whitespace checks on your patches,
f.e. using "git apply --check --whitespace=error-all diff".
Because often I have to fix up problems like the following in
your submissions:
davem@sunset:~/src/GIT/net-2.6$ pcheck diff
+ git apply --check --whitespace=error-all diff
Adds trailing whitespace.
diff:25: * TIPC_LOG : TIPC log buffer
Adds trailing whitespace.
diff:105: *
Adds trailing whitespace.
diff:148: *
Adds trailing whitespace.
diff:334: printk("\n---- Start of %s log dump ----\n\n",
Adds trailing whitespace.
diff:366: tipc_printbuf_init(TIPC_LOG, kmalloc(log_size, GFP_ATOMIC),
Adds trailing whitespace.
diff:393: * @next: used to link print buffers when printing to more than one at a time
Adds trailing whitespace.
diff:395:
fatal: 7 lines add trailing whitespaces.
Thanks.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 3/14] [TIPC] Stream socket can now send > 66000 bytes at a time
2006-10-13 11:37 ` [PATCH 3/14] [TIPC] Stream socket can now send > 66000 bytes at a time Per Liden
@ 2006-10-17 4:44 ` David Miller
0 siblings, 0 replies; 34+ messages in thread
From: David Miller @ 2006-10-17 4:44 UTC (permalink / raw)
To: per.liden; +Cc: netdev, allan.stephens
From: Per Liden <per.liden@ericsson.com>
Date: Fri, 13 Oct 2006 13:37:44 +0200
> From: Allan Stephens <allan.stephens@windriver.com>
>
> The stream socket send code was not initializing some required fields
> of the temporary msghdr structure it was utilizing; this is now fixed.
> A check has also been added to detect if a user illegally specifies
> a destination address when sending on an established stream connection.
>
> Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
> Signed-off-by: Per Liden <per.liden@ericsson.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 4/14] [TIPC] Added duplicate node address detection capability
2006-10-13 11:37 ` [PATCH 4/14] [TIPC] Added duplicate node address detection capability Per Liden
@ 2006-10-17 4:45 ` David Miller
0 siblings, 0 replies; 34+ messages in thread
From: David Miller @ 2006-10-17 4:45 UTC (permalink / raw)
To: per.liden; +Cc: netdev, allan.stephens
From: Per Liden <per.liden@ericsson.com>
Date: Fri, 13 Oct 2006 13:37:45 +0200
> From: Allan Stephens <allan.stephens@windriver.com>
>
> TIPC now rejects and logs link setup requests from node <Z.C.N> if the
> receiving node already has a functional link to that node on the associated
> interface, or if the requestor is using the same <Z.C.N> as the receiver.
>
> Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
> Signed-off-by: Per Liden <per.liden@ericsson.com>
Applied, but more whitespace crap I had to fix up:
davem@sunset:~/src/GIT/net-2.6$ pcheck diff
+ git apply --check --whitespace=error-all diff
Adds trailing whitespace.
diff:19: tipc_printf(pb, "%s(%s)", m_ptr->name,
Adds trailing whitespace.
diff:46:static void disc_dupl_alert(struct bearer *b_ptr, u32 node_addr,
Adds trailing whitespace.
diff:84: spin_unlock_bh(&n_ptr->lock);
fatal: 3 lines add trailing whitespaces.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 5/14] [TIPC] Optimize wakeup logic when socket has no waiting processes
2006-10-13 11:37 ` [PATCH 5/14] [TIPC] Optimize wakeup logic when socket has no waiting processes Per Liden
@ 2006-10-17 4:48 ` David Miller
0 siblings, 0 replies; 34+ messages in thread
From: David Miller @ 2006-10-17 4:48 UTC (permalink / raw)
To: per.liden; +Cc: netdev, allan.stephens
From: Per Liden <per.liden@ericsson.com>
Date: Fri, 13 Oct 2006 13:37:46 +0200
> From: Allan Stephens <allan.stephens@windriver.com>
>
> This patch adds a simple test so TIPC doesn't try waking up processes
> waiting on a socket if there are none waiting.
>
> Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
> Signed-off-by: Per Liden <per.liden@ericsson.com>
Applied.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 6/14] [TIPC] Remove code bloat introduced by print buffer rework
2006-10-13 11:37 ` [PATCH 6/14] [TIPC] Remove code bloat introduced by print buffer rework Per Liden
@ 2006-10-17 4:49 ` David Miller
0 siblings, 0 replies; 34+ messages in thread
From: David Miller @ 2006-10-17 4:49 UTC (permalink / raw)
To: per.liden; +Cc: netdev, allan.stephens
From: Per Liden <per.liden@ericsson.com>
Date: Fri, 13 Oct 2006 13:37:47 +0200
> From: Allan Stephens <allan.stephens@windriver.com>
>
> This patch allows the compiler to optimize out any code that tries to
> send debugging output to the null print buffer (TIPC_NULL), a capability
> that was unintentionally broken during the recent print buffer rework.
>
> Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
> Signed-off-by: Per Liden <per.liden@ericsson.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 7/14] [TIPC] Add support for Ethernet VLANs
2006-10-13 11:37 ` [PATCH 7/14] [TIPC] Add support for Ethernet VLANs Per Liden
@ 2006-10-17 4:50 ` David Miller
0 siblings, 0 replies; 34+ messages in thread
From: David Miller @ 2006-10-17 4:50 UTC (permalink / raw)
To: per.liden; +Cc: netdev, allan.stephens
From: Per Liden <per.liden@ericsson.com>
Date: Fri, 13 Oct 2006 13:37:48 +0200
> From: Allan Stephens <allan.stephens@windriver.com>
>
> This patch enhances TIPC's Ethernet support to include VLAN interfaces.
>
> Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
> Signed-off-by: Per Liden <per.liden@ericsson.com>
Applied, more whitespace I had to fixup:
+ git apply --check --whitespace=error-all diff
Adds trailing whitespace.
diff:24: * (in case the message is sent off-node),
fatal: 1 line adds trailing whitespaces.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 8/14] [TIPC] Fix socket receive queue NULL pointer dereference on SMP systems
2006-10-13 11:37 ` [PATCH 8/14] [TIPC] Fix socket receive queue NULL pointer dereference on SMP systems Per Liden
@ 2006-10-17 4:55 ` David Miller
0 siblings, 0 replies; 34+ messages in thread
From: David Miller @ 2006-10-17 4:55 UTC (permalink / raw)
To: per.liden; +Cc: netdev, xpl
From: Per Liden <per.liden@ericsson.com>
Date: Fri, 13 Oct 2006 13:37:49 +0200
> From: P Litov <xpl@amln.net>
>
> This patch corrects an SMP system-specific race condition which allowed
> TIPC to prematurely dereference the first sk_buff in a socket receive
> queue that was changing from empty to non-empty state.
>
> Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
> Signed-off-by: Per Liden <per.liden@ericsson.com>
If you are going to access the socket packet without some other kind
of locking that prevents changes to the queue, you must take the skb
queue lock. You can't dance around it by checking the linked list
pointer instead the queue length. Otherwise we'd be doing this all
over the UDP code and other datagram socket layers. And we don't
because it simply isn't valid.
So I'm not applying this.
Also, this patch is missing a proper signed off line from the
patch author, P Litov.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 9/14] [TIPC] Name publication events now delivered in chronological order
2006-10-13 11:37 ` [PATCH 9/14] [TIPC] Name publication events now delivered in chronological order Per Liden
2006-10-13 23:13 ` Bill Fink
@ 2006-10-17 4:56 ` David Miller
1 sibling, 0 replies; 34+ messages in thread
From: David Miller @ 2006-10-17 4:56 UTC (permalink / raw)
To: per.liden; +Cc: netdev, allan.stephens
From: Per Liden <per.liden@ericsson.com>
Date: Fri, 13 Oct 2006 13:37:50 +0200
> From: Allan Stephens <allan.stephens@windriver.com>
>
> This patch tivially re-orders the entries in TIPC's list of local
> publications so that applications will receive publication events
> in the order they were published.
>
> Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
> Signed-off-by: Per Liden <per.liden@ericsson.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 10/14] [TIPC] Fixed slow link reactivation when link tolerance is large
2006-10-13 11:37 ` [PATCH 10/14] [TIPC] Fixed slow link reactivation when link tolerance is large Per Liden
@ 2006-10-17 4:57 ` David Miller
0 siblings, 0 replies; 34+ messages in thread
From: David Miller @ 2006-10-17 4:57 UTC (permalink / raw)
To: per.liden; +Cc: netdev, allan.stephens
From: Per Liden <per.liden@ericsson.com>
Date: Fri, 13 Oct 2006 13:37:51 +0200
> From: Allan Stephens <allan.stephens@windriver.com>
>
> This patch corrects an issue wherein a previouly failed node could
> not reestablish a links to a non-failing node in the TIPC network
> until the latter node detected the link failure itself (which might
> be configured to take up to 30 seconds). The non-failing node now
> responds to link setup requests from a previously failed node in at
> most 1 second, allowing it to detect the link failure more quickly.
>
> Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
> Signed-off-by: Per Liden <per.liden@ericsson.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 11/14] [TIPC] Can now list multicast link on an isolated network node
2006-10-13 11:37 ` [PATCH 11/14] [TIPC] Can now list multicast link on an isolated network node Per Liden
@ 2006-10-17 4:58 ` David Miller
0 siblings, 0 replies; 34+ messages in thread
From: David Miller @ 2006-10-17 4:58 UTC (permalink / raw)
To: per.liden; +Cc: netdev, allan.stephens
From: Per Liden <per.liden@ericsson.com>
Date: Fri, 13 Oct 2006 13:37:52 +0200
> From: Allan Stephens <allan.stephens@windriver.com>
>
> This patch fixes a minor bug that prevents "tipc-config -l" from
> displaying the multicast link if a TIPC node has never successfully
> established at least one unicast link.
>
> Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
> Signed-off-by: Per Liden <per.liden@ericsson.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 12/14] [TIPC] Added subscription cancellation capability
2006-10-13 11:37 ` [PATCH 12/14] [TIPC] Added subscription cancellation capability Per Liden
@ 2006-10-17 5:00 ` David Miller
0 siblings, 0 replies; 34+ messages in thread
From: David Miller @ 2006-10-17 5:00 UTC (permalink / raw)
To: per.liden; +Cc: netdev, chenli
From: Per Liden <per.liden@ericsson.com>
Date: Fri, 13 Oct 2006 13:37:53 +0200
> From: Lijun Chen <chenli@nortel.com>
>
> This patch allows a TIPC application to cancel an existing
> topology service subscription by re-requesting the subscription
> with the TIPC_SUB_CANCEL filter bit set. (All other bits of
> the cancel request must match the original subscription request.)
>
> Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
> Signed-off-by: Per Liden <per.liden@ericsson.com>
Applied, but had some trailing whitespace additions to cleanup
and would you please ask all patch authors to provide proper
signed-off-by lines in the future? Thanks.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 13/14] [TIPC] Unrecognized configuration command now returns error message
2006-10-13 11:37 ` [PATCH 13/14] [TIPC] Unrecognized configuration command now returns error message Per Liden
@ 2006-10-17 5:01 ` David Miller
0 siblings, 0 replies; 34+ messages in thread
From: David Miller @ 2006-10-17 5:01 UTC (permalink / raw)
To: per.liden; +Cc: netdev, allan.stephens
From: Per Liden <per.liden@ericsson.com>
Date: Fri, 13 Oct 2006 13:37:54 +0200
> From: Allan Stephens <allan.stephens@windriver.com>
>
> This patch causes TIPC to return an error message when it receives
> an unrecognized configuration command. (Previously, the sender
> received no feedback.)
>
> Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
> Signed-off-by: Per Liden <per.liden@ericsson.com>
Applied.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 14/14] [TIPC] Updated TIPC version number to 1.6.2
2006-10-13 11:37 ` [PATCH 14/14] [TIPC] Updated TIPC version number to 1.6.2 Per Liden
@ 2006-10-17 5:01 ` David Miller
0 siblings, 0 replies; 34+ messages in thread
From: David Miller @ 2006-10-17 5:01 UTC (permalink / raw)
To: per.liden; +Cc: netdev, allan.stephens
From: Per Liden <per.liden@ericsson.com>
Date: Fri, 13 Oct 2006 13:37:55 +0200
> From: Allan Stephens <allan.stephens@windriver.com>
>
> Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
> Signed-off-by: Per Liden <per.liden@ericsson.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 0/14] TIPC updates
2006-10-13 11:37 [PATCH 0/14] TIPC updates Per Liden
` (13 preceding siblings ...)
2006-10-13 11:37 ` [PATCH 14/14] [TIPC] Updated TIPC version number to 1.6.2 Per Liden
@ 2006-10-17 5:04 ` David Miller
2006-10-18 8:24 ` Per Liden
14 siblings, 1 reply; 34+ messages in thread
From: David Miller @ 2006-10-17 5:04 UTC (permalink / raw)
To: per.liden; +Cc: netdev, jon.maloy, allan.stephens
From: Per Liden <per.liden@ericsson.com>
Date: Fri, 13 Oct 2006 13:37:23 +0200 (CEST)
> This patch set includes a number TIPC fixes/cleanups. Please see each
> individual patch for further description.
>
> Please pull from:
>
> git://tipc.cslab.ericsson.net/pub/git/tipc.git
>
> (rebased on linux/kernel/git/davem/net-2.6.git)
I applied everything except patch 8/14, you really need to
add proper SKB queue locking to handle that race. I think
the "performance cost" of taking that lock is much overstated,
you should never have contention on that lock at all.
Secondly, I never pull from your trees because I still have
to make many fixups to your patches:
1) Please add a proper colon to your changeset header lines,
it should be "[TIPC]: ", not "[TIPC] ".
2) Please check for trailing whitespace added by your patches.
I've given you the command you can use in another email to
check this for yourselve before submission.
3) Please get full proper signed-off-by lines from patch submitters,
especially when the patch is more than a trivial 1 or 2 liner.
Thanks.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 0/14] TIPC updates
2006-10-17 5:04 ` [PATCH 0/14] TIPC updates David Miller
@ 2006-10-18 8:24 ` Per Liden
0 siblings, 0 replies; 34+ messages in thread
From: Per Liden @ 2006-10-18 8:24 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Jon Maloy, Allan Stephens
On Mon, 16 Oct 2006, David Miller wrote:
> From: Per Liden <per.liden@ericsson.com>
> Date: Fri, 13 Oct 2006 13:37:23 +0200 (CEST)
>
> > This patch set includes a number TIPC fixes/cleanups. Please see each
> > individual patch for further description.
> >
> > Please pull from:
> >
> > git://tipc.cslab.ericsson.net/pub/git/tipc.git
> >
> > (rebased on linux/kernel/git/davem/net-2.6.git)
>
> I applied everything except patch 8/14, you really need to
> add proper SKB queue locking to handle that race. I think
> the "performance cost" of taking that lock is much overstated,
> you should never have contention on that lock at all.
Ok, we'll take your advice on this.
> Secondly, I never pull from your trees because I still have
> to make many fixups to your patches:
>
> 1) Please add a proper colon to your changeset header lines,
> it should be "[TIPC]: ", not "[TIPC] ".
>
> 2) Please check for trailing whitespace added by your patches.
> I've given you the command you can use in another email to
> check this for yourselve before submission.
>
> 3) Please get full proper signed-off-by lines from patch submitters,
> especially when the patch is more than a trivial 1 or 2 liner.
Thanks a lot for the feedback. We'll do our best to assure that we follow
these rules in the future.
/Per
^ permalink raw reply [flat|nested] 34+ messages in thread
end of thread, other threads:[~2006-10-18 8:24 UTC | newest]
Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-13 11:37 [PATCH 0/14] TIPC updates Per Liden
2006-10-13 11:37 ` [PATCH 1/14] [TIPC] Add missing unlock in port timeout code Per Liden
2006-10-17 4:39 ` David Miller
2006-10-13 11:37 ` [PATCH 2/14] [TIPC] Debug print buffer enhancements and fixes Per Liden
2006-10-17 4:43 ` David Miller
2006-10-13 11:37 ` [PATCH 3/14] [TIPC] Stream socket can now send > 66000 bytes at a time Per Liden
2006-10-17 4:44 ` David Miller
2006-10-13 11:37 ` [PATCH 4/14] [TIPC] Added duplicate node address detection capability Per Liden
2006-10-17 4:45 ` David Miller
2006-10-13 11:37 ` [PATCH 5/14] [TIPC] Optimize wakeup logic when socket has no waiting processes Per Liden
2006-10-17 4:48 ` David Miller
2006-10-13 11:37 ` [PATCH 6/14] [TIPC] Remove code bloat introduced by print buffer rework Per Liden
2006-10-17 4:49 ` David Miller
2006-10-13 11:37 ` [PATCH 7/14] [TIPC] Add support for Ethernet VLANs Per Liden
2006-10-17 4:50 ` David Miller
2006-10-13 11:37 ` [PATCH 8/14] [TIPC] Fix socket receive queue NULL pointer dereference on SMP systems Per Liden
2006-10-17 4:55 ` David Miller
2006-10-13 11:37 ` [PATCH 9/14] [TIPC] Name publication events now delivered in chronological order Per Liden
2006-10-13 23:13 ` Bill Fink
2006-10-16 8:50 ` Per Liden
2006-10-16 20:59 ` David Miller
2006-10-17 4:56 ` David Miller
2006-10-13 11:37 ` [PATCH 10/14] [TIPC] Fixed slow link reactivation when link tolerance is large Per Liden
2006-10-17 4:57 ` David Miller
2006-10-13 11:37 ` [PATCH 11/14] [TIPC] Can now list multicast link on an isolated network node Per Liden
2006-10-17 4:58 ` David Miller
2006-10-13 11:37 ` [PATCH 12/14] [TIPC] Added subscription cancellation capability Per Liden
2006-10-17 5:00 ` David Miller
2006-10-13 11:37 ` [PATCH 13/14] [TIPC] Unrecognized configuration command now returns error message Per Liden
2006-10-17 5:01 ` David Miller
2006-10-13 11:37 ` [PATCH 14/14] [TIPC] Updated TIPC version number to 1.6.2 Per Liden
2006-10-17 5:01 ` David Miller
2006-10-17 5:04 ` [PATCH 0/14] TIPC updates David Miller
2006-10-18 8:24 ` Per Liden
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).