From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: netdev@vger.kernel.org
Cc: dcaratti@redhat.com, lucien.xin@gmail.com, marcelo.leitner@gmail.com
Subject: SCTP over GRE (w csum)
Date: Mon, 23 Dec 2019 18:45:35 +0100 [thread overview]
Message-ID: <20191223174535.GF6274@localhost.localdomain> (raw)
[-- Attachment #1: Type: text/plain, Size: 1055 bytes --]
Hi all,
I am currently working on the following scenario:
sctp --> ipv4 --> gretap --> ipv6 --> eth
If NETIF_F_SCTP_CRC is not supported by the network device (it is the
case for gre), sctp will fallback computing the crc32 in sw with
sctp_gso_make_checksum(), where SKB_GSO_CB(skb)->csum is set to ~0 by
gso_reset_checksum(). After the gso segmentation, gre_gso_segment()
will try to compute gre csum with gso_make_checksum() even if skb->ip_summed
is set to CHECKSUM_NONE (and so using ~0 as partial).
One possible (trivial and not tested) solution would be to recompute the
gre checksum, doing in gre_gso_segment() something like:
if (skb->ip_summed == CHECKSUM_NONE) {
...
err = skb_checksum_help(skb);
if (err < 0)
return return ERR_PTR(err);
} else {
*pcsum = gso_make_checksum(skb, 0);
}
One possible improvement would be offload the GRE checksum computation if the
hw exports this capability in netdev_features and fall back to the sw
implementation if not.
Am I missing something? Is there a better approach?
Regards,
Lorenzo
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next reply other threads:[~2019-12-23 17:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-23 17:45 Lorenzo Bianconi [this message]
2019-12-23 17:49 ` SCTP over GRE (w csum) 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=20191223174535.GF6274@localhost.localdomain \
--to=lorenzo.bianconi@redhat.com \
--cc=dcaratti@redhat.com \
--cc=lucien.xin@gmail.com \
--cc=marcelo.leitner@gmail.com \
--cc=netdev@vger.kernel.org \
/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 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).