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 3416CA2EDB for ; Mon, 30 Sep 2019 08:59:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1077E2A6C; Mon, 30 Sep 2019 08:59:38 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id F38CD271 for ; Mon, 30 Sep 2019 08:59:35 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x8U6uXVs028776 for ; Sun, 29 Sep 2019 23:59:35 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=pfpt0818; bh=dyz95j2VoxQ7V1Cny/a2QAzTA1XOdXKGOU67BIb9pEE=; b=i7cCrVFX8LCDw5sjj1oYNT1DfgGJoqFDHmlkZqQuTXN+YHLscX0IGoNHev0XG5EyeI/c nv1s9EgtXjSRruWyQroB5PXGAFO90hSOmDTJwrZIjcdlhHDtxD9RmO/Ml3c8sqtbN5Mu ajjUdUtlnu6elQT84i12s2hFcqPU1KsyqR8nG0nawPp9xhEii0P+R3tDZCXT+2cVYzQW HMdjiFhdIyE1CW3grTWUD+IysGQyf2ICpjfdE1Mzzor6LfguvpbYHEPg5MwmhIgCUtLR 5YaTqrF0YPOSzQ3QRQwiAOzSekFDtxftP4Xsy5bsxQ/oHlodCI1RTu7naNed4TGYtQAq AQ== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 2va71md5c6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Sun, 29 Sep 2019 23:59:35 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sun, 29 Sep 2019 23:59:33 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Sun, 29 Sep 2019 23:59:33 -0700 Received: from dc7-eodlnx03.marvell.com (dc7-eodlnx03.marvell.com [10.28.113.53]) by maili.marvell.com (Postfix) with ESMTP id 99E483F7041; Sun, 29 Sep 2019 23:59:31 -0700 (PDT) From: Sunil Kumar Kori To: Jerin Jacob , Nithin Dabilpuram , Kiran Kumar K CC: , Sunil Kumar Kori Date: Mon, 30 Sep 2019 12:29:21 +0530 Message-ID: <1569826761-6772-1-git-send-email-skori@marvell.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-09-30_03:2019-09-25,2019-09-30 signatures=0 Subject: [dpdk-dev] [PATCH] net/octeontx2: add Rx/Tx burst mode get callbacks 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" Retrieve burst mode options according to the selected Rx/Tx burst function. Signed-off-by: Sunil Kumar Kori --- Below implementation is based on following patchset http://patches.dpdk.org/patch/59907/ drivers/net/octeontx2/otx2_ethdev.c | 2 ++ drivers/net/octeontx2/otx2_ethdev.h | 4 +++ drivers/net/octeontx2/otx2_ethdev_ops.c | 45 +++++++++++++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c index b84128fef..558ad92f1 100644 --- a/drivers/net/octeontx2/otx2_ethdev.c +++ b/drivers/net/octeontx2/otx2_ethdev.c @@ -1643,6 +1643,8 @@ static const struct eth_dev_ops otx2_eth_dev_ops = { .xstats_get_names_by_id = otx2_nix_xstats_get_names_by_id, .rxq_info_get = otx2_nix_rxq_info_get, .txq_info_get = otx2_nix_txq_info_get, + .rx_burst_mode_get = otx2_rx_burst_mode_get, + .tx_burst_mode_get = otx2_tx_burst_mode_get, .rx_queue_count = otx2_nix_rx_queue_count, .rx_descriptor_done = otx2_nix_rx_descriptor_done, .rx_descriptor_status = otx2_nix_rx_descriptor_status, diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h index 7b15d6bc8..c1de1522b 100644 --- a/drivers/net/octeontx2/otx2_ethdev.h +++ b/drivers/net/octeontx2/otx2_ethdev.h @@ -373,6 +373,10 @@ void otx2_nix_rxq_info_get(struct rte_eth_dev *eth_dev, uint16_t queue_id, struct rte_eth_rxq_info *qinfo); void otx2_nix_txq_info_get(struct rte_eth_dev *eth_dev, uint16_t queue_id, struct rte_eth_txq_info *qinfo); +int otx2_rx_burst_mode_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_burst_mode *mode); +int otx2_tx_burst_mode_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_burst_mode *mode); uint32_t otx2_nix_rx_queue_count(struct rte_eth_dev *eth_dev, uint16_t qidx); int otx2_nix_tx_done_cleanup(void *txq, uint32_t free_cnt); int otx2_nix_rx_descriptor_done(void *rxq, uint16_t offset); diff --git a/drivers/net/octeontx2/otx2_ethdev_ops.c b/drivers/net/octeontx2/otx2_ethdev_ops.c index 7c6532b6f..530ded7fe 100644 --- a/drivers/net/octeontx2/otx2_ethdev_ops.c +++ b/drivers/net/octeontx2/otx2_ethdev_ops.c @@ -2,6 +2,7 @@ * Copyright(C) 2019 Marvell International Ltd. */ +#include #include #include "otx2_ethdev.h" @@ -213,6 +214,50 @@ otx2_nix_txq_info_get(struct rte_eth_dev *eth_dev, uint16_t queue_id, qinfo->conf.tx_deferred_start = 0; } +int +otx2_rx_burst_mode_get(struct rte_eth_dev *eth_dev, + __rte_unused uint16_t queue_id, + struct rte_eth_burst_mode *mode) +{ + struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev); + uint64_t options; + + if (dev->scalar_ena || dev->rx_offloads & DEV_RX_OFFLOAD_TIMESTAMP) + options = RTE_ETH_BURST_SCALAR; + else + options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_NEON; + + if (dev->rx_offloads & DEV_RX_OFFLOAD_SCATTER) + options = RTE_ETH_BURST_SCALAR | RTE_ETH_BURST_SCATTERED; + + mode->options = options; + + return 0; +} + +int +otx2_tx_burst_mode_get(struct rte_eth_dev *eth_dev, + __rte_unused uint16_t queue_id, + struct rte_eth_burst_mode *mode) +{ + struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev); + uint64_t options; + + if (dev->scalar_ena || + (dev->tx_offload_flags & + (NIX_TX_OFFLOAD_VLAN_QINQ_F | NIX_TX_OFFLOAD_TSTAMP_F))) + options = RTE_ETH_BURST_SCALAR; + else + options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_NEON; + + if (dev->tx_offloads & DEV_TX_OFFLOAD_MULTI_SEGS) + options = RTE_ETH_BURST_SCALAR | RTE_ETH_BURST_SCATTERED; + + mode->options = options; + + return 0; +} + static void nix_rx_head_tail_get(struct otx2_eth_dev *dev, uint32_t *head, uint32_t *tail, uint16_t queue_idx) -- 2.17.2