Cathy Zhou wrote:
> Garrett D'Amore wrote:
>> Cathy Zhou wrote:
>>>> > > My 10GbE NIC does not do HW VLAN tag insertion/removal (we
>>>> concluded
>>>> > > there was no performance benefit). On several OSes, I'm
>>>> forced to
>>>> > > claim the device does HW VLAN tag support (and do tag
>>>> > > insertion/removal in the driver) to gain support for the 4
>>>> bytes of
>>>> > > "margin" (1518, 9018), and/or to get the OS to trust that my
>>>> device
>>>> > > can offload checksum in combination with VLAN frames.
>>>> > > > Hmm, can we make the assumption that supporting margin of
>>>> greater than 4 > always implies that a driver can handle offload
>>>> checksum for VLAN frames? I > am not sure whether this is always
>>>> true.
>>>>
>>>> Maybe there could be a capability flag for checksum offload in
>>>> combination with vlan? There seem to be plenty of bits free in the
>>>> 32-bit cap data for MAC_CAPAB_HCKSUM.
>>>>
>>>
>>> This sounds possible, or at least a similar mechanism is needed to
>>> make sure hardware checksum works fine for VLAN frames.
>>
>> Today, checksumming support is not optional, at least for partial
>> checksums.
>
> Why is that? Assuming a hardware does not know of any VLAN semantics,
> it might be able to do HW checksums for non-VLAN frames but not for
> VLAN frames.
Yes, but the API lacks the ability to express this distinction in the
capability bits. So far, I've only run into problems for hardware on
receive... for hme and eri, they have the ability to put a different
start offset on tx. But for rx, you don't know in advance if the frame
is tagged or not, so we just program in the offset for non-tagged
frames. If the frame shows up tagged, then we drop the partial checksum
data before we send the packet upstream.
This means that this hardware can do checksum offload for TX for both
VLAN and non-VLAN data (though it has a different set of problems for
UDP frames, and also for tiny frames that I won't discuss here), but it
only does offload on the receive for non-tagged frames.
-- Garrett
>
> Thanks
> - Cathy
>
> If you claim to support them, you have to do both VLAN and
>> regular on outbound. This means that drivers which can't do this
>> have to do soft checksum in the driver code on transmit. Kind of a
>> pain in the arse.
>>
>> On receive, its no big deal, because any frame can be sent up either
>> with or without a checksum tag, and the OS will figure it out without
>> consulting NIC capabilities.
>>
>> -- Garrett
>>>
>>> Thanks!
>>> - Cathy
>>
>
_______________________________________________
networking-discuss mailing list
[email protected]