From: Steffen Klassert <steffen.klassert@secunet.com>
To: David Miller <davem@davemloft.net>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
Steffen Klassert <steffen.klassert@secunet.com>,
<netdev@vger.kernel.org>
Subject: [PATCH 2/5] udp: enable UDP checksum offload for ESP
Date: Mon, 7 May 2018 11:01:13 +0200 [thread overview]
Message-ID: <20180507090116.31222-3-steffen.klassert@secunet.com> (raw)
In-Reply-To: <20180507090116.31222-1-steffen.klassert@secunet.com>
From: Jacek Kalwas <jacek.kalwas@intel.com>
In case NIC has support for ESP TX CSUM offload skb->ip_summed is not
set to CHECKSUM_PARTIAL which results in checksum calculated by SW.
Fix enables ESP TX CSUM for UDP by extending condition with check for
NETIF_F_HW_ESP_TX_CSUM.
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
net/ipv4/ip_output.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 4c11b810a447..a2dfb5a9ba76 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -907,7 +907,7 @@ static int __ip_append_data(struct sock *sk,
length + fragheaderlen <= mtu &&
rt->dst.dev->features & (NETIF_F_HW_CSUM | NETIF_F_IP_CSUM) &&
!(flags & MSG_MORE) &&
- !exthdrlen)
+ (!exthdrlen || (rt->dst.dev->features & NETIF_F_HW_ESP_TX_CSUM)))
csummode = CHECKSUM_PARTIAL;
cork->length += length;
--
2.14.1
next prev parent reply other threads:[~2018-05-07 9:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-07 9:01 pull request (net-next): ipsec-next 2018-05-07 Steffen Klassert
2018-05-07 9:01 ` [PATCH 1/5] selftests: add xfrm state-policy-monitor to rtnetlink.sh Steffen Klassert
2018-05-07 9:01 ` Steffen Klassert [this message]
2018-05-07 9:01 ` [PATCH 3/5] xfrm: remove VLA usage in __xfrm6_sort() Steffen Klassert
2018-05-07 9:01 ` [PATCH 4/5] change the comment of vti6_ioctl Steffen Klassert
2018-05-07 9:01 ` [PATCH 5/5] xfrm: use a dedicated slab cache for struct xfrm_state Steffen Klassert
2018-05-08 3:57 ` pull request (net-next): ipsec-next 2018-05-07 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=20180507090116.31222-3-steffen.klassert@secunet.com \
--to=steffen.klassert@secunet.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--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).