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)
Nov 24 2024, 3:26 PM
Unknown Object (File)
Nov 22 2024, 3:55 PM
Unknown Object (File)
Nov 22 2024, 1:25 PM
Unknown Object (File)
Nov 19 2024, 9:02 AM
Unknown Object (File)
Nov 18 2024, 11:42 PM
Unknown Object (File)
Nov 18 2024, 1:49 AM
Unknown Object (File)
Nov 15 2024, 12:35 AM
Unknown Object (File)
Nov 15 2024, 12:23 AM

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.