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 9D577A034C; Fri, 21 Jan 2022 10:32:18 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3AAC342736; Fri, 21 Jan 2022 10:32:18 +0100 (CET) Received: from VLXDG1SPAM1.ramaxel.com (email.ramaxel.com [221.4.138.186]) by mails.dpdk.org (Postfix) with ESMTP id 5616C40042 for ; Fri, 21 Jan 2022 10:32:17 +0100 (CET) Received: from V12DG1MBS01.ramaxel.local (v12dg1mbs01.ramaxel.local [172.26.18.31]) by VLXDG1SPAM1.ramaxel.com with ESMTPS id 20L9WACC035352 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 21 Jan 2022 17:32:10 +0800 (GMT-8) (envelope-from songyl@ramaxel.com) Received: from localhost (172.20.2.155) by V12DG1MBS01.ramaxel.local (172.26.18.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2375.17; Fri, 21 Jan 2022 17:32:09 +0800 Date: Fri, 21 Jan 2022 17:32:08 +0800 From: Yanling Song To: Ferruh Yigit CC: , , , , , Subject: Re: [PATCH v6 02/26] net/spnic: initialize the HW interface Message-ID: <20220121173208.0000132a@ramaxel.com> In-Reply-To: References: <6c3420e1bf7371550c9e450675b5dc55591a7164.1640838702.git.songyl@ramaxel.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.29; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [172.20.2.155] X-ClientProxiedBy: V12DG1MBS01.ramaxel.local (172.26.18.31) To V12DG1MBS01.ramaxel.local (172.26.18.31) X-DNSRBL: X-MAIL: VLXDG1SPAM1.ramaxel.com 20L9WACC035352 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 Wed, 19 Jan 2022 17:05:14 +0000 Ferruh Yigit wrote: > 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? > It is a mistake. Will be removed in the next version. > > <...> > > > +#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. OK. 'SPNIC_RELEASE' will be removed. > > <...> > > > 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? Ok. Will be changed in the next version.