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 778B3A052A for ; Mon, 25 Jan 2021 11:07:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 47221140E19; Mon, 25 Jan 2021 11:07:33 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id E0D6F140E19; Mon, 25 Jan 2021 11:07:30 +0100 (CET) IronPort-SDR: Inp/8lQOzXtyEuopfMkS0Hkr9IGGU+CFU7QGUDv4EW/oAZiU/zRseg4GkY74+wVQyNG8o2qKAd mthAaQjJioJw== X-IronPort-AV: E=McAfee;i="6000,8403,9874"; a="241235505" X-IronPort-AV: E=Sophos;i="5.79,373,1602572400"; d="scan'208";a="241235505" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2021 02:07:29 -0800 IronPort-SDR: 6lE3Bklb/UlN0fNvyfClNtScysgP40kXL56GNsNBVdJPHSBdgC9ll/nC5hHWm1E0Ujz48LDKbU CRRXGvcCxL9Q== X-IronPort-AV: E=Sophos;i="5.79,373,1602572400"; d="scan'208";a="361414348" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.243.89]) ([10.213.243.89]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2021 02:07:27 -0800 To: "Huang, Wei" , "dev@dpdk.org" , "Xu, Rosen" , "Zhang, Qi Z" Cc: "stable@dpdk.org" , "Zhang, Tianfei" References: <1611209014-4031-1-git-send-email-wei.huang@intel.com> <1611209014-4031-4-git-send-email-wei.huang@intel.com> <316da5c8-657e-6856-7e22-7e7642188acb@intel.com> From: Ferruh Yigit Message-ID: Date: Mon, 25 Jan 2021 10:07:24 +0000 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v11 3/4] raw/ifpga: add OPAE API for OpenStack Cyborg 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/22/2021 2:43 AM, Huang, Wei wrote: >> -----Original Message----- >> From: Ferruh Yigit >> Sent: Friday, January 22, 2021 00:30 >> To: Huang, Wei ; dev@dpdk.org; Xu, Rosen ; Zhang, Qi Z >> Cc: stable@dpdk.org; Zhang, Tianfei >> Subject: Re: [dpdk-dev] [PATCH v11 3/4] raw/ifpga: add OPAE API for OpenStack Cyborg >> >> On 1/21/2021 6:03 AM, Wei Huang wrote: >>> Cyborg is an OpenStack project that aims to provide a general purpose >>> management framework for acceleration resources (i.e. various types of >>> accelerators such as GPU, FPGA, NP, ODP, DPDK/SPDK and so on). >>> It needs some OPAE type APIs to manage PACs (Programmable Acceleration >>> Card) with Intel FPGA. Below major functions are added to meets Cyborg >>> requirements. >>> 1. opae_init() set up OPAE environment. >>> 2. opae_cleanup() clean up OPAE 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 (do reconfiguration). >>> >>> Signed-off-by: Wei Huang >>> Acked-by: Tianfei Zhang >>> Acked-by: Rosen Xu >> >> <...> >> >>> + >>> +RTE_INIT(init_api_env) >>> +{ >>> +eal_inited = 0; >>> +opae_log_level = OPAE_LOG_ERR; >>> +opae_log_file = NULL; >>> +ifpga_rawdev_logtype = 0; >>> + >>> +opae_log_info("API environment is initialized\n"); } >>> + >>> +RTE_FINI(clean_api_env) >>> +{ >>> +if (opae_log_file) { >>> +fclose(opae_log_file); >>> +opae_log_file = NULL; >>> +} >>> +opae_log_info("API environment is cleaned\n"); } >>> + >> >> There are called in constructor and destructor, which means all DPDK applications have this PMD compiled will run above and print some log, is this really what we want here? >> Is there a way to limit the initialize to the PMD context, like 'probe()' etc? >> > > Hi Ferruh, > > These log information will not be output for the default log level is OPAE_LOG_ERR, they are output only when log level is set to OPAE_LOG_INFO. I can remove them if you think it's necessary. > Although they don't output because of default log level, I think it is wrong that they run for _all_ dpdk applications, I still think it should run for the scope of the driver, not for all dpdk applications. > All these opae_xxx functions will check the input PCI address is valid or not, and the rawdev PMD will also filter input PCI device ID. I think it's enough to prevent these function to be misused. > > Thanks, > Wei