Skip to content

Commit

Permalink
RDMA/nes: Remove session_id from nes_cm stuff
Browse files Browse the repository at this point in the history
The session_id members of struct nes_cm_listener and struct
nes_cm_node are write-only, so remove them.  This allows the
session_id member of struct nes_cm_core to be removed as well, since
it is only used to write those other session_id values.

This removes the use of current->tgid (which will be deprecated)
pointed out by Pavel Emelyanov <xemul@openvz.org>.

Acked-by: Glenn Streiff <gstreiff@neteffect.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Roland Dreier committed Apr 17, 2008
1 parent 7822038 commit 4d43653
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
6 changes: 0 additions & 6 deletions drivers/infiniband/hw/nes/nes_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@ static void print_core(struct nes_cm_core *core)
if (!core)
return;
nes_debug(NES_DBG_CM, "---------------------------------------------\n");
nes_debug(NES_DBG_CM, "Session ID : %u \n", atomic_read(&core->session_id));

nes_debug(NES_DBG_CM, "State : %u \n", core->state);

Expand Down Expand Up @@ -1101,8 +1100,6 @@ static struct nes_cm_node *make_cm_node(struct nes_cm_core *cm_core,
cm_node->tcp_cntxt.rcv_nxt = 0;
/* get a unique session ID , add thread_id to an upcounter to handle race */
atomic_inc(&cm_core->node_cnt);
atomic_inc(&cm_core->session_id);
cm_node->session_id = (u32)(atomic_read(&cm_core->session_id) + current->tgid);
cm_node->conn_type = cm_info->conn_type;
cm_node->apbvt_set = 0;
cm_node->accept_pend = 0;
Expand Down Expand Up @@ -1629,9 +1626,7 @@ static struct nes_cm_listener *mini_cm_listen(struct nes_cm_core *cm_core,
listener->cm_core = cm_core;
listener->nesvnic = nesvnic;
atomic_inc(&cm_core->node_cnt);
atomic_inc(&cm_core->session_id);

listener->session_id = (u32)(atomic_read(&cm_core->session_id) + current->tgid);
listener->conn_type = cm_info->conn_type;
listener->backlog = cm_info->backlog;
listener->listener_state = NES_CM_LISTENER_ACTIVE_STATE;
Expand Down Expand Up @@ -1944,7 +1939,6 @@ static struct nes_cm_core *nes_cm_alloc_core(void)
cm_core->state = NES_CM_STATE_INITED;
cm_core->free_tx_pkt_max = NES_CM_DEFAULT_FREE_PKTS;

atomic_set(&cm_core->session_id, 0);
atomic_set(&cm_core->events_posted, 0);

/* init the packet lists */
Expand Down
3 changes: 0 additions & 3 deletions drivers/infiniband/hw/nes/nes_cm.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ enum nes_cm_listener_state {

struct nes_cm_listener {
struct list_head list;
u64 session_id;
struct nes_cm_core *cm_core;
u8 loc_mac[ETH_ALEN];
nes_addr_t loc_addr;
Expand All @@ -242,7 +241,6 @@ struct nes_cm_listener {

/* per connection node and node state information */
struct nes_cm_node {
u64 session_id;
u32 hashkey;

nes_addr_t loc_addr, rem_addr;
Expand Down Expand Up @@ -327,7 +325,6 @@ struct nes_cm_event {

struct nes_cm_core {
enum nes_cm_node_state state;
atomic_t session_id;

atomic_t listen_node_cnt;
struct nes_cm_node listen_list;
Expand Down

0 comments on commit 4d43653

Please sign in to comment.