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 9808DA0547; Tue, 15 Nov 2022 17:00:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8122440E03; Tue, 15 Nov 2022 17:00:12 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id CE17D40DFD for ; Tue, 15 Nov 2022 17:00:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668528009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=nCQyx1fAYpiCuQF4XVnRY43d3xjnR0VdxuEYkTd3SzQ=; b=Vo1mcppMEUa00j0ck9xiI3jRdtLmOnda0n2d2KjriEirPOVv/lej/knkuUyA0ifTi282jy sfSvzgTFBRCGPT+Y9ff1pXkEwRMjnFEP6LLXe/AXMB56svgRye/KsofU4EGBVaq07KrrqA OPDNhcoRI8JEXp8Oup0bzO+oxRCNlyI= Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-522-ptYEKEgrP-Wel9MOqwbrNg-1; Tue, 15 Nov 2022 11:00:06 -0500 X-MC-Unique: ptYEKEgrP-Wel9MOqwbrNg-1 Received: by mail-pg1-f199.google.com with SMTP id i71-20020a63874a000000b00476a4a5452eso2043815pge.22 for ; Tue, 15 Nov 2022 08:00:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nCQyx1fAYpiCuQF4XVnRY43d3xjnR0VdxuEYkTd3SzQ=; b=WSF4K5/YgQTS6sAaMDzO7zO1FnFTMYtWDewiHZKOH/Je6pCeH9xCdwcNETSzu2vGYo OSRj1xRkkbXwSmXpyBcDvZkY+9BQFexnf55jTGkYJlmuFbAqTQJmYCMsQPKUsnieEqPL F3YQq1DxF7ertAfJe3fpRWI3UE0FEZbRqQBXSTEKExiFzqo4Naux++TnDC3FYaKDXz/y iCiAy5eIWC13xLahLJhxI6jXK3NmnZRADrYJvlpDC+HP3Dt36O5yKrwdmYfokHLHAG50 L9t7FSggAJPbJbMuRQjJ+9fNP+mPDKRMuYxXATrOGmc+Z0wqbTIJT6h+GF2WMnYvPlCf aKUg== X-Gm-Message-State: ANoB5pkh2mN2JDUj0a3D1e+fKJxgWYuIj8bWquVaDIsDiUxueTvp0Cqc kkRR/k99BQR1SFRppMreZAqTE9FtovTKfLksVxjNzGX1X4b0HeaXm/yycgK+w6h68SKZK0ME34L rqD5lNo01fIjI18g5juA= X-Received: by 2002:a17:903:2d2:b0:188:4f86:e4d5 with SMTP id s18-20020a17090302d200b001884f86e4d5mr4813537plk.16.1668528004103; Tue, 15 Nov 2022 08:00:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf7cIIq4aZET7pvXwymv3z2KpLKJak/Q+8LQmX7RGm9ypbF8kvgufFydCQ325dvYtSTgQ4tdq1eGcbzMwtq+UYw= X-Received: by 2002:a17:903:2d2:b0:188:4f86:e4d5 with SMTP id s18-20020a17090302d200b001884f86e4d5mr4813503plk.16.1668528003773; Tue, 15 Nov 2022 08:00:03 -0800 (PST) MIME-Version: 1.0 References: <20221104035209.62109-1-hernan.vargas@intel.com> <20221104035209.62109-2-hernan.vargas@intel.com> In-Reply-To: From: David Marchand Date: Tue, 15 Nov 2022 16:59:52 +0100 Message-ID: Subject: Re: [PATCH v1 1/1] baseband/acc: fix check after deref and dead code To: "Chautru, Nicolas" , "Vargas, Hernan" Cc: "dev@dpdk.org" , "gakhil@marvell.com" , "trix@redhat.com" , "maxime.coquelin@redhat.com" , "Zhang, Qi Z" X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 Hello Nicolas, Hernan, On Thu, Nov 10, 2022 at 10:15 PM Chautru, Nicolas wrote: > > > diff --git a/drivers/baseband/acc/rte_acc100_pmd.c > > > b/drivers/baseband/acc/rte_acc100_pmd.c > > > index 96daef87bc..30a718916d 100644 > > > --- a/drivers/baseband/acc/rte_acc100_pmd.c > > > +++ b/drivers/baseband/acc/rte_acc100_pmd.c > > > @@ -4122,15 +4122,11 @@ acc100_dequeue_ldpc_enc(struct > > rte_bbdev_queue_data *q_data, > > > struct rte_bbdev_enc_op *op; > > > union acc_dma_desc *desc; > > > > > > - if (q == NULL) > > > - return 0; > > > > I guess this protects badly written applications that would do stuff like pass an > > incorrect queue id, or call this callback while the queue has not been configured > > yet. > > This is something that should be caught at the bbdev layer (arguably under the > > RTE_LIBRTE_BBDEV_DEBUG if the performance is that much affected, though > > I'd like to see numbers). > > (edit: I see Maxime replied a similar comment). > > That is not directly to that ticket but would be good to follow up. > From previous discussion with Maxime, the new consensus was to avoid special check in debug mode (try to build the same code). It would be good to come up to a new consensus on this. - Yes, there is something to look at in follow ups so we agree on which checks to add and have them *consistent* for all dequeue functions. I am not taking sides with removing or adding checks for now. My point above was to ask for performance numbers as part of this follow ups. If there is concern that adding checks has a cost, we need numbers to conclude. I saw none so far. - Now, for this patch precisely, I still stand with this part of my previous mail: "" > > Back to this particular patch, rather than remove the check, the right fix is to > > move acc_ring_avail_deq(q). > > This is what Coverity reports. """ This suggestion here seems the minimal and correct fix. Deciding on removing/adding more checks can be decided in follow up discussions. -- David Marchand