From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Duyck Subject: [net-next PATCH v2 1/8] udp: Record gso_segs when supporting UDP segmentation offload Date: Fri, 04 May 2018 11:28:51 -0700 Message-ID: <20180504182847.5194.27449.stgit@localhost.localdomain> References: <20180504182537.5194.72775.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-pg0-f66.google.com ([74.125.83.66]:40774 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751562AbeEDS2x (ORCPT ); Fri, 4 May 2018 14:28:53 -0400 Received: by mail-pg0-f66.google.com with SMTP id l2-v6so15965189pgc.7 for ; Fri, 04 May 2018 11:28:53 -0700 (PDT) In-Reply-To: <20180504182537.5194.72775.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. Reviewed-by: Eric Dumazet 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; }