From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: getting warn once around skb_try_coalesce Date: Tue, 10 Jul 2012 13:22:08 +0200 Message-ID: <1341919328.3265.4871.camel@edumazet-glaptop> References: <4FFBFBD2.6030004@mellanox.com> <1341915510.3265.4734.camel@edumazet-glaptop> <1341918848.3265.4853.camel@edumazet-glaptop> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: David Miller , "netdev@vger.kernel.org" , Shlomo Pongratz , Erez Shitrit To: Or Gerlitz Return-path: Received: from mail-ey0-f174.google.com ([209.85.215.174]:64499 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752940Ab2GJLWO (ORCPT ); Tue, 10 Jul 2012 07:22:14 -0400 Received: by eaak11 with SMTP id k11so4642006eaa.19 for ; Tue, 10 Jul 2012 04:22:13 -0700 (PDT) In-Reply-To: <1341918848.3265.4853.camel@edumazet-glaptop> Sender: netdev-owner@vger.kernel.org List-ID: On Tue, 2012-07-10 at 13:14 +0200, Eric Dumazet wrote: > On Tue, 2012-07-10 at 12:18 +0200, Eric Dumazet wrote: > > On Tue, 2012-07-10 at 12:54 +0300, Or Gerlitz wrote: > > > Hi Dave, Eric, > > > > > > Another trace that I see here with net-next is this one-time warning. I > > > get it always > > > on the passive side of TCP, something that seems related to GRO, it > > > happens only with > > > IPoIB, not with mlx4_en and igb (when igb get to work on net-next...) > > > > > > The latest commit in this area is bad43ca8325f493dcaa0896c2f036276af059c7e > > > "net: introduce skb_try_coalesce()" from Eric. > > > > > > Or. > > > > > > -----------[ cut here ]------------ > > > WARNING: at net/core/skbuff.c:3413 skb_try_coalesce+0x1f8/0x31d() > > > > This warning catch skb truesize offenders, most probably its a driver > > issue. > > > > By the way, this driver allocates not enough tailroom in skbs, so IP/TCP > stacks need to reallocate skb head to pull IP/TCP headers. Thats not > efficient. > > I suggest using following patch : And of course we also can fix the truesize bug. (Not sure it will fix the warning, but worth trying) Since this driver allocates a full page, it must use the PAGE_SIZE, not the used part in the fragment diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 5c1bc99..e611a924 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c @@ -123,7 +123,7 @@ static void ipoib_ud_skb_put_frags(struct ipoib_dev_priv *priv, skb_frag_size_set(frag, size); skb->data_len += size; - skb->truesize += size; + skb->truesize += PAGE_SIZE; } else skb_put(skb, length); @@ -159,7 +159,7 @@ static struct sk_buff *ipoib_alloc_rx_skb(struct net_device *dev, int id) u64 *mapping; if (ipoib_ud_need_sg(priv->max_ib_mtu)) - buf_size = IPOIB_UD_HEAD_SIZE; + buf_size = IPOIB_UD_HEAD_SIZE + 128; /* reserve some tailroom for IP/TCP headers */ else buf_size = IPOIB_UD_BUF_SIZE(priv->max_ib_mtu);