net/sfc: replace of RTE_LOGTYPE_PMD

Message ID 20230223031021.167490-1-stephen@networkplumber.org (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/sfc: replace of RTE_LOGTYPE_PMD |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/github-robot: build fail github build: failed
ci/iol-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Stephen Hemminger Feb. 23, 2023, 3:10 a.m. UTC
  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.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/sfc/sfc_ethdev.c | 2 +-
 drivers/vdpa/sfc/sfc_vdpa.c  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
  

Comments

Andrew Rybchenko March 10, 2023, 2:22 p.m. UTC | #1
On 2/23/23 06:10, Stephen Hemminger wrote:
> 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.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
  
Ferruh Yigit March 10, 2023, 4:09 p.m. UTC | #2
On 3/10/2023 2:22 PM, Andrew Rybchenko wrote:
> On 2/23/23 06:10, Stephen Hemminger wrote:
>> 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.
>>
>> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> 
> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> 
> 

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

Patch

diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 2ec743ebce4a..320043145495 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -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;
 }
diff --git a/drivers/vdpa/sfc/sfc_vdpa.c b/drivers/vdpa/sfc/sfc_vdpa.c
index 53f598facc75..bd6ecde4507f 100644
--- a/drivers/vdpa/sfc/sfc_vdpa.c
+++ b/drivers/vdpa/sfc/sfc_vdpa.c
@@ -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