From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas.monjalon@6wind.com>
Received: from mail-wr0-f171.google.com (mail-wr0-f171.google.com
 [209.85.128.171]) by dpdk.org (Postfix) with ESMTP id 0D17B2FDD
 for <dev@dpdk.org>; Fri,  7 Apr 2017 10:34:50 +0200 (CEST)
Received: by mail-wr0-f171.google.com with SMTP id g19so52819958wrb.0
 for <dev@dpdk.org>; Fri, 07 Apr 2017 01:34:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=6wind-com.20150623.gappssmtp.com; s=20150623;
 h=from:to:cc:subject:date:message-id:user-agent:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=kOMMSpcpYWp5dlTUoYET+VzVgM6681uH/xRRi3ydx1s=;
 b=MPJVYxtzNPsD2UZjxddw3muXE47z4Nm13zalclOS27IjIu4XEVdeUjxheT8rKvXd+o
 oMwnG5/ZWOuZlZSU8YzbrVk2G8wBHOD1l8jHgtHb3G7dQTU3tGC0tZ7uQCnWDaQ/ljPx
 xREH/JBOGZvD3N+BbhQq8lpB8dbFW5hSD93JEAWpCFXS8CHdwZ3HRYRr/qcGLkb6SIN4
 +JQqhpPaBAE5CU6utU7A/Zs+wtuk3IgV+cArFhypzsfZkU8/hCFrlpHndyBzn7UG7qiR
 zl10MSrNQEsRQPlsi4sz3RaHc7lavzfORDSXffn7ob+wfQKx1YJzET/HS4Yuw9Qrbm2F
 xrig==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent
 :in-reply-to:references:mime-version:content-transfer-encoding;
 bh=kOMMSpcpYWp5dlTUoYET+VzVgM6681uH/xRRi3ydx1s=;
 b=poVH2xxwhrdw5ElnIhR9vGK7ZJ7bUEWtw0KIgu7lkbSh/IXe0DwQIgcWM8UHtImnVC
 xHVQT7J1I6ZoN44knNwksvLGMkHfxJiWX33a3Z3g0Q93wIWqaRJKd2nYU1wLA/J+x1dE
 6esogxHYVfXkrFCCteva5yq5qhWQSdpleXCD557HTDpZpxKhVrdClWrf/9u1YNWKSoWC
 dyiVo3h+aClGgils09O8AZKtoEh5vdos6ePT/RHGGJLybLc35Ycay2c+gOlsoJi/O8l5
 PJmI0ihURxeK4R7MgnetSoDDX0Ve3oOFeKId66lm+I5jJNxhZthg3xCeRa7iK81iMwiL
 n0UA==
X-Gm-Message-State: AFeK/H1xQaL+cqSkwHnMqX3atj8lhFg574+wjuUSZGJD3jgwHBXv5lhTAqIzhyRYrA2KHLHd
X-Received: by 10.223.177.195 with SMTP id r3mr34385830wra.40.1491554090525;
 Fri, 07 Apr 2017 01:34:50 -0700 (PDT)
Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184])
 by smtp.gmail.com with ESMTPSA id j2sm5165471wrd.26.2017.04.07.01.34.49
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 07 Apr 2017 01:34:49 -0700 (PDT)
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: Andriy Berestovskyy <Andriy.Berestovskyy@caviumnetworks.com>
Cc: dev@dpdk.org
Date: Fri, 07 Apr 2017 10:34:48 +0200
Message-ID: <4167418.F3k0faufJh@xps13>
User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; )
In-Reply-To: <4c030b76-ae4f-2cff-6cc1-21870ee506fa@caviumnetworks.com>
References: <1490288768-8114-1-git-send-email-Andriy.Berestovskyy@cavium.com>
 <1692122.NGhiyjpKUa@xps13>
 <4c030b76-ae4f-2cff-6cc1-21870ee506fa@caviumnetworks.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Subject: Re: [dpdk-dev] [PATCH v2] ether: use a default for max Rx frame
	size in configure()
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 07 Apr 2017 08:34:51 -0000

2017-04-07 10:09, Andriy Berestovskyy:
> Hi Thomas,
> 
> On 06.04.2017 22:48, Thomas Monjalon wrote:
> > Anyway, why not fixing it in the reverse way: returning error for
> > out of range of non-jumbo frames?
> 
> I guess we need to fix most of the examples then, since most of them 
> just pass 0 for normal frames. And there is no default for jumbo frames, 
> so an app must first get this info from the NIC...

Yes, I would vote to return the NIC capabilities to the app.

> > I am not sure setting a default value in the back of the caller is really
> > a good behaviour.
> 
>  From app perspective, any working default is better that a non-working 
> app, which you have to fix and recompile on each PMD/platform.

Right
That's why there should be a capabilities API for this need.

> What if we use 0 for a default value both for normal and jumbo frames 
> (i.e. ETHER_MAX_LEN and dev_info.max_rx_pktlen) and an error if user 
> passed a non-zero max_rx_pkt_len?

We can set the right default value if the app input is 0,
as a special case.
For any other value, we must try to set it or return an error.

> It will make it consistent, we will not need to fix the existing apps 
> and we will have a default both for normal and jumbo frames. Win-win? ;)