HomeFreeBSD

Switch to TX header format rather than directly manipulating header

Description

Switch to TX header format rather than directly manipulating header
structures. This simplifies mbuf copy operation to USB buffers as
well as improving readability. The controller supports Microsoft
LSOv1(aka TSO) but this change set does not include the support due
to copying overhead to USB buffers and large amount of memory waste.

Remove useless ZLP padding which seems to come from Linux. Required
bits the code tried to set was not copied into USB buffer so it had
no effect. Unlike Linux, FreeBSD USB stack automatically generates
ZLP so no explicit padding is required in driver.[1]

Micro-optimize updating IFCOUNTER_OPACKETS counter by moving it out
of TX loop since updating counter is not cheap operation as it did
long time ago and we already know how many number of packets were
queued after exiting the loop.

While here, fix a checksum offloading bug which will happen when
upper stack computes checksum while H/W checksum offloading is
active. The controller should be notified to not recompute the
checksum in this case.

Reviewed by: kevlo (initial version), hselasky
Pointed out by: hselasky [1]

Details

Provenance
yongariAuthored on
Reviewer
kevlo
Parents
rS304325: Rename cryptic RX filter constants with more readable ones.
Branches
Unknown
Tags
Unknown