Skip to content

Commit

Permalink
Merge branch 'tipc-Jun24-2011' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…kernel/git/paulg/net-next-2.6
  • Loading branch information
David S. Miller committed Jun 24, 2011
2 parents cd5f3e2 + e4a0aee commit 1897fe5
Show file tree
Hide file tree
Showing 12 changed files with 276 additions and 381 deletions.
6 changes: 5 additions & 1 deletion net/tipc/bcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,12 +552,16 @@ static int tipc_bcbearer_send(struct sk_buff *buf,
if (likely(!msg_non_seq(buf_msg(buf)))) {
struct tipc_msg *msg;

assert(tipc_bcast_nmap.count != 0);
bcbuf_set_acks(buf, tipc_bcast_nmap.count);
msg = buf_msg(buf);
msg_set_non_seq(msg, 1);
msg_set_mc_netid(msg, tipc_net_id);
bcl->stats.sent_info++;

if (WARN_ON(!tipc_bcast_nmap.count)) {
dump_stack();
return 0;
}
}

/* Send buffer over bearers until all targets reached */
Expand Down
1 change: 0 additions & 1 deletion net/tipc/bearer.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,6 @@ void tipc_bearer_lock_push(struct tipc_bearer *b_ptr)
void tipc_continue(struct tipc_bearer *b_ptr)
{
spin_lock_bh(&b_ptr->lock);
b_ptr->continue_count++;
if (!list_empty(&b_ptr->cong_links))
tipc_k_signal((Handler)tipc_bearer_lock_push, (unsigned long)b_ptr);
b_ptr->blocked = 0;
Expand Down
2 changes: 0 additions & 2 deletions net/tipc/bearer.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ struct media {
* @link_req: ptr to (optional) structure making periodic link setup requests
* @links: list of non-congested links associated with bearer
* @cong_links: list of congested links associated with bearer
* @continue_count: # of times bearer has resumed after congestion or blocking
* @active: non-zero if bearer structure is represents a bearer
* @net_plane: network plane ('A' through 'H') currently associated with bearer
* @nodes: indicates which nodes in cluster can be reached through bearer
Expand All @@ -129,7 +128,6 @@ struct tipc_bearer {
struct link_req *link_req;
struct list_head links;
struct list_head cong_links;
u32 continue_count;
int active;
char net_plane;
struct tipc_node_map nodes;
Expand Down
6 changes: 0 additions & 6 deletions net/tipc/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@
struct tipc_msg; /* msg.h */
struct print_buf; /* log.h */

/*
* TIPC sanity test macros
*/

#define assert(i) BUG_ON(!(i))

/*
* TIPC system monitoring code
*/
Expand Down
6 changes: 3 additions & 3 deletions net/tipc/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,7 @@ static struct sk_buff *link_insert_deferred_queue(struct link *l_ptr,
static int link_recv_buf_validate(struct sk_buff *buf)
{
static u32 min_data_hdr_size[8] = {
SHORT_H_SIZE, MCAST_H_SIZE, LONG_H_SIZE, DIR_MSG_H_SIZE,
SHORT_H_SIZE, MCAST_H_SIZE, NAMED_H_SIZE, BASIC_H_SIZE,
MAX_H_SIZE, MAX_H_SIZE, MAX_H_SIZE, MAX_H_SIZE
};

Expand Down Expand Up @@ -2553,7 +2553,7 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb,
u32 msg_sz = msg_size(imsg);
u32 fragm_sz = msg_data_sz(fragm);
u32 exp_fragm_cnt = msg_sz/fragm_sz + !!(msg_sz % fragm_sz);
u32 max = TIPC_MAX_USER_MSG_SIZE + LONG_H_SIZE;
u32 max = TIPC_MAX_USER_MSG_SIZE + NAMED_H_SIZE;
if (msg_type(imsg) == TIPC_MCAST_MSG)
max = TIPC_MAX_USER_MSG_SIZE + MCAST_H_SIZE;
if (msg_size(imsg) > max) {
Expand Down Expand Up @@ -2882,7 +2882,7 @@ static int tipc_link_stats(const char *name, char *buf, const u32 buf_size)
profile_total = 1;
tipc_printf(&pb, " TX profile sample:%u packets average:%u octets\n"
" 0-64:%u%% -256:%u%% -1024:%u%% -4096:%u%% "
"-16354:%u%% -32768:%u%% -66000:%u%%\n",
"-16384:%u%% -32768:%u%% -66000:%u%%\n",
l_ptr->stats.msg_length_counts,
l_ptr->stats.msg_lengths_total / profile_total,
percent(l_ptr->stats.msg_length_profile[0], profile_total),
Expand Down
6 changes: 2 additions & 4 deletions net/tipc/msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,8 @@ void tipc_msg_init(struct tipc_msg *m, u32 user, u32 type,
msg_set_size(m, hsize);
msg_set_prevnode(m, tipc_own_addr);
msg_set_type(m, type);
if (!msg_short(m)) {
msg_set_orignode(m, tipc_own_addr);
msg_set_destnode(m, destnode);
}
msg_set_orignode(m, tipc_own_addr);
msg_set_destnode(m, destnode);
}

/**
Expand Down
34 changes: 7 additions & 27 deletions net/tipc/msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@
* Message header sizes
*/

#define SHORT_H_SIZE 24 /* Connected, in-cluster messages */
#define DIR_MSG_H_SIZE 32 /* Directly addressed messages */
#define LONG_H_SIZE 40 /* Named messages */
#define MCAST_H_SIZE 44 /* Multicast messages */
#define SHORT_H_SIZE 24 /* In-cluster basic payload message */
#define BASIC_H_SIZE 32 /* Basic payload message */
#define NAMED_H_SIZE 40 /* Named payload message */
#define MCAST_H_SIZE 44 /* Multicast payload message */
#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 */
Expand Down Expand Up @@ -310,26 +310,6 @@ static inline void msg_set_seqno(struct tipc_msg *m, u32 n)
msg_set_bits(m, 2, 0, 0xffff, n);
}

/*
* TIPC may utilize the "link ack #" and "link seq #" fields of a short
* message header to hold the destination node for the message, since the
* normal "dest node" field isn't present. This cache is only referenced
* when required, so populating the cache of a longer message header is
* harmless (as long as the header has the two link sequence fields present).
*
* Note: Host byte order is OK here, since the info never goes off-card.
*/

static inline u32 msg_destnode_cache(struct tipc_msg *m)
{
return m->hdr[2];
}

static inline void msg_set_destnode_cache(struct tipc_msg *m, u32 dnode)
{
m->hdr[2] = dnode;
}

/*
* Words 3-10
*/
Expand Down Expand Up @@ -377,7 +357,7 @@ static inline void msg_set_mc_netid(struct tipc_msg *m, u32 p)

static inline int msg_short(struct tipc_msg *m)
{
return msg_hdr_sz(m) == 24;
return msg_hdr_sz(m) == SHORT_H_SIZE;
}

static inline u32 msg_orignode(struct tipc_msg *m)
Expand Down Expand Up @@ -635,7 +615,7 @@ static inline u32 msg_link_selector(struct tipc_msg *m)

static inline void msg_set_link_selector(struct tipc_msg *m, u32 n)
{
msg_set_bits(m, 4, 0, 1, (n & 1));
msg_set_bits(m, 4, 0, 1, n);
}

/*
Expand All @@ -659,7 +639,7 @@ static inline u32 msg_probe(struct tipc_msg *m)

static inline void msg_set_probe(struct tipc_msg *m, u32 val)
{
msg_set_bits(m, 5, 0, 1, (val & 1));
msg_set_bits(m, 5, 0, 1, val);
}

static inline char msg_net_plane(struct tipc_msg *m)
Expand Down
6 changes: 3 additions & 3 deletions net/tipc/name_distr.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ static void publ_to_item(struct distr_item *i, struct publication *p)

static struct sk_buff *named_prepare_buf(u32 type, u32 size, u32 dest)
{
struct sk_buff *buf = tipc_buf_acquire(LONG_H_SIZE + size);
struct sk_buff *buf = tipc_buf_acquire(INT_H_SIZE + size);
struct tipc_msg *msg;

if (buf != NULL) {
msg = buf_msg(buf);
tipc_msg_init(msg, NAME_DISTRIBUTOR, type, LONG_H_SIZE, dest);
msg_set_size(msg, LONG_H_SIZE + size);
tipc_msg_init(msg, NAME_DISTRIBUTOR, type, INT_H_SIZE, dest);
msg_set_size(msg, INT_H_SIZE + size);
}
return buf;
}
Expand Down
Loading

0 comments on commit 1897fe5

Please sign in to comment.