From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Duyck Subject: [net-next PATCH 1/5] udp: Record gso_segs when supporting UDP segmentation offload Date: Thu, 03 May 2018 17:33:21 -0700 Message-ID: <20180504003321.4496.34585.stgit@localhost.localdomain> References: <20180504002817.4496.64616.stgit@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: netdev@vger.kernel.org, willemb@google.com, davem@davemloft.net Return-path: Received: from mail-pf0-f193.google.com ([209.85.192.193]:34224 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751116AbeEDAdW (ORCPT ); Thu, 3 May 2018 20:33:22 -0400 Received: by mail-pf0-f193.google.com with SMTP id a14so16068212pfi.1 for ; Thu, 03 May 2018 17:33:22 -0700 (PDT) In-Reply-To: <20180504002817.4496.64616.stgit@localhost.localdomain> Sender: netdev-owner@vger.kernel.org List-ID: From: Alexander Duyck We need to record the number of segments that will be generated when this frame is segmented. The expectation is that if gso_size is set then gso_segs is set as well. Without this some drivers such as ixgbe get confused if they attempt to offload this as they record 0 segments for the entire packet instead of the correct value. Signed-off-by: Alexander Duyck --- net/ipv4/udp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index dd3102a37ef9..e07db83b311e 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -793,6 +793,8 @@ static int udp_send_skb(struct sk_buff *skb, struct flowi4 *fl4, skb_shinfo(skb)->gso_size = cork->gso_size; skb_shinfo(skb)->gso_type = SKB_GSO_UDP_L4; + skb_shinfo(skb)->gso_segs = DIV_ROUND_UP(len - sizeof(uh), + cork->gso_size); goto csum_partial; }