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 322A3A2EEB for ; Sat, 14 Sep 2019 07:53:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C61DE1EFC0; Sat, 14 Sep 2019 07:53:19 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id D81DF1EFAE for ; Sat, 14 Sep 2019 07:53:17 +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 x8E5qGad026266; Fri, 13 Sep 2019 22:53:17 -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=Daq9JRc3HW9m+5ae9EgVLMnCFdFj2ngljJH+bybsPAI=; b=kAC9GSAwxlhukixD0UXn64yj/7hMhTVrSH+FhXqevCtz0HitJPSWKgE6+AvYoPWC+w2m GJu3PN9T36U79Yk1XhzgXCJvAxtB4pXqqqv7u9XN4FhQc4miuZx+7ENRjhuJ1iPWBjUC a9IjhEwjxe3YhW2Gs7R6Q8Q0h+H+H6DUxznqhc9j3bGKHmdLppfPlx9ZxPmlPRuB/4Z9 d+TXssD0cz8VqoupT0jL5Zhiml3SfC8u8GPlyVk9sLLI+iqfB8O5k0vftIm+S3V6l9OA WqaL9Dmyd8Rk2kzgqjLI9mJhZ0WtaurRLpc76Fl96U6a1llC/QheSVrPu4+C32kJCwnr qg== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2uytdh7dsx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 13 Sep 2019 22:53:16 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 13 Sep 2019 22:53:15 -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; Fri, 13 Sep 2019 22:53:15 -0700 Received: from hyd1vattunuru-dt.caveonetworks.com (unknown [10.29.52.72]) by maili.marvell.com (Postfix) with ESMTP id 8595A3F7040; Fri, 13 Sep 2019 22:53:13 -0700 (PDT) From: To: CC: , , , , Vamsi Attunuru Date: Sat, 14 Sep 2019 11:22:47 +0530 Message-ID: <20190914055247.3841-4-vattunuru@marvell.com> X-Mailer: git-send-email 2.8.4 In-Reply-To: <20190914055247.3841-1-vattunuru@marvell.com> References: <20190914055247.3841-1-vattunuru@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.70,1.0.8 definitions=2019-09-14_02:2019-09-11,2019-09-14 signatures=0 Subject: [dpdk-dev] [PATCH v1 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 b84128f..bfca60c 100644 --- a/drivers/net/octeontx2/otx2_ethdev.c +++ b/drivers/net/octeontx2/otx2_ethdev.c @@ -1636,6 +1636,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 7b15d6b..6ea5974 100644 --- a/drivers/net/octeontx2/otx2_ethdev.h +++ b/drivers/net/octeontx2/otx2_ethdev.h @@ -465,6 +465,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