From mboxrd@z Thu Jan 1 00:00:00 1970 From: Davide Caratti Subject: [PATCH RFC net-next v3 6/7] openvswitch: more accurate checksumming in queue_userspace_packet() Date: Fri, 7 Apr 2017 16:16:09 +0200 Message-ID: <82f2e030e76627e43d3184567f89cd76743b7cdf.1491562390.git.dcaratti@redhat.com> References: Cc: Linux Kernel Network Developers , linux-sctp@vger.kernel.org To: Tom Herbert , Alexander Duyck , David Laight , "David S . Miller" , Marcelo Ricardo Leitner Return-path: Received: from mx1.redhat.com ([209.132.183.28]:56606 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933627AbdDGOQl (ORCPT ); Fri, 7 Apr 2017 10:16:41 -0400 In-Reply-To: In-Reply-To: References: Sender: netdev-owner@vger.kernel.org List-ID: if skb carries an SCTP packet and ip_summed is CHECKSUM_PARTIAL, it needs CRC32c in place of Internet Checksum: use skb_csum_hwoffload_help to avoid corrupting such packets while queueing them towards userspace. Signed-off-by: Davide Caratti --- net/openvswitch/datapath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index 9c62b63..457f40d 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c @@ -453,7 +453,7 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb, /* Complete checksum if needed */ if (skb->ip_summed == CHECKSUM_PARTIAL && - (err = skb_checksum_help(skb))) + (err = skb_csum_hwoffload_help(skb, 0))) goto out; /* Older versions of OVS user space enforce alignment of the last -- 2.7.4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Davide Caratti Date: Fri, 07 Apr 2017 14:16:09 +0000 Subject: [PATCH RFC net-next v3 6/7] openvswitch: more accurate checksumming in queue_userspace_packet() Message-Id: <82f2e030e76627e43d3184567f89cd76743b7cdf.1491562390.git.dcaratti@redhat.com> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Tom Herbert , Alexander Duyck , David Laight , "David S . Miller" , Marcelo Ricardo Leitner Cc: Linux Kernel Network Developers , linux-sctp@vger.kernel.org if skb carries an SCTP packet and ip_summed is CHECKSUM_PARTIAL, it needs CRC32c in place of Internet Checksum: use skb_csum_hwoffload_help to avoid corrupting such packets while queueing them towards userspace. Signed-off-by: Davide Caratti --- net/openvswitch/datapath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index 9c62b63..457f40d 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c @@ -453,7 +453,7 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb, /* Complete checksum if needed */ if (skb->ip_summed = CHECKSUM_PARTIAL && - (err = skb_checksum_help(skb))) + (err = skb_csum_hwoffload_help(skb, 0))) goto out; /* Older versions of OVS user space enforce alignment of the last -- 2.7.4