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 6BF7E42B83; Tue, 23 May 2023 18:00:37 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3C96A40EE1; Tue, 23 May 2023 18:00:37 +0200 (CEST) Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by mails.dpdk.org (Postfix) with ESMTP id 849F740689 for ; Tue, 23 May 2023 18:00:36 +0200 (CEST) Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-64d3578c25bso5422664b3a.3 for ; Tue, 23 May 2023 09:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1684857635; x=1687449635; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=UamnrpnqXGEjnUbVahFQ9L++ltoo41obtG63uMO5M+0=; b=aiFLtT63zZQZQGjbRrrAD44aRDDCrYa9J/8lkn+kWOcajdX+BYX9b1gJW1FU0tOVVK 1dB1ZEmclT+wv8rscqN8O6ANEBtTl7aYlp+xspSSYf3nDOBNJJ6aeFuZkOWfjQSezXdp sHMShSbtC2xCjM5LF4WMY/MVsdBvIIKPRTo/j4iqIUmVnkYnOy9hMnX1tdtaMPp/xvKN 8H9exaQaxKcf3P+RKgjVD7uxngavqBkPoDwG+bD5rZlsW2MVxA9CtAM2E9y5K8VU/1SV KMGisS1CQ5McCWqBDnLy3bm4If7MPS6TNEW0OfM9JyW5bjJPxeR0k/2fYWLgFaqgu0uJ da+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684857635; x=1687449635; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UamnrpnqXGEjnUbVahFQ9L++ltoo41obtG63uMO5M+0=; b=lPjYoZyhRV4Trx+7xLX9zccnmO6NciUVmx29itD6QicZ6UhdmB9fyZ6hsN7OtIM5X/ A4QrErxVgQk+O2QkL3aL02kQ1QOTRVcsAKj710LYgJNOmFIjKiSTHec5bf1kbLW1jzNB RlN5/JY1w9yyBx1PezEjlDR8w6Pm9Utl5UW3wsUsxdRthUyoQNsTkV3qeFMdL3EtGsvw dRQAy0UeZD428HaCWsCn8eUejGu8Lh19vr5Bd95sPKFM5xR0LQg9IW6rFcKRyh6sk5wK TNG5fU1Kbv6h76LW5fWHSaKrNzJ6/ZsmUVG5NH142QFi086MvpzoOnapAwBL3rBrzlum Ey5g== X-Gm-Message-State: AC+VfDwqxWskihGPyVVSAipRrmFgm5EQYfSQ7d+328Jv0WolV5+yuvbt ZA5Mp1PoudOCqvFedJn+eyrybg== X-Google-Smtp-Source: ACHHUZ4E4TiE0BovGlSDHJWyv+4WvtDi6EeVvqoIZSm0IsNqRWCP7RU4V2bG85fCYShnJiXX1DzrNw== X-Received: by 2002:a05:6a00:10c3:b0:64d:2e0a:4812 with SMTP id d3-20020a056a0010c300b0064d2e0a4812mr18377630pfu.17.1684857635654; Tue, 23 May 2023 09:00:35 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id 21-20020aa79115000000b00625d84a0194sm5961154pfh.107.2023.05.23.09.00.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 09:00:35 -0700 (PDT) Date: Tue, 23 May 2023 09:00:33 -0700 From: Stephen Hemminger To: Akhil Goyal Cc: Kamil Godzwon , "dev@dpdk.org" , Fan Zhang Subject: Re: [EXT] Re: [PATCH v2] lib/cryptodev: fix assertion to remove GCC compilation warning Message-ID: <20230523090033.145f635b@hermes.local> In-Reply-To: References: <20230522184951.452626-1-kamilx.godzwon@intel.com> <20230522190453.453281-1-kamilx.godzwon@intel.com> <20230522142510.3952adc5@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Tue, 23 May 2023 08:12:28 +0000 Akhil Goyal wrote: > > > > This could happen if the passed in length to this routine was larger than > > the amount of data in the mbuf. Should the function check and return an error? > > > > Panic should only be reserved for seriously corrupted input (like invalid mbuf). > > > > Also, this is a big enough function that it really should not be inlined. > > This is a datapath API. RTE_ASSERT is normally not enabled in release build. > So, this assert is not doing any check for normal scenario. > We normally avoid these type of error checks in the datapath. > And while building in debug mode, we need these asserts to give a backtrace also > To debug the rootcause of the issue. > > I would suggest fixing the assert itself instead of adding a check. > Current patch will affect performance. > > Agreed, that the function is big for being an inline function, > but that is what all the datapath APIs are and > we keep them inline to improve the performance. Inline is not a magic go fast switch. Turns out that the compilers and cpu's already do good job with functions. Using LTO helps too.