From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v2 7/7] app/testpmd: verify mtu with rte_eth_dev_info_get() Date: Thu, 28 Mar 2019 16:41:00 +0000 Message-ID: References: <1553259678-4515-1-git-send-email-ian.stokes@intel.com> <1553259678-4515-8-git-send-email-ian.stokes@intel.com> <6aa38aa8-5bb3-fee1-0449-c1cc11115a67@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: stephen@networkplumber.org To: Ian Stokes , dev@dpdk.org Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 0CA561B3B5 for ; Thu, 28 Mar 2019 17:41:14 +0100 (CET) In-Reply-To: <6aa38aa8-5bb3-fee1-0449-c1cc11115a67@intel.com> Content-Language: en-US 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 3/25/2019 2:20 PM, Ferruh Yigit wrote: > On 3/22/2019 1:01 PM, Ian Stokes wrote: >> This commit uses the mtu fields populated in rte_eth_dev_info_get() >> to validate the mtu value being passed in port_mtu_set(). >> >> Signed-off-by: Ian Stokes > > For patch title, I think 'rte_eth_dev_info_get()' is implementation detail here, > what we are verifying mtu against min/max MTU information provided by PMDs. > What do you think something like: > app/testpmd: verify MTU with PMD provided limits > >> --- >> app/test-pmd/config.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c >> index b9e5dd923..6ca97d0e7 100644 >> --- a/app/test-pmd/config.c >> +++ b/app/test-pmd/config.c >> @@ -1063,9 +1063,13 @@ void >> port_mtu_set(portid_t port_id, uint16_t mtu) >> { >> int diag; >> + struct rte_eth_dev_info dev_info; >> >> if (port_id_is_invalid(port_id, ENABLED_WARN)) >> return; >> + rte_eth_dev_info_get(port_id, &dev_info); >> + if (mtu > dev_info.max_mtu || mtu < dev_info.min_mtu) >> + return; > > This fails silently, I think better to put a log for failure. Ian seems out of office, I can update this myself if set of the patchset is good.