From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [net-next PATCH 1/5] udp: Record gso_segs when supporting UDP segmentation offload Date: Thu, 3 May 2018 18:50:05 -0700 Message-ID: References: <20180504002817.4496.64616.stgit@localhost.localdomain> <20180504003321.4496.34585.stgit@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: Alexander Duyck , netdev@vger.kernel.org, willemb@google.com, davem@davemloft.net Return-path: Received: from mail-pg0-f68.google.com ([74.125.83.68]:39237 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751133AbeEDBuI (ORCPT ); Thu, 3 May 2018 21:50:08 -0400 Received: by mail-pg0-f68.google.com with SMTP id e1-v6so3042675pga.6 for ; Thu, 03 May 2018 18:50:08 -0700 (PDT) In-Reply-To: <20180504003321.4496.34585.stgit@localhost.localdomain> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 05/03/2018 05:33 PM, Alexander Duyck wrote: > 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; > } > > Yes, this also fixes qdisc_pkt_len_init() Reviewed-by: Eric Dumazet