Message ID | 1428927569-98070-1-git-send-email-razamir22@gmail.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 978B2C3CA; Mon, 13 Apr 2015 14:19:35 +0200 (CEST) Received: from localhost.my.domain (84.95.210.61.forward.012.net.il [84.95.210.61]) by dpdk.org (Postfix) with ESMTP id 96C94C3C8 for <dev@dpdk.org>; Mon, 13 Apr 2015 14:19:34 +0200 (CEST) Received: from localhost.my.domain (localhost [127.0.0.1]) by localhost.my.domain (8.14.9/8.14.9) with ESMTP id t3DCJVc3098109 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 13 Apr 2015 15:19:31 +0300 (IDT) (envelope-from root@localhost.my.domain) Received: (from root@localhost) by localhost.my.domain (8.14.9/8.14.9/Submit) id t3DCJVkh098108; Mon, 13 Apr 2015 15:19:31 +0300 (IDT) (envelope-from root) From: Raz Amir <razamir22@gmail.com> To: dev@dpdk.org Date: Mon, 13 Apr 2015 15:19:29 +0300 Message-Id: <1428927569-98070-1-git-send-email-razamir22@gmail.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1428450303-97954-1-git-send-email-razamir22@gmail.com> References: <1428450303-97954-1-git-send-email-razamir22@gmail.com> Cc: Raz Amir <razamir22@gmail.com> Subject: [dpdk-dev] [PATCH v3] Restore support for virtio on FreeBSD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Raz Amir
April 13, 2015, 12:19 p.m. UTC
Fixes: 8a312224bcde ("eal/bsd: fix fd leak")
Signed-off-by: Raz Amir <razamir22@gmail.com>
---
lib/librte_eal/bsdapp/eal/eal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Please provide more information in the commit message. We need to know what was the problem (crash) in the git history. Then when doing git blame, we'll have the full explanation. 2015-04-13 15:19, Raz Amir: > Fixes: 8a312224bcde ("eal/bsd: fix fd leak") > > Signed-off-by: Raz Amir <razamir22@gmail.com> > --- > lib/librte_eal/bsdapp/eal/eal.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c > index 871d5f4..e20f915 100644 > --- a/lib/librte_eal/bsdapp/eal/eal.c > +++ b/lib/librte_eal/bsdapp/eal/eal.c > @@ -426,7 +426,7 @@ rte_eal_iopl_init(void) > fd = open("/dev/io", O_RDWR); > if (fd < 0) > return -1; > - close(fd); > + /* keep fd open for iopl */ Yes we need a comment but "for iopl" is not descriptive and not very accurate as iopl is a Linux mechanism. > return 0; > } Thanks
Hi > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon > Sent: Monday, April 13, 2015 8:55 PM > To: Raz Amir > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v3] Restore support for virtio on FreeBSD > > Please provide more information in the commit message. > We need to know what was the problem (crash) in the git history. > Then when doing git blame, we'll have the full explanation. > > 2015-04-13 15:19, Raz Amir: > > Fixes: 8a312224bcde ("eal/bsd: fix fd leak") > > > > Signed-off-by: Raz Amir <razamir22@gmail.com> > > --- > > lib/librte_eal/bsdapp/eal/eal.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/lib/librte_eal/bsdapp/eal/eal.c > > b/lib/librte_eal/bsdapp/eal/eal.c index 871d5f4..e20f915 100644 > > --- a/lib/librte_eal/bsdapp/eal/eal.c > > +++ b/lib/librte_eal/bsdapp/eal/eal.c > > @@ -426,7 +426,7 @@ rte_eal_iopl_init(void) > > fd = open("/dev/io", O_RDWR); > > if (fd < 0) > > return -1; > > - close(fd); > > + /* keep fd open for iopl */ Copy and paste my comment into this new patch: Would you pls think about this solution? Declare a static var to keep the fd which is opened for freebsd; Then define a deinit function for virtio device, Inside the deinit function, close the fd which was opened in init stage. Done. thanks Changchun
Thomas, I will add more information to the commit message, but regarding your feedback on the iopl comment, it is called also iopl on FreeBSD. See this link to FreeBSD source code, for the io driver code - the flag name is PSL_IOPL: https://github.com/freebsd/freebsd/blob/master/sys/i386/i386/io.c#L38 Ouyang, I will implement your suggestion in the next patch version I submit. -----Original Message----- From: Ouyang, Changchun [mailto:changchun.ouyang@intel.com] Sent: 14 April 2015 05:33 To: Thomas Monjalon; Raz Amir Cc: dev@dpdk.org; Ouyang, Changchun Subject: RE: [dpdk-dev] [PATCH v3] Restore support for virtio on FreeBSD Hi > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon > Sent: Monday, April 13, 2015 8:55 PM > To: Raz Amir > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v3] Restore support for virtio on > FreeBSD > > Please provide more information in the commit message. > We need to know what was the problem (crash) in the git history. > Then when doing git blame, we'll have the full explanation. > > 2015-04-13 15:19, Raz Amir: > > Fixes: 8a312224bcde ("eal/bsd: fix fd leak") > > > > Signed-off-by: Raz Amir <razamir22@gmail.com> > > --- > > lib/librte_eal/bsdapp/eal/eal.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/lib/librte_eal/bsdapp/eal/eal.c > > b/lib/librte_eal/bsdapp/eal/eal.c index 871d5f4..e20f915 100644 > > --- a/lib/librte_eal/bsdapp/eal/eal.c > > +++ b/lib/librte_eal/bsdapp/eal/eal.c > > @@ -426,7 +426,7 @@ rte_eal_iopl_init(void) > > fd = open("/dev/io", O_RDWR); > > if (fd < 0) > > return -1; > > - close(fd); > > + /* keep fd open for iopl */ Copy and paste my comment into this new patch: Would you pls think about this solution? Declare a static var to keep the fd which is opened for freebsd; Then define a deinit function for virtio device, Inside the deinit function, close the fd which was opened in init stage. Done. thanks Changchun
diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index 871d5f4..e20f915 100644 --- a/lib/librte_eal/bsdapp/eal/eal.c +++ b/lib/librte_eal/bsdapp/eal/eal.c @@ -426,7 +426,7 @@ rte_eal_iopl_init(void) fd = open("/dev/io", O_RDWR); if (fd < 0) return -1; - close(fd); + /* keep fd open for iopl */ return 0; }