All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <dborkman@redhat.com>
To: Joseph Gasparakis <joseph.gasparakis@intel.com>
Cc: Vlad Yasevich <vyasevich@gmail.com>,
	"Rose, Gregory V" <gregory.v.rose@intel.com>,
	Ben Hutchings <ben@decadent.org.uk>,
	"Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"gospo@redhat.com" <gospo@redhat.com>,
	"sassmann@redhat.com" <sassmann@redhat.com>
Subject: Re: [net-next] vxlan: Advertise SCTP checksum offloads
Date: Thu, 01 May 2014 13:09:05 +0200	[thread overview]
Message-ID: <53622B51.5000901@redhat.com> (raw)
In-Reply-To: <alpine.LFD.2.03.1404291357500.27339@intel.com>

On 04/29/2014 10:59 PM, Joseph Gasparakis wrote:
> On Tue, 29 Apr 2014, Vlad Yasevich wrote:
...
>>>>>> At the time SCTP tries to do checksum, it will see hw offload
>>>>>> support and set checksum as partial.  That will be propagated
>>>>>> all the way to vxlan which will set encapsulation and pass it on.
>>>>>> At next dev_hard_start_xmit(), we'll look at hw_enc_features,
>>>>>> but it won't matter since SCTP packets are never GSO.
>>>>>>
>>>>>> So, we'll use the non-gso code path and still send with partial
>>>>>> checksum set.  Now, if the driver supports encapsulated SCTP,
>>>>>> then it will work.  If it doesn't, the udp checksum will be computed,
>>>>>> but not the sctp one.
>>>>>
>>>>> That is exactly the way it works, dev_hard_start_xmit() is where
>>>>> the (inner) unchecksummed packets will get checksummed if the Tx'ing
>>>>> interface does not support inner SCTP checksumming.
>>>>
>>>> No, it will not.  dev_hard_start_xmit() calls skb_checksum_help()
>>>> which only knows how to calculate TCP/UDP checksums.  It doesn't know
>>>> how to compute CRC32c for SCTP protocol.
>>>
>>> Interesting, thanks for the clarification! Then how do things work with
>>> non-encapsulated SCTP traffic? Where is the csumming for SCTP take place
>>> if the NIC cannot offload the protocol?
>>
>> In SCTP itself.  Look at sctp_packet_transmit().   There are also
>> fix-ups in netfilter to correct the checksum if the packet has
>> to be rerouted somewhere else.
>>
>> We've tossed around the idea of making skb_checksum have pluggable
>> components.  Daniel started us down that path by adding checksum ops.
>> We just need registration and proper lookup support.

Absolutely, Vlad is right here. That's also why we currently have this
ugly xfrm test in SCTP output path for csumming. I've started something
a while ago in that direction but got distracted with other things. If
someone is faster than me, I appreciate it. ;) In case not, I've kept
it on my todo list so far. Anyway, that would be the right way to go.

  reply	other threads:[~2014-05-01 11:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-28 19:52 [net-next] vxlan: Advertise SCTP checksum offloads Jeff Kirsher
2014-04-29 12:39 ` Ben Hutchings
2014-04-29 16:10   ` Rose, Gregory V
2014-04-29 17:09     ` Vlad Yasevich
2014-04-29 17:34       ` Joseph Gasparakis
2014-04-29 18:00         ` Vlad Yasevich
2014-04-29 19:25           ` Joseph Gasparakis
2014-04-29 19:25             ` Vlad Yasevich
2014-04-29 20:59               ` Joseph Gasparakis
2014-05-01 11:09                 ` Daniel Borkmann [this message]
2014-04-29 15:28 ` Tom Herbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53622B51.5000901@redhat.com \
    --to=dborkman@redhat.com \
    --cc=ben@decadent.org.uk \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=gregory.v.rose@intel.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=joseph.gasparakis@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=sassmann@redhat.com \
    --cc=vyasevich@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.