Page MenuHomeFreeBSD

ixgbe: Avoid sbuf_trim in sysctl handler
ClosedPublic

Authored by kbowling on Aug 22 2021, 5:05 AM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 15 2024, 12:27 PM
Unknown Object (File)
Dec 28 2023, 11:07 PM
Unknown Object (File)
Dec 25 2023, 3:34 AM
Unknown Object (File)
Dec 22 2023, 9:01 PM
Unknown Object (File)
Dec 11 2023, 7:33 AM
Unknown Object (File)
Nov 26 2023, 9:24 AM
Unknown Object (File)
Nov 22 2023, 11:50 PM
Unknown Object (File)
Nov 22 2023, 3:24 PM
Subscribers

Details

Summary

This was an error, we cannot use sbuf_trim(9) in the ixgbe_get_phy_firmware_version function because it also gets called in the context of sbuf_new_for_sysctl(9). sbuf(9) explains the interaction with drain functions as used by sbuf_new_for_sysctl(9).

MFC after: 1 day
Fixes: 7660e4ea5cb7

Test Plan

Tested on X552.

Diff Detail

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

Event Timeline

Suggested approach which I think might be simpler, but the only mandatory thing is the final space that got left in.

sys/dev/ixgbe/if_ix.c
4698

I'd add a const char *space = ""; here

4706–4708

Then add space =" "; here with {}

4711

and use space here instead of this express....

4712

with the same space = " "; here.

4717

and replace this with space.

4723

I think you missed one of the trailing white spaces here.. It would have been trimmed before.

This revision is now accepted and ready to land.Aug 23 2021, 5:17 PM