Page MenuHomeFreeBSD

vtnet: fix enabling/disabling tso
ClosedPublic

Authored by tuexen on Nov 6 2025, 11:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jan 7, 5:13 PM
Unknown Object (File)
Mon, Jan 5, 10:25 PM
Unknown Object (File)
Sat, Jan 3, 4:15 PM
Unknown Object (File)
Fri, Jan 2, 6:08 PM
Unknown Object (File)
Fri, Jan 2, 9:25 AM
Unknown Object (File)
Thu, Jan 1, 10:21 PM
Unknown Object (File)
Thu, Jan 1, 5:06 AM
Unknown Object (File)
Wed, Dec 31, 1:31 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.