Date: Fri, 25 Jun 2021 23:09:30 -0600 From: Warner Losh <imp@bsdimp.com> To: saimabaig11@gmail.com Cc: FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Re: PCI probing in the kernel Message-ID: <CANCZdfpKHU2x6gDbcLGTeH7JESyy8OdGD-XZPAb81Mn8vPoh9g@mail.gmail.com> In-Reply-To: <003201d76a47$dae98bc0$90bca340$@gmail.com> References: <003201d76a47$dae98bc0$90bca340$@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--0000000000007e000305c5a443e4 Content-Type: text/plain; charset="UTF-8" On Fri, Jun 25, 2021 at 10:59 PM <saimabaig11@gmail.com> wrote: > My question relates to how does the kernel go about its business of > discovering PCI devices (after boot time) . I am loading the e1000(em) > driver by kldloading the `if_em` module. The kernel seems to be calling the > probe routine multiple times. So the log below includes messages coming > from > the kernel and also includes my own debug logs. > > > > ``` > > Jun 25 11:16:45 FreeBSD12 kernel: em probing > > Jun 25 11:16:45 FreeBSD12 syslogd: last message repeated 5 times > > Jun 25 11:16:45 FreeBSD12 kernel: em0: +++ Calling em_register > > Jun 25 11:16:45 FreeBSD12 kernel: em probing > > Jun 25 11:16:45 FreeBSD12 syslogd: last message repeated 5 times > > Jun 25 11:16:45 FreeBSD12 kernel: em0: +++ Calling em_register > > Jun 25 11:16:45 FreeBSD12 kernel: em probing > > Jun 25 11:16:45 FreeBSD12 kernel: em0: +++ Calling em_register > > Jun 25 11:16:45 FreeBSD12 kernel: em0: <Intel(R) PRO/1000 Network > Connection> port 0x2000-0x203f mem > 0xfd5c0000-0xfd5dffff,0xfdff0000-0xfdffffff irq 19 at device 1.0 on pci2 > > Jun 25 11:16:45 FreeBSD12 kernel: em attaching > > Jun 25 11:16:45 FreeBSD12 kernel: em0: +++ Calling em_register > > Jun 25 11:17:34 FreeBSD12 kernel: em0: Using 2048 TX descriptors and 2048 > RX > descriptors > > Jun 25 11:17:35 FreeBSD12 kernel: em probing > > Jun 25 11:17:35 FreeBSD12 syslogd: last message repeated 5 times > > Jun 25 11:17:35 FreeBSD12 kernel: em1: +++ Calling em_register > > Jun 25 11:17:35 FreeBSD12 kernel: em probing > > Jun 25 11:17:36 FreeBSD12 kernel: Base = 5ee7e000, Length = 8000 > > ``` > > It seems that the `probe->register` sequence seems to be getting repeated > multiple times until the adapter is identified properly and its resources > allocated. Isn't multiple registration a cause of concern? Or may something > is wrong with the way I think. May be I am not getting it right? Could > someone elaborate? > When you load a driver, we call probe on all the devices on the bus that don't yet have drivers. I believe you are seeing this. The probe routine tries a bunch of different devices until finding the NIC that doesn't have a driver. It's completely normal and ordinary. Warner --0000000000007e000305c5a443e4--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfpKHU2x6gDbcLGTeH7JESyy8OdGD-XZPAb81Mn8vPoh9g>