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)
Wed, Oct 23, 4:01 AM
Unknown Object (File)
Sep 16 2024, 12:08 AM
Unknown Object (File)
Sep 8 2024, 8:26 PM
Unknown Object (File)
Sep 8 2024, 4:33 AM
Unknown Object (File)
Sep 5 2024, 4:02 AM
Unknown Object (File)
Aug 17 2024, 10:42 PM
Unknown Object (File)
Aug 7 2024, 9:40 AM
Unknown Object (File)
Aug 2 2024, 6:27 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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 37652
Build 34541: arc lint + arc unit

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 ↗(On Diff #85772)

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 ↗(On Diff #85772)

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 ↗(On Diff #85772)

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.