[dpdk-dev,2/2] net/ark: report hardware status during PMD init

Message ID 1491827199-4853-2-git-send-email-ed.czeck@atomicrules.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers

Checks

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

Commit Message

Ed Czeck April 10, 2017, 12:26 p.m. UTC
  Expose additional fpga status registers and report
conditions during PMD init

Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
 drivers/net/ark/ark_ethdev.c | 9 +++++++++
 drivers/net/ark/ark_rqp.c    | 6 ++++++
 drivers/net/ark/ark_rqp.h    | 4 +++-
 3 files changed, 18 insertions(+), 1 deletion(-)
  

Comments

Ferruh Yigit April 10, 2017, 3:01 p.m. UTC | #1
On 4/10/2017 1:26 PM, Ed Czeck wrote:
> Expose additional fpga status registers and report
> conditions during PMD init
> 
> Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
> ---
>  drivers/net/ark/ark_ethdev.c | 9 +++++++++
>  drivers/net/ark/ark_rqp.c    | 6 ++++++
>  drivers/net/ark/ark_rqp.h    | 4 +++-
>  3 files changed, 18 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
> index 93721a0..1a6c71c 100644
> --- a/drivers/net/ark/ark_ethdev.c
> +++ b/drivers/net/ark/ark_ethdev.c
> @@ -297,6 +297,15 @@ eth_ark_dev_init(struct rte_eth_dev *dev)
>  			    ark->sysctrl.t32[4], __func__);
>  		return -1;
>  	}
> +	if (ark->sysctrl.t32[3] != 0) {
> +		if (ark_rqp_lasped(ark->rqpacing))
> +			PMD_DRV_LOG(INFO, "Arkville Evaluation System - "

Is this should be "info" level or debug, is end user interested if timer
expired or not?

> +				    "Timer has Expired\n");
> +		else
> +			PMD_DRV_LOG(INFO, "Arkville Evaluation System - "

btw, what is the logic in pmd, when to use PMD_DRV_LOG and when to use
PMD_DEBUG_LOG?

> +				    "Timer is Running\n");
> +	}
> +
>  

Extra line.

>  	PMD_DRV_LOG(INFO,
>  		    "HW Sanity test has PASSED, expected constant"
<...>
  
Ed Czeck April 11, 2017, 3:26 p.m. UTC | #2
On Mon, Apr 10, 2017 at 11:01 AM, Ferruh Yigit <ferruh.yigit@intel.com>
wrote:

> On 4/10/2017 1:26 PM, Ed Czeck wrote:
> > Expose additional fpga status registers and report
> > conditions during PMD init
> >
>
> > +     if (ark->sysctrl.t32[3] != 0) {
> > +             if (ark_rqp_lasped(ark->rqpacing))
> > +                     PMD_DRV_LOG(INFO, "Arkville Evaluation System - "
>
> Is this should be "info" level or debug, is end user interested if timer
> expired or not?
>
> These messages are intended for the user.  After internal discussion we
promoted them to warning and error.



> > +                                 "Timer has Expired\n");
> > +             else
> > +                     PMD_DRV_LOG(INFO, "Arkville Evaluation System - "
>
> btw, what is the logic in pmd, when to use PMD_DRV_LOG and when to use
> PMD_DEBUG_LOG?


The  PMD_DRV_LOG macro is a local wrapper on RTE_LOG, while the
PMD_DEBUG_LOG macro is a compile-time conditional macro to the same
RTE_LOG.  The DEBUG_LOG macro is conditionalize on the configuration
RTE_LIBRTE_ARK_DEBUG_TRACE.


> > +                                 "Timer is Running\n");
> > +     }
> > +
> >
>
> Extra line.
>
Removed.

Thank you
  

Patch

diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 93721a0..1a6c71c 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -297,6 +297,15 @@  eth_ark_dev_init(struct rte_eth_dev *dev)
 			    ark->sysctrl.t32[4], __func__);
 		return -1;
 	}
+	if (ark->sysctrl.t32[3] != 0) {
+		if (ark_rqp_lasped(ark->rqpacing))
+			PMD_DRV_LOG(INFO, "Arkville Evaluation System - "
+				    "Timer has Expired\n");
+		else
+			PMD_DRV_LOG(INFO, "Arkville Evaluation System - "
+				    "Timer is Running\n");
+	}
+
 
 	PMD_DRV_LOG(INFO,
 		    "HW Sanity test has PASSED, expected constant"
diff --git a/drivers/net/ark/ark_rqp.c b/drivers/net/ark/ark_rqp.c
index 59d9b8a..41c497b 100644
--- a/drivers/net/ark/ark_rqp.c
+++ b/drivers/net/ark/ark_rqp.c
@@ -89,3 +89,9 @@  ark_rqp_dump(struct ark_rqpace_t *rqp)
 		      "cplh pending max", rqp->cplh_pending_max,
 		      "cpld pending max", rqp->cpld_pending_max);
 }
+
+int
+ark_rqp_lasped(struct ark_rqpace_t *rqp)
+{
+	return rqp->lasped;
+}
diff --git a/drivers/net/ark/ark_rqp.h b/drivers/net/ark/ark_rqp.h
index 995fc20..0c38007 100644
--- a/drivers/net/ark/ark_rqp.h
+++ b/drivers/net/ark/ark_rqp.h
@@ -76,9 +76,11 @@  struct ark_rqpace_t {
 	volatile uint32_t cplh_pending_max;
 	volatile uint32_t cpld_pending_max;
 	volatile uint32_t err_count_other;
+	char eval[4];
+	volatile int lasped;
 };
 
 void ark_rqp_dump(struct ark_rqpace_t *rqp);
 void ark_rqp_stats_reset(struct ark_rqpace_t *rqp);
-
+int ark_rqp_lasped(struct ark_rqpace_t *rqp);
 #endif