From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4C0A242A53; Thu, 4 May 2023 01:04:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E2ED04021F; Thu, 4 May 2023 01:04:07 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id B3B6F400EF for ; Thu, 4 May 2023 01:04:06 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id A6588205702E; Wed, 3 May 2023 16:04:05 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A6588205702E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1683155045; bh=OVJ0zbOXZTQUm/mHTnrTxTsJ4Tf1FtzVmB6FGrbNvdY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=j2kAzv3+D02SQdFaRhjdgWOQXjsAPr4dTFrpXCgCsbY43h5q9tPSK/TjRHaVG3wBe dseiaVQvnaWBgQWfixAYKQRDHxGcwv/Z4Rja3EfhHwxq79E51GA8ryPmEmEHdfFavb SoKcq61v9gRlcsGXh9sMDI8ZTb5krCEoN/PqhdiU= Date: Wed, 3 May 2023 16:04:05 -0700 From: Tyler Retzlaff To: Stephen Hemminger Cc: Srikanth Yalavarthi , Anup Prabhu , "dev@dpdk.org" , Shivah Shankar Shankar Narayan Rao , Prince Takkar Subject: Re: [EXT] Re: [PATCH v3] app/mldev: add internal function for file read Message-ID: <20230503230405.GA6191@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20230323152801.27666-1-syalavarthi@marvell.com> <20230503085642.7284-1-syalavarthi@marvell.com> <20230503075408.455ee334@hermes.local> <20230503112826.6450d96a@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230503112826.6450d96a@hermes.local> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Wed, May 03, 2023 at 11:28:26AM -0700, Stephen Hemminger wrote: > On Wed, 3 May 2023 14:59:40 +0000 > Srikanth Yalavarthi wrote: > > > > > > > Granted this is a test program. But why did you ignore my feedback that this > > > is the slowest way to read a file. Stdio requires extra buffering, use regular > > > read() or better yet mmap(). > > > > Agree on the improvement, but, considering that this is a test code and these operations are done in slow-path, I would prefer to have the implementation based on C library calls rather than using system calls. > > > > Also, using system calls may not make this code portable? Though we are not supporting this app on platforms other than Linux, as of now. > > Pls let me know what you think. > > > > I had shared my additional comments on v2 patch. > > Using system calls read/write is used lots of places in DPDK already and is portable > to all the supported platforms. well almost, the windows standard c library implements a subset of POSIX.1 (ISO/IEC 9945-1:1996) and there should be a strong emphasis on `a subset' as in it is not fully conformant to any specific POSIX standard. also because they aren't technically part of the standard C library (again POSIX is not standard C) they are exposed with different names on windows by prepending a leading `_' to the names. so you get `_read' instead of `read' for example. you can force exposure of the non-conforming names (i.e. the POSIX names) with the _CRT_DECLARE_NONSTDC_NAMES define but if you do and you use them you may then get deprecation warnings. anyway, i read above nobody cares if this code ever runs on anything but Linux ~forever so i won't make it my business to comment further unless there is a desire to include windows.