Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp384278ybb; Thu, 28 Mar 2019 04:39:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwyPztl8lLYz9wIzsCk2HYmy/ukwjWUgmoXF+7bqisYCqSWJY5FiXhtROADMMywdNi5ToaQ X-Received: by 2002:a65:64cf:: with SMTP id t15mr25080612pgv.322.1553773164337; Thu, 28 Mar 2019 04:39:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553773164; cv=none; d=google.com; s=arc-20160816; b=Js/vcrlx+CMqflR6ZyLCZzPSDar3UdvCyOIivpWCdXq739z3XZuKB2GSrnSUZ1bPAv xovr0JagUmIy7DIACu1xuJspAQmb9NTJ8y4TUDtTQv6Ejm64meZxr4zlXSlyuDZ2drtF vm5lNCz2N1HInVKcrPo9V3rA+5Y3oTpE2+EL47jPw9taGGw+fNo5rZQ7sHxdkD6PGH8s hlu0Lo+XJgXlP9DAMnO/saaCFX2VWdA+RDKKaZuMyGspZrCsd1Ap6cjJ7orB38BCD0WI d4cnV7gYRMsULxGQeQpktr+UCffW5QctTTwGLAR1q6dG83wWOMomYtaGI7D/McMKoPtH 67Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=mQsLxkQsv0kpqnz0+A5uB1wAL2RNNqSGYjcLpWFs2H0=; b=xp2Wf2+oO77Rii1S6o+Hv6AOhk/VH//SECd9f+ljt62OeyGOPT42gbrAQ4X68pj2yy MKcsaBN9WWFYhh86MepjHhu5d88PjGLinuv7EiUt9ja6GFrhnbHKueWRXUAOra1z8tpX 4G5PAXexvI0m7j7uVCEcuzKoUdeNox77oHDjSC17hkdC57iC7R7hKnN9PSfPJca9QoI8 WP3Cm8OljI8nOMOo1Ci5b57YVXh53oFoHqFDWwpaeiz/ADqW+cRxTgCRCGgjzDUIHbkM E6smB0s9EcQog0hdwsqKfG1hj61TyADJ0JLL9qZ8zU88v8cUptW7Yel5mBiWCi1gEEiG XyyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o19si2754339pgk.324.2019.03.28.04.39.08; Thu, 28 Mar 2019 04:39:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727139AbfC1LhI (ORCPT + 99 others); Thu, 28 Mar 2019 07:37:08 -0400 Received: from dispatch1-us1.ppe-hosted.com ([67.231.154.164]:42716 "EHLO dispatch1-us1.ppe-hosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725846AbfC1LhI (ORCPT ); Thu, 28 Mar 2019 07:37:08 -0400 X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us4.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id 9EC4514005D; Thu, 28 Mar 2019 11:37:06 +0000 (UTC) Received: from [10.17.20.203] (10.17.20.203) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 28 Mar 2019 04:37:02 -0700 Subject: Re: [BUG] net: core: netif_receive_skb_list() crash on non-standard ptypes forwarding To: Alexander Lobakin CC: "David S. Miller" , Jiri Pirko , Ido Schimmel , Petr Machata , Alexander Duyck , Amritha Nambiar , Li RongQing , , References: <1553767399.1271.1@dlink.ru> From: Edward Cree Message-ID: <61211987-2c8b-12b2-54cc-5ee23e2d0da9@solarflare.com> Date: Thu, 28 Mar 2019 11:37:00 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.0 MIME-Version: 1.0 In-Reply-To: <1553767399.1271.1@dlink.ru> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Language: en-GB X-Originating-IP: [10.17.20.203] X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24516.005 X-TM-AS-Result: No-4.642800-4.000000-10 X-TMASE-MatchedRID: O/y65JfDwwuHYS4ybQtcOomfV7NNMGm+jLOy13Cgb4+qvcIF1TcLYJRd g7qd4xaLUxPAM3J2QaqUTQ2JYQzY25Coy9iDotiwyeVujmXuYYUDA8I31/g84Czt4/lw8JZDmwL 9o7cpIiY6yk8NZVXu3QdQESungOx5hbj+PXOvhgqeAiCmPx4NwFkMvWAuahr8+gD2vYtOFhgqtq 5d3cxkNffvWahKfRU427/NFe37cxnDZQko9hy/+yE22IdsthQJ18Nf8rMGFqCCXjRSiQE7xc4t4 m7TuVnkIPIPLbin6PIHKnq4/yFwyhFXYkCadnGOooBB8uyeEuspZK3gOa9uGmJwouYrZN4qaw+f kLqdalOeqD9WtJkSIw== X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--4.642800-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24516.005 X-MDID: 1553773027-ge7VrjwHTgCl Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/03/2019 10:03, Alexander Lobakin wrote: > Here's a working possible fix for that, not sure if it can break anything > though. > > diff --git a/net/core/dev.c b/net/core/dev.c > index 2b67f2aa59dd..fdcff29df915 100644 > --- a/net/core/dev.c > +++ b/net/core/dev.c > @@ -5014,8 +5014,10 @@ static inline void __netif_receive_skb_list_ptype(struct list_head *head, >     if (pt_prev->list_func != NULL) >         pt_prev->list_func(head, pt_prev, orig_dev); >     else > -        list_for_each_entry_safe(skb, next, head, list) > +        list_for_each_entry_safe(skb, next, head, list) { > +            skb_list_del_init(skb); >             pt_prev->func(skb, skb->dev, pt_prev, orig_dev); > +        } > } > > static void __netif_receive_skb_list_core(struct list_head *head, bool pfmemalloc) > > Maybe you could look into this and find another/better solution (or I could > submit this one if that's pretty enough). That looks like the correct fix to me, go ahead and have a Reviewed-by: Edward Cree > > BTW, great work with netif_receive_skb_list() -- I've got 70 Mbps gain (~15%) > on my setup in comparsion to napi_gro_receive(). Nice! -Ed