From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id CCC8AC3E8 for ; Wed, 24 Jun 2015 18:16:43 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 24 Jun 2015 09:16:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,672,1427785200"; d="scan'208";a="752489476" Received: from unknown ([10.217.248.46]) by orsmga002.jf.intel.com with SMTP; 24 Jun 2015 09:16:38 -0700 Received: by (sSMTP sendmail emulation); Wed, 24 Jun 2015 18:15:33 +0200 From: Daniel Mrzyglod To: dev@dpdk.org Date: Wed, 24 Jun 2015 18:15:30 +0200 Message-Id: <1435162530-9272-1-git-send-email-danielx.t.mrzyglod@intel.com> X-Mailer: git-send-email 2.1.4 Subject: [dpdk-dev] [PATCH] cfgfile: Fix for Reading Files on nfs filesystem. 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: Wed, 24 Jun 2015 16:16:44 -0000 The problem occure when we have config files on NFS filesystem. Solution with minimal change to library is to add buffer for I/O operations. Without buffering there is 3-10% of faulty Reading from NFS. The problem seems to be only NFS filesystem. Signed-off-by: Daniel Mrzyglod --- lib/librte_cfgfile/rte_cfgfile.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/librte_cfgfile/rte_cfgfile.c b/lib/librte_cfgfile/rte_cfgfile.c index b81c273..6105e0c 100644 --- a/lib/librte_cfgfile/rte_cfgfile.c +++ b/lib/librte_cfgfile/rte_cfgfile.c @@ -93,10 +93,13 @@ rte_cfgfile_load(const char *filename, int flags) int curr_section = -1; int curr_entry = -1; char buffer[256]; + char f_streambuff[BUFSIZ]; int lineno = 0; struct rte_cfgfile *cfg = NULL; + memset(f_streambuff,'\0',BUFSIZ); FILE *f = fopen(filename, "r"); + setbuf( f, f_streambuff); if (f == NULL) return NULL; -- 2.1.0