From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 46CDA2A9 for ; Mon, 8 Dec 2014 19:47:42 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 08 Dec 2014 10:46:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,540,1413270000"; d="scan'208";a="650436431" Received: from irsmsx107.ger.corp.intel.com ([163.33.3.99]) by orsmga002.jf.intel.com with ESMTP; 08 Dec 2014 10:47:28 -0800 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.244]) by IRSMSX107.ger.corp.intel.com ([169.254.10.85]) with mapi id 14.03.0195.001; Mon, 8 Dec 2014 18:47:27 +0000 From: "Burakov, Anatoly" To: "Qiu, Michael" , Michael Qiu , "dev@dpdk.org" Thread-Topic: [PATCH v2] VFIO: Avoid to enable vfio while the module not loaded Thread-Index: AQHQEFe5ciA3i4rZ4ka+imWWJV+oY5yGCbgg Date: Mon, 8 Dec 2014 18:47:26 +0000 Message-ID: References: <1417664219-19679-1-git-send-email-michael.qiu@intel.com> <1417687227-21854-1-git-send-email-michael.qiu@intel.com> <533710CFB86FA344BFBF2D6802E60286C9D920@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <533710CFB86FA344BFBF2D6802E60286C9D920@SHSMSX101.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] VFIO: Avoid to enable vfio while the module not loaded 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: Mon, 08 Dec 2014 18:47:42 -0000 Hi Michael > I don't think so, if we check module "vfio", but if given module name is > "vfio_xx", it will also correct if use strncmp. Sorry I missed this the last time. I don't think that is the case. If you d= o strncmp on sizeof(buffer), strncmp will always check 30 bytes. That way i= f you check vfio against vfio_xx, you'll get a mismatch. Of course, replaci= ng fscanf with fgets would be better too, to make sure we never go over our= buffer size when dealing with /proc/modules.=20 Thanks, Anatoly=20