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 5D629A0A0A; Wed, 24 Mar 2021 06:06:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 644B5140DBF; Wed, 24 Mar 2021 06:06:13 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 5B2A8140DC0 for ; Wed, 24 Mar 2021 06:06:12 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 12O52BSg026531; Tue, 23 Mar 2021 22:06:11 -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=EAJLlPH8LGRooXI0z/picEneFKg7HtG71hir1Bym7T4=; b=GcPZtGOEnbbEHat1ZpUG2ruTXqlyXAnWfGJNjUVsF96UcIiWuz1yM7St944yhoPy36X+ Ob3/WUYrNSkZSjLYL2MSSpRZma5uYd6bqXoXkcicB0VLkqFc/zCD2HNu2llEPcKLWyb8 uMFSY+yeBT6f2hkBhw4FDdL/GuXylx7SCwS6f47r18tbmFpUOcS9MBczLf6GM8p4JcwT Qe1C9dV9b98Ts+RN22IDg/Og2Wb+caeEiVyCvMVPJHfeuklvDuN2+k1MyX6Vx+EC47jQ GYjRTlcdB+ZtwoSERFqhIbimL23/mVcgmWxbXJIbcCjpoFNy02slUdC185ec30HV6hWP kw== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com with ESMTP id 37dgjp3ff2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 23 Mar 2021 22:06:11 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 23 Mar 2021 22:06:08 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 23 Mar 2021 22:06:08 -0700 Received: from BG-LT7430.marvell.com (BG-LT7430.marvell.com [10.28.177.176]) by maili.marvell.com (Postfix) with ESMTP id 1E6393F703F; Tue, 23 Mar 2021 22:06:05 -0700 (PDT) From: To: , , , , , , , , CC: , Pavan Nikhilesh Date: Wed, 24 Mar 2021 10:35:21 +0530 Message-ID: <20210324050525.4489-6-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210324050525.4489-1-pbhagavatula@marvell.com> References: <20210319205718.1436-1-pbhagavatula@marvell.com> <20210324050525.4489-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:6.0.369, 18.0.761 definitions=2021-03-24_03:2021-03-23, 2021-03-24 signatures=0 Subject: [dpdk-dev] [PATCH v5 5/8] eventdev: add Tx adapter event vector support 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" From: Pavan Nikhilesh Add event vector support for event eth Tx adapter, the implementation receives events from the single linked queue and based on rte_event_vector::union_valid transmits the vector of mbufs to a given port, queue pair. Signed-off-by: Pavan Nikhilesh --- .../rte_event_eth_tx_adapter.c | 66 ++++++++++++++++--- lib/librte_eventdev/rte_eventdev.c | 5 +- 2 files changed, 60 insertions(+), 11 deletions(-) diff --git a/lib/librte_eventdev/rte_event_eth_tx_adapter.c b/lib/librte_eventdev/rte_event_eth_tx_adapter.c index 5b4c42dcf..db260bfb6 100644 --- a/lib/librte_eventdev/rte_event_eth_tx_adapter.c +++ b/lib/librte_eventdev/rte_event_eth_tx_adapter.c @@ -510,6 +510,47 @@ txa_service_buffer_retry(struct rte_mbuf **pkts, uint16_t unsent, stats->tx_dropped += unsent - sent; } +static uint16_t +txa_process_event_vector(struct txa_service_data *txa, + struct rte_event_vector *vec) +{ + struct txa_service_queue_info *tqi; + uint16_t port, queue, nb_tx = 0; + struct rte_mbuf **mbufs; + int i; + + mbufs = (struct rte_mbuf **)vec->mbufs; + if (vec->attr_valid) { + port = vec->port; + queue = vec->queue; + tqi = txa_service_queue(txa, port, queue); + if (unlikely(tqi == NULL || !tqi->added)) { + rte_pktmbuf_free_bulk(mbufs, vec->nb_elem); + rte_mempool_put(rte_mempool_from_obj(vec), vec); + return 0; + } + for (i = 0; i < vec->nb_elem; i++) { + nb_tx += rte_eth_tx_buffer(port, queue, tqi->tx_buf, + mbufs[i]); + } + } else { + for (i = 0; i < vec->nb_elem; i++) { + port = mbufs[i]->port; + queue = rte_event_eth_tx_adapter_txq_get(mbufs[i]); + tqi = txa_service_queue(txa, port, queue); + if (unlikely(tqi == NULL || !tqi->added)) { + rte_pktmbuf_free(mbufs[i]); + continue; + } + nb_tx += rte_eth_tx_buffer(port, queue, tqi->tx_buf, + mbufs[i]); + } + } + rte_mempool_put(rte_mempool_from_obj(vec), vec); + + return nb_tx; +} + static void txa_service_tx(struct txa_service_data *txa, struct rte_event *ev, uint32_t n) @@ -522,22 +563,27 @@ txa_service_tx(struct txa_service_data *txa, struct rte_event *ev, nb_tx = 0; for (i = 0; i < n; i++) { - struct rte_mbuf *m; uint16_t port; uint16_t queue; struct txa_service_queue_info *tqi; - m = ev[i].mbuf; - port = m->port; - queue = rte_event_eth_tx_adapter_txq_get(m); + if (!(ev[i].event_type & RTE_EVENT_TYPE_VECTOR)) { + struct rte_mbuf *m; - tqi = txa_service_queue(txa, port, queue); - if (unlikely(tqi == NULL || !tqi->added)) { - rte_pktmbuf_free(m); - continue; - } + m = ev[i].mbuf; + port = m->port; + queue = rte_event_eth_tx_adapter_txq_get(m); - nb_tx += rte_eth_tx_buffer(port, queue, tqi->tx_buf, m); + tqi = txa_service_queue(txa, port, queue); + if (unlikely(tqi == NULL || !tqi->added)) { + rte_pktmbuf_free(m); + continue; + } + + nb_tx += rte_eth_tx_buffer(port, queue, tqi->tx_buf, m); + } else { + nb_tx += txa_process_event_vector(txa, ev[i].vec); + } } stats->tx_packets += nb_tx; diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c index 254a31b1f..ed6b5ba59 100644 --- a/lib/librte_eventdev/rte_eventdev.c +++ b/lib/librte_eventdev/rte_eventdev.c @@ -196,7 +196,10 @@ rte_event_eth_tx_adapter_caps_get(uint8_t dev_id, uint16_t eth_port_id, if (caps == NULL) return -EINVAL; - *caps = 0; + if (dev->dev_ops->eth_tx_adapter_caps_get == NULL) + *caps = RTE_EVENT_ETH_TX_ADAPTER_CAP_EVENT_VECTOR; + else + *caps = 0; return dev->dev_ops->eth_tx_adapter_caps_get ? (*dev->dev_ops->eth_tx_adapter_caps_get)(dev, -- 2.17.1