From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22533C43381 for ; Thu, 28 Mar 2019 11:37:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E54032075E for ; Thu, 28 Mar 2019 11:37:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727149AbfC1LhJ (ORCPT ); Thu, 28 Mar 2019 07:37:09 -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