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 64C42A0C4B; Mon, 8 Nov 2021 22:52:10 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E4B6D40DF7; Mon, 8 Nov 2021 22:52:09 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id AE42440040 for ; Mon, 8 Nov 2021 22:52:07 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10162"; a="232279284" X-IronPort-AV: E=Sophos;i="5.87,218,1631602800"; d="scan'208";a="232279284" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2021 13:52:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,218,1631602800"; d="scan'208";a="544859482" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga008.fm.intel.com with ESMTP; 08 Nov 2021 13:52:03 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 8 Nov 2021 13:52:03 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 8 Nov 2021 13:52:02 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 8 Nov 2021 13:52:02 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.44) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 8 Nov 2021 13:52:02 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PTJO4/ydUJ4zNkuZDYPs1pL2mosFSxIdcChfyL4OK6YtmEMtdEjWPr22cbyaXa3827uuihLi/zSxF81sXgenHj80uopg9OiybsgQQ7AcIKF3qb/ePov/2N5Aq51HQehU72duG1/F5tSlioUrxv9JMo+VSiXNkQjvtCSRG4UGBzlgZdN/qckYYscRV47j2ELtJ/9zRjaYJXR13D37W/YHsG0qZH1Ce3XMhU61gj60vh4LnlFgN2vlYNJtQGs+K4MTUJIgOImjqja96qLKrlsFHeN1PZWkHgB8og4KNlAqPi6yh9D8Ir0Z+OacOXYjLSdc5ZTL1b8Oe0JFgv6xRGxAvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=z9lrYPLu/03dYU129rtS/naXF+EjpOT2SRXxfh6S47g=; b=lA//ODnrEi/hQVdXAQxffWfdkurNthkRxWv+PNDg0uvQH9ZOQpvVmsPRn3txxWShEpL0hHd73Rzm3uMZoFXOcvtFVaeUZPVDcQIwFSv4FpxyEnVhG3c+hfs6M0YzQFuh6IQzlgoz87qs7jMvRmHZ97ZHll+3VaQyCMLh3K36aZ1afnHmWHRlYdEa+CpVOznNl9wZXSYq1GjsSCn0zddTuxl5uZ3yuit2O4NkzlcHA90u4dxLNjrO0/+B2WaDwktZFIow7o/qP034OYjT+SdIIPN+deX+cL+Z3sWadDZ4hTMCIAxHq1pXR+z4mFffDqV4hjitbvWgldmDTi2dRcvwmQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z9lrYPLu/03dYU129rtS/naXF+EjpOT2SRXxfh6S47g=; b=K6rfqO1nt0xrJsanaHrfMjcwEFoM3ZVkJt1U/3BGWZd6bGuHBYWJqbfSFkb5lLzDevjurw+DV9kLo5bVM9gO+TxSbnUxqwNQR95bnUk2e2XaiY90HOFY45hCkPSoglUpgqx7iqX36t2RlUXYPGhuzyZdpxl8VKMghla/w0XiaqE= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB5191.namprd11.prod.outlook.com (2603:10b6:510:3e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Mon, 8 Nov 2021 21:52:01 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c%7]) with mapi id 15.20.4669.016; Mon, 8 Nov 2021 21:52:01 +0000 Message-ID: <917842ba-54e5-5d5c-dc87-f13ab4ced903@intel.com> Date: Mon, 8 Nov 2021 21:51:56 +0000 Content-Language: en-US To: Apeksha Gupta , "david.marchand@redhat.com" , "andrew.rybchenko@oktetlabs.ru" CC: "dev@dpdk.org" , Sachin Saxena , Hemant Agrawal References: <20211021044700.12370-2-apeksha.gupta@nxp.com> <20211103192045.22240-1-apeksha.gupta@nxp.com> <20211103192045.22240-3-apeksha.gupta@nxp.com> From: Ferruh Yigit X-User: ferruhy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P123CA0093.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:139::8) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 Received: from [192.168.0.206] (37.228.236.146) by LO2P123CA0093.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:139::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Mon, 8 Nov 2021 21:51:59 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6f5ce7d2-aa0e-47da-203e-08d9a301fe9b X-MS-TrafficTypeDiagnostic: PH0PR11MB5191: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5C3LE9F/WG8Pld+CT8HvkpkpnDAuqvGlukvtELfwEdC5n/QE3UDX41dUyFUFdXJkvZawurt3KOuoHAPT50Q79I9PW3Ssauum75Yq1eD+jWmR8QEuRYvoPjpGNTC+YjJcIAgU9iRxX75CKvLBVlV7KKo9BhKCd6C3fgzC+A+9zRD5SZy7pD5MVFR6E23apR7uF7zPuP9gWB+cs4D4glXMeCGZK/Is6LmBhckGPY0G2ule53pOXygQKW4sTZhlC4EQ4FNOK3EmCmLQYUZYYhsTEE071LZk5CPrvaIV7sirZrbTUjKipGipaiBCFRRXNo29lc6CYb+OE7Vr5XbgBs9buc/njxay4teK0i0skX2JU4bFS2MViof88rmmUqF40ov9B2owexnhxvehByjJ1igoBQl2UXgXNWvsCRpWFrtiJ4qcCqbNXMBK3n7Lrh7jEzdaMT1piLB3+FmDR7awvhK2G0p+cAMnNaMjoULOJnnYN4vCZ8rqWXEQZsv5Z92NN8hPJ8h9+ORrvVtPOKtH3pWQPT+RyDN2RJXZegb5hY7WS1kndkzOydrtUcQZE7YO2C3vOGOFVk6NhsoraW1c2mzv6Tr7HT2uT1Cohk3V24A5Ssmiy/NZIzzEANWOFCh+fQENsve9CAE71v3IrfYxDnMn6sMWewmnUqrf3HJHjlmhi0hSdamSARvjKxeDkAhR9fmMU2SV96H4M4hjoUpG/4KFRw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(36756003)(66556008)(26005)(6486002)(66476007)(8676002)(66946007)(110136005)(5660300002)(83380400001)(16576012)(316002)(186003)(82960400001)(4326008)(54906003)(53546011)(2906002)(38100700002)(508600001)(31686004)(44832011)(956004)(31696002)(6666004)(2616005)(8936002)(86362001)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VUxOV0pEZlhZSmZmTWQ5bjBLczVMc3NEN3ZQQVVXRW8vaXF3TUdWaGJhbFBt?= =?utf-8?B?RDRyZTZHU0RnVGlFTHZQVjRXVFdpTmVUOEVJakpmN1Fxb0FvT1pHT0xlVlNM?= =?utf-8?B?ZjJyQ3JDN1FNdWdwOFlmQStHNlFFbCttWFBMbHV5U3g3aGFYcUJYdVBweitP?= =?utf-8?B?bGh2b0g1SGJGNnBpalk1OWNKZDUxWmgzQmlCY3J5dkQwQmJGRXlKb1RHSit3?= =?utf-8?B?WDNsR3hOZUVneEhJNEFoalB4TCtHL215bml5RnNhNXh0VEZvdTJvVTR1YXlh?= =?utf-8?B?RzIvOENOZnhDRHVJV1pWcWlnanNTNW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?= =?utf-8?B?Kzg3emMrdkxGdG5TOVlhQWQ5TWFYN0J0ckNoSXpoYXVaMExOUVY0OWxoWXlT?= =?utf-8?Q?cxJjjwzhLdS/kwivAKVQSUg=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 6f5ce7d2-aa0e-47da-203e-08d9a301fe9b X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2021 21:52:01.5502 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CQ2MTYQoa/PuPujSeMzfOK0luTId/bs/5NwQckWMbNlBCKd/jS8ApqCSnLzNx5+OdmW0/q3ZGETHyR9P0NduVg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5191 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [EXT] Re: [PATCH v7 2/5] net/enetfec: add UIO support 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 Sender: "dev" On 11/8/2021 8:24 PM, Apeksha Gupta wrote: > > >> -----Original Message----- >> From: Ferruh Yigit >> Sent: Thursday, November 4, 2021 11:56 PM >> To: Apeksha Gupta ; david.marchand@redhat.com; >> andrew.rybchenko@oktetlabs.ru >> Cc: dev@dpdk.org; Sachin Saxena ; Hemant Agrawal >> >> Subject: [EXT] Re: [PATCH v7 2/5] net/enetfec: add UIO support >> >> Caution: EXT Email >> >> On 11/3/2021 7:20 PM, Apeksha Gupta wrote: >>> Implemented the fec-uio driver in kernel. enetfec PMD uses >>> UIO interface to interact with "fec-uio" driver implemented in >>> kernel for PHY initialisation and for mapping the allocated memory >>> of register & BD from kernel to DPDK which gives access to >>> non-cacheable memory for BD. >>> >>> Signed-off-by: Sachin Saxena >>> Signed-off-by: Apeksha Gupta >>> --- >>> drivers/net/enetfec/enet_ethdev.c | 227 ++++++++++++++++++++++++ >>> drivers/net/enetfec/enet_ethdev.h | 14 ++ >>> drivers/net/enetfec/enet_regs.h | 106 ++++++++++++ >>> drivers/net/enetfec/enet_uio.c | 278 ++++++++++++++++++++++++++++++ >>> drivers/net/enetfec/enet_uio.h | 64 +++++++ >>> drivers/net/enetfec/meson.build | 3 +- >>> 6 files changed, 691 insertions(+), 1 deletion(-) >>> create mode 100644 drivers/net/enetfec/enet_regs.h >>> create mode 100644 drivers/net/enetfec/enet_uio.c >>> create mode 100644 drivers/net/enetfec/enet_uio.h >>> >>> diff --git a/drivers/net/enetfec/enet_ethdev.c >> b/drivers/net/enetfec/enet_ethdev.c >>> index a6c4bcbf2e..410c395039 100644 >>> --- a/drivers/net/enetfec/enet_ethdev.c >>> +++ b/drivers/net/enetfec/enet_ethdev.c >>> @@ -13,16 +13,212 @@ >>> #include >>> #include >>> #include >>> +#include >>> #include "enet_pmd_logs.h" >>> #include "enet_ethdev.h" >>> +#include "enet_regs.h" >>> +#include "enet_uio.h" >>> >>> #define ENETFEC_NAME_PMD net_enetfec >>> #define ENETFEC_CDEV_INVALID_FD -1 >>> +#define BIT(nr) (1u << (nr)) >> >> We already have 'RTE_BIT32' macro, it can be used instead of defining >> a new macro. > [Apeksha] sure, we will use RTE_BIT32 macro. > >> >>> + >>> +/* FEC receive acceleration */ >>> +#define ENETFEC_RACC_IPDIS BIT(1) >>> +#define ENETFEC_RACC_PRODIS BIT(2) >>> +#define ENETFEC_RACC_SHIFT16 BIT(7) >>> +#define ENETFEC_RACC_OPTIONS (ENETFEC_RACC_IPDIS | \ >>> + ENETFEC_RACC_PRODIS) >>> + >>> +#define ENETFEC_PAUSE_FLAG_AUTONEG 0x1 >>> +#define ENETFEC_PAUSE_FLAG_ENABLE 0x2 >>> + >>> +/* Pause frame field and FIFO threshold */ >>> +#define ENETFEC_FCE BIT(5) >>> +#define ENETFEC_RSEM_V 0x84 >>> +#define ENETFEC_RSFL_V 16 >>> +#define ENETFEC_RAEM_V 0x8 >>> +#define ENETFEC_RAFL_V 0x8 >>> +#define ENETFEC_OPD_V 0xFFF0 >>> + >>> +#define NUM_OF_BD_QUEUES 6 >>> + >>> +static uint32_t enetfec_e_cntl; >>> + >> >> Again, question on the usage of this global variable in previous version >> is not answered, let me copy/paste here: >> >> >> Is this global variable really needed, most of the times what you need is >> per port varible. >> For example I can see this variable is updated based on port start/stop, >> what if you have multiple ports and they are different start/stop state, >> will the value of variable still be correct? > [Apeksha] This driver is implemented for IMX8MM board which has only one port. > So implemented accordingly. We will check when multiple ports supported. > If only a single port is supported, isn't it even easier to have this variable as device specific data, instead of global variable. You can have it as part of 'struct enetfec_private'.