From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id EEF7FFFA for ; Tue, 14 Apr 2015 04:32:53 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 13 Apr 2015 19:32:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,573,1422950400"; d="scan'208";a="555550640" Received: from pgsmsx104.gar.corp.intel.com ([10.221.44.91]) by orsmga003.jf.intel.com with ESMTP; 13 Apr 2015 19:32:52 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by PGSMSX104.gar.corp.intel.com (10.221.44.91) with Microsoft SMTP Server (TLS) id 14.3.224.2; Tue, 14 Apr 2015 10:32:36 +0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.223]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.80]) with mapi id 14.03.0224.002; Tue, 14 Apr 2015 10:32:34 +0800 From: "Ouyang, Changchun" To: Thomas Monjalon , Raz Amir Thread-Topic: [dpdk-dev] [PATCH v3] Restore support for virtio on FreeBSD Thread-Index: AQHQdeQniuMVZ1NL+UC7cb0cjdQ3M51KYCAAgAFp5TA= Date: Tue, 14 Apr 2015 02:32:34 +0000 Message-ID: References: <1428450303-97954-1-git-send-email-razamir22@gmail.com> <1428927569-98070-1-git-send-email-razamir22@gmail.com> <2279951.2s8DnS74SK@xps13> In-Reply-To: <2279951.2s8DnS74SK@xps13> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2015 02:32:54 -0000 Hi=20 > -----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 >=20 > 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. >=20 > 2015-04-13 15:19, Raz Amir: > > Fixes: 8a312224bcde ("eal/bsd: fix fd leak") > > > > Signed-off-by: Raz Amir > > --- > > 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 =3D 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