From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D7C58A0546; Sat, 1 May 2021 01:00:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7CE184013F; Sat, 1 May 2021 01:00:49 +0200 (CEST) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by mails.dpdk.org (Postfix) with ESMTP id 8BFDE4003F for ; Sat, 1 May 2021 01:00:48 +0200 (CEST) Received: by mail-lf1-f46.google.com with SMTP id z13so31464067lft.1 for ; Fri, 30 Apr 2021 16:00:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YnWqSwvUhtqGQaGfj2C7J9ut38I1Gz3n/7Qt7CIyxGw=; b=GPYxvhkQA8kpyQ5XVS8aTyeNEQwq5UB2GNzxhcI0mNwqd9IKfJ0N2GRC+b+kkKhKDg 8YjS1AbTUqfFILbTmOorCP4dCsWbZ7I4R/ybCKxu0GRvIKvzAmFzQAVmKbd3D7oIPPeN W8K2feEbDnpOcEPOpXbahWEmCM5H/Rg026NFQTZwdys7GqBIg0nFLvN6NVoOjXW1DW5N 6m/l41WdYwE+QwGIhH4yPEtZn+In1TmzVmN48Pvg5bnf/+6qyIYWYxjiimeQqtZI9il3 K9cgc+98BYbwUaZe2EiHqCKPSvG3WLB04jjVGbyQCamYgbnOttUVVrhAClXUz5pPur/G yw6g== 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=YnWqSwvUhtqGQaGfj2C7J9ut38I1Gz3n/7Qt7CIyxGw=; b=lqcCGDweYpMVc3cyhUvbjBZnYUzRyPzJU3TZhIwB4/ZmwMec3luHeeULZAe/fuFHSA eqYcKsO8nnsGiLOymK8U6z01/aSaEEpagfb5Fy45SJaki+mFj54DPb0NL4Zl4S2JpzWh ExrdJJf0WRHLph03pDAniwtUhM3970CUV5v57D3ZLRBgO0bIOPDQqVn0WPS59dYuKWSq /aAHkN1KpUhG9z4NMOJWJxHLpH/T/XVqHKyWG/FTAmUXs99nfVIMn/mZFtMseaZXnkIP rfHe1Swopm1/X/URQkEf06eBK0CdVo/VgT49CzP2c3+0ls8iUUhKz9hg2iXfiv4ZP5Kn M+4w== X-Gm-Message-State: AOAM532u9xqetNe5zXVp5Px7oAJ1AeUH1a7uw5yzt5IIzUM5+RJSIKXv PZ5N1BO/dh2xawi2DL5GJIM= X-Google-Smtp-Source: ABdhPJzOwllR5QRxF4v5XryKEX9WeUtdY0yfM/m/+N2gM8p2eLOK8JaVE+f+pHpSlCCG2p4CXM5u1A== X-Received: by 2002:a05:6512:2182:: with SMTP id b2mr5247361lft.284.1619823648195; Fri, 30 Apr 2021 16:00:48 -0700 (PDT) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id g20sm407322lfu.17.2021.04.30.16.00.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Apr 2021 16:00:47 -0700 (PDT) Date: Sat, 1 May 2021 02:00:45 +0300 From: Dmitry Kozlyuk To: Tyler Retzlaff Cc: thomas , Narcisa Ana Maria Vasile , "dev@dpdk.org" , Khoa To , Narcisa Ana Maria Vasile , Dmitry Malloy , "talshn@nvidia.com" , Omar Cardona , "bruce.richardson@intel.com" , "david.marchand@redhat.com" , "Kadam, Pallavi" Message-ID: <20210501020045.360fce8a@sovereign> In-Reply-To: References: <1617057640-24301-2-git-send-email-navasile@linux.microsoft.com> <1617413948-10504-3-git-send-email-navasile@linux.microsoft.com> <20210429035034.570f33e3@sovereign> <2879074.f3q8zTBTW7@thomas> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [EXTERNAL] Re: [PATCH v6 02/10] eal: add thread attributes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" 2021-04-29 15:52 (UTC+0000), Tyler Retzlaff: > -----Original Message----- > From: Thomas Monjalon > Sent: Thursday, April 29, 2021 12:48 AM > > > 29/04/2021 02:50, Dmitry Kozlyuk: > > > 2021-04-02 18:39 (UTC-0700), Narcisa Ana Maria Vasile: > > > > +int > > > > +rte_thread_attr_init(rte_thread_attr_t *attr) { > > > > + if (attr == NULL) { > > > > + RTE_LOG(DEBUG, EAL, > > > > + "Unable to init thread attributes, invalid parameter\n"); > > > > + return EINVAL; > > > > + } > > > > > > This message doesn't add value for debugging: caller already knows > > > that attribute initialization failed (that's what function attempts to > > > do) and that the parameter is invalid (EINVAL). > > > I'd remove it (same applies below). > > > If you find it useful to keep, an extra indent missing (also more below). > > > Recently in ethdev we added more messages like this for NULL parameters. > > I agree it is not a lot useful but I understand that lazy developers may like it ;) > > Shouldn't this specific case be an assert? Unless we are trying to maintain compatibility with existing badly designed semantics. > > The whole calling pattern is non-sensible, the caller passes an NULL parameter to a function where the input contract is non-NULL and then proceeds to handle the error by doing what that could possibly be useful exactly? +1 in this case. This function is only specified to diagnose ENOMEM. On my Linux machine pthread_attr_init(NULL) crashes, I guess that would be compatible behavior.