[v5,8/8] net/dpaa: add RSS update func with FMCless
diff mbox series

Message ID 20200813180121.19480-8-hemant.agrawal@nxp.com
State Changes Requested
Delegated to: Ferruh Yigit
Headers show
Series
  • [v5,1/8] net/dpaa: add support for fmlib in dpdk
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Hemant Agrawal Aug. 13, 2020, 6:01 p.m. UTC
From: Sachin Saxena <sachin.saxena@nxp.com>

With fmlib (FMCLESS) mode now RSS can be modified on runtime.
This patch add support for RSS update functions

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
---
 drivers/net/dpaa/dpaa_ethdev.c | 37 ++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

Patch
diff mbox series

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 0ce2f5ae3e..b0f2023e60 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -1303,6 +1303,41 @@  dpaa_dev_set_mac_addr(struct rte_eth_dev *dev,
 	return ret;
 }
 
+static int
+dpaa_dev_rss_hash_update(struct rte_eth_dev *dev,
+			 struct rte_eth_rss_conf *rss_conf)
+{
+	struct rte_eth_dev_data *data = dev->data;
+	struct rte_eth_conf *eth_conf = &data->dev_conf;
+
+	PMD_INIT_FUNC_TRACE();
+
+	if (!(default_q || fmc_q)) {
+		if (dpaa_fm_config(dev, rss_conf->rss_hf)) {
+			DPAA_PMD_ERR("FM port configuration: Failed\n");
+			return -1;
+		}
+		eth_conf->rx_adv_conf.rss_conf.rss_hf = rss_conf->rss_hf;
+	} else {
+		DPAA_PMD_ERR("Function not supported\n");
+		return -ENOTSUP;
+	}
+	return 0;
+}
+
+static int
+dpaa_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
+			   struct rte_eth_rss_conf *rss_conf)
+{
+	struct rte_eth_dev_data *data = dev->data;
+	struct rte_eth_conf *eth_conf = &data->dev_conf;
+
+	/* dpaa does not support rss_key, so length should be 0*/
+	rss_conf->rss_key_len = 0;
+	rss_conf->rss_hf = eth_conf->rx_adv_conf.rss_conf.rss_hf;
+	return 0;
+}
+
 static int dpaa_dev_queue_intr_enable(struct rte_eth_dev *dev,
 				      uint16_t queue_id)
 {
@@ -1418,6 +1453,8 @@  static struct eth_dev_ops dpaa_devops = {
 
 	.rx_queue_intr_enable	  = dpaa_dev_queue_intr_enable,
 	.rx_queue_intr_disable	  = dpaa_dev_queue_intr_disable,
+	.rss_hash_update	  = dpaa_dev_rss_hash_update,
+	.rss_hash_conf_get        = dpaa_dev_rss_hash_conf_get,
 };
 
 static bool