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 787BCA00C3; Wed, 19 Jan 2022 18:05:25 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1AEC341180; Wed, 19 Jan 2022 18:05:25 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id C3A214117D for ; Wed, 19 Jan 2022 18:05:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642611923; x=1674147923; h=message-id:date:to:cc:references:from:subject: in-reply-to:content-transfer-encoding:mime-version; bh=aBXPhJoEAs4XxHoRiNwDEtHbdUwLw8FG8mH8Y3qIjbs=; b=FYZKmEA2YfJE+7plC154NjjummQ4ObghpM/nudq7ZxK+2UrjRcQ7/Ou8 iw5TOcM/W9DySEG10Ei/z7np8gx/9ExzxAeecR+Pn2yIaZM9xxH51ig35 n4D17SpMPNEcyjGjnaRWVD5zZPc+SPKSNzGLZKTNpb5AHXQ2lgCuF6Ga4 +VhM1H21UWWFz/5QalTfLtDTkA3bjoeUCb/THx5Y9WIVIurnDvY/U68vt wxJkAlx1qngpEnwA0JPmH3cB+9Su3W7mnHzaOQaPTCXAYYxq8vpolFo8X GJOSn1ElFw+1rwYWJRBtQCO0T2y+0Lu7LXQdiTs7LIS07BhRt4k78gkV2 w==; X-IronPort-AV: E=McAfee;i="6200,9189,10231"; a="232479205" X-IronPort-AV: E=Sophos;i="5.88,299,1635231600"; d="scan'208";a="232479205" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2022 09:05:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,299,1635231600"; d="scan'208";a="532373028" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga008.jf.intel.com with ESMTP; 19 Jan 2022 09:05:21 -0800 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) 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.2308.20; Wed, 19 Jan 2022 09:05:20 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Wed, 19 Jan 2022 09:05:20 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.103) 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.2308.20; Wed, 19 Jan 2022 09:05:20 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AvEQtApaWhQg1gQKvRr9fOIvQAE/t6PaGD/5C7vYV/PBGwvMLgBsogGnet3zUfwXqB986Gl7PZQviBelkP9LC3rsgN+oWnTX0hmZh0XKEOIt/wzrND76FG2L2VzcsvdueDT4o0mBnv04VJFyqvQ+Hf/MSTF0d69AmFyZNX0kTzse/SOmEY1yx4ev04MmmT8cKvRlexn1C2fzmljOeQZQhGakdn+D9zJqnu7joDciSztQfwmvGSywn7lVLO6DY6dAHS1lnsJ3T0Zy5/XxeKaloe9n34Yu7LJR+BLgW2a2EC33Sj3Ym+VCG5r8Ks4Gcq+MCqaiw1dZqEkjEJIHUVpuNA== 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=dc1OnG/S5CwY9sbZyyJNVWHL6XfgV9RBmOq5vbqUIZo=; b=iAFt2qHK/ybAptvBZv5rIxxUMyIPktOe3+JqCaCI4epvphf7XxMYjggIWL47H7llRa3Y6fBS5YaLNcbp3uW8y1UPpFhCSqDests1FmfsSs+nZ+3A3Uv4urAwL51sXd8ur/qwxzWTP0opXZnnCkTuLTWPISd52lp0WPiUi7dldKko4Ay8Pa5+R1fSQ5JAfCBGh3ZKiCT2gFceCdVqqChVB+g7Yqgr5QM1JON3L8fQqGm0vOIHW8e5jBEUbuOBkmy3zAH34V3UkELbm2TGruBlc4RarN1z2sc0l/umpj4iezJoIwEQzmWrtL4Mh/d2vnBcUUzJgSEnb7yS7X8aihtcKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by DM5PR11MB1931.namprd11.prod.outlook.com (2603:10b6:3:10c::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.12; Wed, 19 Jan 2022 17:05:19 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::5046:8550:928d:850e]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::5046:8550:928d:850e%7]) with mapi id 15.20.4909.008; Wed, 19 Jan 2022 17:05:19 +0000 Message-ID: Date: Wed, 19 Jan 2022 17:05:14 +0000 Content-Language: en-US To: Yanling Song , CC: , , , , References: <6c3420e1bf7371550c9e450675b5dc55591a7164.1640838702.git.songyl@ramaxel.com> From: Ferruh Yigit Subject: Re: [PATCH v6 02/26] net/spnic: initialize the HW interface X-User: ferruhy In-Reply-To: <6c3420e1bf7371550c9e450675b5dc55591a7164.1640838702.git.songyl@ramaxel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0037.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:152::6) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1a8ba6b7-9abd-4034-60f2-08d9db6ddf10 X-MS-TrafficTypeDiagnostic: DM5PR11MB1931:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nlCvXA2ZzbEPehGq1Nkgtyrl8CAzgq/9ZpHKDvho4/7ljDX81dzroTpvFuwPk73n6gsUTQ5/bw1FZuy8qEre4bVggXxIzTiVIDPqZzOvM8iAILGSaVJ9+Hop3fWSQ0XbDY99ngSdJHn/vLM3EyrRTXUOm5k39DyAsPDqo+iA6YFLvV/eGpvuRhbLVM4HSseg6vbrW6DcFzG2HkuqFupIpKFtivjGOp1vrKnjMfeFKqHmfPF8l7NzLSDtiVg0rPuuz+in8P1J3rgj9E8afqdeBw8MqUyeg7EaJB1C+o4bUiFkCkZdBD1KHT/JGhrjnfGzP65JYeeFCISBK2F9uylL/qb45vnf5dd4mXBw+zJOC7tJyj2V/PkQy8myZ+5/MlFBdgsa3igTxxbFI9HjiKjlbTDsfImN36aGFdCbN1UGOUGqWFcYLZAEBnfKz9QvTZ0vZu/00T0huvMa8LYl5AyePFnqy/h8afoOS1YI1EYt9OUHD2aYf7Y1M541tBY8/D5rOBc9QhIGMnQV+1vOldncP4iCpfXYSLyTbZZHsMzqmJAo9znQZbuIr3UVMPPiJR2XGbBLa/QctmdKDG7tu4TgzhsfuyfNJcUqTu1Hx2SZll3ARB4iarhg1oRKk839qkpEiXOc+0JOebn5lL6fTgYIUg+JynT6ORZPSYZhLvdv2vmUIU1q2nci3+ZTQIGHlxx3JX5VD3HnTzwJqP36ktSFZw== 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)(44832011)(316002)(8936002)(26005)(186003)(4326008)(83380400001)(6486002)(82960400001)(86362001)(36756003)(66476007)(2616005)(38100700002)(5660300002)(31696002)(6666004)(6506007)(66556008)(6512007)(66946007)(8676002)(53546011)(508600001)(31686004)(2906002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VEpBL0tlN2J3Q2RNN0FVdlExcFJHMXptaFB5MVI1VEpoa0Z6aXc1dlF6V1VL?= =?utf-8?B?U0lNMTNEaGRCMUUyRE1KTWlVVE0rWkZGVXkxb3Q5cXZ2cnRPcXRsWHVhK205?= =?utf-8?B?bUVjMUxETTFOa3BWcTJMVFR4djM4RnNpRytPWndqNFI2SjNJWGVWMmdJcE5R?= =?utf-8?B?SWRzRGxEYjdNaG5WZEc3RkRjc0MxMHBHTXlxektONjhQL1pVbXpWTjVwS0Jm?= =?utf-8?B?K0dwa0xwZExLZ01pWXVzQTNLS0JwbU5Dc2tOcitKTjdGRVU0L1FodmpmVmQ0?= =?utf-8?B?eDFzTVl5YVVBS2lnWlNPK1U4bFJJNkl1RVpwYzRoYm8vYWJYdUdxVzVBdSti?= =?utf-8?B?ZGV3R2hvUldqYmpuc1c2dlVUa2dNWDZVR0FWK042UDltUjVWTXdKendzY2ZE?= =?utf-8?B?RVI5Ti9tRFJpekNYZTlQV1k4dklFcE9Wdnk0a0dja2lBa1owaGNsWXVXYURo?= =?utf-8?B?RWJPTHg4QzgwNEV5Q1hYR200WEJvZVZWSFZJTkZ3c2RVWHVWczRhNVNMV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JMWhDK1dKQ3JaeHk1dm8rd0JwQStu?= =?utf-8?B?YU9aN29DV09XRWc2ZjI1VmZqTS9lVUw2Ti95OUxSRGVMeVFRNlZ5Q3pOVHdn?= =?utf-8?B?NXprcHBWbEtRamcvUUFzcE1mTVFSKzJWOGpRK1hZTmdodEhyOWxiNC8yeEtI?= =?utf-8?B?Uyt0b2ZYL21ENnhiUFRyTUtOL1V5WEVjaDFLQkRseUNFNlk1WDNZVnBseEFY?= =?utf-8?B?MnBLZTBEdTl2SndZY0lCaXlrcEZaSXlwWllUNFZweWgvMUNDaE5PQmpvZVlL?= =?utf-8?B?d2JES3JKQUJoM2Zic3I4cW9LVXpWRWd0dlVGWTh2bUk3M1J6Y284bmljT3hV?= =?utf-8?B?R1RHNEVWNWE1cGgvK2Y4MjdSZmpZTTYyMlVBUGVXeVNkdEt0UkI5SVFvSnFx?= =?utf-8?B?UWVtTHVQanlmTml4YjNRem8yU3p0Z3VjTWd3aE5ocHlEcm1ZdmxRN21ud0lk?= =?utf-8?B?dDM3VjNrRFR0cTVRaTVkd1B1VG9RL0xyN0VqSFlBbU84MU5JNVhmYjdWeFJ4?= =?utf-8?B?OW9ZYytWYlJqak5yN3AxaGtVbUxSRGdJdjRBV3g0c2RuNHZKRll0VHo1YmxC?= =?utf-8?B?OXNZSlVjTG50YWhJSiswMk15R0lldWJsL2RCaTJuTDhHQWo0NERaTWJYYmJn?= =?utf-8?B?WWk2L3hEdnpPVzVkRWY2MGtLdUZIVlpNaG5MdG55L3JXRTFLakxVaU5YblJX?= =?utf-8?B?b0k1L2pVMk1rVFJUYkFJVUo1TkNGOUtkN1FJaitYc1YxRWh4dUFmK2FjRGhK?= =?utf-8?Q?gCQP+gcggcS1OJggKUqTB+4=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 1a8ba6b7-9abd-4034-60f2-08d9db6ddf10 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2022 17:05:19.2289 (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: XpnccnSYSpZWEYQcli9zMtwSTEL9Q/C9m21NuNG01jiiI5JlXGafftk5rcE+bvLbsznQqGiP2Oy+Z7c4TxxQ/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB1931 X-OriginatorOrg: intel.com 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 On 12/30/2021 6:08 AM, Yanling Song wrote: > Add HW interface registers and initialize the HW > interface. > > Signed-off-by: Yanling Song <...> > diff --git a/drivers/net/spnic/base/spnic_hwdev.h b/drivers/net/spnic/base/spnic_hwdev.h > new file mode 100644 > index 0000000000..c89a4fa840 > --- /dev/null > +++ b/drivers/net/spnic/base/spnic_hwdev.h > @@ -0,0 +1,29 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(c) 2021 Ramaxel Memory Technology, Ltd > + */ > + > +#ifndef _SPNIC_HWDEV_H_ > +#define _SPNIC_HWDEV_H_ > + > +#include > + Why is this header required in this file? <...> > +#ifdef SPNIC_RELEASE > +static int wait_until_doorbell_flush_states(struct spnic_hwif *hwif, > + enum spnic_doorbell_ctrl states) > +{ > + enum spnic_doorbell_ctrl db_ctrl; > + u32 cnt = 0; > + > + if (!hwif) > + return -EINVAL; > + > + while (cnt < SPNIC_WAIT_DOORBELL_AND_OUTBOUND_TIMEOUT) { > + db_ctrl = spnic_get_doorbell_ctrl_status(hwif); > + if (db_ctrl == states) > + return 0; > + > + rte_delay_ms(1); > + cnt++; > + } > + > + return -EFAULT; > +} > +#endif What is this 'SPNIC_RELEASE' macro and why it exists? Please get rid of all all compile time macros, if the code is not required you can delete it while upstreaming. <...> > struct spnic_nic_dev { > + struct spnic_hwdev *hwdev; /* Hardware device */ > + > + struct spnic_txq **txqs; > + struct spnic_rxq **rxqs; > + struct rte_mempool *cpy_mpool; > + > + u16 num_sqs; > + u16 num_rqs; > + u16 max_sqs; > + u16 max_rqs; > + > + u16 rx_buff_len; > + u16 mtu_size; > + > + u16 rss_state; > + u8 num_rss; > + u8 rsvd0; > + > + u32 rx_mode; > + u8 rx_queue_list[SPNIC_MAX_QUEUE_NUM]; > + rte_spinlock_t queue_list_lock; > + pthread_mutex_t rx_mode_mutex; > + > + u32 default_cos; > + u32 rx_csum_en; > + > u32 dev_status; > + > + bool pause_set; > + pthread_mutex_t pause_mutuex; > + > + struct rte_ether_addr default_addr; > + struct rte_ether_addr *mc_list; > + > char dev_name[SPNIC_DEV_NAME_LEN]; > + u32 vfta[SPNIC_VFTA_SIZE]; /* VLAN bitmap */ > }; Most of these additions to the struct is not used at all, can you please add them when they are used?