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 CDA5541D4C; Thu, 23 Feb 2023 09:56:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AD167430F6; Thu, 23 Feb 2023 09:56:58 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id A23B9430F3 for ; Thu, 23 Feb 2023 09:56:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677142617; 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=u4g1sWJzdnrQHhogfE/6ivnHmVWkjVM2cAFB6QEjjb8=; b=RoU1Jh8R9OJNRuxrplBYVAKpYBasLTJRAuGGSwCl/aEZsNJwnVrCMwXQ/S13F4vdbq/E9u dpOjTQJE7f/TG4H0jos0/NbbowIP4ahN9hWFNhD2Os5YtqEnrltzrGGu5bQjHUoMF3ThuU kSVAx086HgjG/Pm5F0J4iYzpxG2a5mM= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-663-xssEERWKMG-nYIDcLfFhFQ-1; Thu, 23 Feb 2023 03:56:52 -0500 X-MC-Unique: xssEERWKMG-nYIDcLfFhFQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 256AF280A322; Thu, 23 Feb 2023 08:56:52 +0000 (UTC) Received: from [10.39.208.21] (unknown [10.39.208.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2F15F2166B29; Thu, 23 Feb 2023 08:56:51 +0000 (UTC) Message-ID: Date: Thu, 23 Feb 2023 09:56:49 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 To: Nicolas Chautru , hernan.vargas@intel.com, dev@dpdk.org Cc: stable@dpdk.org References: <20230209221929.265059-2-nicolas.chautru@intel.com> <20230210175841.303450-1-nicolas.chautru@intel.com> <20230210175841.303450-2-nicolas.chautru@intel.com> From: Maxime Coquelin Subject: Re: [PATCH v2 1/9] baseband/acc: protection for TB negative scenario In-Reply-To: <20230210175841.303450-2-nicolas.chautru@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed 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 2/10/23 18:58, Nicolas Chautru wrote: > Adding handling of negative scenario for malformed > Transport Block mode operations. > > Fixes: bec597b78a0 ("baseband/acc200: add LTE processing") The format is invalid, the sha-1 should be 12B long, checkpatch complains about it: WARNING:BAD_FIXES_TAG: Please use correct Fixes: style 'Fixes: <12 chars of sha1> ("")' - ie: 'Fixes: bec597b78a0e ("baseband/acc200: add LTE processing")' #9: Fixes: bec597b78a0 ("baseband/acc200: add LTE processing") I will fix it here and in other patches. To avoid such issues, you can add an alias in your git global config file (e.g. ~/.gitconfig): [alias] fixline = log -1 --abbrev=12 --format='Fixes: %h (\"%s\")%nCc: %ae' With this, to generate a Fixes tag, you just have to do: $ git fixline bec597b78a0e347f7a82a0d51e4a9fc61dea0a16 Fixes: bec597b78a0e ("baseband/acc200: add LTE processing") Cc: nicolas.chautru@intel.com Hernan, this issue is also present in "baseband/acc: fix check after deref and dead code", I will also fix it while applying, but please consider adding the git alias. Thanks, Maxime > Cc: stable@dpdk.org > > Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com> > Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> > --- > drivers/baseband/acc/rte_vrb_pmd.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/drivers/baseband/acc/rte_vrb_pmd.c b/drivers/baseband/acc/rte_vrb_pmd.c > index 34e42d1f6e..3afaea71a3 100644 > --- a/drivers/baseband/acc/rte_vrb_pmd.c > +++ b/drivers/baseband/acc/rte_vrb_pmd.c > @@ -1820,6 +1820,9 @@ enqueue_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *op, > r = op->turbo_enc.tb_params.r; > > while (mbuf_total_left > 0 && r < c) { > + if (unlikely((input == NULL) || (output == NULL))) > + return -1; > + > seg_total_left = rte_pktmbuf_data_len(input) - in_offset; > /* Set up DMA descriptor */ > desc = acc_desc(q, total_enqueued_cbs); > @@ -1854,6 +1857,10 @@ enqueue_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *op, > r++; > } > > + /* In case the number of CB doesn't match, the configuration was invalid. */ > + if (unlikely(current_enqueued_cbs != cbs_in_tb)) > + return -1; > + > /* Set SDone on last CB descriptor for TB mode. */ > desc->req.sdone_enable = 1; > > @@ -2100,6 +2107,9 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, > } > > while (mbuf_total_left > 0 && r < c) { > + if (unlikely((input == NULL) || (h_output == NULL))) > + return -1; > + > if (check_bit(op->ldpc_dec.op_flags, RTE_BBDEV_LDPC_DEC_SCATTER_GATHER)) > seg_total_left = rte_pktmbuf_data_len(input) - in_offset; > else > @@ -2145,6 +2155,10 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, > r++; > } > > + /* In case the number of CB doesn't match, the configuration was invalid. */ > + if (unlikely(current_enqueued_cbs != cbs_in_tb)) > + return -1; > + > #ifdef RTE_LIBRTE_BBDEV_DEBUG > if (check_mbuf_total_left(mbuf_total_left) != 0) > return -EINVAL; > @@ -2187,6 +2201,8 @@ enqueue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, > r = op->turbo_dec.tb_params.r; > > while (mbuf_total_left > 0 && r < c) { > + if (unlikely((input == NULL) || (h_output == NULL))) > + return -1; > > seg_total_left = rte_pktmbuf_data_len(input) - in_offset; > > @@ -2237,6 +2253,10 @@ enqueue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, > r++; > } > > + /* In case the number of CB doesn't match, the configuration was invalid. */ > + if (unlikely(current_enqueued_cbs != cbs_in_tb)) > + return -1; > + > /* Set SDone on last CB descriptor for TB mode */ > desc->req.sdone_enable = 1; >