[v5,3/4] net/enetc: add log level notice
diff mbox series

Message ID 20191023060602.32456-4-g.singh@nxp.com
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show
Series
  • enetc PMD specific changes
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Gagandeep Singh Oct. 23, 2019, 6:06 a.m. UTC
To display random MAC address as notice,
a log level NOTICE is added.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
---
 drivers/net/enetc/enetc_ethdev.c | 4 +++-
 drivers/net/enetc/enetc_logs.h   | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c
index d07e61c3f..c6099714e 100644
--- a/drivers/net/enetc/enetc_ethdev.c
+++ b/drivers/net/enetc/enetc_ethdev.c
@@ -130,7 +130,7 @@  print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr)
 	char buf[RTE_ETHER_ADDR_FMT_SIZE];
 
 	rte_ether_format_addr(buf, RTE_ETHER_ADDR_FMT_SIZE, eth_addr);
-	ENETC_PMD_INFO("%s%s\n", name, buf);
+	ENETC_PMD_NOTICE("%s%s\n", name, buf);
 }
 
 static int
@@ -158,6 +158,8 @@  enetc_hardware_init(struct enetc_eth_hw *hw)
 	if ((high_mac | low_mac) == 0) {
 		char *first_byte;
 
+		ENETC_PMD_NOTICE("MAC is not available for this SI, "
+				"set random MAC\n");
 		mac = (uint32_t *)hw->mac.addr;
 		*mac = (uint32_t)rte_rand();
 		first_byte = (char *)mac;
diff --git a/drivers/net/enetc/enetc_logs.h b/drivers/net/enetc/enetc_logs.h
index c8a6c0cf3..0976d42de 100644
--- a/drivers/net/enetc/enetc_logs.h
+++ b/drivers/net/enetc/enetc_logs.h
@@ -21,6 +21,8 @@  extern int enetc_logtype_pmd;
 	ENETC_PMD_LOG(CRIT, fmt, ## args)
 #define ENETC_PMD_INFO(fmt, args...) \
 	ENETC_PMD_LOG(INFO, fmt, ## args)
+#define ENETC_PMD_NOTICE(fmt, args...) \
+	ENETC_PMD_LOG(NOTICE, fmt, ## args)
 #define ENETC_PMD_ERR(fmt, args...) \
 	ENETC_PMD_LOG(ERR, fmt, ## args)
 #define ENETC_PMD_WARN(fmt, args...) \