Skip to contentSkip to conversation

net/sfc: replace of RTE_LOGTYPE_PMD

PATCH Applied Stephen Hemminger 3 participants 3 messages Feb 23, 2023 – Mar 10, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/sfc: replace of RTE_LOGTYPE_PMD

The static LOGTYPE PMD will go away in the future. Replace its use in the sfc driver with the same static type as is already used in RTE_LOG_REGISTER macro.

These drivers are trying to do things that other drivers are not in creating log types. IMHO it should follow the other driver usage pattern. But this patch leaves the special code.

---
 drivers/net/sfc/sfc_ethdev.c | 2 +-
 drivers/vdpa/sfc/sfc_vdpa.c  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/sfc/sfc_ethdev.c +1 -1
index 2ec743ebce4a..320043145495 100644
@@ -3231,5 +3231,5 @@ RTE_INIT(sfc_driver_register_logtype)
 
 	ret = rte_log_register_type_and_pick_level(SFC_LOGTYPE_PREFIX "driver",
 						   RTE_LOG_NOTICE);
-	sfc_logtype_driver = (ret < 0) ? RTE_LOGTYPE_PMD : ret;
+	sfc_logtype_driver = (ret < 0) ? RTE_LOGTYPE_EAL : ret;
 }
drivers/vdpa/sfc/sfc_vdpa.c +3 -3
index 53f598facc75..bd6ecde4507f 100644
@@ -180,12 +180,12 @@ sfc_vdpa_register_logtype(const struct rte_pci_addr *pci_addr,
 		++lt_prefix_str_size; /* Reserve space for prefix separator */
 		lt_str_size_max = lt_prefix_str_size + PCI_PRI_STR_SIZE + 1;
 	} else {
-		return RTE_LOGTYPE_PMD;
+		return RTE_LOGTYPE_EAL;
 	}
 
 	lt_str = rte_zmalloc("logtype_str", lt_str_size_max, 0);
 	if (lt_str == NULL)
-		return RTE_LOGTYPE_PMD;
+		return RTE_LOGTYPE_EAL;
 
 	strncpy(lt_str, lt_prefix_str, lt_prefix_str_size);
 	lt_str[lt_prefix_str_size - 1] = '.';
@@ -196,7 +196,7 @@ sfc_vdpa_register_logtype(const struct rte_pci_addr *pci_addr,
 	ret = rte_log_register_type_and_pick_level(lt_str, ll_default);
 	rte_free(lt_str);
 
-	return ret < 0 ? RTE_LOGTYPE_PMD : ret;
+	return ret < 0 ? RTE_LOGTYPE_EAL : ret;
 }
 
 static int
Signature · 1 line
2.39.1
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Stephen Hemminger

The static LOGTYPE PMD will go away in the future. Replace its use in the sfc driver with the same static type as is already used in RTE_LOG_REGISTER macro.

These drivers are trying to do things that other drivers are not in creating log types. IMHO it should follow the other driver usage pattern. But this patch leaves the special code.

Applied
#2 lore raw
Quoted 5 lines · Andrew Rybchenko
Quoted 4 lines · Stephen Hemminger

The static LOGTYPE PMD will go away in the future. Replace its use in the sfc driver with the same static type as is already used in RTE_LOG_REGISTER macro.

Quoted 9 lines
Quoted 5 lines

These drivers are trying to do things that other drivers are not in creating log types. IMHO it should follow the other driver usage pattern. But this patch leaves the special code.

Applied to dpdk-next-net/main, thanks.