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 D995142B83; Tue, 23 May 2023 21:28:17 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C916540A80; Tue, 23 May 2023 21:28:17 +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 344AB40689 for ; Tue, 23 May 2023 21:28:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684870095; 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=FHoJieVXw5Q5tDLVt72cgepYUWiD+N6tmMXX8R8EkrE=; b=Fo3561f0FPNsyWOarDszhWBQdYGg4Z5rpsyd/K3e+aFSNRsvADrNjivPAF+qrOoY/3amJU xZDNNUaKXTlLXewWHNVNGeDYhU3cZKMSXLCaDzPi4ObH+S/fXG3sc5wIwdU/8t7GzfEK5N mXwzox9/DzMrGJ346KZEjz9VjmhnCso= 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-520-EDXByai-N466bq5iotttdw-1; Tue, 23 May 2023 15:28:11 -0400 X-MC-Unique: EDXByai-N466bq5iotttdw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 600581C05AAB; Tue, 23 May 2023 19:28:11 +0000 (UTC) Received: from [10.39.208.2] (unknown [10.39.208.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C5062C164ED; Tue, 23 May 2023 19:28:09 +0000 (UTC) Message-ID: Date: Tue, 23 May 2023 21:28:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v1 2/6] baseband/fpga_5gnr_fec: fix seg fault unconf queue To: Hernan Vargas , dev@dpdk.org, gakhil@marvell.com, trix@redhat.com Cc: nicolas.chautru@intel.com, qi.z.zhang@intel.com, stable@dpdk.org References: <20230523184818.139353-1-hernan.vargas@intel.com> <20230523184818.139353-3-hernan.vargas@intel.com> From: Maxime Coquelin In-Reply-To: <20230523184818.139353-3-hernan.vargas@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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 5/23/23 20:48, Hernan Vargas wrote: > Adding exception to prevent segmentation fault in case a queue is > started which was not configured earlier. > > Fixes: c58109a8871d ("baseband/fpga_5gnr_fec: add queue configuration") > Cc: stable@dpdk.org > > Signed-off-by: Hernan Vargas > --- > drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c > index 9388cce52960..a6211f73e6e3 100644 > --- a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c > +++ b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c > @@ -573,6 +573,10 @@ fpga_queue_start(struct rte_bbdev *dev, uint16_t queue_id) > return -1; > } > #endif > + if (dev->data->queues[queue_id].queue_private == NULL) { > + rte_bbdev_log(ERR, "Cannot start invalid queue %d", queue_id); > + return -1; > + } > struct fpga_queue *q = dev->data->queues[queue_id].queue_private; > uint32_t offset = FPGA_5GNR_FEC_RING_CTRL_REGS + > (sizeof(struct fpga_ring_ctrl_reg) * q->q_idx); Same comment here for offset and q declarations, it should be at the top of the function. Maxime