All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Marcelo Ricardo Leitner' <marcelo.leitner@gmail.com>,
	Vladislav Yasevich <vyasevich@gmail.com>
Cc: "virtio-dev@lists.oasis-open.org"
	<virtio-dev@lists.oasis-open.org>,
	"nhorman@tuxdriver.com" <nhorman@tuxdriver.com>,
	"mst@redhat.com" <mst@redhat.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"linux-sctp@vger.kernel.org" <linux-sctp@vger.kernel.org>
Subject: RE: [PATCH V2 net-next 2/6] sctp: Handle sctp packets with CHECKSUM_PARTIAL
Date: Mon, 20 Aug 2018 15:39:32 +0000	[thread overview]
Message-ID: <a9c9c7f8bb89475c84d665bfdc182f57__9393.92440855063$1534779431$gmane$org@AcuMS.aculab.com> (raw)
In-Reply-To: <20180820145415.GA5310@localhost.localdomain>

From: Marcelo Ricardo Leitner
> Sent: 20 August 2018 15:54
> On Wed, May 02, 2018 at 11:38:24AM -0300, Marcelo Ricardo Leitner wrote:
> > On Tue, May 01, 2018 at 10:07:35PM -0400, Vladislav Yasevich wrote:
> > > With SCTP checksum offload available in virtio, it is now
> > > possible for virtio to receive a sctp packet with CHECKSUM_PARTIAL
> > > set (guest-to-guest traffic).  SCTP doesn't really have a
> > > partial checksum like TCP does, because CRC32c can't do partial
> > > additive checksumming.
...

