From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759173AbcEFWZw (ORCPT ); Fri, 6 May 2016 18:25:52 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:50635 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759138AbcEFWZv (ORCPT ); Fri, 6 May 2016 18:25:51 -0400 Date: Fri, 06 May 2016 18:25:48 -0400 (EDT) Message-Id: <20160506.182548.2125009837273287619.davem@davemloft.net> To: jarno@ovn.org Cc: kuznet@ms2.inr.ac.ru, jmorris@namei.org, yoshfuji@linux-ipv6.org, kaber@trash.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jesse@kernel.org Subject: Re: [PATCH net v3 2/2] udp_offload: Set encapsulation before inner completes. From: David Miller In-Reply-To: <1462317021-7236-2-git-send-email-jarno@ovn.org> References: <1462317021-7236-1-git-send-email-jarno@ovn.org> <1462317021-7236-2-git-send-email-jarno@ovn.org> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 06 May 2016 15:25:50 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jarno Rajahalme Date: Tue, 3 May 2016 16:10:21 -0700 > UDP tunnel segmentation code relies on the inner offsets being set for > an UDP tunnel GSO packet, but the inner *_complete() functions will > set the inner offsets only if 'encapsulation' is set before calling > them. Currently, udp_gro_complete() sets 'encapsulation' only after > the inner *_complete() functions are done. This causes the inner > offsets having invalid values after udp_gro_complete() returns, which > in turn will make it impossible to properly segment the packet in case > it needs to be forwarded, which would be visible to the user either as > invalid packets being sent or as packet loss. > > This patch fixes this by setting skb's 'encapsulation' in > udp_gro_complete() before calling into the inner complete functions, > and by making each possible UDP tunnel gro_complete() callback set the > inner_mac_header to the beginning of the tunnel payload. > > Signed-off-by: Jarno Rajahalme > --- > v3: Added setting inner_mac_header from all possible callbacks to cover > cases where there is no inner mac header. Applied.