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 C14AEA09E4 for ; Thu, 28 Jan 2021 14:34:48 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B3D5940692; Thu, 28 Jan 2021 14:34:48 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 2CC0840395; Thu, 28 Jan 2021 14:34:45 +0100 (CET) IronPort-SDR: 3ICCliQ5IsYdVFPTeOF4Vz28hbDOlVJXMrLj8C7EWu7fSk9CfJY8hxfq10+teeyA942KFRcso1 u6SxYScyLOPw== X-IronPort-AV: E=McAfee;i="6000,8403,9877"; a="176724287" X-IronPort-AV: E=Sophos;i="5.79,382,1602572400"; d="scan'208";a="176724287" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2021 05:34:45 -0800 IronPort-SDR: /St/IpV5BblLRsx2K7Q/G4OneDKO/jH7ES57gxNnnVLjQDw/Q4oJ9wK6P0poms84faZrn3P2RT xWivnzNxYFKQ== X-IronPort-AV: E=Sophos;i="5.79,382,1602572400"; d="scan'208";a="388816538" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.197.127]) ([10.213.197.127]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2021 05:34:43 -0800 To: Wei Huang , dev@dpdk.org, rosen.xu@intel.com, qi.z.zhang@intel.com Cc: stable@dpdk.org, tianfei.zhang@intel.com References: <1611643528-18311-1-git-send-email-wei.huang@intel.com> <1611643528-18311-5-git-send-email-wei.huang@intel.com> From: Ferruh Yigit Message-ID: <39a48ca1-d963-11d3-1738-6aadf7710158@intel.com> Date: Thu, 28 Jan 2021 13:34:42 +0000 MIME-Version: 1.0 In-Reply-To: <1611643528-18311-5-git-send-email-wei.huang@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v12 4/4] examples/ifpga: add example for ifpga opae API X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On 1/26/2021 6:45 AM, Wei Huang wrote: > Below major OPAE APIs are added in this example. > 1. opae_init_eal() set up EAL environment. > 2. opae_cleanup_eal() clean up EAL environment. > 3. opae_enumerate() searches PAC with specific FPGA. > 4. opae_get_property() gets properties of FPGA. > 5. opae_partial_reconfigure() perform partial configuration on FPGA. > 6. opae_get_image_info() gets information of image file. > 7. opae_update_flash() updates FPGA flash with specific image file. > 8. opae_cancel_flash_update() cancel process of FPGA flash update. > 9. opae_probe_device() manually probe specific FPGA with ifpga driver. > 10. opae_remove_device() manually remove specific FPGA from ifpga driver. > 11. opae_bind_driver() binds specific FPGA with specified kernel driver. > 12. opae_unbind_driver() unbinds specific FPGA from kernel driver. > 13. opae_reboot_device() reboots specific FPGA. > > An example application shows how to call above OPAE APIs. > You can test each API by running corresponding command. > A guide is also added to show how to run the example. > > Signed-off-by: Wei Huang > Acked-by: Tianfei Zhang > Acked-by: Rosen Xu > --- > v2: fix coding style issue in commands.c > --- > v3: add guide for running example > --- > v4: fix compilation issue of ifpga.rst > --- > v5: add ifpga.rst into sample_app_ug/index.rst > --- > v6: implement OPAE APIs in example instead of ifpga rawdev > --- > MAINTAINERS | 1 + > doc/guides/sample_app_ug/ifpga.rst | 433 +++++++ > doc/guides/sample_app_ug/index.rst | 1 + > examples/ifpga/Makefile | 45 + > examples/ifpga/commands.c | 1321 ++++++++++++++++++++ > examples/ifpga/commands.h | 16 + > examples/ifpga/main.c | 38 + > examples/ifpga/meson.build | 20 + > examples/ifpga/opae_api.c | 1788 ++++++++++++++++++++++++++++ > examples/ifpga/opae_api.h | 245 ++++ > 10 files changed, 3908 insertions(+) > create mode 100644 doc/guides/sample_app_ug/ifpga.rst > create mode 100644 examples/ifpga/Makefile > create mode 100644 examples/ifpga/commands.c > create mode 100644 examples/ifpga/commands.h > create mode 100644 examples/ifpga/main.c > create mode 100644 examples/ifpga/meson.build > create mode 100644 examples/ifpga/opae_api.c > create mode 100644 examples/ifpga/opae_api.h > > diff --git a/MAINTAINERS b/MAINTAINERS > index eafe9f8c4..04a8fdebb 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -1237,6 +1237,7 @@ M: Tianfei zhang > T: git://dpdk.org/next/dpdk-next-net-intel > F: drivers/raw/ifpga/ > F: doc/guides/rawdevs/ifpga.rst > +F: doc/guides/sample_app_ug/ifpga.rst The new example also needs to be added to the maintainers file. > > IOAT Rawdev > M: Bruce Richardson > diff --git a/doc/guides/sample_app_ug/ifpga.rst b/doc/guides/sample_app_ug/ifpga.rst > new file mode 100644 > index 000000000..adcac3bdf > --- /dev/null > +++ b/doc/guides/sample_app_ug/ifpga.rst > @@ -0,0 +1,433 @@ > +.. SPDX-License-Identifier: BSD-3-Clause > + Copyright(c) 2020-2021 Intel Corporation. > + > +Intel FPGA Sample Application > +============================= > + > +The Intel FPGA sample application is an example of how to use OPAE API to manage > +Intel FPGA. > + Can you please explain more what is "OPAE API" in documentation, provide links if possible. > +Overview > +-------- > + > +The Intel FPGA sample application is a simple application that demonstrates > +the use of the OPAE API provided by ifpga driver in the DPDK. > +This application is a readline-like interface that can be used to manage > +Intel FPGA, in a Linux* application environment. > + > +Compiling the Application > +------------------------- > + > +To compile the sample application see :doc:`compiling` > + > +The application is located in the ``ifpga`` sub-directory. > + > +Running the Application > +----------------------- > + > +To run the application in linux environment, issue the following command: > + > +.. code-block:: console > + > + $ .//examples/dpdk-ifpga --proc-type=auto > + > +Refer to the *DPDK Getting Started Guide* for general information on running > +applications and the Environment Abstraction Layer (EAL) options. > + > +Explanation > +----------- > + > +The following sections provide some explanation of the code. > + > +EAL Initialization and cmdline Start > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > + > +The first task is the initialization of the Environment Abstraction Layer (EAL). > +This is achieved as follows: > + > +.. code-block:: c > + > + int main(int argc, char **argv) > + { > + ret = opae_init_eal(argc, argv); > + if (ret < 0) > + rte_panic("Cannot init EAL\n"); > + Adding code to the documentation will be heachache to maintain, and it will be wrong by time as people update the code but not documentation. I highly suggest removing code snippets from the documentation.