* [PATCH 0/7 net-next-2.6] tipc: More miscellaneous fixes & optimizations
@ 2008-07-10 21:26 Allan Stephens
2008-07-10 21:26 ` [PATCH 1/7 net-next-2.6] tipc: Remove unneeded parameter to tipc_createport_raw() Allan Stephens
` (6 more replies)
0 siblings, 7 replies; 15+ messages in thread
From: Allan Stephens @ 2008-07-10 21:26 UTC (permalink / raw)
To: David Miller; +Cc: netdev, allan.stephens
This patch set includes a number of bug fixes and optimizations for TIPC.
Please see each individual patch for a further description.
Summary:
include/net/tipc/tipc_port.h | 13 ++-------
net/tipc/bcast.c | 10 +++----
net/tipc/bearer.c | 8 +++--
net/tipc/cluster.c | 2 +
net/tipc/eth_media.c | 6 ++--
net/tipc/link.c | 18 ++++++------
net/tipc/name_table.c | 41 ++++++++++++++++++++--------
net/tipc/net.c | 4 +--
net/tipc/node.c | 29 ++++++++++++++++----
net/tipc/port.c | 62 ++++++++++++++++++------------------------
net/tipc/ref.c | 2 +
net/tipc/socket.c | 59 ++++++++++++++++++++--------------------
net/tipc/user_reg.c | 14 +++++----
13 files changed, 146 insertions(+), 122 deletions(-)
Allan Stephens (7):
tipc: Remove unneeded parameter to tipc_createport_raw()
tipc: Optimize pointer dereferencing when receiving stream data
tipc: Fix race condition that could cause accept() to fail
tipc: Eliminate improper use of TIPC_OK error code
tipc: Fix bug in scope checking for multicast messages
tipc: Add missing locks when inspecting node list & link list
tipc: Optimization to multicast name lookup algorithm
Thanks,
Al
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 1/7 net-next-2.6] tipc: Remove unneeded parameter to tipc_createport_raw()
2008-07-10 21:26 [PATCH 0/7 net-next-2.6] tipc: More miscellaneous fixes & optimizations Allan Stephens
@ 2008-07-10 21:26 ` Allan Stephens
2008-07-15 5:42 ` David Miller
2008-07-10 21:26 ` [PATCH 2/7 net-next-2.6] tipc: Optimize pointer dereferencing when receiving stream data Allan Stephens
` (5 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Allan Stephens @ 2008-07-10 21:26 UTC (permalink / raw)
To: David Miller; +Cc: netdev, allan.stephens
This patch eliminates an unneeded parameter when creating a low-level
TIPC port object. Instead of returning both the pointer to the port
structure and the port's reference ID, it now returns only the pointer
since the port structure contains the reference ID as one of its fields.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
---
include/net/tipc/tipc_port.h | 13 +++----------
net/tipc/port.c | 28 ++++++++++------------------
net/tipc/socket.c | 15 +++++++--------
3 files changed, 20 insertions(+), 36 deletions(-)
diff --git a/include/net/tipc/tipc_port.h b/include/net/tipc/tipc_port.h
index 9923e41..c54917c 100644
--- a/include/net/tipc/tipc_port.h
+++ b/include/net/tipc/tipc_port.h
@@ -2,7 +2,7 @@
* include/net/tipc/tipc_port.h: Include file for privileged access to TIPC ports
*
* Copyright (c) 1994-2007, Ericsson AB
- * Copyright (c) 2005-2007, Wind River Systems
+ * Copyright (c) 2005-2008, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -75,17 +75,10 @@ struct tipc_port {
};
-/**
- * tipc_createport_raw - create a native TIPC port and return it's reference
- *
- * Note: 'dispatcher' and 'wakeup' deliver a locked port.
- */
-
-u32 tipc_createport_raw(void *usr_handle,
+struct tipc_port *tipc_createport_raw(void *usr_handle,
u32 (*dispatcher)(struct tipc_port *, struct sk_buff *),
void (*wakeup)(struct tipc_port *),
- const u32 importance,
- struct tipc_port **tp_ptr);
+ const u32 importance);
int tipc_reject_msg(struct sk_buff *buf, u32 err);
diff --git a/net/tipc/port.c b/net/tipc/port.c
index 2e0cff4..ffba1e7 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -2,7 +2,7 @@
* net/tipc/port.c: TIPC port code
*
* Copyright (c) 1992-2007, Ericsson AB
- * Copyright (c) 2004-2007, Wind River Systems
+ * Copyright (c) 2004-2008, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -213,16 +213,13 @@ exit:
/**
* tipc_createport_raw - create a generic TIPC port
*
- * Returns port reference, or 0 if unable to create it
- *
- * Note: The newly created port is returned in the locked state.
+ * Returns pointer to (locked) TIPC port, or NULL if unable to create it
*/
-u32 tipc_createport_raw(void *usr_handle,
+struct tipc_port *tipc_createport_raw(void *usr_handle,
u32 (*dispatcher)(struct tipc_port *, struct sk_buff *),
void (*wakeup)(struct tipc_port *),
- const u32 importance,
- struct tipc_port **tp_ptr)
+ const u32 importance)
{
struct port *p_ptr;
struct tipc_msg *msg;
@@ -231,13 +228,13 @@ u32 tipc_createport_raw(void *usr_handle,
p_ptr = kzalloc(sizeof(*p_ptr), GFP_ATOMIC);
if (!p_ptr) {
warn("Port creation failed, no memory\n");
- return 0;
+ return NULL;
}
ref = tipc_ref_acquire(p_ptr, &p_ptr->publ.lock);
if (!ref) {
warn("Port creation failed, reference table exhausted\n");
kfree(p_ptr);
- return 0;
+ return NULL;
}
p_ptr->publ.usr_handle = usr_handle;
@@ -260,8 +257,7 @@ u32 tipc_createport_raw(void *usr_handle,
INIT_LIST_HEAD(&p_ptr->port_list);
list_add_tail(&p_ptr->port_list, &ports);
spin_unlock_bh(&tipc_port_list_lock);
- *tp_ptr = &p_ptr->publ;
- return ref;
+ return &(p_ptr->publ);
}
int tipc_deleteport(u32 ref)
@@ -1044,21 +1040,18 @@ int tipc_createport(u32 user_ref,
{
struct user_port *up_ptr;
struct port *p_ptr;
- struct tipc_port *tp_ptr;
- u32 ref;
up_ptr = kmalloc(sizeof(*up_ptr), GFP_ATOMIC);
if (!up_ptr) {
warn("Port creation failed, no memory\n");
return -ENOMEM;
}
- ref = tipc_createport_raw(NULL, port_dispatcher, port_wakeup,
- importance, &tp_ptr);
- if (ref == 0) {
+ p_ptr = (struct port *)tipc_createport_raw(NULL, port_dispatcher,
+ port_wakeup, importance);
+ if (!p_ptr) {
kfree(up_ptr);
return -ENOMEM;
}
- p_ptr = (struct port *)tp_ptr;
p_ptr->user_port = up_ptr;
up_ptr->user_ref = user_ref;
@@ -1074,7 +1067,6 @@ int tipc_createport(u32 user_ref,
INIT_LIST_HEAD(&up_ptr->uport_list);
tipc_reg_add_port(up_ptr);
*portref = p_ptr->publ.ref;
- dbg(" tipc_createport: %x with ref %u\n", p_ptr, p_ptr->publ.ref);
tipc_port_unlock(p_ptr);
return TIPC_OK;
}
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 38f4879..9c362c5 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-2007, Wind River Systems
+ * Copyright (c) 2004-2008, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -189,7 +189,6 @@ static int tipc_create(struct net *net, struct socket *sock, int protocol)
socket_state state;
struct sock *sk;
struct tipc_port *tp_ptr;
- u32 portref;
/* Validate arguments */
@@ -225,9 +224,9 @@ static int tipc_create(struct net *net, struct socket *sock, int protocol)
/* Allocate TIPC port for socket to use */
- portref = tipc_createport_raw(sk, &dispatch, &wakeupdispatch,
- TIPC_LOW_IMPORTANCE, &tp_ptr);
- if (unlikely(portref == 0)) {
+ tp_ptr = tipc_createport_raw(sk, &dispatch, &wakeupdispatch,
+ TIPC_LOW_IMPORTANCE);
+ if (unlikely(!tp_ptr)) {
sk_free(sk);
return -ENOMEM;
}
@@ -240,14 +239,14 @@ static int tipc_create(struct net *net, struct socket *sock, int protocol)
sock_init_data(sock, sk);
sk->sk_rcvtimeo = msecs_to_jiffies(CONN_TIMEOUT_DEFAULT);
sk->sk_backlog_rcv = backlog_rcv;
- tipc_sk(sk)->p = tipc_get_port(portref);
+ tipc_sk(sk)->p = tp_ptr;
spin_unlock_bh(tp_ptr->lock);
if (sock->state == SS_READY) {
- tipc_set_portunreturnable(portref, 1);
+ tipc_set_portunreturnable(tp_ptr->ref, 1);
if (sock->type == SOCK_DGRAM)
- tipc_set_portunreliable(portref, 1);
+ tipc_set_portunreliable(tp_ptr->ref, 1);
}
atomic_inc(&tipc_user_count);
--
1.5.4.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 2/7 net-next-2.6] tipc: Optimize pointer dereferencing when receiving stream data
2008-07-10 21:26 [PATCH 0/7 net-next-2.6] tipc: More miscellaneous fixes & optimizations Allan Stephens
2008-07-10 21:26 ` [PATCH 1/7 net-next-2.6] tipc: Remove unneeded parameter to tipc_createport_raw() Allan Stephens
@ 2008-07-10 21:26 ` Allan Stephens
2008-07-15 5:42 ` David Miller
2008-07-10 21:26 ` [PATCH 3/7 net-next-2.6] tipc: Fix race condition that could cause accept() to fail Allan Stephens
` (4 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Allan Stephens @ 2008-07-10 21:26 UTC (permalink / raw)
To: David Miller; +Cc: netdev, allan.stephens
This patch eliminates an unnecessary pointer dereference when
accessing a stream-based socket's receive queue.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
---
net/tipc/socket.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 9c362c5..ddcb2a7 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -1133,7 +1133,7 @@ restart:
/* Loop around if more data is required */
if ((sz_copied < buf_len) /* didn't get all requested data */
- && (!skb_queue_empty(&sock->sk->sk_receive_queue) ||
+ && (!skb_queue_empty(&sk->sk_receive_queue) ||
(flags & MSG_WAITALL))
/* ... and more is ready or required */
&& (!(flags & MSG_PEEK)) /* ... and aren't just peeking at data */
--
1.5.4.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 3/7 net-next-2.6] tipc: Fix race condition that could cause accept() to fail
2008-07-10 21:26 [PATCH 0/7 net-next-2.6] tipc: More miscellaneous fixes & optimizations Allan Stephens
2008-07-10 21:26 ` [PATCH 1/7 net-next-2.6] tipc: Remove unneeded parameter to tipc_createport_raw() Allan Stephens
2008-07-10 21:26 ` [PATCH 2/7 net-next-2.6] tipc: Optimize pointer dereferencing when receiving stream data Allan Stephens
@ 2008-07-10 21:26 ` Allan Stephens
2008-07-15 5:43 ` David Miller
2008-07-10 21:26 ` [PATCH 4/7 net-next-2.6] tipc: Eliminate improper use of TIPC_OK error code Allan Stephens
` (3 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Allan Stephens @ 2008-07-10 21:26 UTC (permalink / raw)
To: David Miller; +Cc: netdev, allan.stephens
This patch ensurs that accept() returns successfully even when
the newly created socket is immediately disconnected by its peer.
Previously, accept() would fail if it was unable to pass back
the optional address info for the socket's peer before the
socket became disconnected; TIPC now allows accept() to gather
peer address information after disconnection. As a bonus, the
revised code accesses the socket's port more efficiently, without
the overhead incurred by a reference table lookup.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
---
net/tipc/socket.c | 42 ++++++++++++++++++++++--------------------
1 files changed, 22 insertions(+), 20 deletions(-)
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index ddcb2a7..1848693 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -63,6 +63,7 @@
struct tipc_sock {
struct sock sk;
struct tipc_port *p;
+ struct tipc_portid peer_name;
};
#define tipc_sk(sk) ((struct tipc_sock *)(sk))
@@ -377,27 +378,29 @@ static int bind(struct socket *sock, struct sockaddr *uaddr, int uaddr_len)
* @sock: socket structure
* @uaddr: area for returned socket address
* @uaddr_len: area for returned length of socket address
- * @peer: 0 to obtain socket name, 1 to obtain peer socket name
+ * @peer: 0 = own ID, 1 = current peer ID, 2 = current/former peer ID
*
* Returns 0 on success, errno otherwise
*
- * NOTE: This routine doesn't need to take the socket lock since it doesn't
- * access any non-constant socket information.
+ * NOTE: This routine doesn't need to take the socket lock since it only
+ * accesses socket information that is unchanging (or which changes in
+ * a completely predictable manner).
*/
static int get_name(struct socket *sock, struct sockaddr *uaddr,
int *uaddr_len, int peer)
{
struct sockaddr_tipc *addr = (struct sockaddr_tipc *)uaddr;
- u32 portref = tipc_sk_port(sock->sk)->ref;
- u32 res;
+ struct tipc_sock *tsock = tipc_sk(sock->sk);
if (peer) {
- res = tipc_peer(portref, &addr->addr.id);
- if (res)
- return res;
+ if ((sock->state != SS_CONNECTED) &&
+ ((peer != 2) || (sock->state != SS_DISCONNECTING)))
+ return -ENOTCONN;
+ addr->addr.id.ref = tsock->peer_name.ref;
+ addr->addr.id.node = tsock->peer_name.node;
} else {
- tipc_ownidentity(portref, &addr->addr.id);
+ tipc_ownidentity(tsock->p->ref, &addr->addr.id);
}
*uaddr_len = sizeof(*addr);
@@ -766,18 +769,17 @@ exit:
static int auto_connect(struct socket *sock, struct tipc_msg *msg)
{
- struct tipc_port *tport = tipc_sk_port(sock->sk);
- struct tipc_portid peer;
+ struct tipc_sock *tsock = tipc_sk(sock->sk);
if (msg_errcode(msg)) {
sock->state = SS_DISCONNECTING;
return -ECONNREFUSED;
}
- peer.ref = msg_origport(msg);
- peer.node = msg_orignode(msg);
- tipc_connect2port(tport->ref, &peer);
- tipc_set_portimportance(tport->ref, msg_importance(msg));
+ tsock->peer_name.ref = msg_origport(msg);
+ tsock->peer_name.node = msg_orignode(msg);
+ tipc_connect2port(tsock->p->ref, &tsock->peer_name);
+ tipc_set_portimportance(tsock->p->ref, msg_importance(msg));
sock->state = SS_CONNECTED;
return 0;
}
@@ -1529,9 +1531,9 @@ static int accept(struct socket *sock, struct socket *new_sock, int flags)
res = tipc_create(sock_net(sock->sk), new_sock, 0);
if (!res) {
struct sock *new_sk = new_sock->sk;
- struct tipc_port *new_tport = tipc_sk_port(new_sk);
+ struct tipc_sock *new_tsock = tipc_sk(new_sk);
+ struct tipc_port *new_tport = new_tsock->p;
u32 new_ref = new_tport->ref;
- struct tipc_portid id;
struct tipc_msg *msg = buf_msg(buf);
lock_sock(new_sk);
@@ -1545,9 +1547,9 @@ static int accept(struct socket *sock, struct socket *new_sock, int flags)
/* Connect new socket to it's peer */
- id.ref = msg_origport(msg);
- id.node = msg_orignode(msg);
- tipc_connect2port(new_ref, &id);
+ new_tsock->peer_name.ref = msg_origport(msg);
+ new_tsock->peer_name.node = msg_orignode(msg);
+ tipc_connect2port(new_ref, &new_tsock->peer_name);
new_sock->state = SS_CONNECTED;
tipc_set_portimportance(new_ref, msg_importance(msg));
--
1.5.4.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 4/7 net-next-2.6] tipc: Eliminate improper use of TIPC_OK error code
2008-07-10 21:26 [PATCH 0/7 net-next-2.6] tipc: More miscellaneous fixes & optimizations Allan Stephens
` (2 preceding siblings ...)
2008-07-10 21:26 ` [PATCH 3/7 net-next-2.6] tipc: Fix race condition that could cause accept() to fail Allan Stephens
@ 2008-07-10 21:26 ` Allan Stephens
2008-07-15 5:44 ` David Miller
2008-07-10 21:26 ` [PATCH 5/7 net-next-2.6] tipc: Fix bug in scope checking for multicast messages Allan Stephens
` (2 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Allan Stephens @ 2008-07-10 21:26 UTC (permalink / raw)
To: David Miller; +Cc: netdev, allan.stephens
This patch corrects many places where TIPC routines indicated
successful completion by returning TIPC_OK instead of 0.
(The TIPC_OK symbol has the value 0, but it should only be used
in contexts that deal with the error code field of a TIPC
message header.)
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
---
net/tipc/bcast.c | 10 +++++-----
net/tipc/bearer.c | 8 ++++----
net/tipc/cluster.c | 2 +-
net/tipc/eth_media.c | 6 +++---
net/tipc/link.c | 18 +++++++++---------
net/tipc/net.c | 4 ++--
net/tipc/port.c | 34 +++++++++++++++++-----------------
net/tipc/ref.c | 2 +-
net/tipc/user_reg.c | 14 +++++++-------
9 files changed, 49 insertions(+), 49 deletions(-)
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index a5883b1..b1ff16a 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -611,7 +611,7 @@ swap:
bcbearer->bpairs[bp_index].secondary = p;
update:
if (bcbearer->remains_new.count == 0)
- return TIPC_OK;
+ return 0;
bcbearer->remains = bcbearer->remains_new;
}
@@ -620,7 +620,7 @@ update:
bcbearer->bearer.publ.blocked = 1;
bcl->stats.bearer_congs++;
- return ~TIPC_OK;
+ return 1;
}
/**
@@ -756,7 +756,7 @@ int tipc_bclink_reset_stats(void)
spin_lock_bh(&bc_lock);
memset(&bcl->stats, 0, sizeof(bcl->stats));
spin_unlock_bh(&bc_lock);
- return TIPC_OK;
+ return 0;
}
int tipc_bclink_set_queue_limits(u32 limit)
@@ -769,7 +769,7 @@ int tipc_bclink_set_queue_limits(u32 limit)
spin_lock_bh(&bc_lock);
tipc_link_set_queue_limits(bcl, limit);
spin_unlock_bh(&bc_lock);
- return TIPC_OK;
+ return 0;
}
int tipc_bclink_init(void)
@@ -810,7 +810,7 @@ int tipc_bclink_init(void)
tipc_printbuf_init(&bcl->print_buf, pb, BCLINK_LOG_BUF_SIZE);
}
- return TIPC_OK;
+ return 0;
}
void tipc_bclink_stop(void)
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index 271a375..6a9aba3 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -370,7 +370,7 @@ void tipc_bearer_remove_dest(struct bearer *b_ptr, u32 dest)
*/
static int bearer_push(struct bearer *b_ptr)
{
- u32 res = TIPC_OK;
+ u32 res = 0;
struct link *ln, *tln;
if (b_ptr->publ.blocked)
@@ -607,7 +607,7 @@ int tipc_block_bearer(const char *name)
}
spin_unlock_bh(&b_ptr->publ.lock);
read_unlock_bh(&tipc_net_lock);
- return TIPC_OK;
+ return 0;
}
/**
@@ -645,7 +645,7 @@ static int bearer_disable(const char *name)
}
spin_unlock_bh(&b_ptr->publ.lock);
memset(b_ptr, 0, sizeof(struct bearer));
- return TIPC_OK;
+ return 0;
}
int tipc_disable_bearer(const char *name)
@@ -668,7 +668,7 @@ int tipc_bearer_init(void)
tipc_bearers = kcalloc(MAX_BEARERS, sizeof(struct bearer), GFP_ATOMIC);
media_list = kcalloc(MAX_MEDIA, sizeof(struct media), GFP_ATOMIC);
if (tipc_bearers && media_list) {
- res = TIPC_OK;
+ res = 0;
} else {
kfree(tipc_bearers);
kfree(media_list);
diff --git a/net/tipc/cluster.c b/net/tipc/cluster.c
index bc1db47..46ee6c5 100644
--- a/net/tipc/cluster.c
+++ b/net/tipc/cluster.c
@@ -571,6 +571,6 @@ exit:
int tipc_cltr_init(void)
{
tipc_highest_allowed_slave = LOWEST_SLAVE + tipc_max_slaves;
- return tipc_cltr_create(tipc_own_addr) ? TIPC_OK : -ENOMEM;
+ return tipc_cltr_create(tipc_own_addr) ? 0 : -ENOMEM;
}
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
index 9cd35ee..bc72fbc 100644
--- a/net/tipc/eth_media.c
+++ b/net/tipc/eth_media.c
@@ -82,7 +82,7 @@ static int send_msg(struct sk_buff *buf, struct tipc_bearer *tb_ptr,
dev->dev_addr, clone->len);
dev_queue_xmit(clone);
}
- return TIPC_OK;
+ return 0;
}
/**
@@ -113,12 +113,12 @@ static int recv_msg(struct sk_buff *buf, struct net_device *dev,
if (likely(buf->len == size)) {
buf->next = NULL;
tipc_recv_msg(buf, eb_ptr->bearer);
- return TIPC_OK;
+ return 0;
}
}
}
kfree_skb(buf);
- return TIPC_OK;
+ return 0;
}
/**
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 9784a8e..d60113b 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1561,7 +1561,7 @@ u32 tipc_link_push_packet(struct link *l_ptr)
l_ptr->retransm_queue_head = mod(++r_q_head);
l_ptr->retransm_queue_size = --r_q_size;
l_ptr->stats.retransmitted++;
- return TIPC_OK;
+ return 0;
} else {
l_ptr->stats.bearer_congs++;
msg_dbg(buf_msg(buf), "|>DEF-RETR>");
@@ -1580,7 +1580,7 @@ u32 tipc_link_push_packet(struct link *l_ptr)
l_ptr->unacked_window = 0;
buf_discard(buf);
l_ptr->proto_msg_queue = NULL;
- return TIPC_OK;
+ return 0;
} else {
msg_dbg(buf_msg(buf), "|>DEF-PROT>");
l_ptr->stats.bearer_congs++;
@@ -1604,7 +1604,7 @@ u32 tipc_link_push_packet(struct link *l_ptr)
msg_set_type(msg, CLOSED_MSG);
msg_dbg(msg, ">PUSH-DATA>");
l_ptr->next_out = buf->next;
- return TIPC_OK;
+ return 0;
} else {
msg_dbg(msg, "|PUSH-DATA|");
l_ptr->stats.bearer_congs++;
@@ -1628,8 +1628,8 @@ void tipc_link_push_queue(struct link *l_ptr)
do {
res = tipc_link_push_packet(l_ptr);
- }
- while (res == TIPC_OK);
+ } while (!res);
+
if (res == PUSH_FAILED)
tipc_bearer_schedule(l_ptr->b_ptr, l_ptr);
}
@@ -2998,7 +2998,7 @@ struct sk_buff *tipc_link_cmd_config(const void *req_tlv_area, int req_tlv_space
link_set_supervision_props(l_ptr, new_value);
tipc_link_send_proto_msg(l_ptr, STATE_MSG,
0, 0, new_value, 0, 0);
- res = TIPC_OK;
+ res = 0;
}
break;
case TIPC_CMD_SET_LINK_PRI:
@@ -3007,14 +3007,14 @@ struct sk_buff *tipc_link_cmd_config(const void *req_tlv_area, int req_tlv_space
l_ptr->priority = new_value;
tipc_link_send_proto_msg(l_ptr, STATE_MSG,
0, 0, 0, new_value, 0);
- res = TIPC_OK;
+ res = 0;
}
break;
case TIPC_CMD_SET_LINK_WINDOW:
if ((new_value >= TIPC_MIN_LINK_WIN) &&
(new_value <= TIPC_MAX_LINK_WIN)) {
tipc_link_set_queue_limits(l_ptr, new_value);
- res = TIPC_OK;
+ res = 0;
}
break;
}
@@ -3230,7 +3230,7 @@ int link_control(const char *name, u32 op, u32 val)
if (op == TIPC_CMD_UNBLOCK_LINK) {
l_ptr->blocked = 0;
}
- res = TIPC_OK;
+ res = 0;
}
tipc_node_unlock(node);
}
diff --git a/net/tipc/net.c b/net/tipc/net.c
index cc51fa4..ec7b04f 100644
--- a/net/tipc/net.c
+++ b/net/tipc/net.c
@@ -165,7 +165,7 @@ static int net_init(void)
if (!tipc_net.zones) {
return -ENOMEM;
}
- return TIPC_OK;
+ return 0;
}
static void net_stop(void)
@@ -295,7 +295,7 @@ int tipc_net_start(u32 addr)
info("Started in network mode\n");
info("Own node address %s, network identity %u\n",
addr_string_fill(addr_string, tipc_own_addr), tipc_net_id);
- return TIPC_OK;
+ return 0;
}
void tipc_net_stop(void)
diff --git a/net/tipc/port.c b/net/tipc/port.c
index ffba1e7..e70d27e 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -291,7 +291,7 @@ int tipc_deleteport(u32 ref)
kfree(p_ptr);
dbg("Deleted port %u\n", ref);
tipc_net_route_msg(buf);
- return TIPC_OK;
+ return 0;
}
/**
@@ -336,7 +336,7 @@ int tipc_portunreliable(u32 ref, unsigned int *isunreliable)
return -EINVAL;
*isunreliable = port_unreliable(p_ptr);
tipc_port_unlock(p_ptr);
- return TIPC_OK;
+ return 0;
}
int tipc_set_portunreliable(u32 ref, unsigned int isunreliable)
@@ -348,7 +348,7 @@ int tipc_set_portunreliable(u32 ref, unsigned int isunreliable)
return -EINVAL;
msg_set_src_droppable(&p_ptr->publ.phdr, (isunreliable != 0));
tipc_port_unlock(p_ptr);
- return TIPC_OK;
+ return 0;
}
static int port_unreturnable(struct port *p_ptr)
@@ -365,7 +365,7 @@ int tipc_portunreturnable(u32 ref, unsigned int *isunrejectable)
return -EINVAL;
*isunrejectable = port_unreturnable(p_ptr);
tipc_port_unlock(p_ptr);
- return TIPC_OK;
+ return 0;
}
int tipc_set_portunreturnable(u32 ref, unsigned int isunrejectable)
@@ -377,7 +377,7 @@ int tipc_set_portunreturnable(u32 ref, unsigned int isunrejectable)
return -EINVAL;
msg_set_dest_droppable(&p_ptr->publ.phdr, (isunrejectable != 0));
tipc_port_unlock(p_ptr);
- return TIPC_OK;
+ return 0;
}
/*
@@ -963,7 +963,7 @@ static u32 port_dispatcher(struct tipc_port *dummy, struct sk_buff *buf)
tipc_k_signal((Handler)port_dispatcher_sigh, 0);
}
spin_unlock_bh(&queue_lock);
- return TIPC_OK;
+ return 0;
}
/*
@@ -1068,14 +1068,14 @@ int tipc_createport(u32 user_ref,
tipc_reg_add_port(up_ptr);
*portref = p_ptr->publ.ref;
tipc_port_unlock(p_ptr);
- return TIPC_OK;
+ return 0;
}
int tipc_ownidentity(u32 ref, struct tipc_portid *id)
{
id->ref = ref;
id->node = tipc_own_addr;
- return TIPC_OK;
+ return 0;
}
int tipc_portimportance(u32 ref, unsigned int *importance)
@@ -1087,7 +1087,7 @@ int tipc_portimportance(u32 ref, unsigned int *importance)
return -EINVAL;
*importance = (unsigned int)msg_importance(&p_ptr->publ.phdr);
tipc_port_unlock(p_ptr);
- return TIPC_OK;
+ return 0;
}
int tipc_set_portimportance(u32 ref, unsigned int imp)
@@ -1102,7 +1102,7 @@ int tipc_set_portimportance(u32 ref, unsigned int imp)
return -EINVAL;
msg_set_importance(&p_ptr->publ.phdr, (u32)imp);
tipc_port_unlock(p_ptr);
- return TIPC_OK;
+ return 0;
}
@@ -1137,7 +1137,7 @@ int tipc_publish(u32 ref, unsigned int scope, struct tipc_name_seq const *seq)
list_add(&publ->pport_list, &p_ptr->publications);
p_ptr->pub_count++;
p_ptr->publ.published = 1;
- res = TIPC_OK;
+ res = 0;
}
exit:
tipc_port_unlock(p_ptr);
@@ -1160,7 +1160,7 @@ int tipc_withdraw(u32 ref, unsigned int scope, struct tipc_name_seq const *seq)
tipc_nametbl_withdraw(publ->type, publ->lower,
publ->ref, publ->key);
}
- res = TIPC_OK;
+ res = 0;
} else {
list_for_each_entry_safe(publ, tpubl,
&p_ptr->publications, pport_list) {
@@ -1174,7 +1174,7 @@ int tipc_withdraw(u32 ref, unsigned int scope, struct tipc_name_seq const *seq)
break;
tipc_nametbl_withdraw(publ->type, publ->lower,
publ->ref, publ->key);
- res = TIPC_OK;
+ res = 0;
break;
}
}
@@ -1218,7 +1218,7 @@ int tipc_connect2port(u32 ref, struct tipc_portid const *peer)
tipc_nodesub_subscribe(&p_ptr->subscription,peer->node,
(void *)(unsigned long)ref,
(net_ev_handler)port_handle_node_down);
- res = TIPC_OK;
+ res = 0;
exit:
tipc_port_unlock(p_ptr);
p_ptr->publ.max_pkt = tipc_link_get_max_pkt(peer->node, ref);
@@ -1240,7 +1240,7 @@ int tipc_disconnect_port(struct tipc_port *tp_ptr)
/* let timer expire on it's own to avoid deadlock! */
tipc_nodesub_unsubscribe(
&((struct port *)tp_ptr)->subscription);
- res = TIPC_OK;
+ res = 0;
} else {
res = -ENOTCONN;
}
@@ -1305,7 +1305,7 @@ int tipc_isconnected(u32 ref, int *isconnected)
return -EINVAL;
*isconnected = p_ptr->publ.connected;
tipc_port_unlock(p_ptr);
- return TIPC_OK;
+ return 0;
}
int tipc_peer(u32 ref, struct tipc_portid *peer)
@@ -1319,7 +1319,7 @@ int tipc_peer(u32 ref, struct tipc_portid *peer)
if (p_ptr->publ.connected) {
peer->ref = port_peerport(p_ptr);
peer->node = port_peernode(p_ptr);
- res = TIPC_OK;
+ res = 0;
} else
res = -ENOTCONN;
tipc_port_unlock(p_ptr);
diff --git a/net/tipc/ref.c b/net/tipc/ref.c
index a101de8..414fc34 100644
--- a/net/tipc/ref.c
+++ b/net/tipc/ref.c
@@ -123,7 +123,7 @@ int tipc_ref_table_init(u32 requested_size, u32 start)
tipc_ref_table.index_mask = actual_size - 1;
tipc_ref_table.start_mask = start & ~tipc_ref_table.index_mask;
- return TIPC_OK;
+ return 0;
}
/**
diff --git a/net/tipc/user_reg.c b/net/tipc/user_reg.c
index 4146c40..5069288 100644
--- a/net/tipc/user_reg.c
+++ b/net/tipc/user_reg.c
@@ -91,7 +91,7 @@ static int reg_init(void)
}
}
spin_unlock_bh(®_lock);
- return users ? TIPC_OK : -ENOMEM;
+ return users ? 0 : -ENOMEM;
}
/**
@@ -129,7 +129,7 @@ int tipc_reg_start(void)
tipc_k_signal((Handler)reg_callback,
(unsigned long)&users[u]);
}
- return TIPC_OK;
+ return 0;
}
/**
@@ -184,7 +184,7 @@ int tipc_attach(u32 *userid, tipc_mode_event cb, void *usr_handle)
if (cb && (tipc_mode != TIPC_NOT_RUNNING))
tipc_k_signal((Handler)reg_callback, (unsigned long)user_ptr);
- return TIPC_OK;
+ return 0;
}
/**
@@ -230,7 +230,7 @@ int tipc_reg_add_port(struct user_port *up_ptr)
struct tipc_user *user_ptr;
if (up_ptr->user_ref == 0)
- return TIPC_OK;
+ return 0;
if (up_ptr->user_ref > MAX_USERID)
return -EINVAL;
if ((tipc_mode == TIPC_NOT_RUNNING) || !users )
@@ -240,7 +240,7 @@ int tipc_reg_add_port(struct user_port *up_ptr)
user_ptr = &users[up_ptr->user_ref];
list_add(&up_ptr->uport_list, &user_ptr->ports);
spin_unlock_bh(®_lock);
- return TIPC_OK;
+ return 0;
}
/**
@@ -250,7 +250,7 @@ int tipc_reg_add_port(struct user_port *up_ptr)
int tipc_reg_remove_port(struct user_port *up_ptr)
{
if (up_ptr->user_ref == 0)
- return TIPC_OK;
+ return 0;
if (up_ptr->user_ref > MAX_USERID)
return -EINVAL;
if (!users )
@@ -259,6 +259,6 @@ int tipc_reg_remove_port(struct user_port *up_ptr)
spin_lock_bh(®_lock);
list_del_init(&up_ptr->uport_list);
spin_unlock_bh(®_lock);
- return TIPC_OK;
+ return 0;
}
--
1.5.4.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 5/7 net-next-2.6] tipc: Fix bug in scope checking for multicast messages
2008-07-10 21:26 [PATCH 0/7 net-next-2.6] tipc: More miscellaneous fixes & optimizations Allan Stephens
` (3 preceding siblings ...)
2008-07-10 21:26 ` [PATCH 4/7 net-next-2.6] tipc: Eliminate improper use of TIPC_OK error code Allan Stephens
@ 2008-07-10 21:26 ` Allan Stephens
2008-07-15 5:44 ` David Miller
2008-07-10 21:26 ` [PATCH 6/7 net-next-2.6] tipc: Add missing locks when inspecting node list & link list Allan Stephens
2008-07-10 21:26 ` [PATCH 7/7 net-next-2.6] tipc: Optimization to multicast name lookup algorithm Allan Stephens
6 siblings, 1 reply; 15+ messages in thread
From: Allan Stephens @ 2008-07-10 21:26 UTC (permalink / raw)
To: David Miller; +Cc: netdev, allan.stephens
This patch ensures that TIPC's multicast message name lookup
algorithm does individualized scope checking for each published
name it examines. Previously, scope checking was only done for
the first name in a name table publication list, which could
result in incoming multicast messages being delivered to ports
publishing names with "node" scope, or not being delivered to
ports publishing names with "cluster" or "zone" scope.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
---
net/tipc/name_table.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c
index 096f7bd..1e53b0c 100644
--- a/net/tipc/name_table.c
+++ b/net/tipc/name_table.c
@@ -710,9 +710,11 @@ int tipc_nametbl_mc_translate(u32 type, u32 lower, u32 upper, u32 limit,
if (sseq->lower > upper)
break;
publ = sseq->cluster_list;
- if (publ && (publ->scope <= limit))
+ if (publ)
do {
- if (publ->node == tipc_own_addr)
+ if (publ->scope > limit)
+ /* ignore out-of-scope publication */ ;
+ else if (publ->node == tipc_own_addr)
tipc_port_list_add(dports, publ->ref);
else
res = 1;
--
1.5.4.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 6/7 net-next-2.6] tipc: Add missing locks when inspecting node list & link list
2008-07-10 21:26 [PATCH 0/7 net-next-2.6] tipc: More miscellaneous fixes & optimizations Allan Stephens
` (4 preceding siblings ...)
2008-07-10 21:26 ` [PATCH 5/7 net-next-2.6] tipc: Fix bug in scope checking for multicast messages Allan Stephens
@ 2008-07-10 21:26 ` Allan Stephens
2008-07-15 5:45 ` David Miller
2008-07-10 21:26 ` [PATCH 7/7 net-next-2.6] tipc: Optimization to multicast name lookup algorithm Allan Stephens
6 siblings, 1 reply; 15+ messages in thread
From: Allan Stephens @ 2008-07-10 21:26 UTC (permalink / raw)
To: David Miller; +Cc: netdev, allan.stephens
This patch ensures that TIPC configuration commands that display info
about neighboring nodes and their links take the spinlocks that
protect the node list and link lists from changing while the lists
are being traversed.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
---
net/tipc/node.c | 29 ++++++++++++++++++++++++-----
1 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 34e9a2b..ee952ad 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -600,12 +600,14 @@ u32 tipc_available_nodes(const u32 domain)
struct node *n_ptr;
u32 cnt = 0;
+ read_lock_bh(&tipc_net_lock);
for (n_ptr = tipc_nodes; n_ptr; n_ptr = n_ptr->next) {
if (!in_scope(domain, n_ptr->addr))
continue;
if (tipc_node_is_up(n_ptr))
cnt++;
}
+ read_unlock_bh(&tipc_net_lock);
return cnt;
}
@@ -625,19 +627,26 @@ struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space)
return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
" (network address)");
- if (!tipc_nodes)
+ read_lock_bh(&tipc_net_lock);
+ if (!tipc_nodes) {
+ read_unlock_bh(&tipc_net_lock);
return tipc_cfg_reply_none();
+ }
/* For now, get space for all other nodes
(will need to modify this when slave nodes are supported */
payload_size = TLV_SPACE(sizeof(node_info)) * (tipc_max_nodes - 1);
- if (payload_size > 32768u)
+ if (payload_size > 32768u) {
+ read_unlock_bh(&tipc_net_lock);
return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
" (too many nodes)");
+ }
buf = tipc_cfg_reply_alloc(payload_size);
- if (!buf)
+ if (!buf) {
+ read_unlock_bh(&tipc_net_lock);
return NULL;
+ }
/* Add TLVs for all nodes in scope */
@@ -650,6 +659,7 @@ struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space)
&node_info, sizeof(node_info));
}
+ read_unlock_bh(&tipc_net_lock);
return buf;
}
@@ -672,16 +682,22 @@ struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space)
if (tipc_mode != TIPC_NET_MODE)
return tipc_cfg_reply_none();
+ read_lock_bh(&tipc_net_lock);
+
/* Get space for all unicast links + multicast link */
payload_size = TLV_SPACE(sizeof(link_info)) *
(tipc_net.zones[tipc_zone(tipc_own_addr)]->links + 1);
- if (payload_size > 32768u)
+ if (payload_size > 32768u) {
+ read_unlock_bh(&tipc_net_lock);
return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
" (too many links)");
+ }
buf = tipc_cfg_reply_alloc(payload_size);
- if (!buf)
+ if (!buf) {
+ read_unlock_bh(&tipc_net_lock);
return NULL;
+ }
/* Add TLV for broadcast link */
@@ -697,6 +713,7 @@ struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space)
if (!in_scope(domain, n_ptr->addr))
continue;
+ tipc_node_lock(n_ptr);
for (i = 0; i < MAX_BEARERS; i++) {
if (!n_ptr->links[i])
continue;
@@ -706,7 +723,9 @@ struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space)
tipc_cfg_append_tlv(buf, TIPC_TLV_LINK_INFO,
&link_info, sizeof(link_info));
}
+ tipc_node_unlock(n_ptr);
}
+ read_unlock_bh(&tipc_net_lock);
return buf;
}
--
1.5.4.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 7/7 net-next-2.6] tipc: Optimization to multicast name lookup algorithm
2008-07-10 21:26 [PATCH 0/7 net-next-2.6] tipc: More miscellaneous fixes & optimizations Allan Stephens
` (5 preceding siblings ...)
2008-07-10 21:26 ` [PATCH 6/7 net-next-2.6] tipc: Add missing locks when inspecting node list & link list Allan Stephens
@ 2008-07-10 21:26 ` Allan Stephens
2008-07-15 5:45 ` David Miller
6 siblings, 1 reply; 15+ messages in thread
From: Allan Stephens @ 2008-07-10 21:26 UTC (permalink / raw)
To: David Miller; +Cc: netdev, allan.stephens
This patch simplifies and speeds up TIPC's algorithm for identifying
on-node and off-node destinations that overlap a multicast name
sequence range. Rather than traversing the list of all known name
publications within the cluster, it now traverses the (potentially
much shorter) list of name publications made by the node itself, and
determines if any off-node destinations exist by comparing the sizes
of the two lists. (Since the node list must be a subset of the
cluster list, a difference in sizes means that at least one off-node
destination must exist.)
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
---
net/tipc/name_table.c | 43 ++++++++++++++++++++++++++++++-------------
1 files changed, 30 insertions(+), 13 deletions(-)
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c
index 1e53b0c..cd72e22 100644
--- a/net/tipc/name_table.c
+++ b/net/tipc/name_table.c
@@ -2,7 +2,7 @@
* net/tipc/name_table.c: TIPC name table code
*
* Copyright (c) 2000-2006, Ericsson AB
- * Copyright (c) 2004-2005, Wind River Systems
+ * Copyright (c) 2004-2008, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -52,9 +52,16 @@ static int tipc_nametbl_size = 1024; /* must be a power of 2 */
* struct sub_seq - container for all published instances of a name sequence
* @lower: name sequence lower bound
* @upper: name sequence upper bound
- * @node_list: circular list of matching publications with >= node scope
- * @cluster_list: circular list of matching publications with >= cluster scope
- * @zone_list: circular list of matching publications with >= zone scope
+ * @node_list: circular list of publications made by own node
+ * @cluster_list: circular list of publications made by own cluster
+ * @zone_list: circular list of publications made by own zone
+ * @node_list_size: number of entries in "node_list"
+ * @cluster_list_size: number of entries in "cluster_list"
+ * @zone_list_size: number of entries in "zone_list"
+ *
+ * Note: The zone list always contains at least one entry, since all
+ * publications of the associated name sequence belong to it.
+ * (The cluster and node lists may be empty.)
*/
struct sub_seq {
@@ -63,6 +70,9 @@ struct sub_seq {
struct publication *node_list;
struct publication *cluster_list;
struct publication *zone_list;
+ u32 node_list_size;
+ u32 cluster_list_size;
+ u32 zone_list_size;
};
/**
@@ -317,6 +327,7 @@ static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq,
dbg("inserting publ %p, node=0x%x publ->node=0x%x, subscr->node=%p\n",
publ, node, publ->node, publ->subscr.node);
+ sseq->zone_list_size++;
if (!sseq->zone_list)
sseq->zone_list = publ->zone_list_next = publ;
else {
@@ -325,6 +336,7 @@ static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq,
}
if (in_own_cluster(node)) {
+ sseq->cluster_list_size++;
if (!sseq->cluster_list)
sseq->cluster_list = publ->cluster_list_next = publ;
else {
@@ -335,6 +347,7 @@ static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq,
}
if (node == tipc_own_addr) {
+ sseq->node_list_size++;
if (!sseq->node_list)
sseq->node_list = publ->node_list_next = publ;
else {
@@ -411,6 +424,7 @@ static struct publication *tipc_nameseq_remove_publ(struct name_seq *nseq, u32 i
} else {
sseq->zone_list = NULL;
}
+ sseq->zone_list_size--;
/* Remove publication from cluster scope list, if present */
@@ -439,6 +453,7 @@ static struct publication *tipc_nameseq_remove_publ(struct name_seq *nseq, u32 i
} else {
sseq->cluster_list = NULL;
}
+ sseq->cluster_list_size--;
}
end_cluster:
@@ -469,6 +484,7 @@ end_cluster:
} else {
sseq->node_list = NULL;
}
+ sseq->node_list_size--;
}
end_node:
@@ -709,17 +725,18 @@ int tipc_nametbl_mc_translate(u32 type, u32 lower, u32 upper, u32 limit,
if (sseq->lower > upper)
break;
- publ = sseq->cluster_list;
- if (publ)
+
+ publ = sseq->node_list;
+ if (publ) {
do {
- if (publ->scope > limit)
- /* ignore out-of-scope publication */ ;
- else if (publ->node == tipc_own_addr)
+ if (publ->scope <= limit)
tipc_port_list_add(dports, publ->ref);
- else
- res = 1;
- publ = publ->cluster_list_next;
- } while (publ != sseq->cluster_list);
+ publ = publ->node_list_next;
+ } while (publ != sseq->node_list);
+ }
+
+ if (sseq->cluster_list_size != sseq->node_list_size)
+ res = 1;
}
spin_unlock_bh(&seq->lock);
--
1.5.4.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 1/7 net-next-2.6] tipc: Remove unneeded parameter to tipc_createport_raw()
2008-07-10 21:26 ` [PATCH 1/7 net-next-2.6] tipc: Remove unneeded parameter to tipc_createport_raw() Allan Stephens
@ 2008-07-15 5:42 ` David Miller
0 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2008-07-15 5:42 UTC (permalink / raw)
To: allan.stephens; +Cc: netdev
From: Allan Stephens <allan.stephens@windriver.com>
Date: Thu, 10 Jul 2008 17:26:05 -0400
> This patch eliminates an unneeded parameter when creating a low-level
> TIPC port object. Instead of returning both the pointer to the port
> structure and the port's reference ID, it now returns only the pointer
> since the port structure contains the reference ID as one of its fields.
>
> Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Applied.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/7 net-next-2.6] tipc: Optimize pointer dereferencing when receiving stream data
2008-07-10 21:26 ` [PATCH 2/7 net-next-2.6] tipc: Optimize pointer dereferencing when receiving stream data Allan Stephens
@ 2008-07-15 5:42 ` David Miller
0 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2008-07-15 5:42 UTC (permalink / raw)
To: allan.stephens; +Cc: netdev
From: Allan Stephens <allan.stephens@windriver.com>
Date: Thu, 10 Jul 2008 17:26:06 -0400
> This patch eliminates an unnecessary pointer dereference when
> accessing a stream-based socket's receive queue.
>
> Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Applied.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 3/7 net-next-2.6] tipc: Fix race condition that could cause accept() to fail
2008-07-10 21:26 ` [PATCH 3/7 net-next-2.6] tipc: Fix race condition that could cause accept() to fail Allan Stephens
@ 2008-07-15 5:43 ` David Miller
0 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2008-07-15 5:43 UTC (permalink / raw)
To: allan.stephens; +Cc: netdev
From: Allan Stephens <allan.stephens@windriver.com>
Date: Thu, 10 Jul 2008 17:26:07 -0400
> This patch ensurs that accept() returns successfully even when
> the newly created socket is immediately disconnected by its peer.
> Previously, accept() would fail if it was unable to pass back
> the optional address info for the socket's peer before the
> socket became disconnected; TIPC now allows accept() to gather
> peer address information after disconnection. As a bonus, the
> revised code accesses the socket's port more efficiently, without
> the overhead incurred by a reference table lookup.
>
> Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Applied.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 4/7 net-next-2.6] tipc: Eliminate improper use of TIPC_OK error code
2008-07-10 21:26 ` [PATCH 4/7 net-next-2.6] tipc: Eliminate improper use of TIPC_OK error code Allan Stephens
@ 2008-07-15 5:44 ` David Miller
0 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2008-07-15 5:44 UTC (permalink / raw)
To: allan.stephens; +Cc: netdev
From: Allan Stephens <allan.stephens@windriver.com>
Date: Thu, 10 Jul 2008 17:26:08 -0400
> This patch corrects many places where TIPC routines indicated
> successful completion by returning TIPC_OK instead of 0.
> (The TIPC_OK symbol has the value 0, but it should only be used
> in contexts that deal with the error code field of a TIPC
> message header.)
>
> Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Applied.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 5/7 net-next-2.6] tipc: Fix bug in scope checking for multicast messages
2008-07-10 21:26 ` [PATCH 5/7 net-next-2.6] tipc: Fix bug in scope checking for multicast messages Allan Stephens
@ 2008-07-15 5:44 ` David Miller
0 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2008-07-15 5:44 UTC (permalink / raw)
To: allan.stephens; +Cc: netdev
From: Allan Stephens <allan.stephens@windriver.com>
Date: Thu, 10 Jul 2008 17:26:09 -0400
> This patch ensures that TIPC's multicast message name lookup
> algorithm does individualized scope checking for each published
> name it examines. Previously, scope checking was only done for
> the first name in a name table publication list, which could
> result in incoming multicast messages being delivered to ports
> publishing names with "node" scope, or not being delivered to
> ports publishing names with "cluster" or "zone" scope.
>
> Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Applied.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 6/7 net-next-2.6] tipc: Add missing locks when inspecting node list & link list
2008-07-10 21:26 ` [PATCH 6/7 net-next-2.6] tipc: Add missing locks when inspecting node list & link list Allan Stephens
@ 2008-07-15 5:45 ` David Miller
0 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2008-07-15 5:45 UTC (permalink / raw)
To: allan.stephens; +Cc: netdev
From: Allan Stephens <allan.stephens@windriver.com>
Date: Thu, 10 Jul 2008 17:26:10 -0400
> This patch ensures that TIPC configuration commands that display info
> about neighboring nodes and their links take the spinlocks that
> protect the node list and link lists from changing while the lists
> are being traversed.
>
> Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Applied.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 7/7 net-next-2.6] tipc: Optimization to multicast name lookup algorithm
2008-07-10 21:26 ` [PATCH 7/7 net-next-2.6] tipc: Optimization to multicast name lookup algorithm Allan Stephens
@ 2008-07-15 5:45 ` David Miller
0 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2008-07-15 5:45 UTC (permalink / raw)
To: allan.stephens; +Cc: netdev
From: Allan Stephens <allan.stephens@windriver.com>
Date: Thu, 10 Jul 2008 17:26:11 -0400
> This patch simplifies and speeds up TIPC's algorithm for identifying
> on-node and off-node destinations that overlap a multicast name
> sequence range. Rather than traversing the list of all known name
> publications within the cluster, it now traverses the (potentially
> much shorter) list of name publications made by the node itself, and
> determines if any off-node destinations exist by comparing the sizes
> of the two lists. (Since the node list must be a subset of the
> cluster list, a difference in sizes means that at least one off-node
> destination must exist.)
>
> Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Also applied, thanks a lot.
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2008-07-15 5:45 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-10 21:26 [PATCH 0/7 net-next-2.6] tipc: More miscellaneous fixes & optimizations Allan Stephens
2008-07-10 21:26 ` [PATCH 1/7 net-next-2.6] tipc: Remove unneeded parameter to tipc_createport_raw() Allan Stephens
2008-07-15 5:42 ` David Miller
2008-07-10 21:26 ` [PATCH 2/7 net-next-2.6] tipc: Optimize pointer dereferencing when receiving stream data Allan Stephens
2008-07-15 5:42 ` David Miller
2008-07-10 21:26 ` [PATCH 3/7 net-next-2.6] tipc: Fix race condition that could cause accept() to fail Allan Stephens
2008-07-15 5:43 ` David Miller
2008-07-10 21:26 ` [PATCH 4/7 net-next-2.6] tipc: Eliminate improper use of TIPC_OK error code Allan Stephens
2008-07-15 5:44 ` David Miller
2008-07-10 21:26 ` [PATCH 5/7 net-next-2.6] tipc: Fix bug in scope checking for multicast messages Allan Stephens
2008-07-15 5:44 ` David Miller
2008-07-10 21:26 ` [PATCH 6/7 net-next-2.6] tipc: Add missing locks when inspecting node list & link list Allan Stephens
2008-07-15 5:45 ` David Miller
2008-07-10 21:26 ` [PATCH 7/7 net-next-2.6] tipc: Optimization to multicast name lookup algorithm Allan Stephens
2008-07-15 5:45 ` David Miller
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).