[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKgT0UeZ1zzJNOcTbiJYzG0_HeDW2jFKkSSSogR-gU+-mRZhYQ@mail.gmail.com>
Date: Wed, 3 Apr 2024 14:51:14 -0700
From: Alexander Duyck <alexander.duyck@...il.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: netdev@...r.kernel.org, Alexander Duyck <alexanderduyck@...com>, kuba@...nel.org,
davem@...emloft.net, pabeni@...hat.com
Subject: Re: [net-next PATCH 02/15] eth: fbnic: add scaffolding for Meta's NIC driver
On Wed, Apr 3, 2024 at 2:17 PM Andrew Lunn <andrew@...n.ch> wrote:
>
> On Wed, Apr 03, 2024 at 01:47:18PM -0700, Alexander Duyck wrote:
> > On Wed, Apr 3, 2024 at 1:33 PM Andrew Lunn <andrew@...n.ch> wrote:
> > >
> > > > + * fbnic_init_module - Driver Registration Routine
> > > > + *
> > > > + * The first routine called when the driver is loaded. All it does is
> > > > + * register with the PCI subsystem.
> > > > + **/
> > > > +static int __init fbnic_init_module(void)
> > > > +{
> > > > + int err;
> > > > +
> > > > + pr_info(DRV_SUMMARY " (%s)", fbnic_driver.name);
> > >
> > > Please don't spam the kernel log like this. Drivers should only report
> > > when something goes wrong.
> > >
> > > Andrew
> >
> > Really?
>
> I think if you look around, GregKH has said this.
>
> lsmod | wc
> 167 585 6814
>
> Do i really want my kernel log spammed with 167 'Hello world'
> messages?
I would say it depends. Are you trying to boot off of all 167 devices?
The issue I run into is that I have to support boot scenarios where
the driver has to load as early as possible in order to mount a boot
image copied over the network. In many cases if something fails we
won't have access to something like lsmod since this is being used in
fairly small monolithic kernel images used for provisioning systems.
> > I have always used something like this to determine that the
> > driver isn't there when a user complains that the driver didn't load
> > on a given device. It isn't as though it would be super spammy as this
> > is something that is normally only run once when the module is loaded
> > during early boot, and there isn't a good way to say the module isn't
> > loaded if the driver itself isn't there.
>
> lsmod
>
> Andrew
That assumes you have access to the system and aren't looking at logs
after the fact. In addition that assumes the module isn't built into
the kernel as well. Having the one line in the log provides a single
point of truth that is easily searchable without having to resort to
one of several different ways of trying to figure out if it is there:
[root@...alhost ~]# dmesg | grep "Meta(R) Host Network Interface Driver"
[ 11.890979] Meta(R) Host Network Interface Driver (fbnic)
Otherwise we are having to go searching in sysfs if it is there, or
lsmod, or whatever is your preferred way and that only works if we
have login access to the system and it isn't just doing something like
writing the log to a file and rebooting.
Thanks,
- Alex
Powered by blists - more mailing lists