netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vlad Yasevich <vyasevich@gmail.com>
To: netdev@vger.kernel.org
Cc: linux-sctp@vger.kernel.org, fan.du@windriver.com,
	Neil Horman <nhorman@tuxdriver.com>,
	Steffen Klassert <steffen.klassert@secunet.com>,
	Vlad Yasevich <vyasevich@gmail.com>
Subject: [PATCH v4 net 2/3] sctp: Use software crc32 checksum when xfrm transform will happen.
Date: Tue, 15 Oct 2013 22:01:30 -0400	[thread overview]
Message-ID: <1381888891-31186-3-git-send-email-vyasevich@gmail.com> (raw)
In-Reply-To: <1381888891-31186-1-git-send-email-vyasevich@gmail.com>

From: Fan Du <fan.du@windriver.com>

igb/ixgbe have hardware sctp checksum support, when this feature is enabled
and also IPsec is armed to protect sctp traffic, ugly things happened as
xfrm_output checks CHECKSUM_PARTIAL to do checksum operation(sum every thing
up and pack the 16bits result in the checksum field). The result is fail
establishment of sctp communication.

Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Fan Du <fan.du@windriver.com>
Signed-off-by: Vlad Yasevich <vyasevich@gmail.com>
---
 net/sctp/output.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/sctp/output.c b/net/sctp/output.c
index 0ac3a65..d35b54c 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -536,7 +536,8 @@ int sctp_packet_transmit(struct sctp_packet *packet)
 	 * by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>.
 	 */
 	if (!sctp_checksum_disable) {
-		if (!(dst->dev->features & NETIF_F_SCTP_CSUM)) {
+		if (!(dst->dev->features & NETIF_F_SCTP_CSUM) ||
+		    (dst_xfrm(dst) != NULL)) {
 			__u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len);
 
 			/* 3) Put the resultant value into the checksum field in the
-- 
1.8.3.1

  parent reply	other threads:[~2013-10-16  2:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-16  2:01 [PATCH v4 net 0/3] sctp: Use software checksum under certain Vlad Yasevich
2013-10-16  2:01 ` [PATCH v4 net 1/3] net: dst: provide accessor function to dst->xfrm Vlad Yasevich
2013-10-16 13:31   ` Neil Horman
2013-10-16  2:01 ` Vlad Yasevich [this message]
2013-10-16 13:32   ` [PATCH v4 net 2/3] sctp: Use software crc32 checksum when xfrm transform will happen Neil Horman
2013-10-16  2:01 ` [PATCH v4 net 3/3] sctp: Perform software checksum if packet has to be fragmented Vlad Yasevich
2013-10-16 13:34   ` Neil Horman
2013-10-16  8:02 ` [PATCH v4 net 0/3] sctp: Use software checksum under certain Daniel Borkmann
2013-10-17 19:26 ` David Miller
2013-10-17 20:21   ` Vlad Yasevich
2013-10-18  3:33     ` David Miller

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=1381888891-31186-3-git-send-email-vyasevich@gmail.com \
    --to=vyasevich@gmail.com \
    --cc=fan.du@windriver.com \
    --cc=linux-sctp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=steffen.klassert@secunet.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 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).