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 77F86A034F; Wed, 22 Dec 2021 01:56:53 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1369C40687; Wed, 22 Dec 2021 01:56:53 +0100 (CET) Received: from VLXDG1SPAM1.ramaxel.com (email.unionmem.com [221.4.138.186]) by mails.dpdk.org (Postfix) with ESMTP id F1E1D40040 for ; Wed, 22 Dec 2021 01:56:50 +0100 (CET) Received: from V12DG1MBS01.ramaxel.local (v12dg1mbs01.ramaxel.local [172.26.18.31]) by VLXDG1SPAM1.ramaxel.com with ESMTPS id 1BM0ujvN008916 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 22 Dec 2021 08:56:45 +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.2308.14; Wed, 22 Dec 2021 08:56:44 +0800 Date: Wed, 22 Dec 2021 08:56:42 +0800 From: Yanling Song To: Stephen Hemminger CC: "dev@dpdk.org" , "yanling.song@linux.dev" , =?GB18030?B?0e64yQ==?= , "ferruh.yigit@intel.com" , Subject: Re: [PATCH v1 16/25] net/spnic: add device configure/version/info Message-ID: <20211222085642.000079ce@ramaxel.com> In-Reply-To: <20211219162356.08e62c72@hermes.local> References: <9e1e5308ac26be6f0dad1c31073968d704564c5c.1639636621.git.songyl@ramaxel.com> <20211219162356.08e62c72@hermes.local> 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 1BM0ujvN008916 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 Mon, 20 Dec 2021 08:23:56 +0800 Stephen Hemminger wrote: > On Sat, 18 Dec 2021 10:51:43 +0800 > Yanling Song wrote: > > > +static int spnic_dev_configure(struct rte_eth_dev *dev) > > +{ > > + struct spnic_nic_dev *nic_dev = > > SPNIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev); + > > + nic_dev->num_sqs = dev->data->nb_tx_queues; > > + nic_dev->num_rqs = dev->data->nb_rx_queues; > > + > > + if (nic_dev->num_sqs > nic_dev->max_sqs || > > + nic_dev->num_rqs > nic_dev->max_rqs) { > > + PMD_DRV_LOG(ERR, "num_sqs: %d or num_rqs: %d > > larger than max_sqs: %d or max_rqs: %d", > > + nic_dev->num_sqs, nic_dev->num_rqs, > > + nic_dev->max_sqs, nic_dev->max_rqs); > > + return -EINVAL; > > + } > > + > > This should already be covered by checks in ethedev:dev_configure. OK. The check will be removed in the next version. > > > + /* The range of mtu is 384~9600 */ > > + if (SPNIC_MTU_TO_PKTLEN(dev->data->dev_conf.rxmode.mtu) < > > + SPNIC_MIN_FRAME_SIZE || > > + SPNIC_MTU_TO_PKTLEN(dev->data->dev_conf.rxmode.mtu) > > > + SPNIC_MAX_JUMBO_FRAME_SIZE) { > > + PMD_DRV_LOG(ERR, "Max rx pkt len out of range, > > mtu: %d, expect between %d and %d", > > + dev->data->dev_conf.rxmode.mtu, > > + SPNIC_MIN_FRAME_SIZE, > > SPNIC_MAX_JUMBO_FRAME_SIZE); > > + return -EINVAL; > > + } > > Already covered by eth_dev_validate_mtu called from ethdev > dev_configure. > OK. The check will be removed in the next version.