From patchwork Mon May 31 21:41:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Duszynski X-Patchwork-Id: 93652 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 36C30A0524; Mon, 31 May 2021 23:43:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A02BC41142; Mon, 31 May 2021 23:42:26 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id CAD5740E50 for ; Mon, 31 May 2021 23:42:23 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 14VLeDUD025917 for ; Mon, 31 May 2021 14:42:23 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=wqVctv4gNmPkofOKYr6ZQTdFzle8cN9UcInjJFWdQXs=; b=UJRjmG4u93e5hVOYzLDS5+GI+KNRYSPdmwozadpwtlkjNYH5obSR13kXjCXxOn8QuNVs p1SKqb5yCbshrlAeEDt58yfZyQhw1tFpP4CCLTZifI6T/oLP8mmPrJW0JN198mVbjeTe iVIcDPAxEL2vq5ErDm1vuWw8NUOjU+Z/l/K4z1kD60nZi9yG/anfE+R9HBUnFAen70Io k8OmRImUQzFyk5jlcp6+a460BJwIBM2qtSfmvRVb0lROg4WbtHmb+xu1hbxS/DKa1mDC WIIvHZHFompoNLjiogQ9n4b9L5T04hADAqdyJQH+DIQABHABH4bKXZtLly9rsbnvvLeT fg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com with ESMTP id 38vjqj3393-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 31 May 2021 14:42:22 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 31 May 2021 14:42:21 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 31 May 2021 14:42:21 -0700 Received: from EH-LT0048.marvell.com (unknown [10.193.32.52]) by maili.marvell.com (Postfix) with ESMTP id A53313F703F; Mon, 31 May 2021 14:42:20 -0700 (PDT) From: Tomasz Duszynski To: CC: , , Tomasz Duszynski Date: Mon, 31 May 2021 23:41:27 +0200 Message-ID: <20210531214142.30167-14-tduszynski@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210531214142.30167-1-tduszynski@marvell.com> References: <20210531214142.30167-1-tduszynski@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: njXNJezJWvDqJ3aIt0OFesEtSn6EhS62 X-Proofpoint-ORIG-GUID: njXNJezJWvDqJ3aIt0OFesEtSn6EhS62 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-05-31_15:2021-05-31, 2021-05-31 signatures=0 Subject: [dpdk-dev] [PATCH 13/28] raw/cnxk_bphy: add support for dequeue operation 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 Sender: "dev" Add support for dequeueing responses to previously enqueued messages. Signed-off-by: Tomasz Duszynski Signed-off-by: Jakub Palider --- drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c index 637514406..a8eafae1b 100644 --- a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c +++ b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c @@ -157,6 +157,32 @@ cnxk_bphy_cgx_enqueue_bufs(struct rte_rawdev *dev, return 1; } +static int +cnxk_bphy_cgx_dequeue_bufs(struct rte_rawdev *dev, + struct rte_rawdev_buf **buffers, unsigned int count, + rte_rawdev_obj_t context) +{ + struct cnxk_bphy_cgx *cgx = dev->dev_private; + unsigned int queue = (size_t)context; + struct cnxk_bphy_cgx_queue *qp; + + if (queue >= cgx->num_queues) + return -EINVAL; + + if (count == 0) + return 0; + + qp = &cgx->queues[queue]; + if (qp->rsp) { + buffers[0]->buf_addr = qp->rsp; + qp->rsp = NULL; + + return 1; + } + + return 0; +} + static uint16_t cnxk_bphy_cgx_queue_count(struct rte_rawdev *dev) { @@ -168,6 +194,7 @@ cnxk_bphy_cgx_queue_count(struct rte_rawdev *dev) static const struct rte_rawdev_ops cnxk_bphy_cgx_rawdev_ops = { .queue_def_conf = cnxk_bphy_cgx_queue_def_conf, .enqueue_bufs = cnxk_bphy_cgx_enqueue_bufs, + .dequeue_bufs = cnxk_bphy_cgx_dequeue_bufs, .queue_count = cnxk_bphy_cgx_queue_count, };