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 C5E46A054A; Tue, 25 Oct 2022 17:55:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7686D42C1F; Tue, 25 Oct 2022 17:55:31 +0200 (CEST) Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by mails.dpdk.org (Postfix) with ESMTP id 9F3DC42C1D for ; Tue, 25 Oct 2022 17:55:30 +0200 (CEST) Received: by mail-pf1-f178.google.com with SMTP id 130so1873409pfu.8 for ; Tue, 25 Oct 2022 08:55:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=kb435Nat+iBCflLiFjLzrNU2VGp27QfkszG2VpPiUuc=; b=zfV+0mbdgtgERt/8J2ybhIA3+v4MhcrqmVOYsY+8fYG4pvNUDn6RahEbeBVL+j9AXZ fccsvbKOODKpxgqi/G6Q4tKGIlgKHz7Bh2e86ZB2kYbcTlDVWSujqpVSN0wiALHKcnFD jSBZ68cbXJBRBdwt7JfqPXE/MWh1mgHyJjjR44kIh8x0l4PPWRPtZFdL0w0lQLT3dfve TBI8QYrYJhYfM0OPCp9dNqSM8hDqPOcsaEYg5NsNqnQGcQ2d10csLasfqQn5lEbs1BUO chCI/7ruL6ZWf8swT5at0j+VQyCIZbdogFWhvINWMTYguZDl9/2TXk+jqtF13GKsf58+ wH8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kb435Nat+iBCflLiFjLzrNU2VGp27QfkszG2VpPiUuc=; b=I/pkl07VNrGoaUtlWyHXIFOWCLSEjlSM3i2Sx2qagT/UH0FUMQarNfROI8q4/ueLLT Db1zvF+mUSDHeqNEShXt/3wr6s+wvdEmWTmyKIcb7Vr8OZDYThK/f5ZbV8DyXfh6LMpl M6FHl4X/WDhl6aUxZE7ZO+4ci1xlonCSDYmC+FDEe0HRUfm3nIBqYXkN62SoZiEb6Zib uMGc0SqQba5wEwwXx968VrUb7dlWpJSLKKIiArvC/5+9pAqsvj6wDayN/yJThAD49o7u rjWMAz4XLWZpxF5mKOsWcsmchWBIsb4v0RuvoRR1WN2utgUP7NWI9go/KlvY7vPsdxIl SYUQ== X-Gm-Message-State: ACrzQf237626wVU/E5rcNLTONr/NGxOurYPTrqfwmKx7o0656UYDJ3FU M4YE84I/SKK3a5yPH+i1/3wP2w== X-Google-Smtp-Source: AMsMyM7u2KuAKj57vDUTIbp9l8BOj4ezxLdPnoqRZOOvdauDLZelwtGjBGTvK7LcB1EbcEAGWOEzPQ== X-Received: by 2002:a05:6a00:430c:b0:562:6897:7668 with SMTP id cb12-20020a056a00430c00b0056268977668mr39732126pfb.23.1666713329694; Tue, 25 Oct 2022 08:55:29 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id o21-20020a170903211500b0017f5ad327casm1382249ple.103.2022.10.25.08.55.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 08:55:29 -0700 (PDT) Date: Tue, 25 Oct 2022 08:55:27 -0700 From: Stephen Hemminger To: Junfeng Guo Cc: qi.z.zhang@intel.com, jingjing.wu@intel.com, ferruh.yigit@xilinx.com, beilei.xing@intel.com, dev@dpdk.org, xiaoyun.li@intel.com, awogbemila@google.com, bruce.richardson@intel.com, hemant.agrawal@nxp.com, chenbo.xia@intel.com, helin.zhang@intel.com Subject: Re: [PATCH v8 5/8] net/gve: add support for MTU setting Message-ID: <20221025085527.48ed5551@hermes.local> In-Reply-To: <20221025090729.2593603-6-junfeng.guo@intel.com> References: <20221021091928.2674471-2-junfeng.guo@intel.com> <20221025090729.2593603-1-junfeng.guo@intel.com> <20221025090729.2593603-6-junfeng.guo@intel.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 Tue, 25 Oct 2022 17:07:26 +0800 Junfeng Guo wrote: > +static int > +gve_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) > +{ > + struct gve_priv *priv = dev->data->dev_private; > + int err; > + > + if (mtu < RTE_ETHER_MIN_MTU || mtu > priv->max_mtu) { > + PMD_DRV_LOG(ERR, "MIN MTU is %u, MAX MTU is %u", > + RTE_ETHER_MIN_MTU, priv->max_mtu); > + return -EINVAL; > + } This check should not be necessary. In rte_eth_dev_set_mtu it queries device for min/max mtu then calls eth_dev_validate_mtu() to check that the mtu is ok.