X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fsfc%2Fbase%2Fefx_mcdi.c;h=8cd651f52973dbcabc4a6fb57b0b90decf7b2ff8;hb=6cf2f95d4dfbae8c8b4ea31ec899e750dcbc62bb;hp=e840401be82fe73314fe0e35b1f702465cf34fad;hpb=addbac71a01332436e5becdc9c0111880239b47e;p=dpdk.git diff --git a/drivers/net/sfc/base/efx_mcdi.c b/drivers/net/sfc/base/efx_mcdi.c index e840401be8..8cd651f529 100644 --- a/drivers/net/sfc/base/efx_mcdi.c +++ b/drivers/net/sfc/base/efx_mcdi.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * - * Copyright (c) 2008-2018 Solarflare Communications Inc. - * All rights reserved. + * Copyright(c) 2019-2020 Xilinx, Inc. + * Copyright(c) 2008-2019 Solarflare Communications Inc. */ #include "efx.h" @@ -1834,17 +1834,10 @@ fail1: #if EFSYS_OPT_MAC_STATS -typedef enum efx_stats_action_e { - EFX_STATS_CLEAR, - EFX_STATS_UPLOAD, - EFX_STATS_ENABLE_NOEVENTS, - EFX_STATS_ENABLE_EVENTS, - EFX_STATS_DISABLE, -} efx_stats_action_t; - -static __checkReturn efx_rc_t + __checkReturn efx_rc_t efx_mcdi_mac_stats( __in efx_nic_t *enp, + __in uint32_t vport_id, __in_opt efsys_mem_t *esmp, __in efx_stats_action_t action, __in uint16_t period_ms) @@ -1910,7 +1903,7 @@ efx_mcdi_mac_stats( * vadapter has already been deleted. */ MCDI_IN_SET_DWORD(req, MAC_STATS_IN_PORT_ID, - (disable ? EVB_PORT_ID_NULL : enp->en_vport_id)); + (disable ? EVB_PORT_ID_NULL : vport_id)); efx_mcdi_execute(enp, &req); @@ -1943,7 +1936,8 @@ efx_mcdi_mac_stats_clear( { efx_rc_t rc; - if ((rc = efx_mcdi_mac_stats(enp, NULL, EFX_STATS_CLEAR, 0)) != 0) + if ((rc = efx_mcdi_mac_stats(enp, enp->en_vport_id, NULL, + EFX_STATS_CLEAR, 0)) != 0) goto fail1; return (0); @@ -1966,7 +1960,8 @@ efx_mcdi_mac_stats_upload( * avoid having to pull the statistics buffer into the cache to * maintain cumulative statistics. */ - if ((rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_UPLOAD, 0)) != 0) + if ((rc = efx_mcdi_mac_stats(enp, enp->en_vport_id, esmp, + EFX_STATS_UPLOAD, 0)) != 0) goto fail1; return (0); @@ -1994,13 +1989,14 @@ efx_mcdi_mac_stats_periodic( * Medford uses a fixed 1sec period before v6.2.1.1033 firmware. */ if (period_ms == 0) - rc = efx_mcdi_mac_stats(enp, NULL, EFX_STATS_DISABLE, 0); + rc = efx_mcdi_mac_stats(enp, enp->en_vport_id, NULL, + EFX_STATS_DISABLE, 0); else if (events) - rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_ENABLE_EVENTS, - period_ms); + rc = efx_mcdi_mac_stats(enp, enp->en_vport_id, esmp, + EFX_STATS_ENABLE_EVENTS, period_ms); else - rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_ENABLE_NOEVENTS, - period_ms); + rc = efx_mcdi_mac_stats(enp, enp->en_vport_id, esmp, + EFX_STATS_ENABLE_NOEVENTS, period_ms); if (rc != 0) goto fail1;