From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH RFC 1/3] eal/bsd: fix fd leak Date: Thu, 25 Sep 2014 12:17:49 +0200 Message-ID: <2401333.1lgWLEPGnW@xps13> References: <1409062300-17004-1-git-send-email-david.marchand@6wind.com> <1409062300-17004-2-git-send-email-david.marchand@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit To: dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <1409062300-17004-2-git-send-email-david.marchand-pdR9zngts4EAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" Hi, Is there any BSD users available to test this patch? I'd like to add this comment in the log: ---- "The initial implementation simply raised the IOPL of the current thread when open(2) was called on the device. This behaviour is retained in the current implementation as legacy support for both i386 and amd64." http://www.freebsd.org/cgi/man.cgi?query=io&sektion=4 Nothing prevents from closing it just after. ---- But it should be tested with virtio to check iopl permissions. Thanks -- Thomas 2014-08-26 16:11, David Marchand: > Signed-off-by: David Marchand > --- > lib/librte_eal/bsdapp/eal/eal.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c > index a296da5..0697b05 100644 > --- a/lib/librte_eal/bsdapp/eal/eal.c > +++ b/lib/librte_eal/bsdapp/eal/eal.c > @@ -810,6 +810,7 @@ rte_eal_iopl_init(void) > fd = open("/dev/io", O_RDWR); > if (fd < 0) > return -1; > + close(fd); > return 0; > }