From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from userp2120.oracle.com ([156.151.31.85]:52342 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751486AbeCEPc2 (ORCPT ); Mon, 5 Mar 2018 10:32:28 -0500 Subject: Re: [PATCH net] sch_netem: fix skb leak in netem_enqueue() To: Eric Dumazet , Neil Horman Cc: netdev@vger.kernel.org, David Miller References: <1520014608-512-1-git-send-email-alexey.kodanev@oracle.com> <20180303122047.GA8802@hmswarspite.think-freely.org> <4a06d0d1-6518-c7d0-f947-f427cf3688d4@oracle.com> <1520262818.109662.1.camel@gmail.com> From: Alexey Kodanev Message-ID: <3ed51f47-ff82-f59f-cf1c-22a92eed0585@oracle.com> Date: Mon, 5 Mar 2018 18:40:56 +0300 MIME-Version: 1.0 In-Reply-To: <1520262818.109662.1.camel@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org List-ID: On 03/05/2018 06:13 PM, Eric Dumazet wrote: > On Mon, 2018-03-05 at 15:57 +0300, Alexey Kodanev wrote: >> >> +static inline void __qdisc_drop_all(struct sk_buff *skb, >> +                                   struct sk_buff **to_free) >> +{ >> +       struct sk_buff *first = skb; >> + >> +       while (skb->next) >> +               skb = skb->next; >> + >> +       skb->next = *to_free; >> +       *to_free = first; >> +} > > You probably can leverage what I did for commit bec3cfdca36bf43cfa > ("net: skb_segment() provides list head and tail") > to avoid the iteration. OK, thanks! Will use it and send a new version of the patch. Thanks, Alexey