Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751320AbbG3E00 (ORCPT ); Thu, 30 Jul 2015 00:26:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56283 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750762AbbG3E0Z (ORCPT ); Thu, 30 Jul 2015 00:26:25 -0400 Message-ID: <55B9A76A.3030908@redhat.com> Date: Thu, 30 Jul 2015 12:26:18 +0800 From: Jason Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: "Zhangjie (HZ)" , "linux-kernel@vger.kernel.org" , "mst@redhat.com" CC: Qinchuanyu , Yewudi , liuyongan 00175866 , "netdev@vger.kernel.org" Subject: Re: [Question]Why a skb with frag_list causes BUG_ON in function skb_segment References: <60A73B7A161A82449A7DB7B382BFD1553712AF1C@SZXEMA504-MBS.china.huawei.com> In-Reply-To: <60A73B7A161A82449A7DB7B382BFD1553712AF1C@SZXEMA504-MBS.china.huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1078 Lines: 52 cc netdev for more experts On 07/28/2015 04:53 PM, Zhangjie (HZ) wrote: > > Hi, > > I generate a skb as follows: > > It has a linear data region, 17 frags and the last fragment is in > skb_shinfo(skb)->frag_list. > > Before this skb is sent to driver, dev_hard_start_xmit() will segment > it first(skb has frag_list, > > so we get true from netif_needs_gso()), then the skb is passed to > function skb_segment(). > > Then, BUG_ON() happened. > > while (pos < offset + len) { > > if (i >= nfrags) { > > BUG_ON(skb_headlen(list_skb)); (skbuff.c:3120) > > … > > } > > … > > } > > A skb that has no frags but frag_list also causes BUG_ON(). > > I wonder if skb like follows is legal? Could skb in frag_list have > linear data region? > > > > > > Thanks > > Zhangjie > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/