From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5C463A04BF; Thu, 3 Sep 2020 21:55:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 54AC11BEAF; Thu, 3 Sep 2020 21:55:22 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 23B92DE0 for ; Thu, 3 Sep 2020 21:55:19 +0200 (CEST) IronPort-SDR: W1OsNmoPkLzo4aG9+5hhh72v85Pw0E14k9aSw0q4KN1D4EECVaxnwPbuc5Z3GO+PfNP1DqELiZ xq8SAlgTe7fA== X-IronPort-AV: E=McAfee;i="6000,8403,9733"; a="145348681" X-IronPort-AV: E=Sophos;i="5.76,387,1592895600"; d="scan'208";a="145348681" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2020 12:55:18 -0700 IronPort-SDR: pBOplmhcZ2Qa2jsxGAzSrTVqFCgt/QL1JAI3eZpbBDeWm32XAOQKBRmEF+PvH///6vs8MjtSau 6zX15foYXQNQ== X-IronPort-AV: E=Sophos;i="5.76,387,1592895600"; d="scan'208";a="478182844" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.213.213.44]) ([10.213.213.44]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2020 12:55:11 -0700 To: Hemant Agrawal , "dev@dpdk.org" References: <20200813180121.19480-1-hemant.agrawal@nxp.com> <20200901123650.29908-1-hemant.agrawal@nxp.com> <8916eb53-52a1-b042-41e5-df58778bc9f1@intel.com> From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@intel.com; prefer-encrypt=mutual; keydata=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6d4uCcUT0l/OEtPG/rA1lxz8ctdFB VOQOxCvwRG2QCgcJ/UTn5vlivul+cThi6ERPvjqjblLncQtRg8izj2qgmwQkvfj+h7Ex88bI 8iWtu5+I3K3LmNz/UxHBSWEmUnkg4fJlRr7oItHsZ0ia6wWQ8lQnABEBAAGJAjwEGAEKACYC GwwWIQTSNlOHQi7ChOOZgcf5M+tD3xNhHwUCXqFrngUJCKxSYAAKCRD5M+tD3xNhH3YWD/9b cUiWaHJasX+OpiuZ1Li5GG3m9aw4lR/k2lET0UPRer2Jy1JsL+uqzdkxGvPqzFTBXgx/6Byz EMa2mt6R9BCyR286s3lxVS5Bgr5JGB3EkpPcoJT3A7QOYMV95jBiiJTy78Qdzi5LrIu4tW6H o0MWUjpjdbR01cnj6EagKrDx9kAsqQTfvz4ff5JIFyKSKEHQMaz1YGHyCWhsTwqONhs0G7V2 0taQS1bGiaWND0dIBJ/u0pU998XZhmMzn765H+/MqXsyDXwoHv1rcaX/kcZIcN3sLUVcbdxA WHXOktGTQemQfEpCNuf2jeeJlp8sHmAQmV3dLS1R49h0q7hH4qOPEIvXjQebJGs5W7s2vxbA 5u5nLujmMkkfg1XHsds0u7Zdp2n200VC4GQf8vsUp6CSMgjedHeF9zKv1W4lYXpHp576ZV7T GgsEsvveAE1xvHnpV9d7ZehPuZfYlP4qgo2iutA1c0AXZLn5LPcDBgZ+KQZTzm05RU1gkx7n gL9CdTzVrYFy7Y5R+TrE9HFUnsaXaGsJwOB/emByGPQEKrupz8CZFi9pkqPuAPwjN6Wonokv ChAewHXPUadcJmCTj78Oeg9uXR6yjpxyFjx3vdijQIYgi5TEGpeTQBymLANOYxYWYOjXk+ae dYuOYKR9nbPv+2zK9pwwQ2NXbUBystaGyQ== Message-ID: <193b6cfd-4b40-2fb0-2c53-b1700e0ae0d0@intel.com> Date: Thu, 3 Sep 2020 20:54:46 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v6 1/8] net/dpaa: add support for fmlib in dpdk X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 9/3/2020 4:24 AM, Hemant Agrawal wrote: > Hi Ferruh, > >> -----Original Message----- >> From: Ferruh Yigit >> Sent: Wednesday, September 2, 2020 7:02 PM >>>> On 9/1/2020 1:36 PM, Hemant Agrawal wrote: >>>>> DPAA platorm MAC interface is known as FMAN i.e. Frame Manager. >>>>> There are two ways to control it. >>>>> 1. Statically configure the queues and classification rules before >>>>> the start of the application using FMC tool. >>>>> 2. Dynamically configure it within application by making API calls >>>>> of fmlib. >>>>> >>>>> The fmlib or Frame Manager library provides an API on top of the >>>>> Frame Manager driver ioctl calls, that provides a user space >>>>> application with a simple way to configure driver parameters and PCD >>>>> (parse - classify - distribute) rules. >>>>> >>>>> This patch integrates the base fmlib so that various queue config, >>>>> RSS and classification related features can be supported on DPAA >> platform. >>>>> >>>>> Signed-off-by: Sachin Saxena >>>>> Signed-off-by: Hemant Agrawal >>>>> --- >>>>> doc/guides/nics/dpaa.rst | 52 +- >>>>> doc/guides/platform/dpaa.rst | 21 +- >>>>> drivers/net/dpaa/fmlib/dpaa_integration.h | 50 + >>>>> drivers/net/dpaa/fmlib/fm_ext.h | 463 ++ >>>>> drivers/net/dpaa/fmlib/fm_lib.c | 561 ++ >>>>> drivers/net/dpaa/fmlib/fm_pcd_ext.h | 5787 >>>> +++++++++++++++++++++ >>>>> drivers/net/dpaa/fmlib/fm_port_ext.h | 3350 ++++++++++++ >>>>> drivers/net/dpaa/fmlib/ncsw_ext.h | 158 + >>>>> drivers/net/dpaa/fmlib/net_ext.h | 411 ++ >>>>> drivers/net/dpaa/meson.build | 3 +- >>>>> 10 files changed, 10849 insertions(+), 7 deletions(-) create mode >>>>> 100644 drivers/net/dpaa/fmlib/dpaa_integration.h >>>>> create mode 100644 drivers/net/dpaa/fmlib/fm_ext.h create mode >>>>> 100644 drivers/net/dpaa/fmlib/fm_lib.c create mode 100644 >>>>> drivers/net/dpaa/fmlib/fm_pcd_ext.h >>>>> create mode 100644 drivers/net/dpaa/fmlib/fm_port_ext.h >>>>> create mode 100644 drivers/net/dpaa/fmlib/ncsw_ext.h create mode >>>>> 100644 drivers/net/dpaa/fmlib/net_ext.h >>>>> >>>>> diff --git a/doc/guides/nics/dpaa.rst b/doc/guides/nics/dpaa.rst >>>>> index >>>>> 17839a920..7e6010471 100644 >>>>> --- a/doc/guides/nics/dpaa.rst >>>>> +++ b/doc/guides/nics/dpaa.rst >>>>> @@ -1,5 +1,5 @@ >>>>> .. SPDX-License-Identifier: BSD-3-Clause >>>>> - Copyright 2017 NXP >>>>> + Copyright 2017,2020 NXP >>>>> >>>>> >>>>> DPAA Poll Mode Driver >>>>> @@ -21,6 +21,7 @@ Contents summary >>>>> >>>>> - DPAA overview >>>>> - DPAA driver architecture overview >>>>> +- FMAN configuration tools and library >>>>> >>>>> .. _dpaa_overview: >>>>> >>>>> @@ -285,6 +286,55 @@ for details. >>>>> Done >>>>> testpmd> >>>>> >>>>> +FMAN Config >>>>> +----------- >>>>> + >>>>> +Frame Manager is also responsible for parser, classify and >>>>> +distribute functionality in the DPAA. >>>>> + >>>>> + FMAN supports: >>>>> + Packet parsing at wire speed. It supports standard protocols parsing >> and >>>>> + identification by HW >>>> (VLAN/IP/UDP/TCP/SCTP/PPPoE/PPP/MPLS/GRE/IPSec). >>>>> + It supports non-standard UDF header parsing for custom protocols. >>>>> + Classification / Distribution: Coarse classification based on >>>>> + Key >>>> generation >>>>> + Hash and exact match lookup >>>>> + >>>>> +FMC - FMAN Configuration Tool >>>>> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>>> + This tool is available in User Space. The tool is used to configure FMAN >>>>> + Physical (MAC) or Ephemeral (OH)ports for Parse/Classify/distribute. >>>>> + The PCDs can be hash based where a set of fields are key input for >> hash >>>>> + generation within FMAN keygen. The hash value is used to >>>>> +generate a >>>> FQID for >>>>> + frame. There is a provision to setup exact match lookup too where >> field >>>>> + values within a packet drives corresponding FQID. >>>>> + Currently it works on XML file inputs. >>>>> + >>>>> + Limitations: >>>>> + 1.For Dynamic Configuration change, currently no support is available. >>>>> + E.g. enable/disable a port, a operator (set of VLANs and associate >> rules). >>>>> + >>>>> + 2.During FMC configuration, port for which policy is being configured >> is >>>>> + brought down and the policy is flushed on port before new policy >>>>> + is >>>> updated >>>>> + for the port. Support is required to add/append/delete etc. >>>>> + >>>>> + 3.FMC, being a separate user-space application, needs to be >>>>> + invoked >>>> from >>>>> + Shell. >>>>> + >>>>> + >>>>> + The details can be found in FMC Doc at: >>>>> + `Frame Mnager Configuration Tool >>>> >> >>> w.nxp.com%2Fdocs%2Fen%2Fapplication- >>>> >> note%2FAN4760.pdf&data=02%7C01%7Chemant.agrawal%40nxp.com% >>>> >> 7Cdb7eda614491479976c508d84e8e8c42%7C686ea1d3bc2b4c6fa92cd99c5c30 >>>> >> 1635%7C0%7C1%7C637345721434145756&sdata=ynJeLWqw0hPTya5IRt >>>> GviovNA7mAGIZ8k3XSFcZyLP4%3D&reserved=0>`_. >>>>> + >>>>> +FMLIB >>>>> +~~~~~ >>>>> + The Frame Manager library provides an API on top of the Frame >>>> Manager driver >>>>> + ioctl calls, that provides a user space application with a simple way to >>>>> + configure driver parameters and PCD (parse - classify - distribute) >> rules. >>>>> + >>>>> + This is an alternate to the FMC based configuration. This libray >> provides >>>>> + direct ioctl based interfaces for FMAN configuration as used by >>>>> + the FMC >>>> tool >>>>> + as well. This helps in overcoming the main limitaiton of FMC - i.e. lack >>>>> + of dynamic configuration. >>>>> + >>>>> Limitations >>>>> ----------- >>>>> >>>>> diff --git a/doc/guides/platform/dpaa.rst >>>>> b/doc/guides/platform/dpaa.rst index 6005f2221..20a0e3932 100644 >>>>> --- a/doc/guides/platform/dpaa.rst >>>>> +++ b/doc/guides/platform/dpaa.rst >>>>> @@ -58,17 +58,28 @@ compatible board: >>>>> >>>>> 4. **FMC Tool** >>>>> >>>>> - Before any DPDK application can be executed, the Frame Manager >>>> Configuration >>>>> - Tool (FMC) need to be executed to set the configurations of the >> queues. >>>> This >>>>> + If one is planning to use more than 1 Recv queue and hardware >>>> capability to >>>>> + parse, classify and distribute the packets, the Frame Manager >>>> Configuration >>>>> + Tool (FMC) need to be executed to set the configurations of the >>>>> + queues >>>> before >>>>> + running the DPAA based DPDK application. This setting is persistent, >> the >>>>> + configuration will remain in the hardware till it is >>>>> + re-configured. This >>>>> includes the queue state, RSS and other policies. >>>>> This tool can be obtained from `NXP (Freescale) Public Git >>>>> Repository >>>> >> >>> ur >>>> ce.codeaurora.org%2Fexternal%2Fqoriq%2Fqoriq- >>>> >> components%2Ffmc&data=02%7C01%7Chemant.agrawal%40nxp.com% >>>> >> 7Cdb7eda614491479976c508d84e8e8c42%7C686ea1d3bc2b4c6fa92cd99c5c30 >>>> >> 1635%7C0%7C1%7C637345721434145756&sdata=pwOJGxY%2BGTkcpdk >>>> O%2BKwoVejywmOeGsWbudo9OPSDqPU%3D&reserved=0>`_. >>>>> >>>>> This tool needs configuration files which are available in the >>>>> :ref:`DPDK Extra Scripts `, described below for >>>>> DPDK >>>> usages. >>>>> >>>>> -As an alternative method, DPAA PMD can also be executed using >>>>> images provided -as part of SDK from NXP. The SDK includes all the >>>>> above prerequisites necessary -to bring up a DPAA board. >>>>> + Note that DPAA PMD can also be executed using images provided >>>>> + as part of SDK from NXP. The SDK includes all the above prerequisites >>>>> + necessary (i.e. fmc tool) to bring up a DPAA board. >>>>> + >>>>> + As an alternate method, DPAA PMDs starting from DPDK 20.11 also >>>> support the >>>>> + fmlib library integration. The driver will detect about any existing FMC >>>>> + based config (if /tmp/fmc.bin is present). DPAA FMD will be used >>>>> + only if >>>> no >>>>> + previous fmc config is existing. >>>>> + >>>>> + Note that fmlib based integratin rely on underlying fmd driver in >> kernel, >>>>> + which is available as part of NXP kernel or NXP SDK. >>>> >>>> Hi Hemant, >>>> >>>> Thanks for the documentation. >>>> >>>> Can it be possible to give a little more detail related to the 'fmd' >>>> module, like its folder etc.. >>>> >>>> Another thing is with current patch 'dpaa' driver becomes completely >>>> dependent to the 'fmd' kernel module [1] and PMD won't run without >>>> it, was the dependency always there indirectly? >>> >>> [Hemant] I thought, I was clear in my documentation. >>> " This libray provides direct ioctl based interfaces for FMAN configuration as >> used by the FMC tool as well" >>> FMD always exist in the kernel for DPAA. At present FMC is using it via >> IOCTL calls and FMC is indepdent tools with limitations for DPDK. >>> Now, we have directly used those ioctl calls via fmlib in DPDK. >>> >>>> And does it make sense to support no 'fmd' kernel module case, as >>>> done previously? >>> [Hemant] FMD is already part of DPAA supported kernels. >> >> >> OK, so what I understand is 'fmd' module was already an indirect >> dependency and there is no point to support 'dpaa' for no 'fmd' available >> case. >> >> Can you just give the location of the 'fmd' module, in case someone would >> like to check the corresponding code for an ioctl call, it may help. > > [Hemant] Thanks for the suggestion. > Yes, I will do that in next version. > > FYI - the location is as follows: > https://source.codeaurora.org/external/qoriq/qoriq-components/linux/tree/drivers/net/ethernet/freescale/sdk_fman?h=linux-4.19-rt > > Please let me know if you have any more comments on the patch. > Rest looks good to me, thanks. Only there are below checkpatch warnings, if you will send new version can you please check them too: ### net/dpaa: add support for fmlib in dpdk WARNING:TYPO_SPELLING: 'libray' may be misspelled - perhaps 'library'? #91: FILE: doc/guides/nics/dpaa.rst:333: + This is an alternate to the FMC based configuration. This libray provides WARNING:REPEATED_WORD: Possible repeated word: 'default' #1627: FILE: drivers/net/dpaa/fmlib/fm_pcd_ext.h:393: + * By default default values are 0. WARNING:REPEATED_WORD: Possible repeated word: 'if' #3785: FILE: drivers/net/dpaa/fmlib/fm_pcd_ext.h:2551: + /**< 0-7, Relevant only if if update_type = WARNING:REPEATED_WORD: Possible repeated word: 'default' #5498: FILE: drivers/net/dpaa/fmlib/fm_pcd_ext.h:4264: + * By default default values are 0.