From patchwork Wed Nov 6 11:26:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kumar Kori X-Patchwork-Id: 62531 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 78A39A04AB; Wed, 6 Nov 2019 12:27:04 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D49291C07B; Wed, 6 Nov 2019 12:26:59 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 51DA81BFE5 for ; Wed, 6 Nov 2019 12:26:57 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xA6BQIFo005396; Wed, 6 Nov 2019 03:26:56 -0800 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=nG8UiCEiz+mM86LJ55ffUEhCO3ESBrENpU5D+HSGrec=; b=uFWpL8lYPrNoC2sPGErH+9m0+lNOE430fv4HO/xqq4OZ+DqjcMSNQXWWp6cIpVfjht99 nFuCa1Jv7sgig1wOqCwRwyvMe+qyWi/BjyiqOuYNkDKV3wpbKSQ5ecDDWvWq6JA5nr6Q /eJJO0vR1ZKi5z2z/DjbjsZdu5TjqGDjz0q47uxlYYyl15Wafb9dP84WoNhoQfwO11yJ VMGNBPLFPnjygCSmJTUsU6R2YL4dHGQMqtlmY588XgsdZfiBqL9buYwzhgqidCo135+U elwKrQlXCvqAtKrnn9l1UbA/61Pvuie8HauwXwZq3ldZGaOMvOllVfdOR2DMIICml2m0 QA== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2w3eud3qh6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 06 Nov 2019 03:26:56 -0800 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 6 Nov 2019 03:26:55 -0800 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, 6 Nov 2019 03:26:55 -0800 Received: from localhost.localdomain (unknown [10.28.34.13]) by maili.marvell.com (Postfix) with ESMTP id 3443A3F7040; Wed, 6 Nov 2019 03:26:52 -0800 (PST) From: Sunil Kumar Kori To: Jerin Jacob , Nithin Dabilpuram , Kiran Kumar K , "John McNamara" , Marko Kovacevic CC: , Sunil Kumar Kori Date: Wed, 6 Nov 2019 16:56:49 +0530 Message-ID: <20191106112649.24484-1-skori@marvell.com> X-Mailer: git-send-email 2.17.2 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-06_03:2019-11-06,2019-11-06 signatures=0 Subject: [dpdk-dev] [PATCH v3 1/1] 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 information according to the selected Rx/Tx mode and offloads. Signed-off-by: Sunil Kumar Kori --- v3: - Rebased the patch over patches.dpdk.org/patch/62368/ v2: - Rebased the patch on latest commit. - Update feature matrix for the support. doc/guides/nics/features/octeontx2.ini | 1 + drivers/net/octeontx2/otx2_ethdev.c | 2 + drivers/net/octeontx2/otx2_ethdev.h | 4 ++ drivers/net/octeontx2/otx2_ethdev_ops.c | 87 +++++++++++++++++++++++++ 4 files changed, 94 insertions(+) diff --git a/doc/guides/nics/features/octeontx2.ini b/doc/guides/nics/features/octeontx2.ini index 7c59b4383..c2a3f47b0 100644 --- a/doc/guides/nics/features/octeontx2.ini +++ b/doc/guides/nics/features/octeontx2.ini @@ -13,6 +13,7 @@ Link status = Y Link status event = Y Runtime Rx queue setup = Y Runtime Tx queue setup = Y +Burst mode info = Y Fast mbuf free = Y Free Tx mbuf on demand = Y Queue start/stop = Y diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c index 62291c698..37b674bcb 100644 --- a/drivers/net/octeontx2/otx2_ethdev.c +++ b/drivers/net/octeontx2/otx2_ethdev.c @@ -1978,6 +1978,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 4d9ed4870..fd43789fe 100644 --- a/drivers/net/octeontx2/otx2_ethdev.h +++ b/drivers/net/octeontx2/otx2_ethdev.h @@ -388,6 +388,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 fc0fbd9f2..1534c955e 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" @@ -221,6 +222,92 @@ 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) +{ +#define STRING_SIZE 1024 + struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev); + char info[STRING_SIZE] = {'\0'}; + ssize_t bytes = 0; + + if (dev->scalar_ena) + bytes += rte_strscpy(info, "Scalar", 7); + else + bytes += rte_strscpy(info, "Vector Neon", 12); + + bytes += rte_strscpy(info + bytes, ", Rx Offloads:", 15); + + if (dev->rx_offload_flags & NIX_RX_OFFLOAD_RSS_F) + bytes += rte_strscpy(info + bytes, " RSS,", 6); + + if (dev->rx_offload_flags & NIX_RX_OFFLOAD_PTYPE_F) + bytes += rte_strscpy(info + bytes, " Ptype,", 8); + + if (dev->rx_offload_flags & NIX_RX_OFFLOAD_CHECKSUM_F) + bytes += rte_strscpy(info + bytes, " Checksum,", 11); + + if (dev->rx_offload_flags & NIX_RX_OFFLOAD_VLAN_STRIP_F) + bytes += rte_strscpy(info + bytes, " VLAN Strip,", 13); + + if (dev->rx_offload_flags & NIX_RX_OFFLOAD_MARK_UPDATE_F) + bytes += rte_strscpy(info + bytes, " Mark Update,", 14); + + if (dev->rx_offload_flags & NIX_RX_OFFLOAD_TSTAMP_F) + bytes += rte_strscpy(info + bytes, " Timestamp,", 12); + + if (dev->rx_offload_flags & NIX_RX_MULTI_SEG_F) + bytes += rte_strscpy(info + bytes, " Scattered,", 12); + + /* Copy required string into output buffer */ + rte_strscpy(mode->info, info, bytes + 1); + 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) +{ +#define STRING_SIZE 1024 + struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev); + char info[STRING_SIZE] = {'\0'}; + ssize_t bytes = 0; + + if (dev->scalar_ena) + bytes += rte_strscpy(info, "Scalar", 7); + else + bytes += rte_strscpy(info, "Vector Neon", 12); + + bytes += rte_strscpy(info + bytes, ", Tx Offloads:", 15); + + if (dev->tx_offload_flags & NIX_TX_OFFLOAD_L3_L4_CSUM_F) + bytes += rte_strscpy(info + bytes, " Inner L3/L4 csum,", 19); + + if (dev->tx_offload_flags & NIX_TX_OFFLOAD_OL3_OL4_CSUM_F) + bytes += rte_strscpy(info + bytes, " Outer L3/L4 csum,", 19); + + if (dev->tx_offload_flags & NIX_TX_OFFLOAD_VLAN_QINQ_F) + bytes += rte_strscpy(info + bytes, " VLAN Insertion,", 16); + + if (dev->tx_offload_flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) + bytes += rte_strscpy(info + bytes, " MBUF free disable,", 20); + + if (dev->tx_offload_flags & NIX_TX_OFFLOAD_TSTAMP_F) + bytes += rte_strscpy(info + bytes, " Timestamp,", 12); + + if (dev->tx_offload_flags & NIX_TX_OFFLOAD_TSO_F) + bytes += rte_strscpy(info + bytes, " TSO,", 6); + + if (dev->tx_offload_flags & NIX_RX_MULTI_SEG_F) + bytes += rte_strscpy(info + bytes, " Scattered,", 12); + + /* Copy required string into output buffer */ + rte_strscpy(mode->info, info, bytes + 1); + return 0; +} + static void nix_rx_head_tail_get(struct otx2_eth_dev *dev, uint32_t *head, uint32_t *tail, uint16_t queue_idx)