DPDK patches and discussions
 help / color / mirror / Atom feed
From: <vattunuru@marvell.com>
To: <dev@dpdk.org>
Cc: <arybchenko@solarflare.com>, <jerinj@marvell.com>,
	<ferruh.yigit@intel.com>, <thomas@monjalon.net>,
	Vamsi Attunuru <vattunuru@marvell.com>
Subject: [dpdk-dev] [PATCH v2 3/3] net/octeontx2: add eth dev op callback to get hash index
Date: Tue, 15 Oct 2019 15:22:07 +0530	[thread overview]
Message-ID: <20191015095207.13249-4-vattunuru@marvell.com> (raw)
In-Reply-To: <20191015095207.13249-1-vattunuru@marvell.com>

From: Vamsi Attunuru <vattunuru@marvell.com>

patch adds pmd support for hash_index_get() ethdev_op callback.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
---
 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


  parent reply	other threads:[~2019-10-15  9:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-14  5:52 [dpdk-dev] [PATCH v1 0/3] add ethdev op " vattunuru
2019-09-14  5:52 ` [dpdk-dev] [PATCH v1 1/3] lib/ethdev: " vattunuru
2019-10-03 13:00   ` Andrew Rybchenko
2019-10-07  4:45     ` [dpdk-dev] [EXT] " Vamsi Krishna Attunuru
2019-10-15  9:52   ` [dpdk-dev] [PATCH v2 0/3] " vattunuru
2019-10-15  9:52     ` [dpdk-dev] [PATCH v2 1/3] lib/ethdev: " vattunuru
2019-10-15 16:47       ` Ferruh Yigit
2019-10-15 17:28         ` Vamsi Krishna Attunuru
2019-10-16 17:47           ` Ferruh Yigit
2019-10-16 17:48       ` Ferruh Yigit
2019-10-15  9:52     ` [dpdk-dev] [PATCH v2 2/3] app/test: add hash index verify autotest vattunuru
2019-10-15 16:49       ` Ferruh Yigit
2019-10-15  9:52     ` vattunuru [this message]
2019-09-14  5:52 ` [dpdk-dev] [PATCH v1 " vattunuru
2019-09-14  5:52 ` [dpdk-dev] [PATCH v1 3/3] net/octeontx2: add eth dev op callback to get hash index vattunuru

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191015095207.13249-4-vattunuru@marvell.com \
    --to=vattunuru@marvell.com \
    --cc=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jerinj@marvell.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).