Page MenuHomeFreeBSD

vtnet: fix enabling/disabling tso
ClosedPublic

Authored by tuexen on Nov 6 2025, 11:11 PM.
Tags
None
Referenced Files
F145856792: D53629.id166005.diff
Wed, Feb 25, 7:10 AM
Unknown Object (File)
Mon, Feb 23, 5:27 PM
Unknown Object (File)
Thu, Feb 19, 2:34 AM
Unknown Object (File)
Wed, Feb 18, 1:23 AM
Unknown Object (File)
Tue, Feb 17, 4:33 PM
Unknown Object (File)
Sun, Feb 15, 5:32 PM
Unknown Object (File)
Sun, Feb 15, 12:05 AM
Unknown Object (File)
Sun, Feb 8, 6:17 PM
Subscribers

Details

Summary

Transmit segment offloading depends on transmit checksum offloading. Enforce that constraint.
This also fixes a bug, since if_hwassist bits are from the CSUM_ space, not from the IFCAP_ space.
This fixes PR 290773.

Diff Detail

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

Event Timeline

tuexen retitled this revision from vtnet: fix enabling tso to vtnet: fix enabling/disabling tso.
tuexen edited the summary of this revision. (Show Details)
tuexen added reviewers: bryanv, kp.
tuexen edited the summary of this revision. (Show Details)

Use the correct sequence sequence of check and action.

Enabling TSO without TXCSUM is not good and should not be possible.

I added an inline comment to a line with an if. Other than that, there is nothing I would change.

sys/dev/virtio/network/if_vtnet.c
1372

Why do you explicitly check for != 0 here and below?
This shorter form seems to check the same:
if (if_getcapenable(ifp) & (IFCAP_TXCSUM | IFCAP_TSO4)) {

This revision is now accepted and ready to land.Nov 10 2025, 10:24 AM
This revision was automatically updated to reflect the committed changes.
tuexen added inline comments.
sys/dev/virtio/network/if_vtnet.c
1372

Why do you explicitly check for != 0 here and below?
This shorter form seems to check the same:
if (if_getcapenable(ifp) & (IFCAP_TXCSUM | IFCAP_TSO4)) {

The newer version would be != 0, but this files uses it without a lot. So stay consistent. Also combine the tests, since this is shorter.
Thanks for suggested the changes, used them in the committed version.