From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7D03FA046B for ; Tue, 20 Aug 2019 17:12:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7D6DA1BED5; Tue, 20 Aug 2019 17:12:20 +0200 (CEST) Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by dpdk.org (Postfix) with ESMTP id 41AAB1BE9D for ; Tue, 20 Aug 2019 17:12:19 +0200 (CEST) Received: by mail-pf1-f195.google.com with SMTP id c81so3561319pfc.11 for ; Tue, 20 Aug 2019 08:12:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/sp3AkE6VDGxDk8UKkecLlMK+3z+PVOsd7SSdZBOZzs=; b=IhyeUyWyejEWdgAoQ3KtZVKnLYofsIfTU87Kb9Ft6o38Ji1L5HslJsSBYkTDoINARY jHnKPIUhmKYhv2beJzYbLM2JnbSijV8tmhSVGW04tx4/+9L7yPX6o/8zAjsWaiL3EBkd Bsk111E32qfMmCEpqkWlSkf7vYVvWJVHIWaGfg0QjqN1AVjgS3UtXSDVfk130NMSS/pl Z4Nu2XoDe6z/Hfe13eP0kaAxqSJR5QSAQEW7uEmroxeAXNODJk/ivo6zB+TAsGIZavY3 fRg6C99wPw86VTYdIGngPNCeHzoWg2RYS+SL8UoFNK2vT6BhcwG2zpNaugxmQTDO2Cli cF5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/sp3AkE6VDGxDk8UKkecLlMK+3z+PVOsd7SSdZBOZzs=; b=ZCjLf0MztXhzM8FgXe9uxWjnSJRNJS8HvsAUgUSyaTqI8xP00/Q0p/SFqgLQXAjDoG s80gNpj7SjytTnKKK44FHdcZTN5r2ig2bYZz/i47q8IHFeKLmCohjUhJMCvpBpsDCdLO j+TFOtr87FEdFJ+9owTbJFnuRZUq/4hqFC5BM/r9Yzu/INsazHq9JHJWTH+n/I9BvFXu Z4tJ7OQ0lTvN9Xh4RlABMV/yRf3ht6s0XnP4HKLs2PlsoxSZgcVBJoBpmh2wz/Dc8ptw hiZqP0YbgxnolQT3LTbWxGv4EM3btkxjTKjMS9RnoYa+Gx1bjDGPM6FvEA+a8ffXF3dJ aNUA== X-Gm-Message-State: APjAAAVBVqqt9fkdgTGT55xNd84Tr6rG3TWFliqxMarLBJtPNENMywXw q8py+6EWmuodiXuZVT5Gb9gB9g== X-Google-Smtp-Source: APXvYqw8rH2gr1DOfOCZ8huF1/y0UMeC2l6w94GVGxvWa6cYX7qqIvycRbM9bd0u/RGPgt4s0G4VrQ== X-Received: by 2002:a63:704:: with SMTP id 4mr25070868pgh.242.1566313938285; Tue, 20 Aug 2019 08:12:18 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id x17sm19633338pff.62.2019.08.20.08.12.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 08:12:18 -0700 (PDT) Date: Tue, 20 Aug 2019 08:12:11 -0700 From: Stephen Hemminger To: "Myers, Charles" Cc: Yong Wang , "dev@dpdk.org" Message-ID: <20190820081211.146a09de@hermes.lan> In-Reply-To: <1566273996-24368-1-git-send-email-charles.myers@spirent.com> References: <1566017542-26938-1-git-send-email-Charles.Myers@spirent.com> <1566273996-24368-1-git-send-email-charles.myers@spirent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2] net/vmxnet3: Added mtu_set() function to allow setting MTU. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, 20 Aug 2019 04:06:53 +0000 "Myers, Charles" wrote: > static int > +vmxnet3_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) > +{ > + if (mtu < VMXNET3_MIN_MTU || mtu > VMXNET3_MAX_MTU) { > + PMD_DRV_LOG(ERR, "MTU should be between %d and %d", > + VMXNET3_MIN_MTU, VMXNET3_MAX_MTU); > + return -EINVAL; > + } > + This is not the best way to handle checking validity of MTU value. The device should report min/max MTU and then rte_eth_dev_set_mtu will do enforcement there. This allows application to know what MTU to use, and eliminates guess/check behavior.