Re: Re: [mpls-linux-general] I need some help to read the codes related with MPLS patches
Status: Beta
Brought to you by:
jleu
From: James R. L. <jl...@mi...> - 2001-11-21 13:51:02
|
On Tue, Nov 20, 2001 at 03:03:17AM +0900, =C1=A4=B1=E2=BF=B5 wrote: > Thanks for your comment, first. > And thanks for you and other peoples that=20 > make the great job about the MPLS-Linux. Thank you. > Before I ask some questions, I must apology about > my lack of English. Actually I read the RFCs related=20 > with MPLS and LDP. But when I looked at the code, MPLS-Linux,=20 > I can't figure out the implementation of LIB tables such like > ILM, NHLFE, FTN as descirbed in RFC 3031. > I think that the problem I've been had is not just for > my case. Ofcourse I read the codes.=20 ILM =3D incoming label info (mpls_in_info) NHLFE =3D outgoing label info (mpls_out_info) FTN =3D FIB entries -> outgoing label info (via proto_data) LIB =3D all of the above :-) > Anyway, I wonder the meaning of the res->proto_data[AUX_PROTO_DATA_MPLS= ]=20 > in route.c as I posted the prevoius mail. It is hard to Heh heh. I could give you the litteral meaning 'C' meaning :-) > follow the code with this because the location of set the > information of code is hard to find. It's not hard to find it just uses lots of abstraction. > Is there anybody explain me about that?=20 mpls_bind_out2fec() is what places MPLS info in a FIB entry. rt_set_nexthop() which is called from ip_route_output_slow() and ip_route_output_slow() grabs the MPLS info from the FIB entry and adds it to a dst_entry. Every SKB that goes through the Linux stack needs a dst_entry to control where it goes. >=20 >=20 >=20 > ------------------------------------------------------- > Ki Young Jung (jj...@ic...) > Information and Communications University(ICU) > Broadband Network Laboratory(http://bnlab.icu.ac.kr) > 58-4 Hwaam-dong, Yusong-gu, Taejon, 305-732, KOREA > Tel)+82-42-866-6182, 016-370-1751 Fax)+82-42-866-6110=20 > ------------------------------------------------------- >=20 > ----- Original Message -----=20 > From: James R. Leu=20 > To: Á=A2=B4=A1=BEâ=A2=AFµ=20 > Cc: mpl...@li...=20 > Sent: Tuesday, November 20, 2001 1:21 AM > Subject: Re: [mpls-linux-general] I need some help to read the codes re= lated with MPLS patches >=20 >=20 > You're already using the best document there is, the code. Keep diggin= g > through it, you'll figure it out. >=20 > If you run into a road block, and have specific questions feel free to > e-mail that list with it. I or someone else will answer. >=20 > Jim >=20 > On Mon, Nov 19, 2001 at 11:58:51PM +0900, Á=A2=B4=A1=BEâ=A2= =AFµ wrote: > > I've looked at the code, and i think that the binding point of mpls_o= utput() is in route.c > >=20 > > After patching mpls codes, in ./net/ipv4/route.c > >=20 > > void rt_set_nexthop(struct rtable *rt, struct fib_result *res, u32 it= ag) > > { > > struct fib_info *fi =3D res->fi; > > =20 > > =A2=AE¦ > > =20 > > #ifdef CONFIG_MPLS > > /* JLEU: we need to do this here because both > > * ip_route_output_slow() and ip_route_output_slow() > > * us this to finish the next hop calculations > > */ > > if(res->proto_data[AUX_PROTO_DATA_MPLS]) { > > struct mpls_out_info *moi; > > int i; > > =20 > > MPLS_DEBUG(("rt_set_nexthop: adding label to dst\n")); > > MPLS_DEBUG(("rt_set_nexthop: before - mtu =3D %d\n", > > rt->u.dst.pmtu)); > > rt->u.dst.output =3D mpls_output; /* HERE */ > > rt->u.dst.dst_proto_data[AUX_PROTO_DATA_MPLS] =3D=20 > > res->proto_data[AUX_PROTO_DATA_MPLS]; > > moi =3D res->proto_data[AUX_PROTO_DATA_MPLS]; > > mpls_again: > > for(i=3D0;i<moi->moi_instruction_length;i++) { > > switch(moi->moi_instruction[i].mi_opcode) { > > case MPLS_OP_FWD: > > moi =3D (struct mpls_out_info*) > > moi->moi_instruction[i].mi_data; > > goto mpls_again; > > break; > > case MPLS_OP_PUSH: > > rt->u.dst.pmtu -=3D 4; > > break; > > } > > } > > MPLS_DEBUG(("rt_set_nexthop: after - mtu =3D %d\n", > > rt->u.dst.pmtu)); > > } > > =20 > > =A2=AE¦ > > =20 > > } > > =20 > > If res->proto_data[AUX_PROTO_DATA_MPLS] have a value (not zero) > > then the output related function is binded with mpls_output() > > so the function is invoked. > > =20 > > But I still try to find work that describes the structures or methods= of MPLS in Linux .=20 > > Is there anyone who know this? I hope to learn from him or her. > > =20 > > Especially, I want to know the semantics of proto_data[AUX_PROTO_DATA= _MPLS]. > > =20 > > Thanks, in advance. > > =20 > > B.E. > > =20 > > Kiyoung Jung > > ------------------------------------------------------- > > Ki Young Jung (jj...@ic...) > > Information and Communications University(ICU) > > Broadband Network Laboratory(http://bnlab.icu.ac.kr) > > 58-4 Hwaam-dong, Yusong-gu, Taejon, 305-732, KOREA > > Tel)+82-42-866-6182, 016-370-1751 Fax)+82-42-866-6110=20 > > ------------------------------------------------------- > > ------------------------------------------------- > > DreamWiz Free Mail @ http://www.dreamwiz.com/ > > DreamSearch Click the world!!! http://search.dreamwiz.com/ > >=20 >=20 > --=20 > James R. Leu >=20 >=20 >=20 > ------------------------------------------------- > DreamWiz Free Mail @ http://www.dreamwiz.com/ > DreamSearch Click the world!!! http://search.dreamwiz.com/ >=20 --=20 James R. Leu |