Date: Wed, 25 Mar 2015 11:10:56 +0000 (UTC) From: Andrew Rybchenko <arybchik@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280568 - stable/10/sys/dev/sfxge/common Message-ID: <201503251110.t2PBAui7009398@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: arybchik Date: Wed Mar 25 11:10:56 2015 New Revision: 280568 URL: https://svnweb.freebsd.org/changeset/base/280568 Log: MFC: 279146 sfxge: use sparse index to retrieve sensor value Submitted by: Andrew Jackson <ajackson at solarflare.com> Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/sys/dev/sfxge/common/siena_mon.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/siena_mon.c ============================================================================== --- stable/10/sys/dev/sfxge/common/siena_mon.c Wed Mar 25 11:09:35 2015 (r280567) +++ stable/10/sys/dev/sfxge/common/siena_mon.c Wed Mar 25 11:10:56 2015 (r280568) @@ -105,6 +105,7 @@ siena_mon_decode_stats( uint16_t mc_sensor; size_t mc_sensor_max; uint32_t vmask = 0; + uint32_t idx = 0; /* Assert the MC_CMD_SENSOR and EFX_MON_STATE namespaces agree */ SIENA_STATIC_SENSOR_ASSERT(OK); @@ -125,18 +126,19 @@ siena_mon_decode_stats( for (mc_sensor = 0; mc_sensor < mc_sensor_max; ++mc_sensor) { uint16_t efx_sensor = sensor_map[mc_sensor]; - if (efx_sensor == SIENA_MON_WRONG_PORT) + if (~dmask & (1 << mc_sensor)) continue; - EFSYS_ASSERT(efx_sensor < EFX_MON_NSTATS); + idx++; - if (~dmask & (1 << mc_sensor)) + if (efx_sensor == SIENA_MON_WRONG_PORT) continue; + EFSYS_ASSERT(efx_sensor < EFX_MON_NSTATS); vmask |= (1 << efx_sensor); if (value != NULL && esmp != NULL && !EFSYS_MEM_IS_NULL(esmp)) { efx_mon_stat_value_t *emsvp = value + efx_sensor; efx_dword_t dword; - EFSYS_MEM_READD(esmp, 4 * mc_sensor, &dword); + EFSYS_MEM_READD(esmp, 4 * (idx - 1), &dword); emsvp->emsv_value = (uint16_t)EFX_DWORD_FIELD( dword,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503251110.t2PBAui7009398>