]> git.droids-corp.org - dpdk.git/commitdiff
common/cnxk: skip probing SoC environment for CN9K
authorRakesh Kudurumalla <rkudurumalla@marvell.com>
Sun, 8 May 2022 07:48:17 +0000 (13:18 +0530)
committerJerin Jacob <jerinj@marvell.com>
Tue, 10 May 2022 14:26:54 +0000 (16:26 +0200)
SoC run platform file is not present in CN9k so probing
is done for CN10k devices

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
drivers/common/cnxk/roc_model.c

index 4120029541fffb0206747e93f13c4f84cce7045a..41cf5584cd836cd4e1d53b8dd1e64accce78b724 100644 (file)
@@ -2,6 +2,9 @@
  * Copyright(C) 2021 Marvell.
  */
 
+#include <fcntl.h>
+#include <unistd.h>
+
 #include "roc_api.h"
 #include "roc_priv.h"
 
@@ -207,6 +210,12 @@ of_env_get(struct roc_model *model)
        uint64_t flag;
        FILE *fp;
 
+       if (access(path, F_OK) != 0) {
+               strncpy(model->env, "HW_PLATFORM", ROC_MODEL_STR_LEN_MAX - 1);
+               model->flag |= ROC_ENV_HW;
+               return;
+       }
+
        fp = fopen(path, "r");
        if (!fp) {
                plt_err("Failed to open %s", path);