[dpdk-dev,5/7] net/mrvl: add extra error logs

Message ID 1512048743-23749-6-git-send-email-tdu@semihalf.com
State Superseded, archived
Delegated to: Ferruh Yigit
Headers show

Checks

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

Commit Message

Tomasz Duszynski Nov. 30, 2017, 1:32 p.m.
Add extra error logs in a few places.

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
---
 drivers/net/mrvl/mrvl_ethdev.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Jianbo Liu Dec. 1, 2017, 3:32 a.m. | #1
The 11/30/2017 14:32, Tomasz Duszynski wrote:
> Add extra error logs in a few places.
>
> Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
> ---
>  drivers/net/mrvl/mrvl_ethdev.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/mrvl/mrvl_ethdev.c b/drivers/net/mrvl/mrvl_ethdev.c
> index 92cc283..ed97831 100644
> --- a/drivers/net/mrvl/mrvl_ethdev.c
> +++ b/drivers/net/mrvl/mrvl_ethdev.c
> @@ -431,8 +431,10 @@ mrvl_dev_start(struct rte_eth_dev *dev)
>       priv->bpool_min_size = priv->nb_rx_queues * MRVL_BURST_SIZE * 2;
>
>       ret = pp2_ppio_init(&priv->ppio_params, &priv->ppio);
> -     if (ret)
> +     if (ret) {
> +             RTE_LOG(ERR, PMD, "Failed to init ppio\n");
>               return ret;
> +     }
>
>       /*
>        * In case there are some some stale uc/mc mac addresses flush them
> @@ -467,8 +469,8 @@ mrvl_dev_start(struct rte_eth_dev *dev)
>       if (mrvl_qos_cfg) {
>               ret = mrvl_start_qos_mapping(priv);
>               if (ret) {
> -                     pp2_ppio_deinit(priv->ppio);
> -                     return ret;
> +                     RTE_LOG(ERR, PMD, "Failed to setup QoS mapping\n");
> +                     goto out;
>               }
>       }
>

Do you need to print error log as well if mrvl_dev_set_link_up fails?

> @@ -478,6 +480,7 @@ mrvl_dev_start(struct rte_eth_dev *dev)
>
>       return 0;
>  out:
> +     RTE_LOG(ERR, PMD, "Failed to start device\n");
>       pp2_ppio_deinit(priv->ppio);
>       return ret;
>  }
> --
> 2.7.4
>

--
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Tomasz Duszynski Dec. 1, 2017, 8:26 a.m. | #2
On Fri, Dec 01, 2017 at 11:32:15AM +0800, Jianbo Liu wrote:
> The 11/30/2017 14:32, Tomasz Duszynski wrote:
> > Add extra error logs in a few places.
> >
> > Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
> > ---
> >  drivers/net/mrvl/mrvl_ethdev.c | 9 ++++++---
> >  1 file changed, 6 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/mrvl/mrvl_ethdev.c b/drivers/net/mrvl/mrvl_ethdev.c
> > index 92cc283..ed97831 100644
> > --- a/drivers/net/mrvl/mrvl_ethdev.c
> > +++ b/drivers/net/mrvl/mrvl_ethdev.c
> > @@ -431,8 +431,10 @@ mrvl_dev_start(struct rte_eth_dev *dev)
> >       priv->bpool_min_size = priv->nb_rx_queues * MRVL_BURST_SIZE * 2;
> >
> >       ret = pp2_ppio_init(&priv->ppio_params, &priv->ppio);
> > -     if (ret)
> > +     if (ret) {
> > +             RTE_LOG(ERR, PMD, "Failed to init ppio\n");
> >               return ret;
> > +     }
> >
> >       /*
> >        * In case there are some some stale uc/mc mac addresses flush them
> > @@ -467,8 +469,8 @@ mrvl_dev_start(struct rte_eth_dev *dev)
> >       if (mrvl_qos_cfg) {
> >               ret = mrvl_start_qos_mapping(priv);
> >               if (ret) {
> > -                     pp2_ppio_deinit(priv->ppio);
> > -                     return ret;
> > +                     RTE_LOG(ERR, PMD, "Failed to setup QoS mapping\n");
> > +                     goto out;
> >               }
> >       }
> >
>
> Do you need to print error log as well if mrvl_dev_set_link_up fails?

Right, extra log can be added for consistency.

>
> > @@ -478,6 +480,7 @@ mrvl_dev_start(struct rte_eth_dev *dev)
> >
> >       return 0;
> >  out:
> > +     RTE_LOG(ERR, PMD, "Failed to start device\n");
> >       pp2_ppio_deinit(priv->ppio);
> >       return ret;
> >  }
> > --
> > 2.7.4
> >
>
> --
> IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

--
- Tomasz Duszyński

Patch

diff --git a/drivers/net/mrvl/mrvl_ethdev.c b/drivers/net/mrvl/mrvl_ethdev.c
index 92cc283..ed97831 100644
--- a/drivers/net/mrvl/mrvl_ethdev.c
+++ b/drivers/net/mrvl/mrvl_ethdev.c
@@ -431,8 +431,10 @@  mrvl_dev_start(struct rte_eth_dev *dev)
 	priv->bpool_min_size = priv->nb_rx_queues * MRVL_BURST_SIZE * 2;
 
 	ret = pp2_ppio_init(&priv->ppio_params, &priv->ppio);
-	if (ret)
+	if (ret) {
+		RTE_LOG(ERR, PMD, "Failed to init ppio\n");
 		return ret;
+	}
 
 	/*
 	 * In case there are some some stale uc/mc mac addresses flush them
@@ -467,8 +469,8 @@  mrvl_dev_start(struct rte_eth_dev *dev)
 	if (mrvl_qos_cfg) {
 		ret = mrvl_start_qos_mapping(priv);
 		if (ret) {
-			pp2_ppio_deinit(priv->ppio);
-			return ret;
+			RTE_LOG(ERR, PMD, "Failed to setup QoS mapping\n");
+			goto out;
 		}
 	}
 
@@ -478,6 +480,7 @@  mrvl_dev_start(struct rte_eth_dev *dev)
 
 	return 0;
 out:
+	RTE_LOG(ERR, PMD, "Failed to start device\n");
 	pp2_ppio_deinit(priv->ppio);
 	return ret;
 }