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 6CCD445B3C; Tue, 15 Oct 2024 04:59:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1A70540270; Tue, 15 Oct 2024 04:59:51 +0200 (CEST) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id 6EFA740156 for ; Tue, 15 Oct 2024 04:59:49 +0200 (CEST) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-20c767a9c50so39045995ad.1 for ; Mon, 14 Oct 2024 19:59:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728961188; x=1729565988; darn=dpdk.org; 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=qETQFzNoTzHfslsucE/6+yCeLy0Avr1vJTELdcYlfRc=; b=ckOR7g+eBMNAL+f9/1vSab8gW490SlvlBNn2hRDuFC5TAwiopRKa0DUpR0AWINLgNt IBToAj6rZlbys3xZ8aALG0ZYV8O5nhEl7A25hL2zcHaG5sZi3Y8EWhecUI+qbHNEFlJx lgURbQnvlGdTixQh7n5Xyo2DnA2JDy3Ei5hzNAmvzxXInMG1gMWH/s3uFC6YWG2U8dc+ WyYDEoODP7bz/sArN3lvaESLv0hT3ZzqowpLEFzKmtZf0GdwJ3ettBOmBV1PUDKVA4FZ WQ0zEvTq0HQEJoVFYFFbK/jTYsow80egULVbqFVtAroSzLROUaTFYRP4awbt2ztGhamd 9JLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728961188; x=1729565988; 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=qETQFzNoTzHfslsucE/6+yCeLy0Avr1vJTELdcYlfRc=; b=i4C9YTpXG88uSgZqqjGoIM4YAOoxrKAX0ttpJ1oA59ghvYSBMU+R6qfycBNLFI9A61 kpVKn6vW1GLqipkiFxL6bNRCmhd+QzAbPceL1EccKWc/54+swKfwiJgFDtDOOJRWfxcY JxjH802eVjf4DSNSGZIPRHL4lhHvuNHc6VrtCBQn1RssxTZzZgls0wSGk2bS003SAYdT Ok5PyLchhahPaAXVaobDE5OWZVN5W29+ojEGi6ay/Ph4HASW6JoMfZgwOZoczEhwTPwb z2J/K9GdykcShTynx5up/hE8NWT7wEL6zsNylOnOaa6V+gyTDz7sDze22PLdk9bpfjEM H92A== X-Gm-Message-State: AOJu0Yw2w2TIOjq+t1A8rJtkB2ehzSQs67KpvA85qNyYxRCty0Q+RC6F BYKKN4ItBCt4QViIWw3dH6xRge1MWrjeO1U1yeBxPcQQ1Nsl1TYNFaUOg8AsbrM= X-Google-Smtp-Source: AGHT+IFNxtfoba5b+1xA1lkdswAHbs9AtqxjcHRN+r64HQLGHgWGmptYrzZOs1mVY9ZARN1nMV8THg== X-Received: by 2002:a17:902:e5d2:b0:20c:ce9c:bbb0 with SMTP id d9443c01a7336-20cce9cbddfmr123970295ad.0.1728961188383; Mon, 14 Oct 2024 19:59:48 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7ea9c6ba3d7sm283679a12.3.2024.10.14.19.59.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2024 19:59:48 -0700 (PDT) Date: Mon, 14 Oct 2024 19:59:46 -0700 From: Stephen Hemminger To: Gagandeep Singh Cc: dev@dpdk.org, Sachin Saxena , Jun Yang Subject: Re: [v6 08/15] dma/dpaa: refactor driver Message-ID: <20241014195946.7290c909@hermes.local> In-Reply-To: <20241014093639.553467-9-g.singh@nxp.com> References: <20241008105810.1454133-2-g.singh@nxp.com> <20241014093639.553467-1-g.singh@nxp.com> <20241014093639.553467-9-g.singh@nxp.com> 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 Mon, 14 Oct 2024 15:06:32 +0530 Gagandeep Singh wrote: > @@ -551,7 +485,7 @@ fsl_qdma_reg_init(struct fsl_qdma_engine *fsl_qdma) > > /* Initialize the status queue mode. */ > reg = FSL_QDMA_BSQMR_EN; > - val = ilog2(fsl_qdma->status[j]->n_cq) - 6; > + val = ilog2_qsize(temp_stat->n_cq); > reg |= FSL_QDMA_BSQMR_CQ_SIZE(val); > qdma_writel(reg, block + FSL_QDMA_BSQMR); > } > @@ -563,158 +497,389 @@ fsl_qdma_reg_init(struct fsl_qdma_engine *fsl_qdma) > return 0; > } > > -static void * > -fsl_qdma_prep_memcpy(void *fsl_chan, dma_addr_t dst, > - dma_addr_t src, size_t len, > - void *call_back, > - void *param) > +static uint16_t > +dpaa_qdma_block_dequeue(struct fsl_qdma_engine *fsl_qdma, > + uint8_t block_id) > { > - struct fsl_qdma_comp *fsl_comp; > + struct fsl_qdma_status_queue *stat_queue; > + struct fsl_qdma_queue *cmd_queue; > + struct fsl_qdma_comp_cmd_desc *cq; > + uint16_t start, count = 0; > + uint8_t qid = 0; > + uint32_t reg; > + int ret; > + uint8_t *block; > + uint16_t *dq_complete; > + struct fsl_qdma_desc *desc[FSL_QDMA_SG_MAX_ENTRY]; > > - fsl_comp = > - fsl_qdma_request_enqueue_desc((struct fsl_qdma_chan *)fsl_chan); > - if (!fsl_comp) > - return NULL; > + stat_queue = &fsl_qdma->stat_queues[block_id]; > + cq = stat_queue->cq; > + start = stat_queue->complete; > + > + block = fsl_qdma->block_base + > + FSL_QDMA_BLOCK_BASE_OFFSET(fsl_qdma, block_id); > > - fsl_comp->qchan = fsl_chan; > - fsl_comp->call_back_func = call_back; > - fsl_comp->params = param; > + do { > + reg = qdma_readl_be(block + FSL_QDMA_BSQSR); > + if (reg & FSL_QDMA_BSQSR_QE_BE) > + break; > > - fsl_qdma_comp_fill_memcpy(fsl_comp, dst, src, len); > - return (void *)fsl_comp; > + qdma_writel_be(FSL_QDMA_BSQMR_DI, block + FSL_QDMA_BSQMR); > + ret = qdma_ccdf_get_queue(&cq[start], &qid); > + if (ret == true) { > + cmd_queue = &fsl_qdma->cmd_queues[block_id][qid]; > + > + ret = rte_ring_dequeue(cmd_queue->complete_burst, > + (void **)&dq_complete); > + if (ret) > + rte_panic("DQ desc number failed!\n"); Please don't panic here, either recover, log an error or take the device offline. Killing the whole application is not acceptable.