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 A5BCDA2EFC for ; Tue, 15 Oct 2019 11:53:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 118F81EB7D; Tue, 15 Oct 2019 11:52:49 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 6B8F71E928 for ; Tue, 15 Oct 2019 11:52:45 +0200 (CEST) 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 x9F9isNV001955; Tue, 15 Oct 2019 02:52:44 -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-type; s=pfpt0818; bh=jBduFEo+C1dqsdjaa+75q/nqQMozPOT68o4Bz5/C/0s=; b=l36zoA9VqABXgZ7vgbyj7swO0eySuWsn41jTKOuUF5k16eIc4XKhh905CsskJVy/wnzv 9mfg4WO3Akn9T+kc0ZqkZgmBOeFvoOWTcIfuzTB+37IYiSgGpTYZZxPWT43zcPn2IM7A fgytWFonfiBIHx80COgwB74PW31n+Thu0wMk1cERXgcFB5QHqWtFYya24MdLsraPsW74 5ILLvQRtj44MuQTdFerMavrf3TS5/HAIib+vv+M49X2GecRmVKH+9QAWJWZ40LOh/QQV oUKz6WZLbue04swKAk8oeH9Tz3h7YAWwJo+tv3+hYfGDiD/BAKeuwkRN3BeuEfnNunAz 7A== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2vkc6ra17p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 15 Oct 2019 02:52:44 -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; Tue, 15 Oct 2019 02:52:43 -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; Tue, 15 Oct 2019 02:52:43 -0700 Received: from hyd1vattunuru-dt.caveonetworks.com (unknown [10.29.52.72]) by maili.marvell.com (Postfix) with ESMTP id BE7CE3F7040; Tue, 15 Oct 2019 02:52:40 -0700 (PDT) From: To: CC: , , , , Vamsi Attunuru Date: Tue, 15 Oct 2019 15:22:07 +0530 Message-ID: <20191015095207.13249-4-vattunuru@marvell.com> X-Mailer: git-send-email 2.8.4 In-Reply-To: <20191015095207.13249-1-vattunuru@marvell.com> References: <20190914055247.3841-2-vattunuru@marvell.com> <20191015095207.13249-1-vattunuru@marvell.com> 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-10-15_04:2019-10-15,2019-10-15 signatures=0 Subject: [dpdk-dev] [PATCH v2 3/3] net/octeontx2: add eth dev op callback to get hash index 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: Vamsi Attunuru patch adds pmd support for hash_index_get() ethdev_op callback. Signed-off-by: Vamsi Attunuru --- drivers/net/octeontx2/otx2_ethdev.c | 1 + drivers/net/octeontx2/otx2_ethdev.h | 3 +++ drivers/net/octeontx2/otx2_rss.c | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c index 4a60f9f..eb41ba4 100644 --- a/drivers/net/octeontx2/otx2_ethdev.c +++ b/drivers/net/octeontx2/otx2_ethdev.c @@ -1961,6 +1961,7 @@ static const struct eth_dev_ops otx2_eth_dev_ops = { .reta_query = otx2_nix_dev_reta_query, .rss_hash_update = otx2_nix_rss_hash_update, .rss_hash_conf_get = otx2_nix_rss_hash_conf_get, + .rss_hash_index_get = otx2_nix_rss_hash_index_get, .xstats_get = otx2_nix_xstats_get, .xstats_get_names = otx2_nix_xstats_get_names, .xstats_reset = otx2_nix_xstats_reset, diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h index 33fa0c6..b410988 100644 --- a/drivers/net/octeontx2/otx2_ethdev.h +++ b/drivers/net/octeontx2/otx2_ethdev.h @@ -471,6 +471,9 @@ int otx2_nix_rss_hash_update(struct rte_eth_dev *eth_dev, int otx2_nix_rss_hash_conf_get(struct rte_eth_dev *eth_dev, struct rte_eth_rss_conf *rss_conf); +int otx2_nix_rss_hash_index_get(struct rte_eth_dev *eth_dev, + uint32_t hash, uint32_t *hash_idx); + /* CGX */ int otx2_cgx_rxtx_start(struct otx2_eth_dev *dev); int otx2_cgx_rxtx_stop(struct otx2_eth_dev *dev); diff --git a/drivers/net/octeontx2/otx2_rss.c b/drivers/net/octeontx2/otx2_rss.c index 5afa214..4b40dfd 100644 --- a/drivers/net/octeontx2/otx2_rss.c +++ b/drivers/net/octeontx2/otx2_rss.c @@ -328,6 +328,24 @@ otx2_nix_rss_hash_conf_get(struct rte_eth_dev *eth_dev, } int +otx2_nix_rss_hash_index_get(struct rte_eth_dev *eth_dev, + uint32_t hash, uint32_t *hash_idx) +{ + struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev); + union flow_tag { + uint32_t hash; + uint8_t byte[4]; + } tag; + + tag.hash = hash; + + *hash_idx = (tag.byte[0] ^ tag.byte[1] ^ tag.byte[2] ^ tag.byte[3]) % + dev->rss_info.rss_size; + + return 0; +} + +int otx2_nix_rss_config(struct rte_eth_dev *eth_dev) { struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev); -- 2.8.4