octeon: add compatibility check 43/42143/3
authorMonendra Singh Kushwaha <[email protected]>
Tue, 14 Jan 2025 01:49:38 +0000 (07:19 +0530)
committerDamjan Marion <[email protected]>
Wed, 15 Jan 2025 13:22:24 +0000 (13:22 +0000)
This patch adds compatibility check for OCTEON model in plugin.

Type: refactor

Change-Id: Id583a2f42b8f66f7e045f6cf9176125680e9a16f
Signed-off-by: Monendra Singh Kushwaha <[email protected]>
src/plugins/dev_octeon/init.c

index 4f39b22..561cbe9 100644 (file)
@@ -411,6 +411,15 @@ oct_plugin_init (vlib_main_t *vm)
   rv = roc_model_init (&oct_model);
   if (rv)
     return clib_error_return (0, "roc_model_init failed");
+
+#ifdef PLATFORM_OCTEON9
+  if (!roc_model_is_cn9k ())
+    return clib_error_return (0, "OCTEON model is not OCTEON9");
+#else
+  if (!roc_model_is_cn10k ())
+    return clib_error_return (0, "OCTEON model is not OCTEON10");
+#endif
+
   return 0;
 }