From: Thomas Monjalon <thomas@monjalon.net>
To: Stefan Baranoff <sbaranoff@gmail.com>
Cc: dev@dpdk.org, Ferruh Yigit <ferruh.yigit@intel.com>
Subject: Re: [dpdk-dev] Fwd: Memory Leak: PCAP TX to File
Date: Thu, 26 Oct 2017 23:56:20 +0200 [thread overview]
Message-ID: <1528417.6K8LKux9Ci@xps> (raw)
In-Reply-To: <CAHzKxpbykU5YfUbdkjt6s7N9a0d_4tpQJij0ek-yh-TNfVPqSA@mail.gmail.com>
Cc Ferruh, maintainer of this driver.
26/10/2017 19:44, Stefan Baranoff:
> All,
>
> I think I've found a (very minor) memory leak in writing to a PCAP file. In
> drivers/net/pcap/rte_eth_pcap.c in open_single_tx_pcap around line 405 a
> pcap_t is allocated by pcap_open_dead but is never freed.
>
> I see two obvious fixes:
> 1) Free the pcap_t immediately after either on pcap_dump_open success or
> failure
> 2) Set the pcap_t pointer internals->tx_queue[i]->tx->pcap so when the
> eth_dev_stop callback happens the pcap_t is freed.
>
> I believe the first is safe but am not a libpcap guru. Can someone please
> confirm this?
Do not hesitate to send a patch, even if you are not sure.
You can annotate your patch to discuss your hesitations.
We are a patch-driven community :)
next prev parent reply other threads:[~2017-10-26 21:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAHzKxpb-d-naP+qJdG6DGa84z+DfcLSJkorH5K-j_+ebquOrDQ@mail.gmail.com>
2017-10-26 17:44 ` Stefan Baranoff
2017-10-26 21:56 ` Thomas Monjalon [this message]
2017-10-27 0:24 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1528417.6K8LKux9Ci@xps \
--to=thomas@monjalon.net \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=sbaranoff@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).