From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2] ether: use a default for max Rx frame size in configure() Date: Fri, 07 Apr 2017 10:34:48 +0200 Message-ID: <4167418.F3k0faufJh@xps13> 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Andriy Berestovskyy Return-path: 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 ; Fri, 7 Apr 2017 10:34:50 +0200 (CEST) Received: by mail-wr0-f171.google.com with SMTP id g19so52819958wrb.0 for ; Fri, 07 Apr 2017 01:34:50 -0700 (PDT) In-Reply-To: <4c030b76-ae4f-2cff-6cc1-21870ee506fa@caviumnetworks.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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? ;)