[qca-nss-drv] Enable RPS in Core 1
Currently, we are enabling RPS only in NPU Core 0.
Which leads all packets from NPU Core 1 to go to the
ARM Core 0 which could cause potential performance loss.
Change-Id: I93abd2c8153ca440a6ae59840388dc9527923735
Signed-off-by: Cemil Coskun <ccoskun@codeaurora.org>
diff --git a/nss_rps.c b/nss_rps.c
index dfbf479..a54c08a 100644
--- a/nss_rps.c
+++ b/nss_rps.c
@@ -1,6 +1,6 @@
/*
**************************************************************************
- * Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2017, 2019 The Linux Foundation. All rights reserved.
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all copies.
@@ -403,8 +403,8 @@
void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
- struct nss_ctx_instance *nss_ctx = &nss_top->nss[0];
- int ret, ret_rps, current_state;
+ struct nss_ctx_instance *nss_ctx;
+ int ret, ret_rps, current_state, i;
current_state = nss_rps_config;
ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
@@ -416,25 +416,34 @@
return ret;
}
- if (nss_rps_config == 1) {
- nss_info("Enabling NSS RPS\n");
- ret_rps = nss_rps_cfg(nss_ctx, 1);
-
- if (ret_rps != NSS_SUCCESS) {
- nss_warning("%p: rps enabling failed\n", nss_ctx);
- nss_rps_config = current_state;
- }
-
- return ret_rps;
- }
-
if (nss_rps_config == 0) {
nss_info_always("Runtime disabling of NSS RPS not supported\n");
return ret;
}
- nss_info_always("Invalid input value. Valid values are 0 and 1\n");
- return ret;
+ if (nss_rps_config != 1) {
+ nss_info_always("Invalid input value. Valid values are 0 and 1\n");
+ return ret;
+ }
+
+ for (i = 0; i < nss_top_main.num_nss; i++) {
+ nss_ctx = &nss_top->nss[i];
+ nss_info("Enabling NSS RPS\n");
+ ret_rps = nss_rps_cfg(nss_ctx, 1);
+
+ /*
+ * In here, we also need to revert the state of the previously enabled cores.
+ * However, runtime disabling is currently not supported since queues are not
+ * flushed in NSS FW.
+ * TODO: Flush queues in NSS FW.
+ */
+ if (ret_rps != NSS_SUCCESS) {
+ nss_warning("%p: rps enabling failed\n", nss_ctx);
+ nss_rps_config = current_state;
+ return ret_rps;
+ }
+ }
+ return NSS_SUCCESS;
}
/*