netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Performance loss due to commit  37c3185 ([NET]: Added GSO toggle)
@ 2015-06-20  9:55 christophe leroy
  2015-06-25 14:37 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: christophe leroy @ 2015-06-20  9:55 UTC (permalink / raw)
  To: Herbert Xu; +Cc: netdev, David S. Miller

Hello Herbert,

In commit "[NET]: Added GSO toggle" 
37c3185a02d4b85fbe134bf5204535405dd2c957,
you force NETIF_F_HW_CSUM if GSO feature is selected.
By default, SW GSO is active as soon as a network board has NETIF_F_SG 
feature.
This means that function sk_setup_caps() forces NETIF_F_HW_CSUM for any 
board having NETIF_F_SG

For boards having no HW checksum capability, this results in performance 
loss due to data copy being done in skb_do_copy_data_nocache() with 
copy_from_user() then checksum being done later with csum_partial() 
instead of getting both done at the same time using 
csum_and_copy_from_user()

Is there a reason for forcing NETIF_F_HW_CSUM   ?

Christophe

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Performance loss due to commit  37c3185 ([NET]: Added GSO toggle)
  2015-06-20  9:55 Performance loss due to commit 37c3185 ([NET]: Added GSO toggle) christophe leroy
@ 2015-06-25 14:37 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2015-06-25 14:37 UTC (permalink / raw)
  To: christophe leroy; +Cc: netdev, David S. Miller

On Sat, Jun 20, 2015 at 11:55:03AM +0200, christophe leroy wrote:
> Hello Herbert,
> 
> In commit "[NET]: Added GSO toggle"
> 37c3185a02d4b85fbe134bf5204535405dd2c957,
> you force NETIF_F_HW_CSUM if GSO feature is selected.
> By default, SW GSO is active as soon as a network board has NETIF_F_SG
> feature.
> This means that function sk_setup_caps() forces NETIF_F_HW_CSUM for any
> board having NETIF_F_SG
> 
> For boards having no HW checksum capability, this results in performance
> loss due to data copy being done in skb_do_copy_data_nocache() with
> copy_from_user() then checksum being done later with csum_partial()
> instead of getting both done at the same time using
> csum_and_copy_from_user()
> 
> Is there a reason for forcing NETIF_F_HW_CSUM   ?

Well GSO requires hardware checksum for all the protocols that
it supports.  I guess we should also check that the hardware can
checksum both IPv4 and IPv6 before enabling it.

However, the benefit of GSO should cancel out the cost of copying
so I was hoping to just enable GSO unconditionally at some point.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-25 14:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-20  9:55 Performance loss due to commit 37c3185 ([NET]: Added GSO toggle) christophe leroy
2015-06-25 14:37 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).