From: Ling, X. <xia...@in...> - 2004-04-16 02:54:45
|
Guo and me are debuging now, currently our local copy can work for = replication transfer and simple broadcast, we are still working on broadcast restransmit. =20 Mark,=20 Has your patch worked for broadcast? I mean when node>8?=20 > -----Original Message----- > From: tip...@li...=20 > [mailto:tip...@li...] On=20 > Behalf Of Jon Maloy > Sent: 2004=C4=EA4=D4=C216=C8=D5 3:20 > To: Mark Haverkamp > Cc: tipc > Subject: [Tipc-discussion] Re: tipc multicast patch >=20 >=20 > It looks ok to me, but I think we should let Guo and Ling=20 > have a say first. >=20 > The only thing I hesitate about is the test for (!index) in=20 > "ref_lock_deref". > This is one of the most time-critical functions in TIPC. > Is it _really_ necessary to do this test, except for pure=20 > debugging purposes ? An index of zero should yield the right=20 > return value, -zero, and is hence no different from other=20 > invalid indexes, which also return zero. =3D> I would prefer=20 > that this test is omitted. >=20 > /Jon >=20 > Mark Haverkamp wrote: >=20 > >Daniel McNeil and I were playing with multicast in the unstable view=20 > >and found that it wasn't working for us. We spent some time=20 > debugging=20 > >and got it working (at least in our simple tests). I have=20 > enclosed the=20 > >patch that we came up with for review. We have run the=20 > client/server=20 > >test and it continues to function so I don't think that we broke=20 > >anything with the change. Please take a look and let us=20 > know what you=20 > >think. > > > >Thanks, > >Mark and Daniel. > > > > > >---=20 > /home/markh/views/tipc/cvs/source/unstable/net/tipc/bcast.h=09 > 2004-03-30 07:11:38.000000000 -0800 > >+++ bcast.h 2004-04-14 14:56:08.000000000 -0700 > >@@ -123,7 +123,7 @@ > > int tipc_bsend_buf(struct sk_buff *buf, struct list_head=20 > *mc_head); =20 > >int tipc_send_buf2nameseq(tipc_ref_t ref,struct tipc_name_seq=20 > >*dest,void *buf, uint size); int=20 > tipc_forward_buf2nameseq(tipc_ref_t ref,struct tipc_name_seq *name, > >- void *buf,struct tipc_portid=20 > const *orig,uint size, > >+ struct sk_buff *buf,struct=20 > tipc_portid const=20 > >+ *orig,uint size, > > uint importance,struct list_head=20 > *mc_head); > >=20 > >=20 > >---=20 > /home/markh/views/tipc/cvs/source/unstable/net/tipc/reg.h=09 > 2004-02-16 15:00:02.000000000 -0800 > >+++ reg.h 2004-04-15 10:08:28.000000000 -0700 > >@@ -91,8 +91,19 @@ > > static inline void * > > ref_lock_deref(uint ref) > > { > >- uint index =3D ref & ref_table.index_mask; > >- struct reference *r =3D &ref_table.entries[index]; > >+ uint index; > >+ struct reference *r; > >+ > >+ index =3D ref & ref_table.index_mask; > >+ > >+ /* > >+ * Zero is not a valid index > >+ */ > >+ if (!index) { > >+ printk("tipc ref_lock_deref: ref is zero\n"); > >+ return 0; > >+ } > >+ r =3D &ref_table.entries[index]; > > spin_lock_bh(&r->lock); > > if (likely(r->data.reference =3D=3D ref)) > > return r->object; > >---=20 > /home/markh/views/tipc/cvs/source/unstable/net/tipc/send > bcast.c 2004-03-24 08:58:32.000000000 -0800 > >+++ sendbcast.c 2004-04-15 10:22:54.000000000 -0700 > >@@ -140,7 +140,7 @@ > > */ > > int tipc_forward_buf2nameseq(tipc_ref_t ref, > > struct tipc_name_seq *name, > >- void *buf, > >+ struct sk_buff *buf, > > struct tipc_portid const *orig, > > uint size, > > uint importance,struct list_head=20 > *mc_head)=20 > >@@ -156,19 +156,19 @@ > > m =3D &this->publ.phdr; > > if (importance <=3D 3) > > msg_set_importance(m,importance); > >-=09 > >+ prev_destnode =3D 0; > > 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)) { > > res =3D=20 > tipc_send_buf_fast(copybuf,mid->node); > >- else > >+ } > >+ else { > > res =3D bcast_port_recv(copybuf); > >+ } > > } > > } > > return res; > >@@ -242,6 +242,7 @@ > > =09 > > if (!this)=20 > > return TIPC_FAILURE; > >+ > > INIT_LIST_HEAD(&mc_head);=09 > > nametbl_mc_translate(&mc_head,=20 > seq->type,seq->lower,seq->upper);=20 > > tipc_ownidentity(ref,&orig); > >@@ -255,7 +256,6 @@ > > res =3D msg_build(hdr,msg,scnt,TIPC_MAX_MSG_SIZE,&b); > > if (!b) > > return TIPC_FAILURE; > >-=09 > > count =3D count_mc_member(&mc_head);=09 > > =09 > > if (count <=3D REPLICA_NODES){ > >---=20 > /home/markh/views/tipc/cvs/source/unstable/net/tipc/bcast.c=09 > 2004-03-30 07:11:38.000000000 -0800 > >+++ bcast.c 2004-04-15 10:24:09.000000000 -0700 > >@@ -383,8 +383,8 @@ > > int i =3D 0,prev_destnode;=09 > > struct mc_identity* mid; > > =09 > >+ prev_destnode =3D 0; > > list_for_each(pos,mc_head) { > >- prev_destnode =3D 0; > > mid =3D list_entry(pos,struct mc_identity,list); > > if (mid !=3D NULL && (prev_destnode !=3D mid->node)){ > > prev_destnode =3D mid->node; > >@@ -433,6 +433,7 @@ > > if (mc_list =3D=3D NULL) > > return false; > > =09 > >+ INIT_LIST_HEAD(&mc_list->list); > > mc_list->port =3D destport; > > mc_list->node =3D destnode;=09 > > list_add_tail(&mc_list->list,list_head); > >@@ -492,15 +493,14 @@ > > void free_mclist(struct list_head *list_head) > > { > > struct mc_identity* mid; > >- struct list_head *pos;=09 > >+ struct list_head *pos, *n;=09 > > =09 > >- list_for_each(pos,list_head) { > >+ list_for_each_safe(pos, n, list_head) { > > mid =3D list_entry(pos, struct mc_identity, list); > > list_del(&mid->list); > > kfree(mid); > > =09 > > } > >- list_del(list_head); > > } > >=20 > > static struct list_head point =3D LIST_HEAD_INIT(point); > >---=20 > /home/markh/views/tipc/cvs/source/unstable/net/tipc/link.c=09 > 2004-03-11 07:32:51.000000000 -0800 > >+++ link.c 2004-04-15 10:24:34.000000000 -0700 > >@@ -1609,7 +1609,11 @@ > > if=20 > (likely(msg_is_dest(msg,tipc_own_addr))){ > > if (likely(msg_isdata(msg))) { > > =20 > spin_unlock_bh(&this->owner->lock); > >- port_recv_msg(buf); > >+ if=20 > (msg_type(msg) =3D=3D TIPC_MCAST_MSG) { > >+ =09 > bcast_port_recv(buf); > >+ } else { > >+ =09 > port_recv_msg(buf); > >+ } > > continue; > > } > > =09 > link_recv_non_data_msg(this, buf); > >---=20 > /home/markh/views/tipc/cvs/source/unstable/net/tipc/cfg.c=09 > 2004-02-16 15:00:01.000000000 -0800 > >+++ cfg.c 2004-04-15 10:27:00.000000000 -0700 > >@@ -393,7 +393,9 @@ > >=20 > > void cfg_link_event(tipc_net_addr_t addr,char* name,int up) > > { > >+#ifdef INTER_CLUSTER_COMM > > struct _zone* z =3D zone_find(addr); > >+#endif > >=20 > > if (in_own_cluster(addr)) > > return; > >---=20 > /home/markh/views/tipc/cvs/source/unstable/net/tipc/recv > bcast.c 2004-03-30 07:11:39.000000000 -0800 > >+++ recvbcast.c 2004-04-15 10:31:18.000000000 -0700 > >@@ -326,10 +326,10 @@ > > =09 > > struct list_head *pos; > > struct mc_identity *mid; > >- int res; > >+ int res =3D TIPC_OK; > > =09 > > list_for_each(pos,mc_head) { > >- mid =3D list_entry(pos, struct=20 > mc_identity, list); =09 > >+ mid =3D list_entry(pos, struct mc_identity, list); > > if(mid && mid ->node =3D=3D tipc_own_addr) { > > struct port* port =3D(struct=20 > port*) ref_deref(mid ->port); > > struct sk_buff *copymsg =3D=20 > buf_clone(buf); > >---=20 > /home/markh/views/tipc/cvs/source/unstable/net/tipc/name_ > table.c 2004-03-30 07:11:39.000000000 -0800 > >+++ name_table.c 2004-04-15 10:32:13.000000000 -0700 > >@@ -299,7 +299,7 @@ > > /* Insert a publication: */ > >=20 > > publ =3D publ_create(type, lower, upper, port, node, scope, key); > >- dbg("inserting publ %x, node =3D %x publ->node =3D %x,=20 > subscr->node\n", > >+ dbg("inserting publ %x, node =3D %x publ->node =3D %x,=20 > >+ subscr->node %x\n", > > publ,node,publ->node,publ->subscr.node); > > if (!sseq->zone_list)=20 > > sseq->zone_list =3D publ->zone_list.next =3D publ; = @@=20 > >-309,10 +309,11 @@ > > } > >=20 > > if (in_own_cluster(node)){ > >- if (!sseq->cluster_list)=20 > >+ if (!sseq->cluster_list) { > > sseq->cluster_list =3D=20 > publ->cluster_list.next =3D publ; > >- else{ > >- publ->cluster_list.next =3D=20 > sseq->cluster_list->cluster_list.next; =20 > >+ } else{ > >+ publ->cluster_list.next =3D=20 > >+ =09 > sseq->cluster_list->cluster_list.next; =20 > > =20 > sseq->cluster_list->cluster_list.next =3D publ; > > } > > } > >@@ -465,7 +466,7 @@ > > struct sub_seq *sseq =3D this->sseqs; > > if (!sseq) > > return 0; > >- dbg("nameseq_av: ff =3D %u, sseq =3D %x,=20 > &&this->sseqs[this->first_free =3D %x\n", > >+ dbg("nameseq_av: ff =3D %u, sseq =3D %x,=20 > >+ &this->sseqs[this]->first_free =3D %x\n", > > this->first_free,sseq,&this->sseqs[this->first_free]); > > for (;sseq !=3D &this->sseqs[this->first_free];sseq++) { > > if ((sseq->lower >=3D lower) && (sseq->lower <=3D upper)) > >@@ -707,10 +708,14 @@ > > =20 > > if (high_seq < low_seq) > > goto not_found; > >+ > >+ if (high_seq >=3D seq->first_free) > >+ high_seq =3D seq->first_free - 1; > > =20 > > spin_lock_bh(&seq->lock); > >=20 > > i =3D low_seq; > >+ > > =20 > > for (i =3D low_seq ; i <=3D high_seq; i++) > > { > >@@ -732,14 +737,15 @@ > > =09 > > if (destport) > > { > >- if ( false =3D=3D=20 > mc_identity_create(mc_head,destport,destnode)) > >+ if ( false =3D=3D=20 > mc_identity_create(mc_head,destport,destnode)) { > > goto found; =09 > >+ } > > } =09 > > }=09 > > if (list_empty(mc_head)) > > { > >- spin_unlock_bh(&seq->lock); > >- goto not_found; > >+ spin_unlock_bh(&seq->lock); > >+ goto not_found; > > } > > found: > > spin_unlock_bh(&seq->lock); > >@@ -783,16 +789,18 @@ > > if (high_seq < low_seq) > > goto not_found; > > =20 > >+ if (high_seq >=3D seq->first_free) > >+ high_seq =3D seq->first_free - 1; > >+ > > spin_lock_bh(&seq->lock); > >=20 > > i =3D low_seq; > >- =20 > >+ > > for (i =3D low_seq ; i <=3D high_seq; i++) > > { > > publ =3D seq->sseqs[i].node_list; > > if(!publ) { > >- spin_unlock_bh(&seq->lock); > >- goto not_found; =09 > >+ continue; > > } > > destnode =3D publ->node;=20 > > destport =3D publ->ref; > >@@ -804,9 +812,10 @@ > > } > > } =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; > > > > =20 > > >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President=20 > and CEO of GenToo technologies. Learn everything from=20 > fundamentals to system=20 > = administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&op=3Dcli= ck > _______________________________________________ > TIPC-discussion mailing list TIP...@li... > https://lists.sourceforge.net/lists/listinfo/tipc-discussion >=20 |