[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20130522.150636.1572124345721031295.davem@davemloft.net>
Date: Wed, 22 May 2013 15:06:36 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: horms@...ge.net.au
Cc: dev@...nvswitch.org, netdev@...r.kernel.org, jesse@...ira.com,
pshelar@...ira.com, jarno.rajahalme@....com,
eric.dumazet@...il.com, maze@...gle.com
Subject: Re: [PATCH net-next v3] net: Loosen constraints for recalculating
checksum in skb_segment()
From: Simon Horman <horms@...ge.net.au>
Date: Mon, 20 May 2013 10:46:49 +0900
> This is a generic solution to resolve a specific problem that I have observed.
>
> If the encapsulation of an skb changes then ability to offload checksums
> may also change. In particular it may be necessary to perform checksumming
> in software.
>
> An example of such a case is where a non-GRE packet is received but
> is to be encapsulated and transmitted as GRE.
>
> Another example relates to my proposed support for for packets
> that are non-MPLS when received but MPLS when transmitted.
>
> The cost of this change is that the value of the csum variable may be
> checked when it previously was not. In the case where the csum variable is
> true this is pure overhead. In the case where the csum variable is false it
> leads to software checksumming, which I believe also leads to correct
> checksums in transmitted packets for the cases described above.
>
> Further analysis:
>
> This patch relies on the return value of can_checksum_protocol()
> being correct and in turn the return value of skb_network_protocol(),
> used to provide the protocol parameter of can_checksum_protocol(),
> being correct. It also relies on the features passed to skb_segment()
> and in turn to can_checksum_protocol() being correct.
>
> I believe that this problem has not been observed for VLANs because it
> appears that almost all drivers, the exception being xgbe, set
> vlan_features such that that the checksum offload support for VLAN packets
> is greater than or equal to that of non-VLAN packets.
>
> I wonder if the code in xgbe may be an oversight and the hardware does
> support checksumming of VLAN packets. If so it may be worth updating the
> vlan_features of the driver as this patch will force such checksums to be
> performed in software rather than hardware.
>
> Signed-off-by: Simon Horman <horms@...ge.net.au>
Applied, thanks Simon.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists