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 8333DA0C47; Wed, 27 Oct 2021 16:22:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 427BB40DDA; Wed, 27 Oct 2021 16:22:13 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 03CA1407FF for ; Wed, 27 Oct 2021 16:22:11 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10150"; a="293631507" X-IronPort-AV: E=Sophos;i="5.87,186,1631602800"; d="scan'208";a="293631507" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2021 07:22:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,186,1631602800"; d="scan'208";a="597376682" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga004.jf.intel.com with ESMTP; 27 Oct 2021 07:22:08 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 27 Oct 2021 07:22:07 -0700 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; Wed, 27 Oct 2021 07:22:07 -0700 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; Wed, 27 Oct 2021 07:22:07 -0700 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.49) 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; Wed, 27 Oct 2021 07:22:05 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZqHXqYVSgxn8OeWAre3H0ZJ4BaCYu5sbUnLueqSbt8Ja6WE6GVx2PLfKVpEEgcTOHvYEldRzqmpieSJE1Fi+wJvFQbLoz2ONs9KUQRP3x+9cpAGQfmCdnqRTUrpUR/pWljkA9iNpC+M4Q6BG9FqIfiAKM2PHo1XyGfFXArkV667/mGaS78nWnzOuzTlvjM4FPJ3293dGa32BZr+NTAN73IccX5bTZDJPf3cASm5Wgoqak1CNcnHdMJC0NztA4we7fWFkwElHQiz0x1MaAgR6LtsNjQ4UmnkP5xTDV55xRygTVht7YgppzJo6XNvxdW5CQwgGSWP5GKZVj5E2SnbPuQ== 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=oHQy5wNXLPhnB9AkFtLYgOdCD1K85SLFPFz5LR5cGyI=; b=c6haUwAG1Uj/S82RFOccyFGX/MlspCkIHKtqSZhqEYiD2/BFxsJZT2Hh30716xb8yeASPMXin6onB0q8xv115N8dljWvEkc80T8LdWyh3LCaqqb82jIQGCCQDf4n3iOLDKmkstvW0hMvUUkipRqdUpVEUHz+RMh13y24WnXeDXhLttQVKPILFaZPV5wqaxBahFuj+P5g8Vm8RabpYHvmRFne2486zCNptYBqgj2JZZhNhhWoV/LMFwVSxIJd3DPOrMhZghdzeQLOqPxPtZ109niyFJVo31IyzdDidDP+8AtM+EuDmCrS3hH01rDpsZtFx2g8w/r9lgi366Rpfm1Ylg== 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=oHQy5wNXLPhnB9AkFtLYgOdCD1K85SLFPFz5LR5cGyI=; b=ygA3tow5pIZOxDNMTovOnzx8KA228Gyr4dwPUP4pzB0HNsmVDZjTm/XMffAWArQBThXnw43+HEMpDxWsXcyudVU6qn5mpzXcR3A8Iku3OTgEM7x1qGMRacZ5ENBornKh2S/qNJe4bk/NpwP53GZdmfrrvo6q/Sc9vkfX6Eu0Yyg= 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 PH0PR11MB4934.namprd11.prod.outlook.com (2603:10b6:510:30::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Wed, 27 Oct 2021 14:22:04 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c%6]) with mapi id 15.20.4628.020; Wed, 27 Oct 2021 14:22:04 +0000 Message-ID: Date: Wed, 27 Oct 2021 15:21:58 +0100 Content-Language: en-US To: Apeksha Gupta , , , CC: , , References: <20211019184003.23128-2-apeksha.gupta@nxp.com> <20211021044700.12370-1-apeksha.gupta@nxp.com> <20211021044700.12370-3-apeksha.gupta@nxp.com> From: Ferruh Yigit X-User: ferruhy In-Reply-To: <20211021044700.12370-3-apeksha.gupta@nxp.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DU2PR04CA0290.eurprd04.prod.outlook.com (2603:10a6:10:28c::25) 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 DU2PR04CA0290.eurprd04.prod.outlook.com (2603:10a6:10:28c::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.18 via Frontend Transport; Wed, 27 Oct 2021 14:22:03 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: feb9fb90-2a53-4134-5faf-08d999552674 X-MS-TrafficTypeDiagnostic: PH0PR11MB4934: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1PAxQIAbCd+I6xKn5CukJnkpG/lGX+MWTVW1w7XtEouDfQQIv+8y1d0cL30GAdqLC09qFj7gocKj8b7Wc9BhCGgiygVj+4KVgojrZuL2s5d/50bfu18xRe9hkdpvxsauRryh/v8ixqAor3Zl/uX8lAw/x/vTKCB0Phw1UJX78REo65wFep2k0aT/5tcEXUWZI+yq610VaHa+pQO4pKl5QMtmBvpKK68EhOMjRnct2yPzLn09K+lSeMxOzVWvsT1XNzt86o7yRlGa5/Y4/V5jZRG6Z0VaklaIiHSy2YZDw/Ehv55iTX0COc20BOu0QuQRyUo5L4fBRL0sXeQ064clJTUwqUrZ7X+AgPN/ksCOZ226ZEOOeOZLu3eFVkZpcTAoZMDWhMJ6gkwaVbooLLPzssg55SgkoG3N6PUPJ6EZIjAtOut3jzJRflvH45KevDDY6B2RAT+6W3PE8z/nM2L3LZL7cTVEXS27xROb0RkcIZely/69HWqL05HOdUbNbvw/+caGBcPNXlTK7iVkYx3pyAojkIDf81639vtleEw8waH7FjsHhgYJfRFuTo1VBwf3Gp0JU8gp0yVcTvImTmxy34P4HeJlw2UkVb2rNLDRA6c5z2Vd5mCFAGepvZmP9w97kjsUhNWP1MDa/1PiZT3KUiY2DWi5Oa9nNJjpP1i47LPkcUMMTog8xFrSCrmLy/mgEtMVdvNQAwAyCBQNY//ILg== 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)(8936002)(2906002)(44832011)(5660300002)(66556008)(8676002)(16576012)(316002)(6486002)(38100700002)(186003)(83380400001)(4326008)(36756003)(6666004)(66946007)(66476007)(82960400001)(86362001)(31696002)(508600001)(26005)(53546011)(2616005)(31686004)(956004)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WEdzVkNKTXhGamkrbFp3anFLRjVFMmZ1VG5LaER4aitIakQ4aWovV3U3c1g0?= =?utf-8?B?YkZXT0R4cm9PanF5RVEvdDl2c2xZM2ZrcFVxY2xHZVVEekQ2RklzZHNTdW5n?= =?utf-8?B?U0JSQnN0TTFHMGYvRVgwTllnTjlkeFBqWEVEaUVPOFFTR2dmaWpWSlcyYjVL?= =?utf-8?B?WktaMUxPR1FpeXZJL1FzN2ZKTUFBNldZS1lxUVEwdjlWN1V5TnYwRk11TVRi?= =?utf-8?B?cjJ3UWdJa0toSVRGRVN4SHdieHkzVkxHaWJFOUlFMUdNM09sTFcra2ZzNS80?= =?utf-8?B?ejJraFZwUmE1aXpKcGlaTStYNERBSyswanhKZTVwQ1FkSS9ZWTJiNW5tQTBw?= =?utf-8?B?VzRkVVdlYUJaQlVCM2FHZFBvMVVIdXlkOTg5czNJSEp4b1lVT1hCd3F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8?Q?897Fj0UI/CuULXlcb2wibQw=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: feb9fb90-2a53-4134-5faf-08d999552674 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2021 14:22:04.8366 (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: Sf11nWX2rHBJeCHC3RD7rTBonXmKxiCSu0aaE9hXAIy/ZxfATzW5lVDphSKnlefEQR3rKcQyNn2+TmMdRa1Z/g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4934 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v6 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 10/21/2021 5:46 AM, 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 <...> > + > +#define NUM_OF_QUEUES 6 I guess this is number of BD queues, may be good to have it in macro name. > + > +uint32_t e_cntl; > + 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? And if it will be global, can you please make it 'static' and prefix driver namespace to it? > +/* > + * This function is called to start or restart the ENETFEC during a link > + * change, transmit timeout, or to reconfigure the ENETFEC. The network > + * packet processing for this device must be stopped before this call. > + */ > +static void > +enetfec_restart(struct rte_eth_dev *dev) > +{ > + struct enetfec_private *fep = dev->data->dev_private; > + uint32_t temp_mac[2]; > + uint32_t rcntl = OPT_FRAME_SIZE | 0x04; > + uint32_t ecntl = ENETFEC_ETHEREN; > + > + /* default mac address */ > + struct rte_ether_addr addr = { > + .addr_bytes = {0x1, 0x2, 0x3, 0x4, 0x5, 0x6} }; > + uint32_t val; > + > + /* > + * enet-mac reset will reset mac address registers too, > + * so need to reconfigure it. > + */ > + memcpy(&temp_mac, addr.addr_bytes, ETH_ALEN); > + rte_write32(rte_cpu_to_be_32(temp_mac[0]), > + (uint8_t *)fep->hw_baseaddr_v + ENETFEC_PALR); > + rte_write32(rte_cpu_to_be_32(temp_mac[1]), > + (uint8_t *)fep->hw_baseaddr_v + ENETFEC_PAUR); > + Is same MAC address used for all ports? Also probe sets a different MAC address, which one is valid? <...> > + > +static int > +enetfec_eth_start(struct rte_eth_dev *dev) > +{ > + enetfec_restart(dev); > + > + return 0; > +} Empty line is missing between two functions. > +/* ENETFEC enable function. > + * @param[in] base ENETFEC base address > + */ > +void > +enetfec_enable(void *base) > +{ > + rte_write32(rte_read32((uint8_t *)base + ENETFEC_ECR) | e_cntl, > + (uint8_t *)base + ENETFEC_ECR); > +} > + > +/* ENETFEC disable function. > + * @param[in] base ENETFEC base address > + */ > +void > +enetfec_disable(void *base) > +{ > + rte_write32(rte_read32((uint8_t *)base + ENETFEC_ECR) & ~e_cntl, > + (uint8_t *)base + ENETFEC_ECR); > +} > + Are these 'enetfec_enable()'/'enetfec_disable()' functions used out of this file, if not why not make them static, and remove definition in header file? > +static int > +enetfec_eth_stop(__rte_unused struct rte_eth_dev *dev) 'dev' is used, so can drop '__rte_unused'. > +{ > + struct enetfec_private *fep = dev->data->dev_private; > + > + dev->data->dev_started = 0; > + enetfec_disable(fep->hw_baseaddr_v); > + > + return 0; > +} <...>