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 0D64EA0588; Tue, 7 Apr 2020 14:50:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EEE002B96; Tue, 7 Apr 2020 14:50:23 +0200 (CEST) Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) by dpdk.org (Postfix) with ESMTP id 898702B86 for ; Tue, 7 Apr 2020 14:50:22 +0200 (CEST) Received: by mail-lf1-f67.google.com with SMTP id x23so2284266lfq.1 for ; Tue, 07 Apr 2020 05:50:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ED7/NQ6+H8S8qfEaNbTZWmKpqOAlY9b4NQBLNfaro3E=; b=pMCM2QVdnTFBFvKPO8n/AVydXNjwpVJlxdLN16G7STNHPH4L0GHx61rZhsvxGCJbdW wWybNpaHZyf2UzCrcxWpupkjJJbr8isrljRlk9TJQvG29g6QyceHkUsRiy/sOu7kW7oO HRHGeSuemWbwTzC1SeUgP1urJK8y8c8vI41y1Ec1szL2kjVJatrx6I3hZtJperqe3k6h j4VPwCDjUEh+cn9xAuOSCpS38jbnVwGoDfoIO5JC3bLtnsXyq2hifEdOgqH1QVzI/27m EfzeXbZMH4hCfDYFxek3m8V3PTFuz1XpvapAzTku0RFRfbyi9OFj5VC3L32yRn6GgG3V XJRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ED7/NQ6+H8S8qfEaNbTZWmKpqOAlY9b4NQBLNfaro3E=; b=hwE0+GImz8BIYclBBJ1i4xZvj7zvcUXBlA8JkExvf6MtGvMEpdCJXmQurySWBG0GFs 2Suhg4xVpXRDFv/elhZnxTXbUq6kIod8ttDzLTfyJ+0kGw+xQaYKfxNwuyOMhec1kq/X epoyTxgpsaqIGpsWiBGc08OdRDP6jLoYHG0Tvv0ACatIQzxIJ+4lsoYohU2XPb+HjsDY 6qFuF97wD3agWQba8aH46+1DvlZJ/djOTBV/vMzy00Pm28xysnTPMrYucS1cugySPjZJ 5UKvc7phhp4G9YxE3F7OfPjxm5qWVGuRB7fkGVen1Q4HTJCDY1fbrHWkGmeG5cnaGq3T 3X9g== X-Gm-Message-State: AGi0Puazsh0e0B7xude5+W+WE5GYyXkR095lYMrpA7h09Sr2U4GAcyML /ROStfkQQfprzZDhOTmCEEoZHg== X-Google-Smtp-Source: APiQypLa6rl/pWG9SDp+R04QDzDMrxYZD+73ekvtpUI6lx3sLGHbqZQ1jJVwFTilC8D0NlgFJePEsg== X-Received: by 2002:a19:7706:: with SMTP id s6mr1421839lfc.31.1586263821367; Tue, 07 Apr 2020 05:50:21 -0700 (PDT) Received: from [192.168.8.100] (user-5-173-33-152.play-internet.pl. [5.173.33.152]) by smtp.gmail.com with ESMTPSA id v9sm11683891lji.11.2020.04.07.05.50.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Apr 2020 05:50:20 -0700 (PDT) To: Jerin Jacob Cc: Jerin Jacob , Kiran Kumar K , dpdk-dev , Thomas Monjalon , David Marchand , Ray Kinsella , =?UTF-8?Q?Mattias_R=c3=b6nnblom?= , Pavan Nikhilesh , Nithin Dabilpuram , Xiao Wang References: <20200331192945.2466880-1-jerinj@marvell.com> <20200405085613.1336841-1-jerinj@marvell.com> <20200405085613.1336841-5-jerinj@marvell.com> <020f8ab9-71e7-b5af-926f-ab52cc342fd4@semihalf.com> From: Andrzej Ostruszka Message-ID: <8b055e3b-5b02-a5c1-8481-141adcb92085@semihalf.com> Date: Tue, 7 Apr 2020 14:50:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 04/29] graph: implement node debug routines 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 4/7/20 2:09 PM, Jerin Jacob wrote: > On Tue, Apr 7, 2020 at 5:20 PM Andrzej Ostruszka wrote: >> >> On 4/7/20 12:22 PM, Jerin Jacob wrote: [...] >>>>> +static void >>>>> +node_scan_dump(FILE *f, rte_node_t id, bool all) >>>>> +{ >>>>> + struct node *node; >>>>> + >>>>> + RTE_ASSERT(f != NULL); >>>> >>>> Why the assert? Below this is used in public (I guess) functions so >>>> user can provide wrong input - in that case I'd expect warning/error not >>>> an assert. >>> >>> Public API rte_node_dump() and node_scan_dump() calls this API without >>> any check. >> >> That was my point. I would expect either there or here to have a check >> for arg instead of assert. I'd say that asserts are very good for >> checking internal logic, but not so for checking if user input is OK. > > All DPDK _dump() functions returns void. I thought, We will keep the same here. > Another option is. if it is NULL we can return. > i.e > -RTE_ASSERT(f != NULL); > +if (f == NULL) > + return > > Either scheme is OK with me, Let me know your preference, I will > change accordingly. No, I don't want to silently skip that. Have an error message here and return error but don't call rte_panic() which would abort application. That would be my preference, but if you don't want to change return type here (and where this is called) then I'm fine with what it is now. With regards Andrzej Ostruszka