From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f180.google.com (mail-qk0-f180.google.com [209.85.220.180]) by dpdk.org (Postfix) with ESMTP id B3FE16932 for ; Tue, 20 Sep 2016 13:16:49 +0200 (CEST) Received: by mail-qk0-f180.google.com with SMTP id t7so11291237qkh.2 for ; Tue, 20 Sep 2016 04:16:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightcyber-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=fC6WT4RBq8aL6GlRlvKW2M2KXZ0vCPZCdanF31BaIDI=; b=ybhX8/Jf3JjQlE3VatQcXnz8uodPNdP73TtroTNxJhyDbY6kymqfQXRDCE3tSCyO4p +txrt+4lD/8GwXiZXQKMuRt1JJLoXJw7iNEKYc6igvcZoATXhrwoldga98K5V/VsLyU2 gHVY85WtZrbPTmbu/jYiAuqzF8QlxWsVtH2MiumnPG2H5ldhpndpgnf8k8wW/vDx82Z9 btFtR2fs/XEt5KRzsD2Z+3hYG1Pe1ar2wiDOPHfskjmElViaPnqCpMITQ38RiA420zGv GZN3MpEmY+5IPcW8VyLifSXQZRXyMFAp3VwrBOkxPUe0zig5w9Sm8EFTYPrD0D77d3cB cIDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=fC6WT4RBq8aL6GlRlvKW2M2KXZ0vCPZCdanF31BaIDI=; b=Sjze3IVTXCY68mxRFYjmDylZL3xBRCdUET4NVcEiZOEi2j8TJrHXidFvksv4AsxDRt baR+LoxcD/LIx2BHjRKJIaVRle+CK37waDymvQGwjuPdXXgit4O4Z59JyDiUOIJosI38 DH2kqM1YemtUEvtSp7FGpzltUYpmBWUtbzLTcDk8300tEoK3KbLmRuBwDmpb1OTJsYVe tqDVASumjIKkZwwihGreE8SinHhQtnQ/f9xnsUQUzpWh3yzDNgVZUrxxNemsxV7l7wfr YsCxiFdZZh+1atWUsDIY/VdTFvm2YVylAouohpjz7Aayc4Vw7++fJ85n85mF6eumh05C Si9w== X-Gm-Message-State: AE9vXwNjejc1sT5Ku1IXaLtkMdZ2lT2ueugeGqCLZOfPSvTaBrQMeL8ylsxROdriswdDATK7lc0UmpK9cc/hQg== X-Received: by 10.55.212.10 with SMTP id l10mr34976815qki.268.1474370209210; Tue, 20 Sep 2016 04:16:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.101.21 with HTTP; Tue, 20 Sep 2016 04:16:48 -0700 (PDT) In-Reply-To: <20160920105829.GU23158@yliu-dev.sh.intel.com> References: <1474367963-83879-1-git-send-email-dror.birkman@lightcyber.com> <20160920105829.GU23158@yliu-dev.sh.intel.com> From: Dror Birkman Date: Tue, 20 Sep 2016 14:16:48 +0300 Message-ID: To: Yuanhan Liu Cc: Nicolas Pernas Maradei , ferruh.yigit@intel.com, dev@dpdk.org, stable@dpdk.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] pcap: fix memory leak in jumbo frames X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2016 11:16:50 -0000 Cool! Adding fixline: If rte_pktmbuf_alloc() fails on any segment that is not the initial segment, previously allocated mbufs are not freed. Fixes: 6db141c91e1f ("pcap: support jumbo frames") Signed-off-by: Dror Birkman --- drivers/net/pcap/rte_eth_pcap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_ pcap.c index b7a3b03..db19a66 100644 --- a/drivers/net/pcap/rte_eth_pcap.c +++ b/drivers/net/pcap/rte_eth_pcap.c @@ -229,8 +229,10 @@ eth_pcap_rx(void *queue, if (unlikely(eth_pcap_rx_jumbo(pcap_q->mb_pool, mbuf, packet, - header.caplen) == -1)) + header.caplen) == -1)) { + rte_pktmbuf_free(mbuf); break; + } } mbuf->pkt_len = (uint16_t)header.caplen; -- 2.3.0 On Tue, Sep 20, 2016 at 1:58 PM, Yuanhan Liu wrote: > On Tue, Sep 20, 2016 at 01:39:23PM +0300, Dror Birkman wrote: > > If rte_pktmbuf_alloc() fails on any segment that is not the initial > > segment, previously allocated mbufs are not freed. > > You should put a "fixline" here. > > Besides that, I think it's a good candidate for stable branch. Thus, > stable@dpdk.org cc'ed. > > --yliu >