New upstream version 18.08
[deb_dpdk.git] / drivers / net / ark / ark_rqp.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2015-2018 Atomic Rules LLC
3  */
4
5 #include <unistd.h>
6
7 #include "ark_rqp.h"
8 #include "ark_logs.h"
9
10 /* ************************************************************************* */
11 void
12 ark_rqp_stats_reset(struct ark_rqpace_t *rqp)
13 {
14         rqp->stats_clear = 1;
15         /* POR 992 */
16         /* rqp->cpld_max = 992; */
17         /* POR 64 */
18         /* rqp->cplh_max = 64; */
19 }
20
21 /* ************************************************************************* */
22 void
23 ark_rqp_dump(struct ark_rqpace_t *rqp)
24 {
25         if (rqp->err_count_other != 0)
26                 PMD_DRV_LOG(ERR,
27                             "RQP Errors noted: ctrl: %d cplh_hmax %d cpld_max %d"
28                             ARK_SU32
29                             ARK_SU32 "\n",
30                             rqp->ctrl, rqp->cplh_max, rqp->cpld_max,
31                             "Error Count", rqp->err_cnt,
32                             "Error General", rqp->err_count_other);
33
34         PMD_STATS_LOG(INFO, "RQP Dump: ctrl: %d cplh_hmax %d cpld_max %d"
35                       ARK_SU32
36                       ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
37                       ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
38                       ARK_SU32 ARK_SU32 ARK_SU32
39                       ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 "\n",
40                       rqp->ctrl, rqp->cplh_max, rqp->cpld_max,
41                       "Error Count", rqp->err_cnt,
42                       "Error General", rqp->err_count_other,
43                       "stall_pS", rqp->stall_ps,
44                       "stall_pS Min", rqp->stall_ps_min,
45                       "stall_pS Max", rqp->stall_ps_max,
46                       "req_pS", rqp->req_ps,
47                       "req_pS Min", rqp->req_ps_min,
48                       "req_pS Max", rqp->req_ps_max,
49                       "req_dWPS", rqp->req_dw_ps,
50                       "req_dWPS Min", rqp->req_dw_ps_min,
51                       "req_dWPS Max", rqp->req_dw_ps_max,
52                       "cpl_pS", rqp->cpl_ps,
53                       "cpl_pS Min", rqp->cpl_ps_min,
54                       "cpl_pS Max", rqp->cpl_ps_max,
55                       "cpl_dWPS", rqp->cpl_dw_ps,
56                       "cpl_dWPS Min", rqp->cpl_dw_ps_min,
57                       "cpl_dWPS Max", rqp->cpl_dw_ps_max,
58                       "cplh pending", rqp->cplh_pending,
59                       "cpld pending", rqp->cpld_pending,
60                       "cplh pending max", rqp->cplh_pending_max,
61                       "cpld pending max", rqp->cpld_pending_max);
62 }
63
64 int
65 ark_rqp_lasped(struct ark_rqpace_t *rqp)
66 {
67         return rqp->lasped;
68 }