* [PATCH 01/08] [TIPC]: Update version to 1.6.3
From: Stephens, Allan @ 2008-02-22 19:59 UTC (permalink / raw)
To: netdev
This patch updates TIPC's version number to 1.6.3.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
---
net/tipc/core.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/tipc/core.c b/net/tipc/core.c
index d2d7d32..9b9429e 100644
--- a/net/tipc/core.c
+++ b/net/tipc/core.c
@@ -57,7 +57,7 @@ void tipc_socket_stop(void);
int tipc_netlink_start(void);
void tipc_netlink_stop(void);
-#define TIPC_MOD_VER "1.6.2"
+#define TIPC_MOD_VER "1.6.3"
#ifndef CONFIG_TIPC_ZONES
#define CONFIG_TIPC_ZONES 3
--
1.5.3.2
^ permalink raw reply related
* [PATCH 04/08] [TIPC]: Minor cleanup of message header code
From: Stephens, Allan @ 2008-02-22 19:59 UTC (permalink / raw)
To: netdev
This patch eliminates some unused or duplicate message header
symbols, and fixes up the comments and/or location of a few
other symbols.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
---
net/tipc/link.c | 16 ++++++++--------
net/tipc/msg.c | 16 ++++++++--------
net/tipc/msg.h | 19 ++++++++-----------
net/tipc/port.c | 4 ++--
4 files changed, 26 insertions(+), 29 deletions(-)
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 1b17fec..9d6b315 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -2832,15 +2832,15 @@ static void link_set_supervision_props(struct
link *l_ptr, u32 tolerance)
void tipc_link_set_queue_limits(struct link *l_ptr, u32 window)
{
/* Data messages from this node, inclusive FIRST_FRAGM */
- l_ptr->queue_limit[DATA_LOW] = window;
- l_ptr->queue_limit[DATA_MEDIUM] = (window / 3) * 4;
- l_ptr->queue_limit[DATA_HIGH] = (window / 3) * 5;
- l_ptr->queue_limit[DATA_CRITICAL] = (window / 3) * 6;
+ l_ptr->queue_limit[TIPC_LOW_IMPORTANCE] = window;
+ l_ptr->queue_limit[TIPC_MEDIUM_IMPORTANCE] = (window / 3) * 4;
+ l_ptr->queue_limit[TIPC_HIGH_IMPORTANCE] = (window / 3) * 5;
+ l_ptr->queue_limit[TIPC_CRITICAL_IMPORTANCE] = (window / 3) * 6;
/* Transiting data messages,inclusive FIRST_FRAGM */
- l_ptr->queue_limit[DATA_LOW + 4] = 300;
- l_ptr->queue_limit[DATA_MEDIUM + 4] = 600;
- l_ptr->queue_limit[DATA_HIGH + 4] = 900;
- l_ptr->queue_limit[DATA_CRITICAL + 4] = 1200;
+ l_ptr->queue_limit[TIPC_LOW_IMPORTANCE + 4] = 300;
+ l_ptr->queue_limit[TIPC_MEDIUM_IMPORTANCE + 4] = 600;
+ l_ptr->queue_limit[TIPC_HIGH_IMPORTANCE + 4] = 900;
+ l_ptr->queue_limit[TIPC_CRITICAL_IMPORTANCE + 4] = 1200;
l_ptr->queue_limit[CONN_MANAGER] = 1200;
l_ptr->queue_limit[ROUTE_DISTRIBUTOR] = 1200;
l_ptr->queue_limit[CHANGEOVER_PROTOCOL] = 2500;
diff --git a/net/tipc/msg.c b/net/tipc/msg.c
index 7824854..696a863 100644
--- a/net/tipc/msg.c
+++ b/net/tipc/msg.c
@@ -73,10 +73,10 @@ void tipc_msg_print(struct print_buf *buf, struct
tipc_msg *msg, const char *str
tipc_printf(buf, "NO(%u/%u):",msg_long_msgno(msg),
msg_fragm_no(msg));
break;
- case DATA_LOW:
- case DATA_MEDIUM:
- case DATA_HIGH:
- case DATA_CRITICAL:
+ case TIPC_LOW_IMPORTANCE:
+ case TIPC_MEDIUM_IMPORTANCE:
+ case TIPC_HIGH_IMPORTANCE:
+ case TIPC_CRITICAL_IMPORTANCE:
tipc_printf(buf, "DAT%u:", msg_user(msg));
if (msg_short(msg)) {
tipc_printf(buf, "CON:");
@@ -229,10 +229,10 @@ void tipc_msg_print(struct print_buf *buf, struct
tipc_msg *msg, const char *str
switch (usr) {
case CONN_MANAGER:
case NAME_DISTRIBUTOR:
- case DATA_LOW:
- case DATA_MEDIUM:
- case DATA_HIGH:
- case DATA_CRITICAL:
+ case TIPC_LOW_IMPORTANCE:
+ case TIPC_MEDIUM_IMPORTANCE:
+ case TIPC_HIGH_IMPORTANCE:
+ case TIPC_CRITICAL_IMPORTANCE:
if (msg_short(msg))
break; /* No error */
switch (msg_errcode(msg)) {
diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index e9ef6df..282e916 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -40,18 +40,16 @@
#include "core.h"
#define TIPC_VERSION 2
-#define DATA_LOW TIPC_LOW_IMPORTANCE
-#define DATA_MEDIUM TIPC_MEDIUM_IMPORTANCE
-#define DATA_HIGH TIPC_HIGH_IMPORTANCE
-#define DATA_CRITICAL TIPC_CRITICAL_IMPORTANCE
-#define SHORT_H_SIZE 24 /* Connected,in cluster */
+
+#define SHORT_H_SIZE 24 /* Connected, in-cluster
messages */
#define DIR_MSG_H_SIZE 32 /* Directly addressed messages
*/
-#define CONN_MSG_H_SIZE 36 /* Routed connected msgs*/
-#define LONG_H_SIZE 40 /* Named Messages */
+#define LONG_H_SIZE 40 /* Named messages */
#define MCAST_H_SIZE 44 /* Multicast messages */
-#define MAX_H_SIZE 60 /* Inclusive full options */
+#define INT_H_SIZE 40 /* Internal messages */
+#define MIN_H_SIZE 24 /* Smallest legal TIPC header
size */
+#define MAX_H_SIZE 60 /* Largest possible TIPC header
size */
+
#define MAX_MSG_SIZE (MAX_H_SIZE + TIPC_MAX_USER_MSG_SIZE)
-#define LINK_CONFIG 13
/*
@@ -97,7 +95,7 @@ static inline u32 msg_user(struct tipc_msg *m)
static inline u32 msg_isdata(struct tipc_msg *m)
{
- return (msg_user(m) <= DATA_CRITICAL);
+ return (msg_user(m) <= TIPC_CRITICAL_IMPORTANCE);
}
static inline void msg_set_user(struct tipc_msg *m, u32 n)
@@ -388,7 +386,6 @@ static inline void msg_expand(struct tipc_msg *m,
u32 destnode)
#define NAME_DISTRIBUTOR 11
#define MSG_FRAGMENTER 12
#define LINK_CONFIG 13
-#define INT_H_SIZE 40
#define DSC_H_SIZE 40
/*
diff --git a/net/tipc/port.c b/net/tipc/port.c
index f508614..25b6967 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -242,7 +242,7 @@ u32 tipc_createport_raw(void *usr_handle,
p_ptr->publ.max_pkt = MAX_PKT_DEFAULT;
p_ptr->publ.ref = ref;
msg = &p_ptr->publ.phdr;
- msg_init(msg, DATA_LOW, TIPC_NAMED_MSG, TIPC_OK, LONG_H_SIZE,
0);
+ msg_init(msg, TIPC_LOW_IMPORTANCE, TIPC_NAMED_MSG, TIPC_OK,
LONG_H_SIZE, 0);
msg_set_orignode(msg, tipc_own_addr);
msg_set_prevnode(msg, tipc_own_addr);
msg_set_origport(msg, ref);
@@ -632,7 +632,7 @@ void tipc_port_recv_proto_msg(struct sk_buff *buf)
msg_orignode(msg),
msg_destport(msg),
tipc_own_addr,
- DATA_HIGH,
+ TIPC_HIGH_IMPORTANCE,
TIPC_CONN_MSG,
err,
0,
--
1.5.3.2
^ permalink raw reply related
* [PATCH 00/08] [TIPC]: Initial patch set for TIPC 1.6.3
From: Stephens, Allan @ 2008-02-22 19:58 UTC (permalink / raw)
To: netdev
This is a patch set containing TIPC code developed as part of the TIPC
1.7
development project. This first set contains small enhancements and bug
fixes
only, and is thus being integrated under the current TIPC 1.6
designation.
Patch set summary:
01 Update version to 1.6.3
02 Add argument validation for shutdown
03 Eliminate sparse warning in socket code
04 Minor cleanup of message header code
05 Use correct bitmask when setting version in
06 Enhancements to message header field writing
07 Removal of obsolete message header option co
08 TIPC network address handling cleanup
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
^ permalink raw reply
* [PATCH 03/08] [TIPC]: Eliminate "sparse" warning in socket code
From: Stephens, Allan @ 2008-02-22 19:59 UTC (permalink / raw)
To: netdev
This patch eliminates warnings about a pair of undeclared symbols.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
---
net/tipc/socket.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index e5a6983..356a18c 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -81,6 +81,12 @@ static int sockets_enabled = 0;
static atomic_t tipc_queue_size = ATOMIC_INIT(0);
+/*
+ * Declare public routines so "sparse" doesn't complain ...
+ */
+
+extern int tipc_socket_init(void);
+extern void tipc_socket_stop(void);
/*
* sock_lock(): Lock a port/socket pair. lock_sock() can
--
1.5.3.2
^ permalink raw reply related
* [PATCH 05/08] [TIPC]: Use correct bitmask when setting version in message
From: Stephens, Allan @ 2008-02-22 19:59 UTC (permalink / raw)
To: netdev
This patch ensures that the 3-bit version field of the TIPC
message header is masked correctly when written into a message.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
---
net/tipc/msg.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index 282e916..45c85a2 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -85,7 +85,7 @@ static inline u32 msg_version(struct tipc_msg *m)
static inline void msg_set_version(struct tipc_msg *m)
{
- msg_set_bits(m, 0, 29, 0xf, TIPC_VERSION);
+ msg_set_bits(m, 0, 29, 0x7, TIPC_VERSION);
}
static inline u32 msg_user(struct tipc_msg *m)
--
1.5.3.2
^ permalink raw reply related
* [PATCH 02/08] [TIPC]: Add argument validation for shutdown()
From: Stephens, Allan @ 2008-02-22 19:59 UTC (permalink / raw)
To: netdev
This patch validates that the "how" argument to shutdown()
is SHUT_RDWR, since this is the only form that TIPC supports.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
---
net/tipc/socket.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 2290903..e5a6983 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -1419,20 +1419,25 @@ exit:
/**
* shutdown - shutdown socket connection
* @sock: socket structure
- * @how: direction to close (unused; always treated as read + write)
+ * @how: direction to close (must be SHUT_RDWR)
*
* Terminates connection (if necessary), then purges socket's receive
queue.
*
* Returns 0 on success, errno otherwise
*/
+#ifndef SHUT_RDWR
+#define SHUT_RDWR 2
+#endif
+
static int shutdown(struct socket *sock, int how)
{
struct tipc_sock* tsock = tipc_sk(sock->sk);
struct sk_buff *buf;
int res;
- /* Could return -EINVAL for an invalid "how", but why bother? */
+ if (how != SHUT_RDWR)
+ return -EINVAL;
if (down_interruptible(&tsock->sem))
return -ERESTARTSYS;
--
1.5.3.2
^ permalink raw reply related
* [PATCH 08/08] [TIPC]: TIPC network address handling cleanup
From: Stephens, Allan @ 2008-02-22 19:59 UTC (permalink / raw)
To: netdev
This patch improves the code which manipulates TIPC network
address (aka <Z.C.N> values).
1) Address format validation routines are generalized to
accept any valid <Z.C.N> value.
2) Eliminated inlining of scope checking code to prevent
needless code duplication in non-critical path areas.
3) Introduced new primitives for manipulating network
addresses to improve code readability.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
---
net/tipc/addr.c | 35 ++++++++++++++++++++---------------
net/tipc/addr.h | 30 ++++++++++++++++++------------
net/tipc/bearer.c | 2 +-
net/tipc/discover.c | 2 +-
net/tipc/name_table.c | 2 +-
net/tipc/net.c | 2 +-
net/tipc/node.c | 6 +++---
7 files changed, 45 insertions(+), 34 deletions(-)
diff --git a/net/tipc/addr.c b/net/tipc/addr.c
index e5207a1..84570ae 100644
--- a/net/tipc/addr.c
+++ b/net/tipc/addr.c
@@ -2,7 +2,7 @@
* net/tipc/addr.c: TIPC address utility routines
*
* Copyright (c) 2000-2006, Ericsson AB
- * Copyright (c) 2004-2005, Wind River Systems
+ * Copyright (c) 2004-2007, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -49,8 +49,7 @@ u32 tipc_get_addr(void)
/**
* tipc_addr_domain_valid - validates a network domain address
*
- * Accepts <Z.C.N>, <Z.C.0>, <Z.0.0>, and <0.0.0>,
- * where Z, C, and N are non-zero and do not exceed the configured
limits.
+ * Accepts <Z.C.N>, <Z.C.0>, <Z.0.0>, and <0.0.0>, where Z, C, & N are
non-zero.
*
* Returns 1 if domain address is valid, otherwise 0
*/
@@ -60,16 +59,6 @@ int tipc_addr_domain_valid(u32 addr)
u32 n = tipc_node(addr);
u32 c = tipc_cluster(addr);
u32 z = tipc_zone(addr);
- u32 max_nodes = tipc_max_nodes;
-
- if (is_slave(addr))
- max_nodes = LOWEST_SLAVE + tipc_max_slaves;
- if (n > max_nodes)
- return 0;
- if (c > tipc_max_clusters)
- return 0;
- if (z > tipc_max_zones)
- return 0;
if (n && (!z || !c))
return 0;
@@ -81,8 +70,7 @@ int tipc_addr_domain_valid(u32 addr)
/**
* tipc_addr_node_valid - validates a proposed network address for this
node
*
- * Accepts <Z.C.N>, where Z, C, and N are non-zero and do not exceed
- * the configured limits.
+ * Accepts <Z.C.N>, where Z, C, and N are non-zero.
*
* Returns 1 if address can be used, otherwise 0
*/
@@ -92,3 +80,20 @@ int tipc_addr_node_valid(u32 addr)
return (tipc_addr_domain_valid(addr) && tipc_node(addr));
}
+/**
+ * tipc_in_scope - determines if network address lies within specified
domain
+ */
+
+int tipc_in_scope(u32 domain, u32 addr)
+{
+ if (likely(domain == addr))
+ return 1;
+ if (domain == 0)
+ return 1;
+ if (domain == addr_cluster(addr)) /* domain <Z.C.0> */
+ return 1;
+ if (domain == addr_zone(addr)) /* domain <Z.0.0> */
+ return 1;
+ return 0;
+}
+
diff --git a/net/tipc/addr.h b/net/tipc/addr.h
index 3ba67e6..097eb20 100644
--- a/net/tipc/addr.h
+++ b/net/tipc/addr.h
@@ -2,7 +2,7 @@
* net/tipc/addr.h: Include file for TIPC address utility routines
*
* Copyright (c) 2000-2006, Ericsson AB
- * Copyright (c) 2004-2005, Wind River Systems
+ * Copyright (c) 2004-2006, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -37,6 +37,17 @@
#ifndef _TIPC_ADDR_H
#define _TIPC_ADDR_H
+
+static inline u32 addr_zone(u32 addr)
+{
+ return addr & 0xff000000u;
+}
+
+static inline u32 addr_cluster(u32 addr)
+{
+ return addr & 0xfffff000u;
+}
+
static inline u32 own_node(void)
{
return tipc_node(tipc_own_addr);
@@ -57,6 +68,11 @@ static inline int in_own_cluster(u32 addr)
return !((addr ^ tipc_own_addr) >> 12);
}
+static inline int in_own_zone(u32 addr)
+{
+ return !((addr ^ tipc_own_addr) >> 24);
+}
+
static inline int is_slave(u32 addr)
{
return addr & 0x800;
@@ -67,17 +83,6 @@ static inline int may_route(u32 addr)
return(addr ^ tipc_own_addr) >> 11;
}
-static inline int in_scope(u32 domain, u32 addr)
-{
- if (!domain || (domain == addr))
- return 1;
- if (domain == (addr & 0xfffff000u)) /* domain <Z.C.0> */
- return 1;
- if (domain == (addr & 0xff000000u)) /* domain <Z.0.0> */
- return 1;
- return 0;
-}
-
/**
* addr_scope - convert message lookup domain to equivalent 2-bit scope
value
*/
@@ -119,5 +124,6 @@ static inline char *addr_string_fill(char *string,
u32 addr)
int tipc_addr_domain_valid(u32);
int tipc_addr_node_valid(u32 addr);
+int tipc_in_scope(u32 domain, u32 addr);
#endif
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index 271a375..ec2fd2e 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -491,7 +491,7 @@ int tipc_enable_bearer(const char *name, u32
bcast_scope, u32 priority)
return -EINVAL;
}
if (!tipc_addr_domain_valid(bcast_scope) ||
- !in_scope(bcast_scope, tipc_own_addr)) {
+ !tipc_in_scope(bcast_scope, tipc_own_addr)) {
warn("Bearer <%s> rejected, illegal broadcast scope\n",
name);
return -EINVAL;
}
diff --git a/net/tipc/discover.c b/net/tipc/discover.c
index 5d643e5..c2c69c8 100644
--- a/net/tipc/discover.c
+++ b/net/tipc/discover.c
@@ -184,7 +184,7 @@ void tipc_disc_recv_msg(struct sk_buff *buf)
disc_dupl_alert(b_ptr, tipc_own_addr,
&media_addr);
return;
}
- if (!in_scope(dest, tipc_own_addr))
+ if (!tipc_in_scope(dest, tipc_own_addr))
return;
if (is_slave(tipc_own_addr) && is_slave(orig))
return;
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c
index ac7dfdd..dba78a0 100644
--- a/net/tipc/name_table.c
+++ b/net/tipc/name_table.c
@@ -611,7 +611,7 @@ u32 tipc_nametbl_translate(u32 type, u32 instance,
u32 *destnode)
struct name_seq *seq;
u32 ref;
- if (!in_scope(*destnode, tipc_own_addr))
+ if (!tipc_in_scope(*destnode, tipc_own_addr))
return 0;
read_lock_bh(&tipc_nametbl_lock);
diff --git a/net/tipc/net.c b/net/tipc/net.c
index c39c762..e218c5b 100644
--- a/net/tipc/net.c
+++ b/net/tipc/net.c
@@ -234,7 +234,7 @@ void tipc_net_route_msg(struct sk_buff *buf)
/* Handle message for this node */
dnode = msg_short(msg) ? tipc_own_addr : msg_destnode(msg);
- if (in_scope(dnode, tipc_own_addr)) {
+ if (tipc_in_scope(dnode, tipc_own_addr)) {
if (msg_isdata(msg)) {
if (msg_mcast(msg))
tipc_port_recv_mcast(buf, NULL);
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 598f4d3..1d2cd1f 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -575,7 +575,7 @@ u32 tipc_available_nodes(const u32 domain)
u32 cnt = 0;
for (n_ptr = tipc_nodes; n_ptr; n_ptr = n_ptr->next) {
- if (!in_scope(domain, n_ptr->addr))
+ if (!tipc_in_scope(domain, n_ptr->addr))
continue;
if (tipc_node_is_up(n_ptr))
cnt++;
@@ -616,7 +616,7 @@ struct sk_buff *tipc_node_get_nodes(const void
*req_tlv_area, int req_tlv_space)
/* Add TLVs for all nodes in scope */
for (n_ptr = tipc_nodes; n_ptr; n_ptr = n_ptr->next) {
- if (!in_scope(domain, n_ptr->addr))
+ if (!tipc_in_scope(domain, n_ptr->addr))
continue;
node_info.addr = htonl(n_ptr->addr);
node_info.up = htonl(tipc_node_is_up(n_ptr));
@@ -669,7 +669,7 @@ struct sk_buff *tipc_node_get_links(const void
*req_tlv_area, int req_tlv_space)
for (n_ptr = tipc_nodes; n_ptr; n_ptr = n_ptr->next) {
u32 i;
- if (!in_scope(domain, n_ptr->addr))
+ if (!tipc_in_scope(domain, n_ptr->addr))
continue;
for (i = 0; i < MAX_BEARERS; i++) {
if (!n_ptr->links[i])
--
1.5.3.2
^ permalink raw reply related
* [PATCH 07/08] [TIPC]: Removal of obsolete message header option code
From: Stephens, Allan @ 2008-02-22 19:59 UTC (permalink / raw)
To: netdev
This patch removes code associated with optional, user-specified
fields of the TIPC message header. Such fields were never
utilized by TIPC, and have now been removed from the protocol
specification.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
---
include/net/tipc/tipc_port.h | 7 -------
net/tipc/core.c | 1 -
net/tipc/msg.h | 23 -----------------------
net/tipc/port.c | 7 -------
4 files changed, 0 insertions(+), 38 deletions(-)
diff --git a/include/net/tipc/tipc_port.h b/include/net/tipc/tipc_port.h
index cfc4ba4..c9b36b7 100644
--- a/include/net/tipc/tipc_port.h
+++ b/include/net/tipc/tipc_port.h
@@ -86,13 +86,6 @@ u32 tipc_createport_raw(void *usr_handle,
void (*wakeup)(struct tipc_port *),
const u32 importance);
-/*
- * tipc_set_msg_option(): port must be locked.
- */
-int tipc_set_msg_option(struct tipc_port *tp_ptr,
- const char *opt,
- const u32 len);
-
int tipc_reject_msg(struct sk_buff *buf, u32 err);
int tipc_send_buf_fast(struct sk_buff *buf, u32 destnode);
diff --git a/net/tipc/core.c b/net/tipc/core.c
index 9b9429e..99ddb8e 100644
--- a/net/tipc/core.c
+++ b/net/tipc/core.c
@@ -277,7 +277,6 @@ EXPORT_SYMBOL(tipc_register_media);
/* TIPC API for external APIs (see tipc_port.h) */
EXPORT_SYMBOL(tipc_createport_raw);
-EXPORT_SYMBOL(tipc_set_msg_option);
EXPORT_SYMBOL(tipc_reject_msg);
EXPORT_SYMBOL(tipc_send_buf_fast);
EXPORT_SYMBOL(tipc_acknowledge);
diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index 3f03739..4bcf4c9 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -190,18 +190,6 @@ static inline void msg_set_lookup_scope(struct
tipc_msg *m, u32 n)
msg_set_bits(m, 1, 19, 0x3, n);
}
-static inline void msg_set_options(struct tipc_msg *m, const char *opt,
u32 sz)
-{
- u32 hsz = msg_hdr_sz(m);
- char *to = (char *)&m->hdr[hsz/4];
-
- if ((hsz < DIR_MSG_H_SIZE) || ((hsz + sz) > MAX_H_SIZE))
- return;
- msg_set_bits(m, 1, 16, 0x7, (hsz - 28)/4);
- msg_set_hdr_sz(m, hsz + sz);
- memcpy(to, opt, sz);
-}
-
static inline u32 msg_bcast_ack(struct tipc_msg *m)
{
return msg_bits(m, 1, 0, 0xffff);
@@ -330,17 +318,6 @@ static inline struct tipc_msg
*msg_get_wrapped(struct tipc_msg *m)
return (struct tipc_msg *)msg_data(m);
}
-static inline void msg_expand(struct tipc_msg *m, u32 destnode)
-{
- if (!msg_short(m))
- return;
- msg_set_hdr_sz(m, LONG_H_SIZE);
- msg_set_orignode(m, msg_prevnode(m));
- msg_set_destnode(m, destnode);
- memset(&m->hdr[8], 0, 12);
-}
-
-
/*
TIPC internal message header format, version 2
diff --git a/net/tipc/port.c b/net/tipc/port.c
index 25b6967..c4ea00f 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -413,13 +413,6 @@ static struct sk_buff *port_build_proto_msg(u32
destport, u32 destnode,
return buf;
}
-int tipc_set_msg_option(struct tipc_port *tp_ptr, const char *opt,
const u32 sz)
-{
- msg_expand(&tp_ptr->phdr, msg_destnode(&tp_ptr->phdr));
- msg_set_options(&tp_ptr->phdr, opt, sz);
- return TIPC_OK;
-}
-
int tipc_reject_msg(struct sk_buff *buf, u32 err)
{
struct tipc_msg *msg = buf_msg(buf);
--
1.5.3.2
^ permalink raw reply related
* [PATCH 06/08] [TIPC]: Enhancements to message header field writing
From: Stephens, Allan @ 2008-02-22 19:59 UTC (permalink / raw)
To: netdev
>From d588668422a802166b8368104490c7f644e95271 Mon Sep 17 00:00:00 2001
From: Allan Stephens <allan.stephens@windriver.com>
Date: Fri, 22 Feb 2008 10:21:42 -0500
Subject:
This patch makes two enhancements to the routine used to
set bit fields within a TIPC message header:
1) It now ignores any bits of the new field value that are not
covered by the mask being used. (Previously, if the new value
exceeded the size of the mask the extra bits could corrupt
other fields in the message header word being updated.)
2) The code has been optimized to minimize the number of run-time
endianness conversion operations by leveraging the fact that the
mask (and, in some cases, the value as well) is constant and the
necessary conversion can be performed by the compiler.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
---
net/tipc/msg.h | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index 45c85a2..3f03739 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -70,8 +70,10 @@ static inline void msg_set_bits(struct tipc_msg *m,
u32 w,
u32 pos, u32 mask, u32 val)
{
val = (val & mask) << pos;
- m->hdr[w] &= ~htonl(mask << pos);
- m->hdr[w] |= htonl(val);
+ val = htonl(val);
+ mask = htonl(mask << pos);
+ m->hdr[w] &= ~mask;
+ m->hdr[w] |= val;
}
/*
--
1.5.3.2
^ permalink raw reply related
* Re: [PATCH 03/08] [TIPC]: Eliminate "sparse" warning in socket code
From: Sam Ravnborg @ 2008-02-22 20:04 UTC (permalink / raw)
To: Stephens, Allan; +Cc: netdev
In-Reply-To: <AF1602CB2550CE4381C0C75118A7856B0246C891@ala-mail02.corp.ad.wrs.com>
On Fri, Feb 22, 2008 at 11:59:12AM -0800, Stephens, Allan wrote:
> This patch eliminates warnings about a pair of undeclared symbols.
Hi Allan.
Last I looked there where ~90 sparse warnings for tipc.
I assume you are aware and that they are getting fixed.
Sam - who would like to see an almost sparse clean kernel
^ permalink raw reply
* RE: [PATCH 03/08] [TIPC]: Eliminate "sparse" warning in socket code
From: Stephens, Allan @ 2008-02-22 20:10 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: netdev
In-Reply-To: <20080222200425.GC7154@uranus.ravnborg.org>
Hi Sam:
Yes and yes. Some fixes will occur naturally as the problematic code
has already been rewritten in TIPC 1.7, but other fixes will need to be
developed. I'll see what I can do to accelerate the process ...
-- Al
-----Original Message-----
From: Sam Ravnborg [mailto:sam@ravnborg.org]
Sent: Friday, February 22, 2008 3:04 PM
To: Stephens, Allan
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 03/08] [TIPC]: Eliminate "sparse" warning in socket
code
On Fri, Feb 22, 2008 at 11:59:12AM -0800, Stephens, Allan wrote:
> This patch eliminates warnings about a pair of undeclared symbols.
Hi Allan.
Last I looked there where ~90 sparse warnings for tipc.
I assume you are aware and that they are getting fixed.
Sam - who would like to see an almost sparse clean kernel
^ permalink raw reply
* Re: [PATCH 00/08] [TIPC]: Initial patch set for TIPC 1.6.3
From: David Miller @ 2008-02-22 22:22 UTC (permalink / raw)
To: allan.stephens; +Cc: netdev
In-Reply-To: <AF1602CB2550CE4381C0C75118A7856B0246C88D@ala-mail02.corp.ad.wrs.com>
Please only submit bug fixes for 2.6.25 at this time.
Thank you.
^ permalink raw reply
* Error on ip route replace command
From: Francesco Saverio Giudice @ 2008-02-22 22:22 UTC (permalink / raw)
To: netdev
Hi All,
I have a problem with kernel 2.6.24.
Having a running configuration using Shorewall and restarting it I got
follow error:
RTNETLINK answers: File exists
Tom Eastep, Shorewall creator, told me to inform you about the problem.
Here is the mail:
------------------------------------------------------------
Francesco Saverio Giudice wrote:
> Hi Tom,
>
> I get the error:
>
> ---------
> # ip route add 1.2.4.5 dev eth3
> # ip route replace 1.2.4.5 dev eth3
> RTNETLINK answers: File exists
> ---------
>
> I have to patch kernel or something else ?
>
You should report it at netdev@vger.kernel.org (that's where the Linux
networking developers hang out). This failure does not occur with kernel
2.6.22 and iproute2 ss070710:
gateway:~ # ip route add 1.2.4.5 dev eth0
gateway:~ # ip route replace 1.2.4.5 dev eth0
gateway:~ # ip route del 1.2.4.5
-Tom
--
Tom Eastep \ Nothing is foolproof to a sufficiently talented fool
Shoreline, \ http://shorewall.net
Washington USA \ teastep@shorewall.net
PGP Public Key \ https://lists.shorewall.net/teastep.pgp.key
------------------------------------------------------------
Best Regards
Francesco Saverio Giudice
^ permalink raw reply
* Re: [NETFILTER]: Introduce nf_inet_address
From: David Woodhouse @ 2008-02-22 22:37 UTC (permalink / raw)
To: Patrick McHardy
Cc: Pablo Neira Ayuso, netdev, Jan Engelhardt, David S. Miller,
varekova, twoerner, Netfilter Development Mailinglist
In-Reply-To: <47BEEDEF.5060503@trash.net>
On Fri, 2008-02-22 at 16:44 +0100, Patrick McHardy wrote:
> Pablo Neira Ayuso wrote:
> > Patrick McHardy wrote:
> >> Yes, that was a bug in the lastest release. We need to
> >> release a 1.4.1 version or something like that, but I'm
> >> not too familiar with the release process, so I haven't
> >> done this so far.
> >
> > I can schedule one for this weekend, just send me an ACK.
>
>
> That would be great. I think we had another issue in 1.4.0 with
> some header files, but I can't remeber the details.
If you are going to include header files in the release (which makes a
certain amount of sense), it would be best if those are simply the
result of the kernel's 'make headers_install', without any manual
changes.
--
dwmw2
^ permalink raw reply
* [Patch] Crash (BUG()) when handling fragmented ESP packets
From: Dirk Nehring @ 2008-02-22 23:23 UTC (permalink / raw)
To: netdev
[-- Attachment #1: Type: text/plain, Size: 4885 bytes --]
Most likely all 2.6 series kernels crash with BUG() when receives a
fragmented ESP packet where ESP header and IV are not in the first
fragment. This patches fixes this behaviour by reassembling the
fragmented packet into the sk_buff.
Signed-off-by: Dirk Nehring <dnehring@marcant.net>
Signed-off-by: Andreas Ferber <aferber@marcant.net>
Please apply this patch to 2.6.25. We tested the patch successfully on
production systems which ran into this problem.
Long description:
=================
We have come across (and fixed) a bug in the linux kernel (specifically
in the IPsec code) that has some security concerns attached. On Dec.,
12., 2007, we have contacted security@kernel.org where Herbert was also
informed.
RedHat Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=404291
Future CVE: CVE-2007-6282
BUG DESCRIPTION:
----------------
As you may know, an ESP packet starts with an ESP header (8 Octets),
depending on the encryption algorithm followed by an Initialization
Vector (eg. 16 Octets for AES-CBC, 8 Octets for 3DES-CBC). If the ESP
packet is divided into IP fragments so that the first fragment does not
contain the whole of ESP-Header plus the IV (for example only the first
8 Octets), the kernel runs into a BUG() when decoding the packet and
thus crashes instantly.
HOW TO REPRODUCE:
-----------------
To reproduce the problem you can use the following setup with three
machines:
+----+ +----+ +----+
| E1 |---------| IR |---------| E2 |
+----+ +----+ +----+
E1, E2: IPsec tunnel endpoints
IR: intermediate router
Setup an IPsec tunnel using 3DES-CBC or AES-CBC between E1 and E2 (I
tested it with ISAKMP keying, but it should work with manual keying
also). Now setup "IR" so that it fragments packets going from E1 to E2
into very small fragments (8 Octets each), for example using fragrouter.
Now, when you try to send some traffic through the tunnel from E1 to E2
(thus generating ESP packets), as soon as the last fragment of it has
arrived on E2, it crashes with a BUG().
Note that E1 does not have to be a linux machine, any IPsec capable
device will do.
ANALYSIS:
---------
All line numbers refer to kernel version 2.6.24-rc4.
Have a look at net/ipv4/esp4.c, function esp_input(). Starting at line
195, it tries to get the IV from the ESP packet, however it does not
take into account that the sk_buff it is handling may be paged or
fragmented. This may result in an out of bounds memory read access if
the head of the sk_buff does not contain the full ESP header plus the
IV.
Then at the end of the function, at line 268, it tries to __skb_pull()
the ESP header and IV of the packet. This is where the BUG() is
triggered, since __skb_pull() checks that there is enough data in the
sk_buff head to fulfill the pull.
When reassembling fragmented IP packets, the kernel does so using a
fragmented sk_buff (using skb->frag_list). If the first fragment is
shorter than the ESP header plus the IV, the condition to trigger the
BUG() in esp_input() is satisfied by the resulting sk_buff, thus
crashing the kernel.
The relevant code for IPv6 ESP (in net/ipv6/esp6.c) is mostly the same
as the IPv4 code, so this is affected, too.
The bug most likely exists in all 2.6 kernel versions up till today. I
explicitly checked 2.6.18 (my vendors version of that I first
encountered the bug on a few days ago) and 2.6.0. Although the code of
esp_input() changed in between, the relevant code lines exist in almost
identical form since 2.6.0 up to the latest development versions, so it
is unlikely that some version in between is unaffected by the bug.
BUGFIX:
-------
Attached you can find a patch against stable 2.6.24.1 and 2.6.25-rc2
(there are some bigger changes between 2.6.24 and 2.6.25 is the
responsible code segment). This patch modify the code in question to
correctly deal with a fragmented or paged sk_buff.
We did not test the IPv6 part of the patch, but since it is almost the
same as the IPv4 part, we are pretty confident that it will work as
advertised.
SECURITY CONCERNS:
------------------
In order to reach the code path that crashes the machine, the fragmented
ESP packet has to contain a valid SPI and must be correctly
authenticated (if authentication is used on the Policy).
Thus, you can remotely crash a vulnerable machine, if you
(a) have control of an IPsec peer connected to it (with a valid SA
existing)
or
(b) have the ability to manipulate (fragment) packets going from a
peer to the machine (note that you do not have to crack the
encryption to do this)
An example of (b) is that if you are connecting to your company network
using an IPsec VPN from an internet cafe or WiFi hotspot, the owner of
the cafe or access point can crash your central company VPN gateway if
it is running a vulnerable version of the linux kernel.
Dirk
[-- Attachment #2: 2.6.24.1_esp_iv_bug.patch --]
[-- Type: text/plain, Size: 843 bytes --]
diff -ur linux-2.6.24.2.orig/net/ipv4/esp4.c linux-2.6.24.2/net/ipv4/esp4.c
--- linux-2.6.24.2.orig/net/ipv4/esp4.c 2008-01-24 23:58:37.000000000 +0100
+++ linux-2.6.24.2/net/ipv4/esp4.c 2008-02-12 09:02:56.000000000 +0100
@@ -165,7 +165,7 @@
int padlen;
int err;
- if (!pskb_may_pull(skb, sizeof(*esph)))
+ if (!pskb_may_pull(skb, sizeof(*esph) + esp->conf.ivlen))
goto out;
if (elen <= 0 || (elen & (blksize-1)))
diff -ur linux-2.6.24.2.orig/net/ipv6/esp6.c linux-2.6.24.2/net/ipv6/esp6.c
--- linux-2.6.24.2.orig/net/ipv6/esp6.c 2008-01-24 23:58:37.000000000 +0100
+++ linux-2.6.24.2/net/ipv6/esp6.c 2008-02-12 09:03:15.000000000 +0100
@@ -155,7 +155,7 @@
int nfrags;
int ret = 0;
- if (!pskb_may_pull(skb, sizeof(*esph))) {
+ if (!pskb_may_pull(skb, sizeof(*esph) + esp->conf.ivlen)) {
ret = -EINVAL;
goto out;
}
[-- Attachment #3: 2.6.25-rc2_esp_iv_bug.patch --]
[-- Type: text/plain, Size: 900 bytes --]
diff -ur linux-2.6.25-rc2.orig/net/ipv4/esp4.c linux-2.6.25-rc2/net/ipv4/esp4.c
--- linux-2.6.25-rc2.orig/net/ipv4/esp4.c 2008-02-22 21:58:26.000000000 +0100
+++ linux-2.6.25-rc2/net/ipv4/esp4.c 2008-02-22 21:59:03.000000000 +0100
@@ -336,7 +336,7 @@
struct scatterlist *asg;
int err = -EINVAL;
- if (!pskb_may_pull(skb, sizeof(*esph)))
+ if (!pskb_may_pull(skb, sizeof(*esph) + crypto_aead_ivsize(aead)))
goto out;
if (elen <= 0)
diff -ur linux-2.6.25-rc2.orig/net/ipv6/esp6.c linux-2.6.25-rc2/net/ipv6/esp6.c
--- linux-2.6.25-rc2.orig/net/ipv6/esp6.c 2008-02-22 21:58:26.000000000 +0100
+++ linux-2.6.25-rc2/net/ipv6/esp6.c 2008-02-22 21:59:03.000000000 +0100
@@ -282,7 +282,7 @@
struct scatterlist *sg;
struct scatterlist *asg;
- if (!pskb_may_pull(skb, sizeof(*esph))) {
+ if (!pskb_may_pull(skb, sizeof(*esph) + crypto_aead_ivsize(aead))) {
ret = -EINVAL;
goto out;
}
^ permalink raw reply
* [PATCH] sky2: fix LED management
From: Stephen Hemminger @ 2008-02-23 0:00 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev
Fix problems in LED management, so ethtool -p works correctly on Yukon-EC
and other chips. The driver was incorrectly setting the PHY LED overide bits.
Moral: read the spec sheet, not the vendor driver.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
---
drivers/net/sky2.c | 99 +++++++++++++++++------------------------------------
drivers/net/sky2.h | 21 +++++------
2 files changed, 44 insertions(+), 76 deletions(-)
--- a/drivers/net/sky2.h 2008-02-22 14:02:58.000000000 -0800
+++ b/drivers/net/sky2.h 2008-02-22 14:06:17.000000000 -0800
@@ -1318,18 +1318,21 @@ enum {
BLINK_670MS = 4,/* 670 ms */
};
-/**** PHY_MARV_LED_OVER 16 bit r/w LED control */
-enum {
- PHY_M_LED_MO_DUP = 3<<10,/* Bit 11..10: Duplex */
- PHY_M_LED_MO_10 = 3<<8, /* Bit 9.. 8: Link 10 */
- PHY_M_LED_MO_100 = 3<<6, /* Bit 7.. 6: Link 100 */
- PHY_M_LED_MO_1000 = 3<<4, /* Bit 5.. 4: Link 1000 */
- PHY_M_LED_MO_RX = 3<<2, /* Bit 3.. 2: Rx */
- PHY_M_LED_MO_TX = 3<<0, /* Bit 1.. 0: Tx */
-
- PHY_M_LED_ALL = PHY_M_LED_MO_DUP | PHY_M_LED_MO_10
- | PHY_M_LED_MO_100 | PHY_M_LED_MO_1000
- | PHY_M_LED_MO_RX,
+/***** PHY_MARV_LED_OVER 16 bit r/w Manual LED Override Reg *****/
+#define PHY_M_LED_MO_SGMII(x) ((x)<<14) /* Bit 15..14: SGMII AN Timer */
+
+#define PHY_M_LED_MO_DUP(x) ((x)<<10) /* Bit 11..10: Duplex */
+#define PHY_M_LED_MO_10(x) ((x)<<8) /* Bit 9.. 8: Link 10 */
+#define PHY_M_LED_MO_100(x) ((x)<<6) /* Bit 7.. 6: Link 100 */
+#define PHY_M_LED_MO_1000(x) ((x)<<4) /* Bit 5.. 4: Link 1000 */
+#define PHY_M_LED_MO_RX(x) ((x)<<2) /* Bit 3.. 2: Rx */
+#define PHY_M_LED_MO_TX(x) ((x)<<0) /* Bit 1.. 0: Tx */
+
+enum led_mode {
+ MO_LED_NORM = 0,
+ MO_LED_BLINK = 1,
+ MO_LED_OFF = 2,
+ MO_LED_ON = 3,
};
/***** PHY_MARV_EXT_CTRL_2 16 bit r/w Ext. PHY Specific Ctrl 2 *****/
--- a/drivers/net/sky2.c 2008-02-22 10:51:13.000000000 -0800
+++ b/drivers/net/sky2.c 2008-02-22 15:46:18.000000000 -0800
@@ -572,8 +572,9 @@ static void sky2_phy_init(struct sky2_hw
default:
/* set Tx LED (LED_TX) to blink mode on Rx OR Tx activity */
ledctrl |= PHY_M_LED_BLINK_RT(BLINK_84MS) | PHY_M_LEDC_TX_CTRL;
+
/* turn off the Rx LED (LED_RX) */
- ledover &= ~PHY_M_LED_MO_RX;
+ ledover |= PHY_M_LED_MO_RX(MO_LED_OFF);
}
if (hw->chip_id == CHIP_ID_YUKON_EC_U &&
@@ -602,7 +603,7 @@ static void sky2_phy_init(struct sky2_hw
if (sky2->autoneg == AUTONEG_DISABLE || sky2->speed == SPEED_100) {
/* turn on 100 Mbps LED (LED_LINK100) */
- ledover |= PHY_M_LED_MO_100;
+ ledover |= PHY_M_LED_MO_100(MO_LED_ON);
}
if (ledover)
@@ -3322,82 +3323,80 @@ static void sky2_set_multicast(struct ne
/* Can have one global because blinking is controlled by
* ethtool and that is always under RTNL mutex
*/
-static void sky2_led(struct sky2_hw *hw, unsigned port, int on)
+static void sky2_led(struct sky2_port *sky2, enum led_mode mode)
{
- u16 pg;
+ struct sky2_hw *hw = sky2->hw;
+ unsigned port = sky2->port;
- switch (hw->chip_id) {
- case CHIP_ID_YUKON_XL:
+ spin_lock_bh(&sky2->phy_lock);
+ if (hw->chip_id == CHIP_ID_YUKON_EC_U ||
+ hw->chip_id == CHIP_ID_YUKON_EX ||
+ hw->chip_id == CHIP_ID_YUKON_SUPR) {
+ u16 pg;
pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR);
gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3);
- gm_phy_write(hw, port, PHY_MARV_PHY_CTRL,
- on ? (PHY_M_LEDC_LOS_CTRL(1) |
- PHY_M_LEDC_INIT_CTRL(7) |
- PHY_M_LEDC_STA1_CTRL(7) |
- PHY_M_LEDC_STA0_CTRL(7))
- : 0);
- gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg);
- break;
+ switch (mode) {
+ case MO_LED_OFF:
+ gm_phy_write(hw, port, PHY_MARV_PHY_CTRL,
+ PHY_M_LEDC_LOS_CTRL(8) |
+ PHY_M_LEDC_INIT_CTRL(8) |
+ PHY_M_LEDC_STA1_CTRL(8) |
+ PHY_M_LEDC_STA0_CTRL(8));
+ break;
+ case MO_LED_ON:
+ gm_phy_write(hw, port, PHY_MARV_PHY_CTRL,
+ PHY_M_LEDC_LOS_CTRL(9) |
+ PHY_M_LEDC_INIT_CTRL(9) |
+ PHY_M_LEDC_STA1_CTRL(9) |
+ PHY_M_LEDC_STA0_CTRL(9));
+ break;
+ case MO_LED_BLINK:
+ gm_phy_write(hw, port, PHY_MARV_PHY_CTRL,
+ PHY_M_LEDC_LOS_CTRL(0xa) |
+ PHY_M_LEDC_INIT_CTRL(0xa) |
+ PHY_M_LEDC_STA1_CTRL(0xa) |
+ PHY_M_LEDC_STA0_CTRL(0xa));
+ break;
+ case MO_LED_NORM:
+ gm_phy_write(hw, port, PHY_MARV_PHY_CTRL,
+ PHY_M_LEDC_LOS_CTRL(1) |
+ PHY_M_LEDC_INIT_CTRL(8) |
+ PHY_M_LEDC_STA1_CTRL(7) |
+ PHY_M_LEDC_STA0_CTRL(7));
+ }
- default:
- gm_phy_write(hw, port, PHY_MARV_LED_CTRL, 0);
+ gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg);
+ } else
gm_phy_write(hw, port, PHY_MARV_LED_OVER,
- on ? PHY_M_LED_ALL : 0);
- }
+ PHY_M_LED_MO_DUP(mode) |
+ PHY_M_LED_MO_10(mode) |
+ PHY_M_LED_MO_100(mode) |
+ PHY_M_LED_MO_1000(mode) |
+ PHY_M_LED_MO_RX(mode) |
+ PHY_M_LED_MO_TX(mode));
+
+ spin_unlock_bh(&sky2->phy_lock);
}
/* blink LED's for finding board */
static int sky2_phys_id(struct net_device *dev, u32 data)
{
struct sky2_port *sky2 = netdev_priv(dev);
- struct sky2_hw *hw = sky2->hw;
- unsigned port = sky2->port;
- u16 ledctrl, ledover = 0;
- long ms;
- int interrupted;
- int onoff = 1;
+ unsigned int i;
- if (!data || data > (u32) (MAX_SCHEDULE_TIMEOUT / HZ))
- ms = jiffies_to_msecs(MAX_SCHEDULE_TIMEOUT);
- else
- ms = data * 1000;
-
- /* save initial values */
- spin_lock_bh(&sky2->phy_lock);
- if (hw->chip_id == CHIP_ID_YUKON_XL) {
- u16 pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR);
- gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3);
- ledctrl = gm_phy_read(hw, port, PHY_MARV_PHY_CTRL);
- gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg);
- } else {
- ledctrl = gm_phy_read(hw, port, PHY_MARV_LED_CTRL);
- ledover = gm_phy_read(hw, port, PHY_MARV_LED_OVER);
- }
-
- interrupted = 0;
- while (!interrupted && ms > 0) {
- sky2_led(hw, port, onoff);
- onoff = !onoff;
-
- spin_unlock_bh(&sky2->phy_lock);
- interrupted = msleep_interruptible(250);
- spin_lock_bh(&sky2->phy_lock);
-
- ms -= 250;
- }
+ if (data == 0)
+ data = UINT_MAX;
- /* resume regularly scheduled programming */
- if (hw->chip_id == CHIP_ID_YUKON_XL) {
- u16 pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR);
- gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3);
- gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, ledctrl);
- gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg);
- } else {
- gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl);
- gm_phy_write(hw, port, PHY_MARV_LED_OVER, ledover);
+ for (i = 0; i < data; i++) {
+ sky2_led(sky2, MO_LED_ON);
+ if (msleep_interruptible(500))
+ break;
+ sky2_led(sky2, MO_LED_OFF);
+ if (msleep_interruptible(500))
+ break;
}
- spin_unlock_bh(&sky2->phy_lock);
+ sky2_led(sky2, MO_LED_NORM);
return 0;
}
^ permalink raw reply
* [patch 2.6.25-rc2-git] rndis_host: fix transfer size negotiation
From: David Brownell @ 2008-02-23 1:31 UTC (permalink / raw)
To: Network development list; +Cc: Jean-Christophe Dubois
From: Jean-Christophe Dubois <jcd@tribudubois.net>
This patch should resolve a problem that's troubled support for
some RNDIS peripherals. It seems to have boiled down to using a
variable to establish transfer size limits before it was assigned,
which caused those devices to fallback to a default "jumbogram"
mode we don't support. Fix by assigning it earlier for RNDIS.
Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>
[ cleanups ]
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
---
This bugfix should be merged before 2.6.25-final.
drivers/net/usb/rndis_host.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
--- g26.orig/drivers/net/usb/rndis_host.c 2008-02-01 22:24:38.000000000 -0800
+++ g26/drivers/net/usb/rndis_host.c 2008-02-16 12:55:35.000000000 -0800
@@ -16,10 +16,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
-// #define DEBUG // error path messages, extra info
-// #define VERBOSE // more; success messages
-
#include <linux/module.h>
#include <linux/init.h>
#include <linux/netdevice.h>
@@ -318,6 +314,14 @@ generic_rndis_bind(struct usbnet *dev, s
net->hard_header_len += sizeof (struct rndis_data_hdr);
dev->hard_mtu = net->mtu + net->hard_header_len;
+ dev->maxpacket = usb_maxpacket(dev->udev, dev->out, 1);
+ if (dev->maxpacket == 0) {
+ if (netif_msg_probe(dev))
+ dev_dbg(&intf->dev, "dev->maxpacket can't be 0\n");
+ retval = -EINVAL;
+ goto fail_and_release;
+ }
+
dev->rx_urb_size = dev->hard_mtu + (dev->maxpacket + 1);
dev->rx_urb_size &= ~(dev->maxpacket - 1);
u.init->max_transfer_size = cpu_to_le32(dev->rx_urb_size);
^ permalink raw reply
* Re: Error on ip route replace command
From: Joonwoo Park @ 2008-02-23 6:44 UTC (permalink / raw)
To: Francesco Saverio Giudice; +Cc: netdev
In-Reply-To: <00a701c875a1$58f70fb0$b400a8c0@ASUSFSG>
2008/2/23, Francesco Saverio Giudice <info@fsgiudice.com>:
> Hi All,
>
> I have a problem with kernel 2.6.24.
>
> Having a running configuration using Shorewall and restarting it I got
> follow error:
> RTNETLINK answers: File exists
>
> Tom Eastep, Shorewall creator, told me to inform you about the problem.
>
> Here is the mail:
> ------------------------------------------------------------
> Francesco Saverio Giudice wrote:
> > Hi Tom,
> >
> > I get the error:
> >
> > ---------
> > # ip route add 1.2.4.5 dev eth3
> > # ip route replace 1.2.4.5 dev eth3
> > RTNETLINK answers: File exists
> > ---------
> >
> > I have to patch kernel or something else ?
> >
>
> You should report it at netdev@vger.kernel.org (that's where the Linux
> networking developers hang out). This failure does not occur with kernel
> 2.6.22 and iproute2 ss070710:
>
> gateway:~ # ip route add 1.2.4.5 dev eth0
> gateway:~ # ip route replace 1.2.4.5 dev eth0
> gateway:~ # ip route del 1.2.4.5
>
> -Tom
> --
> Tom Eastep \ Nothing is foolproof to a sufficiently talented fool
> Shoreline, \ http://shorewall.net
> Washington USA \ teastep@shorewall.net
> PGP Public Key \ https://lists.shorewall.net/teastep.pgp.key
>
> ------------------------------------------------------------
>
> Best Regards
>
> Francesco Saverio Giudice
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
Francesco,
It was fixed by 936f6f8e1bc46834bbb3e3fa3ac13ab44f1e7ba6 and
c18865f39276435abb9286f9a816cb5b66c99a00.
Please try with lastest git source
Joonwoo.
^ permalink raw reply
* Re: [RFC PATCH 8/8] Jhash in too big for inlining, move under lib/
From: Andrew Morton @ 2008-02-23 8:02 UTC (permalink / raw)
To: "Ilpo Järvinen"
Cc: netdev, linux-kernel, David Miller, Arnaldo Carvalho de Melo
In-Reply-To: <1203515238-22848-9-git-send-email-ilpo.jarvinen@helsinki.fi>
On Wed, 20 Feb 2008 15:47:18 +0200 "Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi> wrote:
> vmlinux.o:
> 62 functions changed, 66 bytes added, 10935 bytes removed, diff: -10869
>
> ...+ these to lib/jhash.o:
> jhash_3words: 112
> jhash2: 276
> jhash: 475
>
> select for networking code might need a more fine-grained approach.
It should be possible to use a modular jhash.ko. The things which you
have identified as clients of the jhash library are usually loaded as modules.
But in the case where someone does (say) NFSD=y we do need jhash.o linked into
vmlinux also. This is doable in Kconfig but I always forget how. Adrian, Sam
and Randy are the repositories of knowledge here ;)
^ permalink raw reply
* Re: [RFC PATCH 0/8]: uninline & uninline
From: Andrew Morton @ 2008-02-23 8:02 UTC (permalink / raw)
To: "Ilpo Järvinen"
Cc: netdev, linux-kernel, David Miller, Arnaldo Carvalho de Melo
In-Reply-To: <1203515238-22848-1-git-send-email-ilpo.jarvinen@helsinki.fi>
On Wed, 20 Feb 2008 15:47:10 +0200 "Ilpo J__rvinen" <ilpo.jarvinen@helsinki.fi> wrote:
> Ok, here's the top of the list (10000+ bytes):
This is good stuff - thanks.
> -41525 2066 f, 3370 +, 44895 -, diff: -41525 IS_ERR
This is a surprise. I expect that the -mm-only
profile-likely-unlikely-macros.patch is the cause of this and mainline
doesn't have this problem.
If true, then this likely/unlikely bloat has probably spread into a lot of
your other results and it all should be redone against mainline, sorry :(
(I'm not aware of anyone having used profile-likely-unlikely-macros.patch
in quite some time. That's unfortunate because it has turned up some
fairly flagrant code deoptimisations)
^ permalink raw reply
* Re: WARNING: at net/ipv4/tcp_input.c:2054 tcp_mark_head_lost()
From: Andrew Morton @ 2008-02-23 8:03 UTC (permalink / raw)
To: Giangiacomo Mariotti; +Cc: linux-kernel, netdev
In-Reply-To: <858077.97160.qm@web39709.mail.mud.yahoo.com>
(cc netdev)
On Wed, 20 Feb 2008 20:04:39 -0800 (PST) Giangiacomo Mariotti <giangiacomo_mariotti@yahoo.com> wrote:
> This is what I got with dmesg :
>
> [ 266.978695] WARNING: at net/ipv4/tcp_input.c:2054 tcp_mark_head_lost()
> [ 266.978701] Pid: 0, comm: swapper Not tainted 2.6.24.2-my001 #1
> [ 266.978703]
> [ 266.978704] Call Trace:
> [ 266.978706] <IRQ> [<ffffffff80426981>] tcp_ack+0x16d8/0x197f
> [ 266.978721] [<ffffffff8022e72f>] __wake_up+0x38/0x4e
> [ 266.978727] [<ffffffff804295ef>] tcp_rcv_established+0xe2/0x8cb
> [ 266.978732] [<ffffffff8042f56f>] tcp_v4_do_rcv+0x30/0x39c
> [ 266.978738] [<ffffffff80431d29>] tcp_v4_rcv+0x99b/0xa06
> [ 266.978743] [<ffffffff803f2c95>] __netdev_alloc_skb+0x29/0x43
> [ 266.978749] [<ffffffff80416d21>] ip_local_deliver_finish+0x152/0x212
> [ 266.978753] [<ffffffff80416bac>] ip_rcv_finish+0x2f8/0x31b
> [ 266.978758] [<ffffffff803f6c42>] netif_receive_skb+0x3ae/0x3d1
> [ 266.978763] [<ffffffff8037398f>] rtl8169_rx_interrupt+0x45f/0x53e
> [ 266.978768] [<ffffffff8037405b>] rtl8169_poll+0x36/0x16a
> [ 266.978773] [<ffffffff803f8ca7>] net_rx_action+0xb7/0x1f3
> [ 266.978778] [<ffffffff8023a3a5>] __do_softirq+0x65/0xce
> [ 266.978782] [<ffffffff8020b0d2>] default_idle+0x0/0x3d
> [ 266.978786] [<ffffffff8020d09c>] call_softirq+0x1c/0x28
> [ 266.978789] [<ffffffff8020e4f0>] do_softirq+0x2c/0x7d
> [ 266.978792] [<ffffffff8023a2fb>] irq_exit+0x3f/0x84
> [ 266.978794] [<ffffffff8020e729>] do_IRQ+0xb6/0xd5
> [ 266.978797] [<ffffffff8020b0d2>] default_idle+0x0/0x3d
> [ 266.978800] [<ffffffff8020c421>] ret_from_intr+0x0/0xa
> [ 266.978801] <EOI> [<ffffffff8020b0fb>] default_idle+0x29/0x3d
> [ 266.978809] [<ffffffff8020b1a2>] cpu_idle+0x93/0xbb
> [ 266.978813] [<ffffffff805cfa4b>] start_kernel+0x2bb/0x2c7
> [ 266.978818] [<ffffffff805cf123>] _sinittext+0x123/0x12a
> [ 266.978821]
>
> This though didn't cause any user-visible problem.
>
> .config file :
^ permalink raw reply
* Re: [PATCH 09/28] mm: __GFP_MEMALLOC
From: Andrew Morton @ 2008-02-23 8:06 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Linus Torvalds, linux-kernel, linux-mm, netdev, trond.myklebust
In-Reply-To: <20080220150306.424308000@chello.nl>
On Wed, 20 Feb 2008 15:46:19 +0100 Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
> __GFP_MEMALLOC will allow the allocation to disregard the watermarks,
> much like PF_MEMALLOC.
>
'twould be nice if the changelog had some explanation of the reason
for this change.
^ permalink raw reply
* Re: [PATCH 07/28] mm: emergency pool
From: Andrew Morton @ 2008-02-23 8:05 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Linus Torvalds, linux-kernel, linux-mm, netdev, trond.myklebust
In-Reply-To: <20080220150306.165236000@chello.nl>
On Wed, 20 Feb 2008 15:46:17 +0100 Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
> @@ -213,7 +213,7 @@ enum zone_type {
>
> struct zone {
> /* Fields commonly accessed by the page allocator */
> - unsigned long pages_min, pages_low, pages_high;
> + unsigned long pages_emerg, pages_min, pages_low, pages_high;
It would be nice to make these one-per-line, then document them.
^ permalink raw reply
* Re: [PATCH 04/28] mm: kmem_estimate_pages()
From: Andrew Morton @ 2008-02-23 8:05 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Linus Torvalds, linux-kernel, linux-mm, netdev, trond.myklebust
In-Reply-To: <20080220150305.774294000@chello.nl>
On Wed, 20 Feb 2008 15:46:14 +0100 Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
> Provide a method to get the upper bound on the pages needed to allocate
> a given number of objects from a given kmem_cache.
>
> This lays the foundation for a generic reserve framework as presented in
> a later patch in this series. This framework needs to convert object demand
> (kmalloc() bytes, kmem_cache_alloc() objects) to pages.
>
> ...
>
> /*
> + * return the max number of pages required to allocated count
> + * objects from the given cache
> + */
> +unsigned kmem_estimate_pages(struct kmem_cache *s, gfp_t flags, int objects)
You might want to have another go at that comment.
> +/*
> + * return the max number of pages required to allocate @bytes from kmalloc
> + * in an unspecified number of allocation of heterogeneous size.
> + */
> +unsigned kestimate(gfp_t flags, size_t bytes)
And its pal.
^ permalink raw reply
* Re: [PATCH 05/28] mm: allow PF_MEMALLOC from softirq context
From: Andrew Morton @ 2008-02-23 8:05 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Linus Torvalds, linux-kernel, linux-mm, netdev, trond.myklebust
In-Reply-To: <20080220150305.905314000@chello.nl>
On Wed, 20 Feb 2008 15:46:15 +0100 Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
> Allow PF_MEMALLOC to be set in softirq context. When running softirqs from
> a borrowed context save current->flags, ksoftirqd will have its own
> task_struct.
The second sentence doesn't make sense.
> This is needed to allow network softirq packet processing to make use of
> PF_MEMALLOC.
>
> ...
>
> +#define tsk_restore_flags(p, pflags, mask) \
> + do { (p)->flags &= ~(mask); \
> + (p)->flags |= ((pflags) & (mask)); } while (0)
> +
Does it need to be a macro?
If so, it really should cook up a temporary to avoid referencing p twice -
the children might be watching.
^ 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