How about the order of Network stack initialize
Subsystems (2)
Hi all:
I have a question about the order of network stack initialize.
From some books it says the order is as below:
1.core_initcall: sock_init
2.fs_initcall: inet_init
3.subsys_initcall: net_dev_init
4.device_initcall: device init
in the source code of linux2.6.18:
#define core_initcall(fn) __define_initcall("1",fn) #define postcore_initcall(fn) __define_initcall("2",fn) #define arch_initcall(fn) __define_initcall("3",fn) #define subsys_initcall(fn) __define_initcall("4",fn) #define fs_initcall(fn) __define_initcall("5",fn) #define device_initcall(fn) __define_initcall("6",fn) #define late_initcall(fn) __define_initcall("7",fn)
obviously:
macro sectioncore_initcall <--> .initcall1.initfs_initcall <--> .initcall5.initsubsys_initcall <--> .initcall4.initdevice_intcall <--> .initcall6.init
Some also says:
“Every child is to determine the sequence between sections, the first call. Initcall1 init.
The function pointer, again. Initcall2 init. Call the function pointer, etc. And in each section of the function pointer is associated with links to order, is uncertain ”
As the above says, the order should be: core_initcall->subsys_initcall->fs_initcall->device_intcall
So which one is really correct?
2010-09-15
Huangqiang Zhou
Quoted 31 lines · On Thu, 16 Sep 2010 09:06:16 +0800 Huangqiang Zhou wrote:
Hi all:
I have a question about the order of network stack initialize.
From some books it says the order is as below:
1.core_initcall:sock_init
2.fs_initcall:inet_init
3.subsys_initcall:net_dev_init
4.device_initcall: device initin the source code of linux2.6.18:
#definecore_initcall(fn)__define_initcall("1",fn)#definepostcore_initcall(fn)__define_initcall("2",fn)#definearch_initcall(fn)__define_initcall("3",fn)#definesubsys_initcall(fn)__define_initcall("4",fn)#definefs_initcall(fn)__define_initcall("5",fn)#definedevice_initcall(fn)__define_initcall("6",fn)#definelate_initcall(fn)__define_initcall("7",fn)obviously:
macro sectioncore_initcall<--> .initcall1.initfs_initcall<--> .initcall5.initsubsys_initcall<--> .initcall4.initdevice_intcall<--> .initcall6.initSome also says:
“Every child is to determine the sequence between sections, the first call. Initcall1 init.
The function pointer, again. Initcall2 init. Call the function pointer, etc. And in each section of the function pointer is associated with links to order, is uncertain ”
Quoted 6 lines
As the above says, the order should be:
core_initcall->subsys_initcall->fs_initcall->device_intcallSo which one is really correct?
2010-09-15
Huangqiang Zhou
Hi,
BTW, did you find out anything from your previous posting's answers?
http://marc.info/?l=linux-net&m=128443018603483&w=2
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 7 lines · On Sun, 19 Sep 2010 08:48:09 +0800 Huangqiang Zhou wrote:
Hi:
yes, i have found the answer."please refer to the macro definition INITCALLS in the header file
include/asm-generic/vmlinux.lds.h-- many definitions are moved to this file now." --- by Randy Dunlap
That answer was
From: Tony Wan <[email protected]>
Quoted 51 lines
2010-09-19
Huangqiang Zhou
发件人: Randy Dunlap
发送时间: 2010-09-18 05:19:50
收件人: Huangqiang Zhou
抄送: ly; linux-net; netdev
主题: Re: How about the order of Network stack initializeQuoted 35 lines · On Thu, 16 Sep 2010 09:06:16 +0800 Huangqiang Zhou wrote:
Hi all:
I have a question about the order of network stack initialize.
From some books it says the order is as below:
1.core_initcall:sock_init
2.fs_initcall:inet_init
3.subsys_initcall:net_dev_init
4.device_initcall: device initin the source code of linux2.6.18:
#definecore_initcall(fn)__define_initcall("1",fn)#definepostcore_initcall(fn)__define_initcall("2",fn)#definearch_initcall(fn)__define_initcall("3",fn)#definesubsys_initcall(fn)__define_initcall("4",fn)#definefs_initcall(fn)__define_initcall("5",fn)#definedevice_initcall(fn)__define_initcall("6",fn)#definelate_initcall(fn)__define_initcall("7",fn)obviously:
macro sectioncore_initcall<--> .initcall1.initfs_initcall<--> .initcall5.initsubsys_initcall<--> .initcall4.initdevice_intcall<--> .initcall6.initSome also says:
“Every child is to determine the sequence between sections, the first call. Initcall1 init.
The function pointer, again. Initcall2 init. Call the function pointer, etc. And in each section of the function pointer is associated with links to order, is uncertain ”As the above says, the order should be:
core_initcall->subsys_initcall->fs_initcall->device_intcallSo which one is really correct?
Quoted 8 lines
Quoted 2 lines
2010-09-15
Huangqiang ZhouHi,
BTW, did you find out anything from your previous posting's answers?
http://marc.info/?l=linux-net&m=128443018603483&w=2
---
~Randy
*** Remember to useDocumentation/SubmitChecklistwhen testing your code ***
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***