* [PATCH net-next 03/17] tipc: Remove unused global variable tipc_user_count
From: Paul Gortmaker @ 2011-02-24 1:26 UTC (permalink / raw)
To: davem; +Cc: allan.stephens, netdev, Allan Stephens, Paul Gortmaker
In-Reply-To: <1298510805-20630-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <Allan.Stephens@windriver.com>
Eliminates a global variable that was previously used by TIPC's user
registry to track the number of distinct applications using TIPC. Due to
the recent elimination of the user registry this variable no longer serves
any purpose and can be removed.
Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/core.c | 3 +--
net/tipc/core.h | 3 +--
net/tipc/socket.c | 4 +---
3 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/net/tipc/core.c b/net/tipc/core.c
index e071579..2da1fc7 100644
--- a/net/tipc/core.c
+++ b/net/tipc/core.c
@@ -2,7 +2,7 @@
* net/tipc/core.c: TIPC module code
*
* Copyright (c) 2003-2006, Ericsson AB
- * Copyright (c) 2005-2006, Wind River Systems
+ * Copyright (c) 2005-2006, 2010-2011, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -57,7 +57,6 @@
int tipc_mode = TIPC_NOT_RUNNING;
int tipc_random;
-atomic_t tipc_user_count = ATOMIC_INIT(0);
const char tipc_alphabet[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.";
diff --git a/net/tipc/core.h b/net/tipc/core.h
index 9971585..37544d9 100644
--- a/net/tipc/core.h
+++ b/net/tipc/core.h
@@ -2,7 +2,7 @@
* net/tipc/core.h: Include file for TIPC global declarations
*
* Copyright (c) 2005-2006, Ericsson AB
- * Copyright (c) 2005-2007, Wind River Systems
+ * Copyright (c) 2005-2007, 2010-2011, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -161,7 +161,6 @@ extern int tipc_remote_management;
extern int tipc_mode;
extern int tipc_random;
extern const char tipc_alphabet[];
-extern atomic_t tipc_user_count;
/*
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 2b02a3a..893ca6e 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-2007, Ericsson AB
- * Copyright (c) 2004-2008, Wind River Systems
+ * Copyright (c) 2004-2008, 2010-2011, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -241,7 +241,6 @@ static int tipc_create(struct net *net, struct socket *sock, int protocol,
tipc_set_portunreliable(tp_ptr->ref, 1);
}
- atomic_inc(&tipc_user_count);
return 0;
}
@@ -321,7 +320,6 @@ static int release(struct socket *sock)
sock_put(sk);
sock->sk = NULL;
- atomic_dec(&tipc_user_count);
return res;
}
--
1.7.3.3
^ permalink raw reply related
* [PATCH net-next 04/17] tipc: Prevent invalid memory access when sending to configuration service
From: Paul Gortmaker @ 2011-02-24 1:26 UTC (permalink / raw)
To: davem; +Cc: allan.stephens, netdev, Allan Stephens, Paul Gortmaker
In-Reply-To: <1298510805-20630-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <Allan.Stephens@windriver.com>
Reject TIPC configuration service messages without a full message
header. Previously, an application that sent a message to the
configuration service that was too short could cause the validation
code to access an uninitialized field in the msghdr structure,
resulting in a memory access exception.
Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/socket.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 893ca6e..125dcb0 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -493,6 +493,8 @@ static int dest_name_check(struct sockaddr_tipc *dest, struct msghdr *m)
if (likely(dest->addr.name.name.type != TIPC_CFG_SRV))
return -EACCES;
+ if (!m->msg_iovlen || (m->msg_iov[0].iov_len < sizeof(hdr)))
+ return -EMSGSIZE;
if (copy_from_user(&hdr, m->msg_iov[0].iov_base, sizeof(hdr)))
return -EFAULT;
if ((ntohs(hdr.tcm_type) & 0xC000) && (!capable(CAP_NET_ADMIN)))
--
1.7.3.3
^ permalink raw reply related
* [PATCH net-next 05/17] tipc: Improve handling of invalid link tolerance values
From: Paul Gortmaker @ 2011-02-24 1:26 UTC (permalink / raw)
To: davem; +Cc: allan.stephens, netdev, Allan Stephens, Paul Gortmaker
In-Reply-To: <1298510805-20630-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <Allan.Stephens@windriver.com>
Enhances TIPC link code to ignore an invalid link tolerance value
contained in an incoming LINK_PROTOCOL message, rather than
processing the value and potentially causing a divide-by-zero error.
Also add a compile-time check that catches attempts to redefine
TIPC's minimum link tolerance value in a manner that might result
in the same divide-by-zero error at run-time.
Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
include/linux/tipc_config.h | 4 ++++
net/tipc/link.c | 3 +++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h
index 7d42460a..c14102d 100644
--- a/include/linux/tipc_config.h
+++ b/include/linux/tipc_config.h
@@ -193,6 +193,10 @@
#define TIPC_DEF_LINK_TOL 1500
#define TIPC_MAX_LINK_TOL 30000
+#if (TIPC_MIN_LINK_TOL < 16)
+#error "TIPC_MIN_LINK_TOL is too small (abort limit may be NaN)"
+#endif
+
/*
* Link window limits (min, default, max), in packets
*/
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 1c5c53a..3c1c28c 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -2617,6 +2617,9 @@ static void link_check_defragm_bufs(struct link *l_ptr)
static void link_set_supervision_props(struct link *l_ptr, u32 tolerance)
{
+ if ((tolerance < TIPC_MIN_LINK_TOL) || (tolerance > TIPC_MAX_LINK_TOL))
+ return;
+
l_ptr->tolerance = tolerance;
l_ptr->continuity_interval =
((tolerance / 4) > 500) ? 500 : tolerance / 4;
--
1.7.3.3
^ permalink raw reply related
* [PATCH net-next 06/17] tipc: Fix print statements that assume pointers are 32-bit values
From: Paul Gortmaker @ 2011-02-24 1:26 UTC (permalink / raw)
To: davem; +Cc: allan.stephens, netdev, Allan Stephens, Paul Gortmaker
In-Reply-To: <1298510805-20630-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <Allan.Stephens@windriver.com>
Corrects print statements that use %x to print pointer values to use
%p instead, so that 64-bit pointer values are displayed correctly.
Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/link.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 3c1c28c..d586265 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -2983,9 +2983,9 @@ static void link_print(struct link *l_ptr, const char *str)
!= (l_ptr->out_queue_size - 1)) ||
(l_ptr->last_out->next != NULL)) {
tipc_printf(buf, "\nSend queue inconsistency\n");
- tipc_printf(buf, "first_out= %x ", l_ptr->first_out);
- tipc_printf(buf, "next_out= %x ", l_ptr->next_out);
- tipc_printf(buf, "last_out= %x ", l_ptr->last_out);
+ tipc_printf(buf, "first_out= %p ", l_ptr->first_out);
+ tipc_printf(buf, "next_out= %p ", l_ptr->next_out);
+ tipc_printf(buf, "last_out= %p ", l_ptr->last_out);
}
} else
tipc_printf(buf, "[]");
--
1.7.3.3
^ permalink raw reply related
* [PATCH net-next 07/17] tipc: Clean out all remaining instances of #if 0'd unused code
From: Paul Gortmaker @ 2011-02-24 1:26 UTC (permalink / raw)
To: davem; +Cc: allan.stephens, netdev, Allan Stephens, Paul Gortmaker
In-Reply-To: <1298510805-20630-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <Allan.Stephens@windriver.com>
Remove all instances of legacy or proposed-but-not-implemented code
that lives within an #if 0 ... #endif block. If some of it is needed
in the future it can recovered out of history, but there is no need
for it to clutter up the active code base.
Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
include/linux/tipc.h | 8 +-------
include/linux/tipc_config.h | 28 +---------------------------
2 files changed, 2 insertions(+), 34 deletions(-)
diff --git a/include/linux/tipc.h b/include/linux/tipc.h
index 1eefa3f..a5b994a 100644
--- a/include/linux/tipc.h
+++ b/include/linux/tipc.h
@@ -2,7 +2,7 @@
* include/linux/tipc.h: Include file for TIPC socket interface
*
* Copyright (c) 2003-2006, Ericsson AB
- * Copyright (c) 2005, Wind River Systems
+ * Copyright (c) 2005, 2010-2011, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -130,12 +130,6 @@ static inline unsigned int tipc_node(__u32 addr)
#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 */
-#define TIPC_SUB_NO_UNBIND_EVTS 0x08 /* filter out "withdraw" events */
-#define TIPC_SUB_SINGLE_EVT 0x10 /* expire after first event */
-#endif
#define TIPC_WAIT_FOREVER (~0) /* timeout for permanent subscription */
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h
index c14102d..011556f 100644
--- a/include/linux/tipc_config.h
+++ b/include/linux/tipc_config.h
@@ -2,7 +2,7 @@
* include/linux/tipc_config.h: Include file for TIPC configuration interface
*
* Copyright (c) 2003-2006, Ericsson AB
- * Copyright (c) 2005-2007, Wind River Systems
+ * Copyright (c) 2005-2007, 2010-2011, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -76,13 +76,6 @@
#define TIPC_CMD_SHOW_LINK_STATS 0x000B /* tx link_name, rx ultra_string */
#define TIPC_CMD_SHOW_STATS 0x000F /* tx unsigned, rx ultra_string */
-#if 0
-#define TIPC_CMD_SHOW_PORT_STATS 0x0008 /* tx port_ref, rx ultra_string */
-#define TIPC_CMD_RESET_PORT_STATS 0x0009 /* tx port_ref, rx none */
-#define TIPC_CMD_GET_ROUTES 0x000A /* tx ?, rx ? */
-#define TIPC_CMD_GET_LINK_PEER 0x000D /* tx link_name, rx ? */
-#endif
-
/*
* Protected commands:
* May only be issued by "network administration capable" process.
@@ -109,13 +102,6 @@
#define TIPC_CMD_DUMP_LOG 0x410B /* tx none, rx ultra_string */
#define TIPC_CMD_RESET_LINK_STATS 0x410C /* tx link_name, rx none */
-#if 0
-#define TIPC_CMD_CREATE_LINK 0x4103 /* tx link_create, rx none */
-#define TIPC_CMD_REMOVE_LINK 0x4104 /* tx link_name, rx none */
-#define TIPC_CMD_BLOCK_LINK 0x4105 /* tx link_name, rx none */
-#define TIPC_CMD_UNBLOCK_LINK 0x4106 /* tx link_name, rx none */
-#endif
-
/*
* Private commands:
* May only be issued by "network administration capable" process.
@@ -123,9 +109,6 @@
*/
#define TIPC_CMD_SET_NODE_ADDR 0x8001 /* tx net_addr, rx none */
-#if 0
-#define TIPC_CMD_SET_ZONE_MASTER 0x8002 /* tx none, rx none */
-#endif
#define TIPC_CMD_SET_REMOTE_MNG 0x8003 /* tx unsigned, rx none */
#define TIPC_CMD_SET_MAX_PORTS 0x8004 /* tx unsigned, rx none */
#define TIPC_CMD_SET_MAX_PUBL 0x8005 /* tx unsigned, rx none */
@@ -251,15 +234,6 @@ struct tipc_name_table_query {
#define TIPC_CFG_NOT_SUPPORTED "\x84" /* request is not supported by TIPC */
#define TIPC_CFG_INVALID_VALUE "\x85" /* request has invalid argument value */
-#if 0
-/* prototypes TLV structures for proposed commands */
-struct tipc_link_create {
- __u32 domain;
- struct tipc_media_addr peer_addr;
- char bearer_name[TIPC_MAX_BEARER_NAME];
-};
-#endif
-
/*
* A TLV consists of a descriptor, followed by the TLV value.
* TLV descriptor fields are stored in network byte order;
--
1.7.3.3
^ permalink raw reply related
* [PATCH net-next 08/17] tipc: Clean up tracking of node requesting a broadcast retransmit
From: Paul Gortmaker @ 2011-02-24 1:26 UTC (permalink / raw)
To: davem; +Cc: allan.stephens, netdev, Allan Stephens, Paul Gortmaker
In-Reply-To: <1298510805-20630-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <Allan.Stephens@windriver.com>
Allows the broadcast link to track the node that is requesting a retransmit
in a new field dedicated to that purpose. This replaces the existing
mechanism that (ab)uses an existing node structure linked list field to do
the tracking.
Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/bcast.c | 16 ++++++++++++++--
net/tipc/bcast.h | 3 ++-
net/tipc/link.c | 2 +-
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index b4d659d..a5eb7db 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -93,6 +93,7 @@ struct bcbearer {
* struct bclink - link used for broadcast messages
* @link: (non-standard) broadcast link structure
* @node: (non-standard) node structure representing b'cast link's peer node
+ * @retransmit_to: node that most recently requested a retransmit
*
* Handles sequence numbering, fragmentation, bundling, etc.
*/
@@ -100,6 +101,7 @@ struct bcbearer {
struct bclink {
struct link link;
struct tipc_node node;
+ struct tipc_node *retransmit_to;
};
@@ -184,6 +186,17 @@ static int bclink_ack_allowed(u32 n)
/**
+ * tipc_bclink_retransmit_to - get most recent node to request retransmission
+ *
+ * Called with bc_lock locked
+ */
+
+struct tipc_node *tipc_bclink_retransmit_to(void)
+{
+ return bclink->retransmit_to;
+}
+
+/**
* bclink_retransmit_pkt - retransmit broadcast packets
* @after: sequence number of last packet to *not* retransmit
* @to: sequence number of last packet to retransmit
@@ -444,10 +457,9 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
tipc_node_unlock(node);
spin_lock_bh(&bc_lock);
bcl->stats.recv_nacks++;
- bcl->owner->next = node; /* remember requestor */
+ bclink->retransmit_to = node;
bclink_retransmit_pkt(msg_bcgap_after(msg),
msg_bcgap_to(msg));
- bcl->owner->next = NULL;
spin_unlock_bh(&bc_lock);
} else {
tipc_bclink_peek_nack(msg_destnode(msg),
diff --git a/net/tipc/bcast.h b/net/tipc/bcast.h
index 51f8c53..500c97f 100644
--- a/net/tipc/bcast.h
+++ b/net/tipc/bcast.h
@@ -2,7 +2,7 @@
* net/tipc/bcast.h: Include file for TIPC broadcast code
*
* Copyright (c) 2003-2006, Ericsson AB
- * Copyright (c) 2005, Wind River Systems
+ * Copyright (c) 2005, 2010-2011, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -90,6 +90,7 @@ void tipc_port_list_free(struct port_list *pl_ptr);
int tipc_bclink_init(void);
void tipc_bclink_stop(void);
+struct tipc_node *tipc_bclink_retransmit_to(void);
void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked);
int tipc_bclink_send_msg(struct sk_buff *buf);
void tipc_bclink_recv_pkt(struct sk_buff *buf);
diff --git a/net/tipc/link.c b/net/tipc/link.c
index d586265..0cb773b 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1441,7 +1441,7 @@ static void link_retransmit_failure(struct link *l_ptr, struct sk_buff *buf)
info("Outstanding acks: %lu\n",
(unsigned long) TIPC_SKB_CB(buf)->handle);
- n_ptr = l_ptr->owner->next;
+ n_ptr = tipc_bclink_retransmit_to();
tipc_node_lock(n_ptr);
tipc_addr_string_fill(addr_string, n_ptr->addr);
--
1.7.3.3
^ permalink raw reply related
* [PATCH net-next 09/17] tipc: Eliminate unnecessary locking when starting topology service
From: Paul Gortmaker @ 2011-02-24 1:26 UTC (permalink / raw)
To: davem; +Cc: allan.stephens, netdev, Allan Stephens, Paul Gortmaker
In-Reply-To: <1298510805-20630-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <Allan.Stephens@windriver.com>
Modifies the initialization code for TIPC's topology service to
avoid taking the spinlock protecting the subscriber list, since
there is no need to do this.
Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/subscr.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c
index 98ee50b..1387372 100644
--- a/net/tipc/subscr.c
+++ b/net/tipc/subscr.c
@@ -542,7 +542,6 @@ int tipc_subscr_start(void)
spin_lock_init(&topsrv.lock);
INIT_LIST_HEAD(&topsrv.subscriber_list);
- spin_lock_bh(&topsrv.lock);
res = tipc_createport(NULL,
TIPC_CRITICAL_IMPORTANCE,
NULL,
@@ -563,12 +562,10 @@ int tipc_subscr_start(void)
goto failed;
}
- spin_unlock_bh(&topsrv.lock);
return 0;
failed:
err("Failed to create subscription service\n");
- spin_unlock_bh(&topsrv.lock);
return res;
}
--
1.7.3.3
^ permalink raw reply related
* [PATCH net-next 10/17] tipc: Improve accuracy of link transmit queue maximum size statistic
From: Paul Gortmaker @ 2011-02-24 1:26 UTC (permalink / raw)
To: davem; +Cc: allan.stephens, netdev, Allan Stephens, Paul Gortmaker
In-Reply-To: <1298510805-20630-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <Allan.Stephens@windriver.com>
Enhances TIPC's unicast and broadcast link code to update the transmit
queue maximum size counter in a single place, namely the routine that
adds messages to the queue. This ensures that the maximum size statistic
reported for unicast links is completely accurate, rather than being
partially based on statistical sampling.
The changes to link.h are just documenting the roles of the variables.
Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/bcast.c | 2 --
net/tipc/link.c | 9 +++------
net/tipc/link.h | 18 ++++++------------
3 files changed, 9 insertions(+), 20 deletions(-)
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index a5eb7db..63df42b 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -418,8 +418,6 @@ int tipc_bclink_send_msg(struct sk_buff *buf)
else
bclink_set_last_sent();
- if (bcl->out_queue_size > bcl->stats.max_queue_sz)
- bcl->stats.max_queue_sz = bcl->out_queue_size;
bcl->stats.queue_sz_counts++;
bcl->stats.accu_queue_sz += bcl->out_queue_size;
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 0cb773b..d1818fb 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -246,9 +246,6 @@ static void link_timeout(struct link *l_ptr)
l_ptr->stats.accu_queue_sz += l_ptr->out_queue_size;
l_ptr->stats.queue_sz_counts++;
- if (l_ptr->out_queue_size > l_ptr->stats.max_queue_sz)
- l_ptr->stats.max_queue_sz = l_ptr->out_queue_size;
-
if (l_ptr->first_out) {
struct tipc_msg *msg = buf_msg(l_ptr->first_out);
u32 length = msg_size(msg);
@@ -824,7 +821,10 @@ static void link_add_to_outqueue(struct link *l_ptr,
l_ptr->last_out = buf;
} else
l_ptr->first_out = l_ptr->last_out = buf;
+
l_ptr->out_queue_size++;
+ if (l_ptr->out_queue_size > l_ptr->stats.max_queue_sz)
+ l_ptr->stats.max_queue_sz = l_ptr->out_queue_size;
}
/*
@@ -867,9 +867,6 @@ int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf)
/* Packet can be queued or sent: */
- if (queue_size > l_ptr->stats.max_queue_sz)
- l_ptr->stats.max_queue_sz = queue_size;
-
if (likely(!tipc_bearer_congested(l_ptr->b_ptr, l_ptr) &&
!link_congested(l_ptr))) {
link_add_to_outqueue(l_ptr, buf, msg);
diff --git a/net/tipc/link.h b/net/tipc/link.h
index bdb0fa2..a7794e7 100644
--- a/net/tipc/link.h
+++ b/net/tipc/link.h
@@ -196,18 +196,12 @@ struct link {
u32 bearer_congs;
u32 deferred_recv;
u32 duplicates;
-
- /* for statistical profiling of send queue size */
-
- u32 max_queue_sz;
- u32 accu_queue_sz;
- u32 queue_sz_counts;
-
- /* for statistical profiling of message lengths */
-
- u32 msg_length_counts;
- u32 msg_lengths_total;
- u32 msg_length_profile[7];
+ u32 max_queue_sz; /* send queue size high water mark */
+ u32 accu_queue_sz; /* used for send queue size profiling */
+ u32 queue_sz_counts; /* used for send queue size profiling */
+ u32 msg_length_counts; /* used for message length profiling */
+ u32 msg_lengths_total; /* used for message length profiling */
+ u32 msg_length_profile[7]; /* used for msg. length profiling */
} stats;
};
--
1.7.3.3
^ permalink raw reply related
* [PATCH net-next 11/17] tipc: Set unused probe field of link protocol messages to defined value
From: Paul Gortmaker @ 2011-02-24 1:26 UTC (permalink / raw)
To: davem; +Cc: allan.stephens, netdev, Allan Stephens, Paul Gortmaker
In-Reply-To: <1298510805-20630-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <Allan.Stephens@windriver.com>
Ensures that a link reset or activate message has a "probe" field
of zero. (This field is currently unused in these messages, but this
could potentially change in future versions of TIPC.)
Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/link.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/net/tipc/link.c b/net/tipc/link.c
index d1818fb..754e310 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1946,6 +1946,7 @@ void tipc_link_send_proto_msg(struct link *l_ptr, u32 msg_typ, int probe_msg,
msg_set_ack(msg, mod(l_ptr->reset_checkpoint - 1));
msg_set_seq_gap(msg, 0);
msg_set_next_sent(msg, 1);
+ msg_set_probe(msg, 0);
msg_set_link_tolerance(msg, l_ptr->tolerance);
msg_set_linkprio(msg, l_ptr->priority);
msg_set_max_pkt(msg, l_ptr->max_pkt_target);
--
1.7.3.3
^ permalink raw reply related
* [PATCH net-next 12/17] tipc: Minor optimization to topology service connection establishment
From: Paul Gortmaker @ 2011-02-24 1:26 UTC (permalink / raw)
To: davem; +Cc: allan.stephens, netdev, Allan Stephens, Paul Gortmaker
In-Reply-To: <1298510805-20630-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <Allan.Stephens@windriver.com>
Eliminates a local iovec structure containing no data, which was
previously used during the establishment of a topology service connection,
since the same effect can be achieved by passing in a NULL pointer and
an iovec length of zero.
Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/subscr.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c
index 1387372..aae9eae 100644
--- a/net/tipc/subscr.c
+++ b/net/tipc/subscr.c
@@ -472,8 +472,6 @@ static void subscr_named_msg_event(void *usr_handle,
struct tipc_portid const *orig,
struct tipc_name_seq const *dest)
{
- static struct iovec msg_sect = {NULL, 0};
-
struct subscriber *subscriber;
u32 server_port_ref;
@@ -523,7 +521,7 @@ static void subscr_named_msg_event(void *usr_handle,
/* Send an ACK- to complete connection handshaking */
- tipc_send(server_port_ref, 1, &msg_sect);
+ tipc_send(server_port_ref, 0, NULL);
/* Handle optional subscription request */
--
1.7.3.3
^ permalink raw reply related
* [PATCH net-next 13/17] tipc: Fix port counter handling to correct congestion control
From: Paul Gortmaker @ 2011-02-24 1:26 UTC (permalink / raw)
To: davem; +Cc: allan.stephens, netdev, Allan Stephens, Paul Gortmaker
In-Reply-To: <1298510805-20630-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <Allan.Stephens@windriver.com>
Modifies TIPC's congestion control between a connected port and its
peer so that it works as documented. The following changes have been
made:
1) The counter of the number of messages sent by a port now starts
at zero, rather than one. This prevents the port from reporting port
congestion one message earlier than it was supposed to.
2) The counter of the number of messages sent by a port is now
incremented only if a non-empty message is sent successfully.
This prevents the port from becoming permanently congested if
too many send attempts are unsuccessful because of congestion
(or other reasons). It also removes the risk that empty hand-
shaking messages used during connection setup might cause the
port to report congestion earlier than it was supposed to.
3) The counter of the number of unacknowledged messages received by
a port controlled by an internal TIPC service is now incremented
only if the message is non-empty, in order to be consistent with
the aforementioned changes.
Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/port.c | 53 ++++++++++++++++++++++++++++++++++-------------------
net/tipc/port.h | 4 ++--
2 files changed, 36 insertions(+), 21 deletions(-)
diff --git a/net/tipc/port.c b/net/tipc/port.c
index aff5dc0..3e5122c 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -234,7 +234,6 @@ struct tipc_port *tipc_createport_raw(void *usr_handle,
tipc_msg_init(msg, importance, TIPC_NAMED_MSG, LONG_H_SIZE, 0);
msg_set_origport(msg, ref);
p_ptr->last_in_seqno = 41;
- p_ptr->sent = 1;
INIT_LIST_HEAD(&p_ptr->wait_list);
INIT_LIST_HEAD(&p_ptr->subscription.nodesub_list);
p_ptr->dispatcher = dispatcher;
@@ -732,6 +731,7 @@ static void port_dispatcher_sigh(void *dummy)
tipc_conn_msg_event cb = up_ptr->conn_msg_cb;
u32 peer_port = port_peerport(p_ptr);
u32 peer_node = port_peernode(p_ptr);
+ u32 dsz;
tipc_port_unlock(p_ptr);
if (unlikely(!cb))
@@ -742,13 +742,14 @@ static void port_dispatcher_sigh(void *dummy)
} else if ((msg_origport(msg) != peer_port) ||
(msg_orignode(msg) != peer_node))
goto reject;
- if (unlikely(++p_ptr->conn_unacked >=
- TIPC_FLOW_CONTROL_WIN))
+ dsz = msg_data_sz(msg);
+ if (unlikely(dsz &&
+ (++p_ptr->conn_unacked >=
+ TIPC_FLOW_CONTROL_WIN)))
tipc_acknowledge(dref,
p_ptr->conn_unacked);
skb_pull(buf, msg_hdr_sz(msg));
- cb(usr_handle, dref, &buf, msg_data(msg),
- msg_data_sz(msg));
+ cb(usr_handle, dref, &buf, msg_data(msg), dsz);
break;
}
case TIPC_DIRECT_MSG:{
@@ -1221,7 +1222,8 @@ int tipc_send(u32 ref, unsigned int num_sect, struct iovec const *msg_sect)
if (likely(res != -ELINKCONG)) {
port_incr_out_seqno(p_ptr);
p_ptr->congested = 0;
- p_ptr->sent++;
+ if (res > 0)
+ p_ptr->sent++;
return res;
}
}
@@ -1263,13 +1265,17 @@ int tipc_send2name(u32 ref, struct tipc_name const *name, unsigned int domain,
msg_set_destport(msg, destport);
if (likely(destport)) {
- p_ptr->sent++;
if (likely(destnode == tipc_own_addr))
- return tipc_port_recv_sections(p_ptr, num_sect, msg_sect);
- res = tipc_link_send_sections_fast(p_ptr, msg_sect, num_sect,
- destnode);
- if (likely(res != -ELINKCONG))
+ res = tipc_port_recv_sections(p_ptr, num_sect,
+ msg_sect);
+ else
+ res = tipc_link_send_sections_fast(p_ptr, msg_sect,
+ num_sect, destnode);
+ if (likely(res != -ELINKCONG)) {
+ if (res > 0)
+ p_ptr->sent++;
return res;
+ }
if (port_unreliable(p_ptr)) {
/* Just calculate msg length and return */
return tipc_msg_calc_data_size(msg_sect, num_sect);
@@ -1302,12 +1308,17 @@ int tipc_send2port(u32 ref, struct tipc_portid const *dest,
msg_set_destnode(msg, dest->node);
msg_set_destport(msg, dest->ref);
msg_set_hdr_sz(msg, DIR_MSG_H_SIZE);
- p_ptr->sent++;
+
if (dest->node == tipc_own_addr)
- return tipc_port_recv_sections(p_ptr, num_sect, msg_sect);
- res = tipc_link_send_sections_fast(p_ptr, msg_sect, num_sect, dest->node);
- if (likely(res != -ELINKCONG))
+ res = tipc_port_recv_sections(p_ptr, num_sect, msg_sect);
+ else
+ res = tipc_link_send_sections_fast(p_ptr, msg_sect, num_sect,
+ dest->node);
+ if (likely(res != -ELINKCONG)) {
+ if (res > 0)
+ p_ptr->sent++;
return res;
+ }
if (port_unreliable(p_ptr)) {
/* Just calculate msg length and return */
return tipc_msg_calc_data_size(msg_sect, num_sect);
@@ -1343,12 +1354,16 @@ int tipc_send_buf2port(u32 ref, struct tipc_portid const *dest,
skb_push(buf, DIR_MSG_H_SIZE);
skb_copy_to_linear_data(buf, msg, DIR_MSG_H_SIZE);
- p_ptr->sent++;
+
if (dest->node == tipc_own_addr)
- return tipc_port_recv_msg(buf);
- res = tipc_send_buf_fast(buf, dest->node);
- if (likely(res != -ELINKCONG))
+ res = tipc_port_recv_msg(buf);
+ else
+ res = tipc_send_buf_fast(buf, dest->node);
+ if (likely(res != -ELINKCONG)) {
+ if (res > 0)
+ p_ptr->sent++;
return res;
+ }
if (port_unreliable(p_ptr))
return dsz;
return -ELINKCONG;
diff --git a/net/tipc/port.h b/net/tipc/port.h
index f8722af..34ccb7c 100644
--- a/net/tipc/port.h
+++ b/net/tipc/port.h
@@ -113,8 +113,8 @@ struct user_port {
* @user_port: ptr to user port associated with port (if any)
* @wait_list: adjacent ports in list of ports waiting on link congestion
* @waiting_pkts:
- * @sent:
- * @acked:
+ * @sent: # of non-empty messages sent by port
+ * @acked: # of non-empty message acknowledgements from connected port's peer
* @publications: list of publications for port
* @pub_count: total # of publications port has made during its lifetime
* @probing_state:
--
1.7.3.3
^ permalink raw reply related
* [PATCH net-next 14/17] tipc: Add in missing lock during link initialization
From: Paul Gortmaker @ 2011-02-24 1:26 UTC (permalink / raw)
To: davem; +Cc: allan.stephens, netdev, Allan Stephens, Paul Gortmaker
In-Reply-To: <1298510805-20630-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <Allan.Stephens@windriver.com>
Ensure that the routine that starts up processing on a newly created
link endpoint takes the spinlock of the node object that owns the link,
to prevent possible conflicts with processing involving other links
owned by that node object.
Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/link.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 754e310..89fbb6d 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -388,7 +388,9 @@ void tipc_link_delete(struct link *l_ptr)
static void link_start(struct link *l_ptr)
{
+ tipc_node_lock(l_ptr->owner);
link_state_event(l_ptr, STARTING_EVT);
+ tipc_node_unlock(l_ptr->owner);
}
/**
--
1.7.3.3
^ permalink raw reply related
* [PATCH net-next 15/17] tipc: Remove support for per-connection message sequence numbering
From: Paul Gortmaker @ 2011-02-24 1:26 UTC (permalink / raw)
To: davem; +Cc: allan.stephens, netdev, Allan Stephens, Paul Gortmaker
In-Reply-To: <1298510805-20630-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <Allan.Stephens@windriver.com>
Eliminates TIPC's prototype support for message sequence numbering
on routable connections (i.e. connections requiring more than one hop).
This capability isn't currently used, and can be removed since TIPC
only supports systems in which all inter-node communication can be
achieved in a single hop.
Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/msg.c | 6 +-----
net/tipc/msg.h | 12 +-----------
net/tipc/port.c | 29 +----------------------------
net/tipc/port.h | 2 --
4 files changed, 3 insertions(+), 46 deletions(-)
diff --git a/net/tipc/msg.c b/net/tipc/msg.c
index bb6180c..e56b9b8 100644
--- a/net/tipc/msg.c
+++ b/net/tipc/msg.c
@@ -2,7 +2,7 @@
* net/tipc/msg.c: TIPC message header routines
*
* Copyright (c) 2000-2006, Ericsson AB
- * Copyright (c) 2005, Wind River Systems
+ * Copyright (c) 2005, 2010-2011, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -381,14 +381,10 @@ void tipc_msg_dbg(struct print_buf *buf, struct tipc_msg *msg, const char *str)
tipc_printf(buf, ":OPRT(%u):", msg_origport(msg));
tipc_printf(buf, ":DPRT(%u):", msg_destport(msg));
}
- if (msg_routed(msg) && !msg_non_seq(msg))
- tipc_printf(buf, ":TSEQN(%u)", msg_transp_seqno(msg));
}
if (msg_user(msg) == NAME_DISTRIBUTOR) {
tipc_printf(buf, ":ONOD(%x):", msg_orignode(msg));
tipc_printf(buf, ":DNOD(%x):", msg_destnode(msg));
- if (msg_routed(msg))
- tipc_printf(buf, ":CSEQN(%u)", msg_transp_seqno(msg));
}
if (msg_user(msg) == LINK_CONFIG) {
diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index 92c4c4f..b1438c7 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -2,7 +2,7 @@
* net/tipc/msg.h: Include file for TIPC message header routines
*
* Copyright (c) 2000-2007, Ericsson AB
- * Copyright (c) 2005-2008, Wind River Systems
+ * Copyright (c) 2005-2008, 2010-2011, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -438,11 +438,6 @@ static inline void msg_set_nametype(struct tipc_msg *m, u32 n)
msg_set_word(m, 8, n);
}
-static inline u32 msg_transp_seqno(struct tipc_msg *m)
-{
- return msg_word(m, 8);
-}
-
static inline void msg_set_timestamp(struct tipc_msg *m, u32 n)
{
msg_set_word(m, 8, n);
@@ -453,11 +448,6 @@ static inline u32 msg_timestamp(struct tipc_msg *m)
return msg_word(m, 8);
}
-static inline void msg_set_transp_seqno(struct tipc_msg *m, u32 n)
-{
- msg_set_word(m, 8, n);
-}
-
static inline u32 msg_nameinst(struct tipc_msg *m)
{
return msg_word(m, 9);
diff --git a/net/tipc/port.c b/net/tipc/port.c
index 3e5122c..6ff78f9 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -69,20 +69,6 @@ static u32 port_peerport(struct tipc_port *p_ptr)
return msg_destport(&p_ptr->phdr);
}
-static u32 port_out_seqno(struct tipc_port *p_ptr)
-{
- return msg_transp_seqno(&p_ptr->phdr);
-}
-
-static void port_incr_out_seqno(struct tipc_port *p_ptr)
-{
- struct tipc_msg *m = &p_ptr->phdr;
-
- if (likely(!msg_routed(m)))
- return;
- msg_set_transp_seqno(m, (msg_transp_seqno(m) + 1));
-}
-
/**
* tipc_multicast - send a multicast message to local and remote destinations
*/
@@ -233,7 +219,6 @@ struct tipc_port *tipc_createport_raw(void *usr_handle,
msg = &p_ptr->phdr;
tipc_msg_init(msg, importance, TIPC_NAMED_MSG, LONG_H_SIZE, 0);
msg_set_origport(msg, ref);
- p_ptr->last_in_seqno = 41;
INIT_LIST_HEAD(&p_ptr->wait_list);
INIT_LIST_HEAD(&p_ptr->subscription.nodesub_list);
p_ptr->dispatcher = dispatcher;
@@ -344,7 +329,7 @@ int tipc_set_portunreturnable(u32 ref, unsigned int isunrejectable)
static struct sk_buff *port_build_proto_msg(u32 destport, u32 destnode,
u32 origport, u32 orignode,
u32 usr, u32 type, u32 err,
- u32 seqno, u32 ack)
+ u32 ack)
{
struct sk_buff *buf;
struct tipc_msg *msg;
@@ -357,7 +342,6 @@ static struct sk_buff *port_build_proto_msg(u32 destport, u32 destnode,
msg_set_destport(msg, destport);
msg_set_origport(msg, origport);
msg_set_orignode(msg, orignode);
- msg_set_transp_seqno(msg, seqno);
msg_set_msgcnt(msg, ack);
}
return buf;
@@ -467,9 +451,7 @@ static void port_timeout(unsigned long ref)
CONN_MANAGER,
CONN_PROBE,
TIPC_OK,
- port_out_seqno(p_ptr),
0);
- port_incr_out_seqno(p_ptr);
p_ptr->probing_state = PROBING;
k_start_timer(&p_ptr->timer, p_ptr->probing_interval);
}
@@ -506,7 +488,6 @@ static struct sk_buff *port_build_self_abort_msg(struct tipc_port *p_ptr, u32 er
imp,
TIPC_CONN_MSG,
err,
- p_ptr->last_in_seqno + 1,
0);
}
@@ -526,7 +507,6 @@ static struct sk_buff *port_build_peer_abort_msg(struct tipc_port *p_ptr, u32 er
imp,
TIPC_CONN_MSG,
err,
- port_out_seqno(p_ptr),
0);
}
@@ -568,7 +548,6 @@ void tipc_port_recv_proto_msg(struct sk_buff *buf)
TIPC_HIGH_IMPORTANCE,
TIPC_CONN_MSG,
err,
- 0,
0);
goto exit;
}
@@ -582,11 +561,9 @@ void tipc_port_recv_proto_msg(struct sk_buff *buf)
CONN_MANAGER,
CONN_PROBE_REPLY,
TIPC_OK,
- port_out_seqno(p_ptr),
0);
}
p_ptr->probing_state = CONFIRMED;
- port_incr_out_seqno(p_ptr);
exit:
if (p_ptr)
tipc_port_unlock(p_ptr);
@@ -914,7 +891,6 @@ void tipc_acknowledge(u32 ref, u32 ack)
CONN_MANAGER,
CONN_ACK,
TIPC_OK,
- port_out_seqno(p_ptr),
ack);
}
tipc_port_unlock(p_ptr);
@@ -1088,7 +1064,6 @@ int tipc_connect2port(u32 ref, struct tipc_portid const *peer)
msg_set_destport(msg, peer->ref);
msg_set_orignode(msg, tipc_own_addr);
msg_set_origport(msg, p_ptr->ref);
- msg_set_transp_seqno(msg, 42);
msg_set_type(msg, TIPC_CONN_MSG);
msg_set_hdr_sz(msg, SHORT_H_SIZE);
@@ -1170,7 +1145,6 @@ int tipc_shutdown(u32 ref)
imp,
TIPC_CONN_MSG,
TIPC_CONN_SHUTDOWN,
- port_out_seqno(p_ptr),
0);
}
tipc_port_unlock(p_ptr);
@@ -1220,7 +1194,6 @@ int tipc_send(u32 ref, unsigned int num_sect, struct iovec const *msg_sect)
res = tipc_port_recv_sections(p_ptr, num_sect, msg_sect);
if (likely(res != -ELINKCONG)) {
- port_incr_out_seqno(p_ptr);
p_ptr->congested = 0;
if (res > 0)
p_ptr->sent++;
diff --git a/net/tipc/port.h b/net/tipc/port.h
index 34ccb7c..87b9424 100644
--- a/net/tipc/port.h
+++ b/net/tipc/port.h
@@ -119,7 +119,6 @@ struct user_port {
* @pub_count: total # of publications port has made during its lifetime
* @probing_state:
* @probing_interval:
- * @last_in_seqno:
* @timer_ref:
* @subscription: "node down" subscription used to terminate failed connections
*/
@@ -147,7 +146,6 @@ struct tipc_port {
u32 pub_count;
u32 probing_state;
u32 probing_interval;
- u32 last_in_seqno;
struct timer_list timer;
struct tipc_node_subscr subscription;
};
--
1.7.3.3
^ permalink raw reply related
* [PATCH net-next 16/17] tipc: Remove unused message header field for requested number of links
From: Paul Gortmaker @ 2011-02-24 1:26 UTC (permalink / raw)
To: davem; +Cc: allan.stephens, netdev, Allan Stephens, Paul Gortmaker
In-Reply-To: <1298510805-20630-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <Allan.Stephens@windriver.com>
Eliminates support for the "number of requested links" field in a neighbor
discovery message. This field was never used and has been removed from
the TIPC 2.0 protocol specification.
Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/bearer.c | 2 +-
net/tipc/discover.c | 11 +++--------
net/tipc/discover.h | 3 +--
net/tipc/msg.c | 1 -
net/tipc/msg.h | 10 ----------
5 files changed, 5 insertions(+), 22 deletions(-)
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index 9e2ff0e..f2839b0 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -566,7 +566,7 @@ restart:
INIT_LIST_HEAD(&b_ptr->links);
if (m_ptr->bcast) {
b_ptr->link_req = tipc_disc_init_link_req(b_ptr, &m_ptr->bcast_addr,
- bcast_scope, 2);
+ bcast_scope);
}
spin_lock_init(&b_ptr->lock);
write_unlock_bh(&tipc_net_lock);
diff --git a/net/tipc/discover.c b/net/tipc/discover.c
index 59a86fc..09ce231 100644
--- a/net/tipc/discover.c
+++ b/net/tipc/discover.c
@@ -67,13 +67,11 @@ struct link_req {
/**
* tipc_disc_init_msg - initialize a link setup message
* @type: message type (request or response)
- * @req_links: number of links associated with message
* @dest_domain: network domain of node(s) which should respond to message
* @b_ptr: ptr to bearer issuing message
*/
static struct sk_buff *tipc_disc_init_msg(u32 type,
- u32 req_links,
u32 dest_domain,
struct tipc_bearer *b_ptr)
{
@@ -84,7 +82,6 @@ static struct sk_buff *tipc_disc_init_msg(u32 type,
msg = buf_msg(buf);
tipc_msg_init(msg, LINK_CONFIG, type, DSC_H_SIZE, dest_domain);
msg_set_non_seq(msg, 1);
- msg_set_req_links(msg, req_links);
msg_set_dest_domain(msg, dest_domain);
msg_set_bc_netid(msg, tipc_net_id);
msg_set_media_addr(msg, &b_ptr->addr);
@@ -191,7 +188,7 @@ void tipc_disc_recv_msg(struct sk_buff *buf, struct tipc_bearer *b_ptr)
spin_unlock_bh(&n_ptr->lock);
if ((type == DSC_RESP_MSG) || link_fully_up)
return;
- rbuf = tipc_disc_init_msg(DSC_RESP_MSG, 1, orig, b_ptr);
+ rbuf = tipc_disc_init_msg(DSC_RESP_MSG, orig, b_ptr);
if (rbuf != NULL) {
b_ptr->media->send_msg(rbuf, b_ptr, &media_addr);
buf_discard(rbuf);
@@ -274,15 +271,13 @@ static void disc_timeout(struct link_req *req)
* @b_ptr: ptr to bearer issuing requests
* @dest: destination address for request messages
* @dest_domain: network domain of node(s) which should respond to message
- * @req_links: max number of desired links
*
* Returns pointer to link request structure, or NULL if unable to create.
*/
struct link_req *tipc_disc_init_link_req(struct tipc_bearer *b_ptr,
const struct tipc_media_addr *dest,
- u32 dest_domain,
- u32 req_links)
+ u32 dest_domain)
{
struct link_req *req;
@@ -290,7 +285,7 @@ struct link_req *tipc_disc_init_link_req(struct tipc_bearer *b_ptr,
if (!req)
return NULL;
- req->buf = tipc_disc_init_msg(DSC_REQ_MSG, req_links, dest_domain, b_ptr);
+ req->buf = tipc_disc_init_msg(DSC_REQ_MSG, dest_domain, b_ptr);
if (!req->buf) {
kfree(req);
return NULL;
diff --git a/net/tipc/discover.h b/net/tipc/discover.h
index 4046d77..e48a167 100644
--- a/net/tipc/discover.h
+++ b/net/tipc/discover.h
@@ -41,8 +41,7 @@ struct link_req;
struct link_req *tipc_disc_init_link_req(struct tipc_bearer *b_ptr,
const struct tipc_media_addr *dest,
- u32 dest_domain,
- u32 req_links);
+ u32 dest_domain);
void tipc_disc_update_link_req(struct link_req *req);
void tipc_disc_stop_link_req(struct link_req *req);
diff --git a/net/tipc/msg.c b/net/tipc/msg.c
index e56b9b8..0787e12 100644
--- a/net/tipc/msg.c
+++ b/net/tipc/msg.c
@@ -390,7 +390,6 @@ void tipc_msg_dbg(struct print_buf *buf, struct tipc_msg *msg, const char *str)
if (msg_user(msg) == LINK_CONFIG) {
u32 *raw = (u32 *)msg;
struct tipc_media_addr *orig = (struct tipc_media_addr *)&raw[5];
- tipc_printf(buf, ":REQL(%u):", msg_req_links(msg));
tipc_printf(buf, ":DDOM(%x):", msg_dest_domain(msg));
tipc_printf(buf, ":NETID(%u):", msg_bc_netid(msg));
tipc_media_addr_printf(buf, orig);
diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index b1438c7..9d643a1 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -567,16 +567,6 @@ static inline void msg_set_seq_gap(struct tipc_msg *m, u32 n)
msg_set_bits(m, 1, 16, 0x1fff, n);
}
-static inline u32 msg_req_links(struct tipc_msg *m)
-{
- return msg_bits(m, 1, 16, 0xfff);
-}
-
-static inline void msg_set_req_links(struct tipc_msg *m, u32 n)
-{
- msg_set_bits(m, 1, 16, 0xfff, n);
-}
-
/*
* Word 2
--
1.7.3.3
^ permalink raw reply related
* [PATCH net-next 17/17] tipc: Avoid reliable broadcast preparation for NACK messages
From: Paul Gortmaker @ 2011-02-24 1:26 UTC (permalink / raw)
To: davem; +Cc: allan.stephens, netdev, Allan Stephens, Paul Gortmaker
In-Reply-To: <1298510805-20630-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <Allan.Stephens@windriver.com>
Enhance TIPC to skip unnecessary (and, in some cases, redundant)
preparation work when sending a broadcast link NACK message, since this
preparation is only required for broadcast messages that are sent in a
reliable manner. This change also fixes a bug that caused NACK messages
to be improperly counted as "TX packets" in TIPC's broadcast link
statistics.
Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/bcast.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index 63df42b..7dc1dc7 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -298,6 +298,7 @@ static void bclink_send_nack(struct tipc_node *n_ptr)
msg = buf_msg(buf);
tipc_msg_init(msg, BCAST_PROTOCOL, STATE_MSG,
INT_H_SIZE, n_ptr->addr);
+ msg_set_non_seq(msg, 1);
msg_set_mc_netid(msg, tipc_net_id);
msg_set_bcast_ack(msg, mod(n_ptr->bclink.last_in));
msg_set_bcgap_after(msg, n_ptr->bclink.gap_after);
--
1.7.3.3
^ permalink raw reply related
* Re: KIND
From: Mr.David Gurupatham @ 2011-02-23 12:19 UTC (permalink / raw)
To: netdev@vger.kernel.org
My name is David Gurupatham a legal practitioner with David Gurupatham & Associates
in Kuala Lumpur Msia.
I found your contact/profile some where over the Internet and it gave me the
greatest joy, that you are the one I have been looking for. Whom I strongly believe could
execute this project with me. Kindly get back to me for more information
Best regards,
Mr David Gurupatham{Esq}
^ permalink raw reply
* Re: Multicast snooping fixes and suggestions
From: H. Peter Anvin @ 2011-02-24 3:16 UTC (permalink / raw)
To: Linus Lüssing
Cc: Stephen Hemminger, David S. Miller, bridge, netdev, linux-kernel,
Herbert Xu
In-Reply-To: <1297811961-19249-1-git-send-email-linus.luessing@web.de>
On 02/15/2011 03:19 PM, Linus Lüssing wrote:
> Hello everyone,
>
> While testing the (very awesome!) bridge igmp/mld snooping support I came across
> two issues which are breaking IPv6 multicast snooping and IPv6
> non-link-local multicast on bridges with multicast snooping support enabled
> in general. The first two patches shall fix these issues.
>
> The third one addresses a potential bug on little endian machines which I noticed
> during this little code reviewing. This patch is untested though, feedback welcome.
>
> The fourth and fifth patch are a suggestion to also permit using the bridge multicast
> snooping feature for link local multimedia multicast traffic. Therefore
> using the transient multicast flag instead of the non-link-local scope criteria
> seems to be a suitable solution at least for IPv6, in my opinion. Let me know what
> you think about it.
>
Hello,
I have just noticed that when using a Linux bridge, IPv6 often fails to
configure until some considerable time has passed, presumably some kind
of retry timer. The dmesg shows:
[178292.449300] br0: port 1(eth0) entering learning state
[178292.449304] br0: port 1(eth0) entering learning state
[178302.536098] br0: no IPv6 routers present
[178307.416139] br0: port 1(eth0) entering forwarding state
... even though there is a configured and active IPv6 router on the network.
I have also seen some serious delays with DHCPv4 which presumably is due
to lost packets during bridge learning.
Are these packets likely to address that situation (or am I just plain
doing something stupid)?
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
^ permalink raw reply
* Re: Multicast snooping fixes and suggestions
From: Herbert Xu @ 2011-02-24 4:04 UTC (permalink / raw)
To: H. Peter Anvin
Cc: Linus Lüssing, Stephen Hemminger, David S. Miller, bridge,
netdev, linux-kernel
In-Reply-To: <4D65CD81.4070203@zytor.com>
On Wed, Feb 23, 2011 at 07:16:17PM -0800, H. Peter Anvin wrote:
>
> Are these packets likely to address that situation (or am I just plain
> doing something stupid)?
No these patches deal with IPv6 multicast support in the bridge and
are not related to your problem.
If you're using the bridge for virtualisation and you know that
you don't have a loop in your setup, then one option would be to
disable STP on your bridge.
Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: Multicast snooping fixes and suggestions
From: H. Peter Anvin @ 2011-02-24 4:46 UTC (permalink / raw)
To: Herbert Xu
Cc: Linus Lüssing, Stephen Hemminger, David S. Miller, bridge,
netdev, linux-kernel
In-Reply-To: <20110224040412.GA25488@gondor.apana.org.au>
On 02/23/2011 08:04 PM, Herbert Xu wrote:
> On Wed, Feb 23, 2011 at 07:16:17PM -0800, H. Peter Anvin wrote:
>>
>> Are these packets likely to address that situation (or am I just plain
>> doing something stupid)?
>
> No these patches deal with IPv6 multicast support in the bridge and
> are not related to your problem.
>
> If you're using the bridge for virtualisation and you know that
> you don't have a loop in your setup, then one option would be to
> disable STP on your bridge.
Hi,
I have disabled STP on the bridge; it doesn't change the behavior.
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
^ permalink raw reply
* Re: [PATCH net-next 00/17] TIPC: Another mixed bag of cleanups and bugfixes
From: David Miller @ 2011-02-24 4:49 UTC (permalink / raw)
To: paul.gortmaker; +Cc: allan.stephens, netdev
In-Reply-To: <1298510805-20630-1-git-send-email-paul.gortmaker@windriver.com>
From: Paul Gortmaker <paul.gortmaker@windriver.com>
Date: Wed, 23 Feb 2011 20:26:28 -0500
> We are still seeing some rewards from dumping the native API stuff,
> things like the top two struct amalgamation commits are a direct
> result of that. The rest is just a mixed bag of largely unrelated
> small bugfixes and other cleanups as summarized below.
Looks great, pulled, thanks a lot!
^ permalink raw reply
* Re: [PATCH net-next-2.6 v4] net_sched: SFB flow scheduler
From: Eric Dumazet @ 2011-02-24 5:40 UTC (permalink / raw)
To: David Miller
Cc: Juliusz.Chroboczek, linville, shemminger, kaber, netdev, andi
In-Reply-To: <20110223.140614.112607341.davem@davemloft.net>
Le mercredi 23 février 2011 à 14:06 -0800, David Miller a écrit :
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Wed, 23 Feb 2011 21:56:17 +0100
>
> > This is the Stochastic Fair Blue scheduler, based on work from :
>
> Applied with the 'static' fix, thanks Eric!
Thanks David !
My next step is to expand the idea I had some time ago (with my SFQ
works in december) :
Add a generic (core) service :
- Timestamp skb when it enters qdisc (might use skb->tstamp ?)
- At dequeue time, compute the delay.
1) Be able to mark/drop the packet right before giving it to device if
delay above a threshold, or use an array of thresholds depending on TOS
2) Integrate the delay into one EWMA
3) For SFB : Use the EWMA to eventually replace the non convenient
penalty_box by auto adaptative mechanism : Allow non elastic flows to
take part of the bandwidth, using a drop/mark probability depending on
this EWMA.
^ permalink raw reply
* Re: Multicast snooping fixes and suggestions
From: Herbert Xu @ 2011-02-24 5:42 UTC (permalink / raw)
To: H. Peter Anvin
Cc: Linus Lüssing, Stephen Hemminger, David S. Miller, bridge,
netdev, linux-kernel
In-Reply-To: <4D65E2B4.1010501@zytor.com>
On Wed, Feb 23, 2011 at 08:46:44PM -0800, H. Peter Anvin wrote:
>
> I have disabled STP on the bridge; it doesn't change the behavior.
Once you have disabled STP, you can set the forward delay to 0
which should do the trick.
Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: Multicast snooping fixes and suggestions
From: H. Peter Anvin @ 2011-02-24 5:57 UTC (permalink / raw)
To: Herbert Xu
Cc: netdev, bridge, linux-kernel, Linus Lüssing, David S. Miller
In-Reply-To: <20110224054232.GA26064@gondor.apana.org.au>
[-- Attachment #1.1: Type: text/plain, Size: 699 bytes --]
Ok, so stupid question... how do hardware switches deal with this? It would seem to me that if everyone behind say a Cisco switch had these kind of issues they would have limited appeal...
--
Sent from my mobile phone. Please pardon any lack of formatting.
Herbert Xu <herbert@gondor.hengli.com.au> wrote:
On Wed, Feb 23, 2011 at 08:46:44PM -0800, H. Peter Anvin wrote: > > I have disabled STP on the bridge; it doesn't change the behavior. Once you have disabled STP, you can set the forward delay to 0 which should do the trick. Cheers, -- Email: Herbert Xu <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
[-- Attachment #1.2: Type: text/html, Size: 1121 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Bridge mailing list
Bridge@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/bridge
^ permalink raw reply
* linux-next IPv4 connect() call to dest routed over ppp broken
From: Valdis.Kletnieks @ 2011-02-24 6:27 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 3777 bytes --]
l2.6.38-rc5-next-20110222 is giving me trouble with network - specifically IPv4
routed over a PPP link. IPv6 seems to be OK, as does IPv4 not over PPP.
Problem entered sometime after -rc2-mmotm0125 (I didn't try -rc3 or -rc4 due to
time constraints that kept me from chasing down a different problem I had).
I'm at home, so I bring up a PPP link to our VPN endpoint, and route 2 /16s
via the PPP connection. So ifconfig and routing look like this:
ppp0 Link encap:Point-to-Point Protocol
inet addr:128.173.34.98 P-t-P:128.173.32.21 Mask:255.255.255.255
inet6 addr: 2001:468:c80:3b05:9559:2833:c9c6:4910/64 Scope:Global
inet6 addr: fe80::9559:2833:c9c6:4910/10 Scope:Link
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1460 Metric:1
RX packets:19709 errors:0 dropped:0 overruns:0 frame:0
TX packets:14189 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:20541163 (19.5 MiB) TX bytes:1294777 (1.2 MiB)
wlan0 Link encap:Ethernet HWaddr 00:24:D6:53:C5:BA
inet addr:192.168.2.2 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::224:d6ff:fe53:c5ba/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:209585 errors:0 dropped:3 overruns:0 frame:0
TX packets:205993 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:169153434 (161.3 MiB) TX bytes:105289986 (100.4 MiB)
% ip route show
default via 192.168.2.1 dev wlan0 metric 2
128.173.0.0/16 dev ppp0 scope link
128.173.32.21 via 192.168.2.1 dev wlan0 src 192.168.2.2
128.173.32.21 dev ppp0 proto kernel scope link src 128.173.34.98
192.168.2.0/24 dev wlan0 proto kernel scope link src 192.168.2.2
198.82.0.0/16 dev ppp0 scope link
strace ntpdate -q 198.82.1.201 (an NTP server of ours, UDP over ppp0):
....
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(123), sin_addr=inet_addr("198.82.1.201")}, 16) = -1 EINVAL (Invalid argument)
.. and we're dead.
strace ping 198.82.1.201 (ICMP this time, over ppp0):
...
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4
connect(4, {sa_family=AF_INET, sin_port=htons(1025), sin_addr=inet_addr("198.82.1.201")}, 16) = -1 EINVAL (Invalid argument)
and things fall over from there...
strace telnet telnet 198.82.161.192 25 (does TCP work? SMTP to a mail host of ours)
...
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3
setsockopt(3, SOL_IP, IP_TOS, [16], 4) = 0
connect(3, {sa_family=AF_INET, sin_port=htons(25), sin_addr=inet_addr("198.82.161.192")}, 16) = -1 EINVAL (Invalid argument)
Not looking good for the home team, but going to hosts not routed via the PPP interface
works just fine:
strace ping www.google.com (goes out via wlan0 directly)
....
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4
connect(4, {sa_family=AF_INET, sin_port=htons(1025), sin_addr=inet_addr("72.14.204.99")}, 16) = 0
getsockname(4, {sa_family=AF_INET, sin_port=htons(60231), sin_addr=inet_addr("192.168.2.2")}, [16]) = 0
If I take down the ppp link, my routing table looks like:
% ip route show
default via 192.168.2.1 dev wlan0 metric 2
128.173.32.21 via 192.168.2.1 dev wlan0 src 192.168.2.2
192.168.2.0/24 dev wlan0 proto kernel scope link src 192.168.2.2
and IPv4 to the problem addresses starts working:
strace ping 198.82.1.201 (via wlan0 directly):
...
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4
connect(4, {sa_family=AF_INET, sin_port=htons(1025), sin_addr=inet_addr("198.82.1.201")}, 16) = 0
getsockname(4, {sa_family=AF_INET, sin_port=htons(60404), sin_addr=inet_addr("192.168.2.2")}, [16]) = 0
Any ideas? I'll probably not have a chance to bisect this for several days...
[-- Attachment #2: Type: application/pgp-signature, Size: 227 bytes --]
^ permalink raw reply
* Re: Multicast snooping fixes and suggestions
From: Stephen Hemminger @ 2011-02-24 6:37 UTC (permalink / raw)
To: H. Peter Anvin
Cc: Herbert Xu, Linus Lüssing, David S. Miller, bridge, netdev,
linux-kernel
In-Reply-To: <89132767-587d-4186-8eac-9692bed59a44@email.android.com>
On Wed, 23 Feb 2011 21:57:32 -0800
"H. Peter Anvin" <hpa@zytor.com> wrote:
> Ok, so stupid question... how do hardware switches deal with this? It would seem to me that if everyone behind say a Cisco switch had these kind of issues they would have limited appeal...
Real bridges run current newwer Spanning Tree Protocol that converges faster.
The current Linux STP code is on older standard (around 2001). The current STP
standard use RSTP which converges much faster.
http://en.wikipedia.org/wiki/Spanning_Tree_Protocol
There is a userspace RSTP daemon that almost nobody uses.
There are a number of other STP enhancements that are needed like
STP protection and MSTP, as welll as the Cisco non-standard STP VLAN stuff.
Fixing STP and testing it is a fairly project, too big for a spare time
effort and currently not something high enough on the project chart for me to
be able to dedicate much company time on. Contributions welcome.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox