LWF filter checksum offloads

Hi,

I’m developing a LWF driver, which is part of a filtering infrastructure. I don’t want the tcp/ip stack to use the checksum offload feature of some network devices, so: in the FilterStatus callback of the LWF, i intercept the NDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG item, setting all items in the configuration structure PNDIS_TCP_IP_CHECKSUM_OFFLOAD i want to disable to NDIS_OFFLOAD_SET_OFF.

Usually it works fine, but in some cases, when the machine starts, checksums seems to be offloaded anyway since all of the network packets from that machine (captured in another machine), have a wrong checksum. If i unload my filter and reload it again, the issue is fixed.

The driver start type is “system”, and is of mandatory type.

The question is: which is the canonical way to disable checksum offloads in a LWF? Is there any other callback i need to filter?

Consider making a NDIS_STATUS_INDICATION for
NDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG from your FilterRestart callback.
Perhaps this will convince higher levels to forget about offload.

An alternate solution is to go ahead and add support for offload.

Thomas F. Divine
http://www.pcausa.com


From:
Sent: Wednesday, February 15, 2012 1:15 PM
To: “Windows System Software Devs Interest List”
Subject: [ntdev] LWF filter checksum offloads

> Hi,
>
> I’m developing a LWF driver, which is part of a filtering infrastructure.
> I don’t want the tcp/ip stack to use the checksum offload feature of some
> network devices, so: in the FilterStatus callback of the LWF, i intercept
> the NDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG item, setting all items in the
> configuration structure PNDIS_TCP_IP_CHECKSUM_OFFLOAD i want to disable to
> NDIS_OFFLOAD_SET_OFF.
>
> Usually it works fine, but in some cases, when the machine starts,
> checksums seems to be offloaded anyway since all of the network packets
> from that machine (captured in another machine), have a wrong checksum. If
> i unload my filter and reload it again, the issue is fixed.
>
> The driver start type is “system”, and is of mandatory type.
>
> The question is: which is the canonical way to disable checksum offloads
> in a LWF? Is there any other callback i need to filter?
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

Ok, that fixed the issue. Thank you!

I’ll check the cost of supporting offload, anyway. That’s the right way to behave.