Page MenuHomeFreeBSD

mlx5: Print driver version only when creating an interface
ClosedPublic

Authored by hselasky on Mar 5 2021, 5:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jun 30, 10:01 AM
Unknown Object (File)
Sun, Jun 30, 9:59 AM
Unknown Object (File)
Sun, Jun 30, 9:09 AM
Unknown Object (File)
Sun, Jun 30, 8:35 AM
Unknown Object (File)
Sat, Jun 29, 4:35 AM
Unknown Object (File)
Sat, Jun 29, 12:48 AM
Unknown Object (File)
Fri, Jun 28, 10:42 PM
Unknown Object (File)
Fri, Jun 28, 7:03 PM

Details

Summary

Otherwise mlx5 unconditionally prints messages to the dmesg during boot,
even when there is no hardware for it to drive.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Mar 5 2021, 5:56 PM

Need to check this a bit. I will come back on monday with a final answer.

BTW: There is a macro in the LinuxKPI, PRINTK ONCE or something like that, which does exactly like you do. Maybe use that?

I suspect we may just put the printf() under if (bootverbose) .

Predicate the printf() on bootverbose.

@markj: Do you mind if I commander this revision?

@markj: Do you mind if I commander this revision?

Sure, go ahead.

hselasky updated this revision to Diff 85369.
hselasky edited reviewers, added: markj; removed: hselasky.

Update patch.

This revision is now accepted and ready to land.Mar 9 2021, 3:09 PM
This revision now requires review to proceed.Mar 15 2021, 10:04 AM
sys/dev/mlx5/mlx5_core/mlx5_main.c
1328

This reintroduces the problem. The line is printed even if no mlx5 hw is present. We already call device_set_desc() here, that ensures that mlx5_version will be printed immediately before attach.

Also there is a newline missing I think.

sys/dev/mlx5/mlx5_core/mlx5_main.c
1328

No, this is not the device_probe(). This is the device_attach(), and the device_set_desc() is only visible to the sysctl tree. We actually set it too late for it to show up in dmesg :-(

Should work. Can you test it? Or are you sure?

sys/dev/mlx5/mlx5_core/mlx5_main.c
1328

Sorry, I tested it, you are right. I missed that Linux "probe" is FreeBSD "attach".

We should remove the device_set_desc() call then.

Right now we want both, due to some internal QA/regression tools. Else you are right! Thanks for reviewing.

This revision is now accepted and ready to land.Jul 28 2021, 11:37 AM
This revision was automatically updated to reflect the committed changes.