[PATCH 05/11] net/nfp: add major version to nsp commands
Chaoyong He
chaoyong.he at corigine.com
Thu Nov 2 03:23:15 CET 2023
From: Peng Zhang <peng.zhang at corigine.com>
The commands sent to the NSP take the NSP major version into account. Up
until now only NSP major version 0 have been supported and the value
have been hard-coded to 0.
In preparation to add support for both NSP version 0.x and 1.x, extend
the command to take the running NSP version into account.
Signed-off-by: Peng Zhang <peng.zhang at corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he at corigine.com>
Reviewed-by: Long Wu <long.wu at corigine.com>
---
drivers/net/nfp/nfpcore/nfp_nsp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c
index 9f88b822f3..589d878e0d 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.c
@@ -22,7 +22,8 @@
#define NSP_COMMAND 0x08
#define NSP_COMMAND_OPTION GENMASK_ULL(63, 32)
-#define NSP_COMMAND_CODE GENMASK_ULL(31, 16)
+#define NSP_COMMAND_VER_MAJOR GENMASK_ULL(31, 28)
+#define NSP_COMMAND_CODE GENMASK_ULL(27, 16)
#define NSP_COMMAND_DMA_BUF RTE_BIT64(1)
#define NSP_COMMAND_START RTE_BIT64(0)
@@ -370,6 +371,7 @@ nfp_nsp_command_real(struct nfp_nsp *state,
err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_command,
FIELD_PREP(NSP_COMMAND_OPTION, arg->option) |
+ FIELD_PREP(NSP_COMMAND_VER_MAJOR, state->ver.major) |
FIELD_PREP(NSP_COMMAND_CODE, arg->code) |
FIELD_PREP(NSP_COMMAND_DMA_BUF, arg->dma) |
FIELD_PREP(NSP_COMMAND_START, 1));
--
2.39.1
More information about the dev
mailing list