Skip to contentSkip to conversation

Drivers: net: Hyperv

DISCUSSION K. Y. Srinivasan 2 participants 3 messages Apr 22, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

I am trying to port the various offloads (checksum, TSO etc.) that I recently implemented for the Hyper-V network driver to a 2.6.32 kernel and while this code works on the upstream bits, TCP checksum offload does not seem to work on the 2.6.32 kernel. Would you know if there is a different way to turn on checksum offload on 2.6.32 kernels? I am setting the relevant feature flags:

        net->features =  NETIF_F_SG | NETIF_F_RXCSUM |
                        NETIF_F_IP_CSUM | NETIF_F_TSO;

What I am observing is that when the skb is presented to the driver for transmission, The ip_summed field in the skb is set to 0.
On the kernel tip, I see this value set to CHECKSUM_PARTIAL and the offloads work correctly on the kernel tip. The other difference I see is that on entry into the driver, the eth_hdr state is not correctly set in the skb.
I need to invoke skb_reset_mac_header() to get this state correctly set.
Any help would be greatly appreciated.

Regards,

K. Y

#1 lore raw
Quoted 9 lines · K. Y. Srinivasan

I am trying to port the various offloads (checksum, TSO etc.) that I recently implemented for the Hyper-V network driver to a 2.6.32 kernel and while this code works on the upstream bits, TCP checksum offload does not seem to work on the 2.6.32 kernel. Would you know if there is a different way to turn on checksum offload on 2.6.32 kernels? I am setting the relevant feature flags:

        net->features =  NETIF_F_SG | NETIF_F_RXCSUM |
                        NETIF_F_IP_CSUM | NETIF_F_TSO;

There is no NETIF_F_RXCSUM in 2.6.32, but otherwise this should work.

I notice that NETIF_F_HIGHDMA is not there, and it seems like you could add it as netvsc_start_xmit() doesn't assume page fragments are in lowmem.

Quoted 2 lines

What I am observing is that when the skb is presented to the driver for transmission, The ip_summed field in the skb is set to 0.

Maybe you tested on a 32-bit system and the packet had to be copied to lowmem? The allocation behaviour may have changed since 2.6.32.

Quoted 5 lines

On the kernel tip, I see this value set to CHECKSUM_PARTIAL and the offloads work correctly on the kernel tip. The other difference I see is that on entry into the driver, the eth_hdr state is not correctly set in the skb.
I need to invoke skb_reset_mac_header() to get this state correctly set.
Any help would be greatly appreciated.

I don't recall that problem.

Ben.

Signature · 2 lines
Ben Hutchings
Beware of programmers who carry screwdrivers. - Leonard Brandwein
#2 lore raw
Quoted 19 lines

-----Original Message-----
From: Ben Hutchings [mailto:[email protected]]
Sent: Tuesday, April 22, 2014 11:22 AM
To: KY Srinivasan
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: Drivers: net: Hyperv

Quoted 5 lines · K. Y. Srinivasan

I am trying to port the various offloads (checksum, TSO etc.) that I recently implemented for the Hyper-V network driver to a 2.6.32 kernel and while this code works on the upstream bits, TCP checksum offload does not seem to work on the 2.6.32 kernel. Would you know if there is a different way to turn on checksum offload on 2.6.32 kernels? I am setting

the relevant feature flags:

Quoted 2 lines
Quoted 7 lines
Quoted 2 lines
        net->features =  NETIF_F_SG | NETIF_F_RXCSUM |
                        NETIF_F_IP_CSUM | NETIF_F_TSO;

There is no NETIF_F_RXCSUM in 2.6.32, but otherwise this should work.

I notice that NETIF_F_HIGHDMA is not there, and it seems like you could add it as netvsc_start_xmit() doesn't assume page fragments are in lowmem.

Ben,

Thank you for the prompt response. I added the HIGHDMA feature and yet I see the same behavior.

Quoted 6 lines
Quoted 3 lines

What I am observing is that when the skb is presented to the driver for transmission, The ip_summed field in the skb is set to 0.

Maybe you tested on a 32-bit system and the packet had to be copied to lowmem? The allocation behaviour may have changed since 2.6.32.

I am testing on a 64 bit VM.

Quoted 9 lines
Quoted 4 lines

On the kernel tip, I see this value set to CHECKSUM_PARTIAL and the offloads work correctly on the kernel tip. The other difference I see is that on entry into the driver, the eth_hdr state is not correctly set in the

skb.

Quoted 2 lines

I need to invoke skb_reset_mac_header() to get this state correctly set. Any help would be greatly appreciated.

I don't recall that problem.

Regards,

K. Y