Skip to content

Commit

Permalink
net/sfc/base: import monitors access via MCDI
Browse files Browse the repository at this point in the history
EFSYS_OPT_MON_MCDI should be enabled to use it.

From Solarflare Communications Inc.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
  • Loading branch information
arybchenko authored and Ferruh Yigit committed Jan 17, 2017
1 parent d4c9cda commit dfb3b1c
Show file tree
Hide file tree
Showing 7 changed files with 675 additions and 1 deletion.
3 changes: 3 additions & 0 deletions drivers/net/sfc/base/ef10_nic.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@

#include "efx.h"
#include "efx_impl.h"
#if EFSYS_OPT_MON_MCDI
#include "mcdi_mon.h"
#endif

#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD

Expand Down
7 changes: 7 additions & 0 deletions drivers/net/sfc/base/efx_check.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,13 @@
# endif
#endif /* EFSYS_OPT_MON_STATS */

#if EFSYS_OPT_MON_MCDI
/* Support Monitor via mcdi */
# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
# error "MON_MCDI requires SIENA or HUNTINGTON or MEDFORD"
# endif
#endif /* EFSYS_OPT_MON_MCDI*/

#if EFSYS_OPT_NAMES
/* Support printable names for statistics */
# if !(EFSYS_OPT_LOOPBACK || EFSYS_OPT_MAC_STATS || EFSYS_OPT_MCDI || \
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/sfc/base/efx_ev.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@

#include "efx.h"
#include "efx_impl.h"
#if EFSYS_OPT_MON_MCDI
#include "mcdi_mon.h"
#endif

#if EFSYS_OPT_QSTATS
#define EFX_EV_QSTAT_INCR(_eep, _stat) \
Expand Down
21 changes: 20 additions & 1 deletion drivers/net/sfc/base/efx_mon.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
#include "efx.h"
#include "efx_impl.h"

#if EFSYS_OPT_MON_MCDI
#include "mcdi_mon.h"
#endif

#if EFSYS_OPT_NAMES

static const char * const __efx_mon_name[] = {
Expand All @@ -55,6 +59,14 @@ efx_mon_name(

#endif /* EFSYS_OPT_NAMES */

#if EFSYS_OPT_MON_MCDI
static const efx_mon_ops_t __efx_mon_mcdi_ops = {
#if EFSYS_OPT_MON_STATS
mcdi_mon_stats_update /* emo_stats_update */
#endif /* EFSYS_OPT_MON_STATS */
};
#endif


__checkReturn efx_rc_t
efx_mon_init(
Expand All @@ -79,6 +91,13 @@ efx_mon_init(

EFSYS_ASSERT(encp->enc_mon_type != EFX_MON_INVALID);
switch (emp->em_type) {
#if EFSYS_OPT_MON_MCDI
case EFX_MON_SFC90X0:
case EFX_MON_SFC91X0:
case EFX_MON_SFC92X0:
emop = &__efx_mon_mcdi_ops;
break;
#endif
default:
rc = ENOTSUP;
goto fail2;
Expand All @@ -104,7 +123,7 @@ efx_mon_init(

#if EFSYS_OPT_NAMES

/* START MKCONFIG GENERATED MonitorStatNamesBlock 31f437eafb0b0437 */
/* START MKCONFIG GENERATED MonitorStatNamesBlock 5daa2a5725ba734b */
static const char * const __mon_stat_name[] = {
"value_2_5v",
"value_vccp1",
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/sfc/base/hunt_nic.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@

#include "efx.h"
#include "efx_impl.h"
#if EFSYS_OPT_MON_MCDI
#include "mcdi_mon.h"
#endif

#if EFSYS_OPT_HUNTINGTON

Expand Down

0 comments on commit dfb3b1c

Please sign in to comment.