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 1E81DA0093; Tue, 10 May 2022 14:11:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 01E754281D; Tue, 10 May 2022 14:11:40 +0200 (CEST) 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 D02DB4069D for ; Tue, 10 May 2022 14:11:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652184698; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=grPaU/RUaYO/d2lrHj8D/+lBLTK2fEocrsUmJyJGpwI=; b=UkEGhckgif+wi4eZ63nj3avMQ5Z3uz79KAek/sIaZn05RGxzlTu9qK0YQg04VJZvm/HVYB NlZNOd40EWfvVq0aRt+dowuxS4FexSWBEcpGoFVbwQWtx7MbwYHoHWx/UGgKl33rBMnScT YCU9H/kFVvCxqoVjmDlz481+suVYli4= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-222-rkheHElmPLOnlH-NChwXlg-1; Tue, 10 May 2022 08:11:35 -0400 X-MC-Unique: rkheHElmPLOnlH-NChwXlg-1 Received: by mail-qk1-f198.google.com with SMTP id c84-20020a379a57000000b0069fcf83c373so10522775qke.20 for ; Tue, 10 May 2022 05:11:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=grPaU/RUaYO/d2lrHj8D/+lBLTK2fEocrsUmJyJGpwI=; b=2BxCWB4ToBOxO1VQMD57tLfK3OizbfKmtFRwVSqE8XvnYDsI9W4ZkJd02J7hu0qBfS h5F6+x0o2HL6nozRoVOFToLYyyVuAJAvwA6OZsq5FCI/QYjylr6+Llwxk98L0CXrMuOA JhgzMENIPiBHYR0Ocx/4rsMOj79JUZeNgY47D9KKkq0vVsQMiHJv2lL9k4Eouka8PViB Hxdw6We/G5ugR0FSBDyCaH1fKorx3RGtkCka9gRrLe/J2sMgBHdxwIEVXVpC8Ey3qAj4 gW8jlBge8j8eiXDnq+DW6A27P9YXjJon1oS8PxfHCC+BSwsIJFUFMTOWj/iHFrBXQgJM /+Rw== X-Gm-Message-State: AOAM531z6bZ2AyKz6BogWTM/IGrJ+bdcvhZApgY2ZZbnlLtpfj9wh6ug jO3n8c2LdRh2hrqxcnUyrAbb6U6xiobDk9YaXarVVdzLshqZHtLOeAY3D1A2DfnxkPrEyAPSDLQ PU0g= X-Received: by 2002:a05:622a:11:b0:2f3:ba6b:7139 with SMTP id x17-20020a05622a001100b002f3ba6b7139mr19352105qtw.411.1652184694859; Tue, 10 May 2022 05:11:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3QjS9P+e9kCsjYcJOZyl2M5HllVeU8glTJt20hcAeuodOoSOkN8fvmVCgjLBLVn07oKWe2g== X-Received: by 2002:a05:622a:11:b0:2f3:ba6b:7139 with SMTP id x17-20020a05622a001100b002f3ba6b7139mr19352082qtw.411.1652184694605; Tue, 10 May 2022 05:11:34 -0700 (PDT) Received: from localhost.localdomain (024-205-208-113.res.spectrum.com. [24.205.208.113]) by smtp.gmail.com with ESMTPSA id w14-20020ac87e8e000000b002f3d23cf87esm5920524qtj.27.2022.05.10.05.11.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 May 2022 05:11:33 -0700 (PDT) Subject: Re: [PATCH v2 5/5] baseband/acc100: add protection for some negative scenario To: "Chautru, Nicolas" , "dev@dpdk.org" , "gakhil@marvell.com" Cc: "thomas@monjalon.net" , "Kinsella, Ray" , "Richardson, Bruce" , "hemant.agrawal@nxp.com" , "Zhang, Mingshan" , "david.marchand@redhat.com" References: <1651083423-33202-1-git-send-email-nicolas.chautru@intel.com> <1651083423-33202-6-git-send-email-nicolas.chautru@intel.com> <1c8eb52f-437e-c5eb-ed85-182dc8b81499@redhat.com> From: Tom Rix Message-ID: Date: Tue, 10 May 2022 05:11:30 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=trix@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US 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 5/9/22 2:45 PM, Chautru, Nicolas wrote: > Hi Tom, > >> -----Original Message----- >> From: Tom Rix >> Sent: Sunday, May 8, 2022 6:56 AM >> To: Chautru, Nicolas ; dev@dpdk.org; >> gakhil@marvell.com >> Cc: thomas@monjalon.net; Kinsella, Ray ; Richardson, >> Bruce ; hemant.agrawal@nxp.com; Zhang, >> Mingshan ; david.marchand@redhat.com >> Subject: Re: [PATCH v2 5/5] baseband/acc100: add protection for some >> negative scenario >> >> >> On 4/27/22 11:17 AM, Nicolas Chautru wrote: >>> Catch exception in PMD in case of invalid input parameter. >> It is not clear if this is 1 fix or 2. >> >> But it does look like an acc100 fix so it should be split from the >> acc101 patchset. >> > What is the concern? This is a different commit related to acc100. Bisecting patchsets. A patchset like this that enables a new device should just enable the new device. Not enable a new device and random other stuff. If the patchset had to be reverted, the revert would wipe out the fixes. That work is done by someone else without deep knowledge or time to analyze every patchset for misc parts. The fixes are more important than the new device, so they should be submitted first. Tom > >>> Signed-off-by: Nicolas Chautru >>> --- >>> drivers/baseband/acc100/rte_acc100_pmd.c | 6 ++++++ >>> 1 file changed, 6 insertions(+) >>> >>> diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c >>> b/drivers/baseband/acc100/rte_acc100_pmd.c >>> index b588f5f..a13966c 100644 >>> --- a/drivers/baseband/acc100/rte_acc100_pmd.c >>> +++ b/drivers/baseband/acc100/rte_acc100_pmd.c >>> @@ -1241,6 +1241,8 @@ >>> return (bg == 1 ? ACC100_K0_3_1 : ACC100_K0_3_2) >> * z_c; >>> } >>> /* LBRM case - includes a division by N */ >>> + if (unlikely(z_c == 0)) >>> + return 0; >> This check should be moved to earlier, if 'n' is set to 0 in the statement above, >> there is div by 0 later > N is purely a factor of z_c, I don’t see the concern is order. > >> Tom >> >>> if (rv_index == 1) >>> return (((bg == 1 ? ACC100_K0_1_1 : ACC100_K0_1_2) * >> n_cb) >>> / n) * z_c; >>> @@ -1916,6 +1918,10 @@ static inline uint32_t hq_index(uint32_t >>> offset) >>> >>> /* Soft output */ >>> if (check_bit(op->turbo_dec.op_flags, >> RTE_BBDEV_TURBO_SOFT_OUTPUT)) >>> { >>> + if (op->turbo_dec.soft_output.data == 0) { >>> + rte_bbdev_log(ERR, "Soft output is not defined"); >>> + return -1; >>> + } >>> if (check_bit(op->turbo_dec.op_flags, >>> RTE_BBDEV_TURBO_EQUALIZER)) >>> *s_out_length = e;