Page MenuHomeFreeBSD

vtnet: fix enabling/disabling tso
ClosedPublic

Authored by tuexen on Thu, Nov 6, 11:11 PM.
Tags
None
Referenced Files
F137450564: D53629.id165989.diff
Sun, Nov 23, 2:25 PM
F137441294: D53629.id166031.diff
Sun, Nov 23, 12:10 PM
F137439211: D53629.id166135.diff
Sun, Nov 23, 11:41 AM
F137439207: D53629.id.diff
Sun, Nov 23, 11:41 AM
F137438671: D53629.id165989.diff
Sun, Nov 23, 11:35 AM
F137438668: D53629.id166031.diff
Sun, Nov 23, 11:34 AM
F137438658: D53629.id166005.diff
Sun, Nov 23, 11:34 AM
F137438019: D53629.diff
Sun, Nov 23, 11:26 AM
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 Skipped
Unit
Tests Skipped

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.