summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOphir Munk <ophirmu@mellanox.com>2018-05-10 14:38:10 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2018-05-14 22:32:22 +0100
commit907252079a0cf56b61754a59739e3a5703b28524 (patch)
tree27fee2a160e9ccf334c4b3bb3ca15d15ce3d7414
parent2d65bf3cfb1bb6063476a078ab43b60cac6cbfa7 (diff)
downloaddpdk-907252079a0cf56b61754a59739e3a5703b28524.zip
dpdk-907252079a0cf56b61754a59739e3a5703b28524.tar.gz
dpdk-907252079a0cf56b61754a59739e3a5703b28524.tar.xz
net/failsafe: add an RSS hash update callback
Add an RSS hash update callback to eth_dev_ops. Signed-off-by: Ophir Munk <ophirmu@mellanox.com> Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
-rw-r--r--drivers/net/failsafe/failsafe_ops.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
index 089f114..d04277b 100644
--- a/drivers/net/failsafe/failsafe_ops.c
+++ b/drivers/net/failsafe/failsafe_ops.c
@@ -13,6 +13,7 @@
#include <rte_malloc.h>
#include <rte_flow.h>
#include <rte_cycles.h>
+#include <rte_ethdev.h>
#include "failsafe_private.h"
@@ -947,6 +948,31 @@ fs_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr)
}
static int
+fs_rss_hash_update(struct rte_eth_dev *dev,
+ struct rte_eth_rss_conf *rss_conf)
+{
+ struct sub_device *sdev;
+ uint8_t i;
+ int ret;
+
+ fs_lock(dev, 0);
+ FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) {
+ ret = rte_eth_dev_rss_hash_update(PORT_ID(sdev), rss_conf);
+ ret = fs_err(sdev, ret);
+ if (ret) {
+ ERROR("Operation rte_eth_dev_rss_hash_update"
+ " failed for sub_device %d with error %d",
+ i, ret);
+ fs_unlock(dev, 0);
+ return ret;
+ }
+ }
+ fs_unlock(dev, 0);
+
+ return 0;
+}
+
+static int
fs_filter_ctrl(struct rte_eth_dev *dev,
enum rte_filter_type type,
enum rte_filter_op op,
@@ -1005,5 +1031,6 @@ const struct eth_dev_ops failsafe_ops = {
.mac_addr_remove = fs_mac_addr_remove,
.mac_addr_add = fs_mac_addr_add,
.mac_addr_set = fs_mac_addr_set,
+ .rss_hash_update = fs_rss_hash_update,
.filter_ctrl = fs_filter_ctrl,
};