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 2287AA034E; Mon, 20 Dec 2021 01:24:03 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9731E40141; Mon, 20 Dec 2021 01:24:02 +0100 (CET) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mails.dpdk.org (Postfix) with ESMTP id C8BEA40140 for ; Mon, 20 Dec 2021 01:24:01 +0100 (CET) Received: by mail-wm1-f44.google.com with SMTP id z206so5826093wmc.1 for ; Sun, 19 Dec 2021 16:24:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XrGUn+2hymG72SnhmUJbSC2Z4Q0rShEatJrjyh0TDqw=; b=Zy2dTbeph+dFqpAsUCGOUJiVtG8NM8t9AqiuQc1Ecu+i9lYytn/UQgBTp/w5laey8P 6+hIhD0IQGlXTFWD7LsiynkbCvAnsBYgtyBjtxX2TWbYGRTWlZ7hzrYsbTouVQQ97FUs QeHFzVINKgpkl5mUSGsf/vJorNsXcB6Q+p8QgdLlsEDR2na+l9E15lswd5nHYAj4P2ig WPwLriAof+J4YE40Qa/NCVJQ2phh3PL0mYMrYfkzylt1K2YcVIWvI9cu+TdIV8fHsMeP okPzQ8GTNvQntqyEEIonDShNiSEV3Gek9K40UKhHoZ8WLfJGok0DQQmKx7VqPwYcBHdd 7d3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XrGUn+2hymG72SnhmUJbSC2Z4Q0rShEatJrjyh0TDqw=; b=HCXjfuQcqp2x2OrFnSDZK5xXTJpexdlbsQbUw474heGfUheMfJo6KxXlIFtdqmOfSB rt35fXeW6vxw41dcufqvkY/iYouOD9m6PZ5uWluNlUe8JsglPzO1NurRYW39RxrsGRSW 70+yiDUp1XmSBUqyRSYHbF1m9FCefjuycOI0SOSp6IaF7mQ4bW+T7WRHabXJwjVouBkA BqxAcmJAtj6hHo7PdPillb5DMjtAGf80voa801dP9VMCdP6qtLBnczJjKWk/1k+O4pFu wEvc2HUKH+iuCe1KVxn4IaltHa+axm9VHelm7po9jzVBRcSeKtfi4ZWN2MpNTqeSTKO+ eVtw== X-Gm-Message-State: AOAM530WmBOQjfqF9xAuEQf0PXCF9FHNEAd0XSykJIblxxg6PV+b1uI2 cll7uGXll1vXVqu72Gil0gWxTQ== X-Google-Smtp-Source: ABdhPJyhR70R/wioGo99FJkkZChE0zReaQbk2Hdn5WgKr3S60WLpXFwTXv2LY29+4cTvlITsWMMtZA== X-Received: by 2002:a7b:c008:: with SMTP id c8mr11734363wmb.87.1639959841385; Sun, 19 Dec 2021 16:24:01 -0800 (PST) Received: from hermes.local ([185.217.117.143]) by smtp.gmail.com with ESMTPSA id d2sm10115228wrw.26.2021.12.19.16.23.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Dec 2021 16:24:01 -0800 (PST) Date: Sun, 19 Dec 2021 16:23:56 -0800 From: Stephen Hemminger To: Yanling Song Cc: , , , Subject: Re: [PATCH v1 16/25] net/spnic: add device configure/version/info Message-ID: <20211219162356.08e62c72@hermes.local> In-Reply-To: <9e1e5308ac26be6f0dad1c31073968d704564c5c.1639636621.git.songyl@ramaxel.com> References: <9e1e5308ac26be6f0dad1c31073968d704564c5c.1639636621.git.songyl@ramaxel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 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. > + /* 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.