From patchwork Fri Jul 10 16:21:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 235249 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp602485ilg; Fri, 10 Jul 2020 09:26:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6LIyZDb+sT+BG5274Jp5xuEwqDFDWvTFU59ubcy//hB54ypHFqTcqm2imWOFL2PvCf/Xc X-Received: by 2002:a05:6402:1346:: with SMTP id y6mr79125767edw.192.1594398374112; Fri, 10 Jul 2020 09:26:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594398374; cv=none; d=google.com; s=arc-20160816; b=cwQ7XiHiZcdBZHfX4ww18Dti/Sy6daUQ67RziQfYQf2AiOJq7bFWOCPz8+bbd/bR7l 3ZDmnz+9DLRYmyvOMsDHfCOwnWaekHo+or2Btjopa1E85KWVWS3PFfukF382N3NfMn+A 34BffGU+jIZ4VczLjHbzLvq+/Y54x6TsrmFg7EWYV8KAJGErVMeSgQNMrptvDGoDgOja G/TLSNWOehqzxfl5b3M5iWow181cGZSm5CVApx1SmkLVSU82kOtwmwAp+2L7d4QexrVO L7zNuxzKxedVB9TbfmP2pAdBPGyIRoHBLFDZfe8T6ofqHQ0Tcj1A22jqUnzVhox4X2wx C76w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=h8INA/LxnYnFPDJTpZ0jGxIKzG7cbqcWQc5w+RcRDrU=; b=KOGXWfhpXi/huRAenlqkElokKdKwjNlWArbMkw+NeFNM2VpSrw7t3EwzBQUnX/x/7/ ckkoWjDxMWqyQSk+NGVhyqFCerUoQMP/BiIp4R0ea/UMk8qVBFH3e45PSoLumIo40MaO 75PUEvBXZM0T5w1ZqDyPSLUCXIa6OeQhQxOjzjiePMPMvUqvvW3kZ/jTeY4KqLHKWZn1 jy1aX2WKugIfVQpaayyd1ATGGMz0asARohOMZagU+Qhx1nZRZrRaqEgef7Ls5sZhJkvl bGbBHO/2ZEdRGLgCO5YM8F72hKgSbYGUKyAsryf6LLiNidBWj1fz+t1paVtmb2upj7F2 tO2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id op5si4108452ejb.617.2020.07.10.09.26.13; Fri, 10 Jul 2020 09:26:14 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D4F641D9FB; Fri, 10 Jul 2020 18:26:00 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id D85B01D9DA for ; Fri, 10 Jul 2020 18:25:57 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id ACFAB1A04AF; Fri, 10 Jul 2020 18:25:57 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id C9E001A04B2; Fri, 10 Jul 2020 18:25:55 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 288FA402AA; Sat, 11 Jul 2020 00:25:53 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Apeksha Gupta Date: Fri, 10 Jul 2020 21:51:31 +0530 Message-Id: <20200710162137.22973-3-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200710162137.22973-1-hemant.agrawal@nxp.com> References: <20200710162137.22973-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 3/9] net/dpaa: add Tx/Rx burst mode info 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: Apeksha Gupta Retrieve burst mode information according to the selected Rx/Tx mode and offloads. Signed-off-by: Apeksha Gupta --- doc/guides/nics/features/dpaa.ini | 1 + drivers/net/dpaa/dpaa_ethdev.c | 70 ++++++++++++++++++++++++++++++- 2 files changed, 70 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/doc/guides/nics/features/dpaa.ini b/doc/guides/nics/features/dpaa.ini index 816a6e08e..e0ed3e868 100644 --- a/doc/guides/nics/features/dpaa.ini +++ b/doc/guides/nics/features/dpaa.ini @@ -7,6 +7,7 @@ Speed capabilities = Y Link status = Y Link status event = Y +Burst mode info = Y Jumbo frame = Y MTU update = Y Scattered Rx = Y diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 3a5b319d4..62ecb112f 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -457,6 +457,73 @@ static int dpaa_eth_dev_info(struct rte_eth_dev *dev, return 0; } +static int +dpaa_dev_rx_burst_mode_get(struct rte_eth_dev *dev, + __rte_unused uint16_t queue_id, + struct rte_eth_burst_mode *mode) +{ + struct rte_eth_conf *eth_conf = &dev->data->dev_conf; + int ret = -EINVAL; + unsigned int i; + const struct burst_info { + uint64_t flags; + const char *output; + } rx_offload_map[] = { + {DEV_RX_OFFLOAD_JUMBO_FRAME, " Jumbo frame,"}, + {DEV_RX_OFFLOAD_SCATTER, " Scattered,"}, + {DEV_RX_OFFLOAD_IPV4_CKSUM, " IPV4 csum,"}, + {DEV_RX_OFFLOAD_UDP_CKSUM, " UDP csum,"}, + {DEV_RX_OFFLOAD_TCP_CKSUM, " TCP csum,"}, + {DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM, " Outer IPV4 csum,"}, + {DEV_RX_OFFLOAD_RSS_HASH, " RSS,"} + }; + + /* Update Rx offload info */ + for (i = 0; i < RTE_DIM(rx_offload_map); i++) { + if (eth_conf->rxmode.offloads & rx_offload_map[i].flags) { + snprintf(mode->info, sizeof(mode->info), "%s", + rx_offload_map[i].output); + ret = 0; + break; + } + } + return ret; +} + +static int +dpaa_dev_tx_burst_mode_get(struct rte_eth_dev *dev, + __rte_unused uint16_t queue_id, + struct rte_eth_burst_mode *mode) +{ + struct rte_eth_conf *eth_conf = &dev->data->dev_conf; + int ret = -EINVAL; + unsigned int i; + const struct burst_info { + uint64_t flags; + const char *output; + } tx_offload_map[] = { + {DEV_TX_OFFLOAD_MT_LOCKFREE, " MT lockfree,"}, + {DEV_TX_OFFLOAD_MBUF_FAST_FREE, " MBUF free disable,"}, + {DEV_TX_OFFLOAD_IPV4_CKSUM, " IPV4 csum,"}, + {DEV_TX_OFFLOAD_UDP_CKSUM, " UDP csum,"}, + {DEV_TX_OFFLOAD_TCP_CKSUM, " TCP csum,"}, + {DEV_TX_OFFLOAD_SCTP_CKSUM, " SCTP csum,"}, + {DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM, " Outer IPV4 csum,"}, + {DEV_TX_OFFLOAD_MULTI_SEGS, " Scattered,"} + }; + + /* Update Tx offload info */ + for (i = 0; i < RTE_DIM(tx_offload_map); i++) { + if (eth_conf->txmode.offloads & tx_offload_map[i].flags) { + snprintf(mode->info, sizeof(mode->info), "%s", + tx_offload_map[i].output); + ret = 0; + break; + } + } + return ret; +} + static int dpaa_eth_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused) { @@ -1182,7 +1249,8 @@ static struct eth_dev_ops dpaa_devops = { .rx_queue_release = dpaa_eth_rx_queue_release, .tx_queue_release = dpaa_eth_tx_queue_release, .rx_queue_count = dpaa_dev_rx_queue_count, - + .rx_burst_mode_get = dpaa_dev_rx_burst_mode_get, + .tx_burst_mode_get = dpaa_dev_tx_burst_mode_get, .flow_ctrl_get = dpaa_flow_ctrl_get, .flow_ctrl_set = dpaa_flow_ctrl_set,