From: Guo, M. <mi...@in...> - 2004-03-19 06:38:14
|
Hi,Jon Xiaofeng and I debug the RM on local host and the following is the stabilization patch for local host communication! For inter node communication, we are still on debugging, and I find that packets can not be transmitted among the different nodes on the=20 links, any updates on the link transmission? Thanks Guo min -------------------- Index: bcast.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/develop/tipc2/net/tipc/bcast.c,v retrieving revision 1.1.1.2 retrieving revision 1.1.1.2.4.2 diff -u -r1.1.1.2 -r1.1.1.2.4.2 --- bcast.c 18 Mar 2004 07:28:32 -0000 1.1.1.2 +++ bcast.c 19 Mar 2004 06:13:15 -0000 1.1.1.2.4.2 @@ -430,9 +436,10 @@ int size =3D sizeof (struct mc_identity); =20 mc_list =3D (struct mc_identity*)k_malloc(size); - if (mc_list =3D=3D NULL) + if (mc_list =3D=3D NULL){ + dbg("mc_indentity_create malloc error");=09 return false; -=09 + } mc_list->port =3D destport; mc_list->node =3D destnode;=09 list_add_tail(&mc_list->list,list_head); @@ -492,15 +499,14 @@ void free_mclist(struct list_head *list_head) { struct mc_identity* mid; - struct list_head *pos;=09 + struct list_head *tmp;=09 =09 - list_for_each(pos,list_head) { - mid =3D list_entry(pos, struct mc_identity, list); - list_del(&mid->list); - kfree(mid); - =09 + while(!list_empty(list_head)) { + tmp =3D list_head->next; + list_del(tmp); + kfree(list_entry(tmp, struct mc_identity, list)); } - list_del(list_head); + } =20 static struct list_head point =3D LIST_HEAD_INIT(point); =20 Index: name_table.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/develop/tipc2/net/tipc/name_table.c,v retrieving revision 1.1.1.2 retrieving revision 1.1.1.2.4.3 diff -u -r1.1.1.2 -r1.1.1.2.4.3 --- name_table.c 18 Mar 2004 07:28:32 -0000 1.1.1.2 +++ name_table.c 19 Mar 2004 06:13:15 -0000 1.1.1.2.4.3 @@ -729,21 +738,20 @@ spin_unlock_bh(&seq->lock); goto not_found; =09 - } - =09 + } =09 do { destnode =3D publ->node;=20 destport =3D publ->ref; - if ( false =3D=3D mc_indenity_create(mc_head,destport,destnode)) - goto found; =09 + if (destport) + { + if ( false =3D=3D mc_indenity_create(mc_head,destport,destnode)){ + spin_unlock_bh(&seq->lock); + goto not_found; =09 + }=09 + } =20 publ=3D publ->cluster_list.next; }while(publ !=3D seq->sseqs[i].cluster_list); - =09 - if (destport) - { - if ( false =3D=3D mc_indenity_create(mc_head,destport,destnode)) - goto found; =09 - } =09 + =09 }=09 if (list_empty(mc_head)) { @@ -775,12 +783,11 @@ tipc_net_addr_t destnode; =20 read_lock_bh(&nametbl_lock);=20 + seq =3D nametbl_find_seq(type);=20 if (!seq) goto not_found; =20 - sseq =3D nameseq_available(seq,lower,upper); =20 if (!sseq) goto not_found; =20 - =20 low_seq =3D nameseq_find_insert_pos(seq,lower); =20 if (low_seq < 0) low_seq =3D low_seq < 0 ? ~low_seq : low_seq; @@ -791,11 +798,11 @@ =20 if (high_seq < low_seq) goto not_found;=20 - =20 - spin_lock_bh(&seq->lock); =20 - i =3D low_seq; - =20 + spin_lock_bh(&seq->lock); + + i =3D low_seq; + for (i =3D low_seq ; i <=3D high_seq; i++) { publ =3D seq->sseqs[i].node_list; @@ -813,9 +820,11 @@ } } =09 }=09 - if (list_empty(mc_head)) + + if (list_empty(mc_head)) { spin_unlock_bh(&seq->lock); goto not_found; + } spin_unlock_bh(&seq->lock); read_unlock_bh(&nametbl_lock);=20 return true; Index: recvbcast.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/develop/tipc2/net/tipc/recvbcast.c,v retrieving revision 1.1.1.2 retrieving revision 1.1.1.2.4.1 diff -u -r1.1.1.2 -r1.1.1.2.4.1 --- recvbcast.c 18 Mar 2004 07:28:32 -0000 1.1.1.2 +++ recvbcast.c 19 Mar 2004 05:01:29 -0000 1.1.1.2.4.1 @@ -327,7 +330,7 @@ struct list_head *pos; struct mc_identity *mid; int res; - =09 + printk("nameseq_deliver\n"); list_for_each(pos,mc_head) { mid =3D list_entry(pos, struct mc_identity, list); if(mid && mid ->node =3D=3D tipc_own_addr) { @@ -435,18 +438,22 @@ int bcast_port_recv(struct sk_buff *buf) { struct list_head mc_head; + struct tipc_msg *msg; int res; =09 INIT_LIST_HEAD(&mc_head); - struct tipc_msg *msg =3D buf_msg(buf); + msg =3D buf_msg(buf); + res =3D true; =09 if (false =3D=3D nametbl_self_translate(&mc_head,msg_nametype(msg),\ msg_namelower(msg),msg_nameupper(msg))) { buf_discard(buf); + printk("get TIPC_ERR_NO_PORT\n"); return TIPC_ERR_NO_PORT; } res =3D nameseq_deliver(buf,&mc_head); free_mclist(&mc_head); +ok:=09 return res; } =20 Index: sendbcast.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/develop/tipc2/net/tipc/sendbcast.c,v retrieving revision 1.1.1.2 retrieving revision 1.1.1.2.4.3 diff -u -r1.1.1.2 -r1.1.1.2.4.3 --- sendbcast.c 18 Mar 2004 07:28:32 -0000 1.1.1.2 +++ sendbcast.c 19 Mar 2004 06:13:15 -0000 1.1.1.2.4.3 @@ -156,24 +165,32 @@ struct sk_buff *copybuf; tipc_net_addr_t prev_destnode; =20 + m =3D &this->publ.phdr; if (importance <=3D 3) msg_set_importance(m,importance); -=09 + + list_for_each(pos,mc_head) { prev_destnode =3D 0; mid =3D list_entry(pos,struct mc_identity,list);=20 if (mid !=3D NULL && (prev_destnode !=3D mid->node)){ prev_destnode =3D mid->node; - copybuf =3D buf_acquire(msg_size(m)); - memcpy(copybuf,buf,msg_size(m)); + copybuf =3D buf_clone(buf); msg_set_destnode(buf_msg(copybuf), mid ->node); - if (likely(mid ->node !=3D tipc_own_addr)) + if (likely(mid ->node !=3D tipc_own_addr)) { + printk("ERRRRR\n"); res =3D tipc_send_buf_fast(copybuf,mid->node); - else + } + else{ res =3D bcast_port_recv(copybuf); + if(res !=3D 0) + break; + } } } + ok: + buf_discard(buf); return res; } /** @@ -240,27 +257,29 @@ uint count,res; struct tipc_msg* hdr; struct tipc_portid orig; - struct port *this =3D (struct port*)ref_deref(ref); - struct sk_buff* b; -=09 - if (!this)=20 - return TIPC_FAILURE; + struct sk_buff* b; + struct port *this =3D (struct port*)ref_deref(ref); + + + if (!this)=20 + return TIPC_FAILURE; INIT_LIST_HEAD(&mc_head);=09 - nametbl_mc_translate(&mc_head, seq->type,seq->lower,seq->upper); + res =3D nametbl_mc_translate(&mc_head, seq->type,seq->lower,seq->upper);=20 + if(res =3D=3D false) + return TIPC_ERR_NO_NAME; tipc_ownidentity(ref,&orig); - hdr =3D &this->publ.phdr; -=09 + hdr =3D &this->publ.phdr; msg_set_type(hdr,TIPC_MCAST_MSG); - msg_set_nametype(hdr,seq->type); - msg_set_namelower(hdr,seq->lower); - msg_set_nameupper(hdr,seq->upper); + msg_set_nametype(hdr,seq->type); + msg_set_namelower(hdr,seq->lower); + msg_set_nameupper(hdr,seq->upper); msg_set_hdr_sz(hdr,MCAST_H_SIZE); - res =3D msg_build(hdr,msg,scnt,TIPC_MAX_MSG_SIZE,&b); - if (!b) + res =3D msg_build(hdr,msg,scnt,TIPC_MAX_MSG_SIZE,&b); + if (!b) { + free_mclist(&mc_head); return TIPC_FAILURE; -=09 + }=09 count =3D count_mc_member(&mc_head);=09 -=09 if (count <=3D REPLICA_NODES){ res =3D tipc_forward_buf2nameseq(ref,(struct tipc_name_seq*)seq, =20 b,&orig,res,17,&mc_head); @@ -270,6 +289,7 @@ check_bcast_outqueue(); res =3D tipc_bsend_buf(b,&mc_head); }=09 + free_mclist(&mc_head); return res; } =20 |