Actually that isn't entirely true.
For all crc, crc(a) ^ crc(b) == crc(a^b).
Since crc(0) == 0 you can xor together two separately calculated crc
provided they both end at the same point.
The slight problem is that you are more likely to be appending
one buffer to another - which requires appending lots of zero
bytes to one of the crcs.
This could be speeded up by using lookup tables that add moderate
sized blocks of zero bytes to a crc instead of adding the zero
bytes one at a time.
Doing it without large const data and/or data cache trashing
is left as an exercise to the implementer.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

  reply	other threads:[~2018-08-20 15:39 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-02  2:07 [PATCH V2 net-next 0/6] virtio-net: Add SCTP checksum offload support Vladislav Yasevich
2018-05-02  2:07 ` Vladislav Yasevich
2018-05-02  2:07 ` [PATCH V2 net-next 1/6] virtio: Add support for SCTP checksum offloading Vladislav Yasevich
2018-05-02  2:07   ` Vladislav Yasevich
2018-05-02  3:16   ` Michael S. Tsirkin
2018-05-02  3:16     ` [virtio-dev] " Michael S. Tsirkin
2018-05-02  3:16     ` Michael S. Tsirkin
2018-05-02 13:00     ` [virtio-dev] " Vlad Yasevich
2018-05-02 14:14     ` Marcelo Ricardo Leitner
2018-05-02 14:14       ` Marcelo Ricardo Leitner
2018-05-02 14:21       ` Michael S. Tsirkin
2018-05-02 14:21       ` Michael S. Tsirkin
2018-05-02 14:21         ` [virtio-dev] " Michael S. Tsirkin
2018-05-02 14:21         ` Michael S. Tsirkin
2018-05-02 14:34         ` Marcelo Ricardo Leitner
2018-05-02 14:34           ` Marcelo Ricardo Leitner
2018-05-02  2:07 ` Vladislav Yasevich
2018-05-02  2:07 ` [PATCH V2 net-next 2/6] sctp: Handle sctp packets with CHECKSUM_PARTIAL Vladislav Yasevich
2018-05-02  2:07 ` Vladislav Yasevich
2018-05-02  2:07   ` Vladislav Yasevich
2018-05-02 14:38   ` Marcelo Ricardo Leitner
2018-05-02 14:38     ` Marcelo Ricardo Leitner
2018-08-20 14:54     ` Marcelo Ricardo Leitner
2018-08-20 14:54       ` Marcelo Ricardo Leitner
2018-08-20 15:39       ` David Laight [this message]
2018-08-20 15:39       ` David Laight
2018-08-20 15:39         ` David Laight
2018-05-02  2:07 ` [PATCH V2 net-next 3/6] sctp: Build sctp offload support into the base kernel Vladislav Yasevich
2018-05-02  2:07   ` Vladislav Yasevich
2018-05-02  2:07 ` [PATCH V2 net-next 4/6] tun: Add support for SCTP checksum offload Vladislav Yasevich
2018-05-02  2:07   ` Vladislav Yasevich
2018-05-02 14:53   ` Marcelo Ricardo Leitner
2018-05-02 14:53     ` Marcelo Ricardo Leitner
2018-05-02 14:56     ` Marcelo Ricardo Leitner
2018-05-02 14:56       ` Marcelo Ricardo Leitner
2018-05-02 17:17       ` Vlad Yasevich
2018-05-02 17:17       ` Vlad Yasevich
2018-05-02 17:17         ` [virtio-dev] " Vlad Yasevich
2018-05-02 17:17         ` Vlad Yasevich
2018-05-02  2:07 ` Vladislav Yasevich
2018-05-02  2:07 ` [PATCH V2 net-next 5/6] macvlan/macvtap: " Vladislav Yasevich
2018-05-02  2:07   ` Vladislav Yasevich
2018-05-02  3:24   ` Michael S. Tsirkin
2018-05-02  3:24   ` Michael S. Tsirkin
2018-05-02  3:24     ` [virtio-dev] " Michael S. Tsirkin
2018-05-02  3:24     ` Michael S. Tsirkin
2018-05-02 13:27     ` Vlad Yasevich
2018-05-02 13:27     ` Vlad Yasevich
2018-05-02 13:27       ` [virtio-dev] " Vlad Yasevich
2018-05-02 13:27       ` Vlad Yasevich
2018-05-02 13:46       ` Michael S. Tsirkin
2018-05-02 13:46       ` Michael S. Tsirkin
2018-05-02 13:46         ` [virtio-dev] " Michael S. Tsirkin
2018-05-02 13:46         ` Michael S. Tsirkin
2018-05-02 14:00         ` Vlad Yasevich
2018-05-02 14:00           ` [virtio-dev] " Vlad Yasevich
2018-05-02 14:00           ` Vlad Yasevich
2018-05-02 14:17           ` Michael S. Tsirkin
2018-05-02 14:17             ` [virtio-dev] " Michael S. Tsirkin
2018-05-02 14:17             ` Michael S. Tsirkin
2018-05-02 14:25             ` Vlad Yasevich
2018-05-02 14:25             ` Vlad Yasevich
2018-05-02 14:25               ` [virtio-dev] " Vlad Yasevich
2018-05-02 14:25               ` Vlad Yasevich
2018-05-02 14:00         ` Vlad Yasevich
2018-05-02  2:07 ` Vladislav Yasevich
2018-05-02  2:07 ` [PATCH V2 net-next 6/6] ipvlan: " Vladislav Yasevich
2018-05-02  2:07   ` Vladislav Yasevich
2018-05-02  8:12   ` Davide Caratti
2018-05-02  8:12     ` Davide Caratti
2018-05-02  2:07 ` Vladislav Yasevich
2018-05-02 21:57 ` [PATCH V2 net-next 0/6] virtio-net: Add SCTP checksum offload support Marcelo Ricardo Leitner
2018-05-02 21:57   ` Marcelo Ricardo Leitner

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='a9c9c7f8bb89475c84d665bfdc182f57__9393.92440855063$1534779431$gmane$org@AcuMS.aculab.com' \
    --to=david.laight@aculab.com \
    --cc=linux-sctp@vger.kernel.org \
    --cc=marcelo.leitner@gmail.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=virtualization@lists.linux-foundation.org \
    --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.