Page MenuHomeFreeBSD

vtnet: fix enabling/disabling tso
ClosedPublic

Authored by tuexen on Thu, Nov 6, 11:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 17, 5:39 PM
Unknown Object (File)
Mon, Nov 17, 3:10 PM
Unknown Object (File)
Sun, Nov 16, 9:23 PM
Unknown Object (File)
Sun, Nov 16, 4:11 PM
Unknown Object (File)
Fri, Nov 14, 9:14 PM
Unknown Object (File)
Fri, Nov 14, 6:30 PM
Unknown Object (File)
Fri, Nov 14, 6:30 PM
Unknown Object (File)
Fri, Nov 14, 3:53 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.Mon, Nov 10, 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.