[dpdk-dev] ethdev: adjust error log level

Message ID 1518534227-104477-1-git-send-email-martinx.klozik@intel.com (mailing list archive)
State Accepted, archived
Headers

Checks

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

Commit Message

Martin Klozik Feb. 13, 2018, 3:03 p.m. UTC
  DPDK API does not propagate the reason of device allocation failure
from rte_eth_dev_allocate() up to the DPDK application (e.g. Open
vSwitch).
Log level of associated log entries was changed to warning. So user
can find additional details in log files also in production systems,
where debug messages cannot be turned on.

Signed-off-by: Martin Klozik <martinx.klozik@intel.com>
---
 lib/librte_ether/rte_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Thomas Monjalon Feb. 13, 2018, 3:29 p.m. UTC | #1
13/02/2018 16:03, Martin Klozik:
> DPDK API does not propagate the reason of device allocation failure
> from rte_eth_dev_allocate() up to the DPDK application (e.g. Open
> vSwitch).
> Log level of associated log entries was changed to warning. So user
> can find additional details in log files also in production systems,
> where debug messages cannot be turned on.
> 
> Signed-off-by: Martin Klozik <martinx.klozik@intel.com>

Acked-by: Thomas Monjalon <thomas@monjalon.net>

Applied, thanks
  
Stephen Hemminger Feb. 15, 2018, 6:55 p.m. UTC | #2
On Tue, 13 Feb 2018 15:03:47 +0000
Martin Klozik <martinx.klozik@intel.com> wrote:

> DPDK API does not propagate the reason of device allocation failure
> from rte_eth_dev_allocate() up to the DPDK application (e.g. Open
> vSwitch).
> Log level of associated log entries was changed to warning. So user
> can find additional details in log files also in production systems,
> where debug messages cannot be turned on.
> 
> Signed-off-by: Martin Klozik <martinx.klozik@intel.com>
> ---
>  lib/librte_ether/rte_ethdev.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
> index a6ce2a5..0590f0c 100644
> --- a/lib/librte_ether/rte_ethdev.c
> +++ b/lib/librte_ether/rte_ethdev.c
> @@ -277,12 +277,12 @@ rte_eth_dev_allocate(const char *name)
>  
>  	port_id = rte_eth_dev_find_free_port();
>  	if (port_id == RTE_MAX_ETHPORTS) {
> -		RTE_PMD_DEBUG_TRACE("Reached maximum number of Ethernet ports\n");
> +		RTE_LOG(ERR, EAL, "Reached maximum number of Ethernet ports\n");
>  		goto unlock;
>  	}
>  
>  	if (rte_eth_dev_allocated(name) != NULL) {
> -		RTE_PMD_DEBUG_TRACE("Ethernet Device with name %s already allocated!\n",
> +		RTE_LOG(ERR, EAL, "Ethernet Device with name %s already allocated!\n",
>  				name);
>  		goto unlock;
>  	}

Should be NOTICE not ERROR. Since this is a recoverable condition.
  

Patch

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index a6ce2a5..0590f0c 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -277,12 +277,12 @@  rte_eth_dev_allocate(const char *name)
 
 	port_id = rte_eth_dev_find_free_port();
 	if (port_id == RTE_MAX_ETHPORTS) {
-		RTE_PMD_DEBUG_TRACE("Reached maximum number of Ethernet ports\n");
+		RTE_LOG(ERR, EAL, "Reached maximum number of Ethernet ports\n");
 		goto unlock;
 	}
 
 	if (rte_eth_dev_allocated(name) != NULL) {
-		RTE_PMD_DEBUG_TRACE("Ethernet Device with name %s already allocated!\n",
+		RTE_LOG(ERR, EAL, "Ethernet Device with name %s already allocated!\n",
 				name);
 		goto unlock;
 	}