Skip to contentSkip to conversation

common/cnxk: show more detailed info on model mismatch

PATCH In review Tomasz Duszynski 2 participants 2 messages Feb 24, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/cnxk: show more detailed info on model mismatch

Model is uniquely identified by 4 numbers. Print them all in case model being populated is not on a list of known models. This makes debugging a bit easier.

---
 drivers/common/cnxk/roc_model.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/common/cnxk/roc_model.c +2 -1
index 447dc6e8bc..49617c02b7 100644
@@ -132,7 +132,8 @@ populate_model(struct roc_model *model, uint32_t midr)
 	if (!found) {
 		model->flag = 0;
 		strncpy(model->name, "unknown", ROC_MODEL_STR_LEN_MAX - 1);
-		plt_err("Invalid RoC model (impl=0x%x, part=0x%x)", impl, part);
+		plt_err("Invalid RoC model (impl=0x%x, part=0x%x, major=0x%x, minor=0x%x)",
+			impl, part, major, minor);
 	}
 
 	return found;
Signature · 1 line
2.25.1
Reviewed-by Jakub Palider Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Tomasz Duszynski

Model is uniquely identified by 4 numbers. Print them all in case model being populated is not on a list of known models. This makes debugging a bit easier.

Updated the git commit as follows and applied to
dpdk-next-net-mrvl/for-next-net. Thanks

common/cnxk: show more detailed info on model mismatch

Model is uniquely identified by 4 numbers. Print them all in case model being populated is not on a list of known models. This makes debugging a bit easier.

Quoted 21 lines
---
 drivers/common/cnxk/roc_model.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/common/cnxk/roc_model.c +2 -2
index 447dc6e8bc..49617c02b7 100644
@@ -132,7 +132,8 @@ populate_model(struct roc_model *model, uint32_t midr)
        if (!found) {
                model->flag = 0;
                strncpy(model->name, "unknown", ROC_MODEL_STR_LEN_MAX - 1);
-               plt_err("Invalid RoC model (impl=0x%x, part=0x%x)", impl, part);
+               plt_err("Invalid RoC model (impl=0x%x, part=0x%x, major=0x%x, minor=0x%x)",
+                       impl, part, major, minor);
        }
 
        return found;
--

2.25.1