DPDK patches and discussions
 help / color / mirror / Atom feed
From: "张 杨" <zypscode@outlook.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: [dpdk-dev] 回复: [PATCH] driver/net/pcap fix: pcap fd leak
Date: Fri, 26 Feb 2021 17:47:01 +0000	[thread overview]
Message-ID: <ME3P282MB16687D9CFA3559DC23C77A72DC9D9@ME3P282MB1668.AUSP282.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <ea17570d-2041-5837-2f91-6d1e650adf2d@intel.com>

I think your idea is fine

What do you think just record file path in "pmd_pcap_probe()",
Perform an open operation only in "eth_dev_start()"?

When the secondary process add pcap vdev,
it send the request to primary process,
the primary process probe pcap vdev too ,
Both the two process open the same file (in function "pmd_pcap_probe()")
It's not necessary

I prefer "ZhangTengfei <zypscode@outlook.com>" sign (this one)


发送自 Windows 10 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>应用

发件人: Ferruh Yigit<mailto:ferruh.yigit@intel.com>
发送时间: 2021年2月27日 0:46
收件人: ZhangTengfei<mailto:zypscode@outlook.com>
抄送: dev@dpdk.org<mailto:dev@dpdk.org>
主题: Re: [PATCH] driver/net/pcap fix: pcap fd leak

On 2/26/2021 4:20 PM, ZhangTengfei wrote:
> pcap fd was opend when vdev probed,
> but not closed when vdev removed.
> This bug appears in dpdk-pdump
>
> Signed-off-by: ZhangTengfei <zypscode@outlook.com>
> ---
>   drivers/net/pcap/rte_eth_pcap.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
> index 90f5d75ea..fb01ea924 100644
> --- a/drivers/net/pcap/rte_eth_pcap.c
> +++ b/drivers/net/pcap/rte_eth_pcap.c
> @@ -1597,6 +1597,7 @@ pmd_pcap_remove(struct rte_vdev_device *dev)
>        if (eth_dev == NULL)
>                return 0; /* port already released */
>
> +     eth_dev_stop(eth_dev);
>        eth_dev_close(eth_dev);
>        rte_eth_dev_release_port(eth_dev);
>
>

Thanks for the fix,
the cleanup seems missing in 'eth_dev_close()' too, what do you think moving
'eth_dev_stop(eth_dev);' inside the 'eth_dev_close()'?
So both 'close' and 'remove' will be covered.


Btw, you have same patch with both "ZhangTengfei <zhangtengfei@oppo.com>" sign
and "ZhangTengfei <zypscode@outlook.com>" sign (this one), can you please
clarify which one do you prefer?



  reply	other threads:[~2021-02-26 17:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-26 16:20 [dpdk-dev] " ZhangTengfei
2021-02-26 16:46 ` Ferruh Yigit
2021-02-26 17:47   ` 张 杨 [this message]
2021-03-01 11:40     ` [dpdk-dev] 回复: " Ferruh Yigit
2021-03-01 15:18       ` Tengfei Zhang

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=ME3P282MB16687D9CFA3559DC23C77A72DC9D9@ME3P282MB1668.AUSP282.PROD.OUTLOOK.COM \
    --to=zypscode@outlook.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.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).