From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id AFBD9A0487 for ; Wed, 3 Jul 2019 12:04:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E51DA231E; Wed, 3 Jul 2019 12:04:48 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 5A36B23D for ; Wed, 3 Jul 2019 12:04:47 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x639xbCo028324 for ; Wed, 3 Jul 2019 03:04:46 -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=pfpt0818; bh=kFUjB251FBgf5Ms3qntkD4XHwEPiXw3xz/td1CR+Le8=; b=kIKzNVg5L7zxBPs4+MtKBI5X+M5oJMToWyuMMhk59zOei8l1PceODIMxYjjS74cgwdW0 2FvT0gOE4YqQrDP8WqwqlbCSOGKO90i9OlQ5qnKb1tRHFzvQdtsVGCm7Li5qDw3DXujh KrocCeLe0fnzjjPqUytZDwC+VPl+fUQCJsdxQERAVlK7dvB/AbRk2ek0IxgR0yDqQ3HP /fA9eySEZ8kP8xBTZ8iZej8TqqTgufqeHGBuXWEEpkAZcOcbw8bQVDSoxLv49u5ybB6U V4H5bN9BF8+Ty6JtL/Qy5FWQuxjVP9A8Xh/o23loyGrD/T7KfvYAuPrP1Psns6o8wesX xw== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2tgrv18b6t-14 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 03 Jul 2019 03:04:46 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 3 Jul 2019 03:04:41 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Wed, 3 Jul 2019 03:04:41 -0700 Received: from BG-LT7430.marvell.com (unknown [10.28.17.31]) by maili.marvell.com (Postfix) with ESMTP id 59BF93F703F; Wed, 3 Jul 2019 03:04:39 -0700 (PDT) From: To: , Pavan Nikhilesh CC: Date: Wed, 3 Jul 2019 15:34:26 +0530 Message-ID: <20190703100430.716-3-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190703100430.716-1-pbhagavatula@marvell.com> References: <20190703100430.716-1-pbhagavatula@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-07-03_03:, , signatures=0 Subject: [dpdk-dev] [PATCH v3 2/6] event/octeontx2: resize SSO inflight event buffers X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" From: Pavan Nikhilesh Resize SSO internal in-flight buffer count based on the Rx queues mempool size connected to event queues. Signed-off-by: Pavan Nikhilesh --- drivers/event/octeontx2/otx2_evdev.h | 2 ++ drivers/event/octeontx2/otx2_evdev_adptr.c | 34 +++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/drivers/event/octeontx2/otx2_evdev.h b/drivers/event/octeontx2/otx2_evdev.h index 8bee8c737..107aa79d4 100644 --- a/drivers/event/octeontx2/otx2_evdev.h +++ b/drivers/event/octeontx2/otx2_evdev.h @@ -132,7 +132,9 @@ struct otx2_sso_evdev { uint64_t nb_xaq_cfg; rte_iova_t fc_iova; struct rte_mempool *xaq_pool; + uint16_t rx_adptr_pool_cnt; uint32_t adptr_xae_cnt; + uint64_t *rx_adptr_pools; /* Dev args */ uint8_t dual_ws; uint8_t selftest; diff --git a/drivers/event/octeontx2/otx2_evdev_adptr.c b/drivers/event/octeontx2/otx2_evdev_adptr.c index 836184ac5..d849a9ea6 100644 --- a/drivers/event/octeontx2/otx2_evdev_adptr.c +++ b/drivers/event/octeontx2/otx2_evdev_adptr.c @@ -199,6 +199,29 @@ void sso_updt_xae_cnt(struct otx2_sso_evdev *dev, void *data, uint32_t event_type) { switch (event_type) { + case RTE_EVENT_TYPE_ETHDEV: + { + struct otx2_eth_rxq *rxq = data; + int i, match = false; + + for (i = 0; i < dev->rx_adptr_pool_cnt; i++) { + if ((uint64_t)rxq->pool == dev->rx_adptr_pools[i]) + match = true; + } + + if (!match) { + dev->rx_adptr_pool_cnt++; + dev->rx_adptr_pools = rte_realloc(dev->rx_adptr_pools, + sizeof(uint64_t) * + dev->rx_adptr_pool_cnt + , 0); + dev->rx_adptr_pools[dev->rx_adptr_pool_cnt - 1] = + (uint64_t)rxq->pool; + + dev->adptr_xae_cnt += rxq->pool->size; + } + break; + } case RTE_EVENT_TYPE_TIMER: { dev->adptr_xae_cnt += (*(uint64_t *)data); @@ -216,21 +239,30 @@ otx2_sso_rx_adapter_queue_add(const struct rte_eventdev *event_dev, const struct rte_event_eth_rx_adapter_queue_conf *queue_conf) { struct otx2_eth_dev *otx2_eth_dev = eth_dev->data->dev_private; + struct otx2_sso_evdev *dev = sso_pmd_priv(event_dev); uint16_t port = eth_dev->data->port_id; + struct otx2_eth_rxq *rxq; int i, rc; - RTE_SET_USED(event_dev); rc = strncmp(eth_dev->device->driver->name, "net_octeontx2", 13); if (rc) return -EINVAL; if (rx_queue_id < 0) { for (i = 0 ; i < eth_dev->data->nb_rx_queues; i++) { + rxq = eth_dev->data->rx_queues[i]; + sso_updt_xae_cnt(dev, rxq, RTE_EVENT_TYPE_ETHDEV); + rc = sso_xae_reconfigure((struct rte_eventdev *) + (uintptr_t)event_dev); rc |= sso_rxq_enable(otx2_eth_dev, i, queue_conf->ev.sched_type, queue_conf->ev.queue_id, port); } } else { + rxq = eth_dev->data->rx_queues[rx_queue_id]; + sso_updt_xae_cnt(dev, rxq, RTE_EVENT_TYPE_ETHDEV); + rc = sso_xae_reconfigure((struct rte_eventdev *) + (uintptr_t)event_dev); rc |= sso_rxq_enable(otx2_eth_dev, (uint16_t)rx_queue_id, queue_conf->ev.sched_type, queue_conf->ev.queue_id, port); -- 2.22.0