Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ixgbe/ixgbe_dcb.c
/****************************************************************************** | /****************************************************************************** | ||||
Copyright (c) 2001-2015, Intel Corporation | Copyright (c) 2001-2017, Intel Corporation | ||||
All rights reserved. | All rights reserved. | ||||
Redistribution and use in source and binary forms, with or without | Redistribution and use in source and binary forms, with or without | ||||
modification, are permitted provided that the following conditions are met: | modification, are permitted provided that the following conditions are met: | ||||
1. Redistributions of source code must retain the above copyright notice, | 1. Redistributions of source code must retain the above copyright notice, | ||||
this list of conditions and the following disclaimer. | this list of conditions and the following disclaimer. | ||||
2. Redistributions in binary form must reproduce the above copyright | 2. Redistributions in binary form must reproduce the above copyright | ||||
notice, this list of conditions and the following disclaimer in the | notice, this list of conditions and the following disclaimer in the | ||||
documentation and/or other materials provided with the distribution. | documentation and/or other materials provided with the distribution. | ||||
3. Neither the name of the Intel Corporation nor the names of its | 3. Neither the name of the Intel Corporation nor the names of its | ||||
contributors may be used to endorse or promote products derived from | contributors may be used to endorse or promote products derived from | ||||
this software without specific prior written permission. | this software without specific prior written permission. | ||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||||
POSSIBILITY OF SUCH DAMAGE. | POSSIBILITY OF SUCH DAMAGE. | ||||
******************************************************************************/ | ******************************************************************************/ | ||||
/*$FreeBSD$*/ | /*$FreeBSD$*/ | ||||
#include "ixgbe_type.h" | #include "ixgbe_type.h" | ||||
▲ Show 20 Lines • Show All 359 Lines • ▼ Show 20 Lines | s32 ixgbe_dcb_get_tc_stats(struct ixgbe_hw *hw, struct ixgbe_hw_stats *stats, | ||||
switch (hw->mac.type) { | switch (hw->mac.type) { | ||||
case ixgbe_mac_82598EB: | case ixgbe_mac_82598EB: | ||||
ret = ixgbe_dcb_get_tc_stats_82598(hw, stats, tc_count); | ret = ixgbe_dcb_get_tc_stats_82598(hw, stats, tc_count); | ||||
break; | break; | ||||
case ixgbe_mac_82599EB: | case ixgbe_mac_82599EB: | ||||
case ixgbe_mac_X540: | case ixgbe_mac_X540: | ||||
case ixgbe_mac_X550: | case ixgbe_mac_X550: | ||||
case ixgbe_mac_X550EM_x: | case ixgbe_mac_X550EM_x: | ||||
case ixgbe_mac_X550EM_a: | |||||
#if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) | #if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) | ||||
ret = ixgbe_dcb_get_tc_stats_82599(hw, stats, tc_count); | ret = ixgbe_dcb_get_tc_stats_82599(hw, stats, tc_count); | ||||
break; | break; | ||||
#endif | #endif | ||||
default: | default: | ||||
break; | break; | ||||
} | } | ||||
return ret; | return ret; | ||||
Show All 14 Lines | s32 ixgbe_dcb_get_pfc_stats(struct ixgbe_hw *hw, struct ixgbe_hw_stats *stats, | ||||
switch (hw->mac.type) { | switch (hw->mac.type) { | ||||
case ixgbe_mac_82598EB: | case ixgbe_mac_82598EB: | ||||
ret = ixgbe_dcb_get_pfc_stats_82598(hw, stats, tc_count); | ret = ixgbe_dcb_get_pfc_stats_82598(hw, stats, tc_count); | ||||
break; | break; | ||||
case ixgbe_mac_82599EB: | case ixgbe_mac_82599EB: | ||||
case ixgbe_mac_X540: | case ixgbe_mac_X540: | ||||
case ixgbe_mac_X550: | case ixgbe_mac_X550: | ||||
case ixgbe_mac_X550EM_x: | case ixgbe_mac_X550EM_x: | ||||
case ixgbe_mac_X550EM_a: | |||||
#if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) | #if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) | ||||
ret = ixgbe_dcb_get_pfc_stats_82599(hw, stats, tc_count); | ret = ixgbe_dcb_get_pfc_stats_82599(hw, stats, tc_count); | ||||
break; | break; | ||||
#endif | #endif | ||||
default: | default: | ||||
break; | break; | ||||
} | } | ||||
return ret; | return ret; | ||||
Show All 25 Lines | s32 ixgbe_dcb_config_rx_arbiter_cee(struct ixgbe_hw *hw, | ||||
switch (hw->mac.type) { | switch (hw->mac.type) { | ||||
case ixgbe_mac_82598EB: | case ixgbe_mac_82598EB: | ||||
ret = ixgbe_dcb_config_rx_arbiter_82598(hw, refill, max, tsa); | ret = ixgbe_dcb_config_rx_arbiter_82598(hw, refill, max, tsa); | ||||
break; | break; | ||||
case ixgbe_mac_82599EB: | case ixgbe_mac_82599EB: | ||||
case ixgbe_mac_X540: | case ixgbe_mac_X540: | ||||
case ixgbe_mac_X550: | case ixgbe_mac_X550: | ||||
case ixgbe_mac_X550EM_x: | case ixgbe_mac_X550EM_x: | ||||
case ixgbe_mac_X550EM_a: | |||||
#if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) | #if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) | ||||
ret = ixgbe_dcb_config_rx_arbiter_82599(hw, refill, max, bwgid, | ret = ixgbe_dcb_config_rx_arbiter_82599(hw, refill, max, bwgid, | ||||
tsa, map); | tsa, map); | ||||
break; | break; | ||||
#endif | #endif | ||||
default: | default: | ||||
break; | break; | ||||
} | } | ||||
Show All 25 Lines | s32 ixgbe_dcb_config_tx_desc_arbiter_cee(struct ixgbe_hw *hw, | ||||
case ixgbe_mac_82598EB: | case ixgbe_mac_82598EB: | ||||
ret = ixgbe_dcb_config_tx_desc_arbiter_82598(hw, refill, max, | ret = ixgbe_dcb_config_tx_desc_arbiter_82598(hw, refill, max, | ||||
bwgid, tsa); | bwgid, tsa); | ||||
break; | break; | ||||
case ixgbe_mac_82599EB: | case ixgbe_mac_82599EB: | ||||
case ixgbe_mac_X540: | case ixgbe_mac_X540: | ||||
case ixgbe_mac_X550: | case ixgbe_mac_X550: | ||||
case ixgbe_mac_X550EM_x: | case ixgbe_mac_X550EM_x: | ||||
case ixgbe_mac_X550EM_a: | |||||
#if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) | #if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) | ||||
ret = ixgbe_dcb_config_tx_desc_arbiter_82599(hw, refill, max, | ret = ixgbe_dcb_config_tx_desc_arbiter_82599(hw, refill, max, | ||||
bwgid, tsa); | bwgid, tsa); | ||||
break; | break; | ||||
#endif | #endif | ||||
default: | default: | ||||
break; | break; | ||||
} | } | ||||
Show All 27 Lines | s32 ixgbe_dcb_config_tx_data_arbiter_cee(struct ixgbe_hw *hw, | ||||
case ixgbe_mac_82598EB: | case ixgbe_mac_82598EB: | ||||
ret = ixgbe_dcb_config_tx_data_arbiter_82598(hw, refill, max, | ret = ixgbe_dcb_config_tx_data_arbiter_82598(hw, refill, max, | ||||
bwgid, tsa); | bwgid, tsa); | ||||
break; | break; | ||||
case ixgbe_mac_82599EB: | case ixgbe_mac_82599EB: | ||||
case ixgbe_mac_X540: | case ixgbe_mac_X540: | ||||
case ixgbe_mac_X550: | case ixgbe_mac_X550: | ||||
case ixgbe_mac_X550EM_x: | case ixgbe_mac_X550EM_x: | ||||
case ixgbe_mac_X550EM_a: | |||||
#if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) | #if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) | ||||
ret = ixgbe_dcb_config_tx_data_arbiter_82599(hw, refill, max, | ret = ixgbe_dcb_config_tx_data_arbiter_82599(hw, refill, max, | ||||
bwgid, tsa, | bwgid, tsa, | ||||
map); | map); | ||||
break; | break; | ||||
#endif | #endif | ||||
default: | default: | ||||
break; | break; | ||||
Show All 21 Lines | s32 ixgbe_dcb_config_pfc_cee(struct ixgbe_hw *hw, | ||||
switch (hw->mac.type) { | switch (hw->mac.type) { | ||||
case ixgbe_mac_82598EB: | case ixgbe_mac_82598EB: | ||||
ret = ixgbe_dcb_config_pfc_82598(hw, pfc_en); | ret = ixgbe_dcb_config_pfc_82598(hw, pfc_en); | ||||
break; | break; | ||||
case ixgbe_mac_82599EB: | case ixgbe_mac_82599EB: | ||||
case ixgbe_mac_X540: | case ixgbe_mac_X540: | ||||
case ixgbe_mac_X550: | case ixgbe_mac_X550: | ||||
case ixgbe_mac_X550EM_x: | case ixgbe_mac_X550EM_x: | ||||
case ixgbe_mac_X550EM_a: | |||||
#if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) | #if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) | ||||
ret = ixgbe_dcb_config_pfc_82599(hw, pfc_en, map); | ret = ixgbe_dcb_config_pfc_82599(hw, pfc_en, map); | ||||
break; | break; | ||||
#endif | #endif | ||||
default: | default: | ||||
break; | break; | ||||
} | } | ||||
return ret; | return ret; | ||||
Show All 12 Lines | s32 ixgbe_dcb_config_tc_stats(struct ixgbe_hw *hw) | ||||
switch (hw->mac.type) { | switch (hw->mac.type) { | ||||
case ixgbe_mac_82598EB: | case ixgbe_mac_82598EB: | ||||
ret = ixgbe_dcb_config_tc_stats_82598(hw); | ret = ixgbe_dcb_config_tc_stats_82598(hw); | ||||
break; | break; | ||||
case ixgbe_mac_82599EB: | case ixgbe_mac_82599EB: | ||||
case ixgbe_mac_X540: | case ixgbe_mac_X540: | ||||
case ixgbe_mac_X550: | case ixgbe_mac_X550: | ||||
case ixgbe_mac_X550EM_x: | case ixgbe_mac_X550EM_x: | ||||
case ixgbe_mac_X550EM_a: | |||||
#if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) | #if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) | ||||
ret = ixgbe_dcb_config_tc_stats_82599(hw, NULL); | ret = ixgbe_dcb_config_tc_stats_82599(hw, NULL); | ||||
break; | break; | ||||
#endif | #endif | ||||
default: | default: | ||||
break; | break; | ||||
} | } | ||||
return ret; | return ret; | ||||
Show All 31 Lines | s32 ixgbe_dcb_hw_config_cee(struct ixgbe_hw *hw, | ||||
case ixgbe_mac_82598EB: | case ixgbe_mac_82598EB: | ||||
ret = ixgbe_dcb_hw_config_82598(hw, dcb_config->link_speed, | ret = ixgbe_dcb_hw_config_82598(hw, dcb_config->link_speed, | ||||
refill, max, bwgid, tsa); | refill, max, bwgid, tsa); | ||||
break; | break; | ||||
case ixgbe_mac_82599EB: | case ixgbe_mac_82599EB: | ||||
case ixgbe_mac_X540: | case ixgbe_mac_X540: | ||||
case ixgbe_mac_X550: | case ixgbe_mac_X550: | ||||
case ixgbe_mac_X550EM_x: | case ixgbe_mac_X550EM_x: | ||||
case ixgbe_mac_X550EM_a: | |||||
#if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) | #if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) | ||||
ixgbe_dcb_config_82599(hw, dcb_config); | ixgbe_dcb_config_82599(hw, dcb_config); | ||||
ret = ixgbe_dcb_hw_config_82599(hw, dcb_config->link_speed, | ret = ixgbe_dcb_hw_config_82599(hw, dcb_config->link_speed, | ||||
refill, max, bwgid, | refill, max, bwgid, | ||||
tsa, map); | tsa, map); | ||||
ixgbe_dcb_config_tc_stats_82599(hw, dcb_config); | ixgbe_dcb_config_tc_stats_82599(hw, dcb_config); | ||||
break; | break; | ||||
Show All 18 Lines | s32 ixgbe_dcb_config_pfc(struct ixgbe_hw *hw, u8 pfc_en, u8 *map) | ||||
switch (hw->mac.type) { | switch (hw->mac.type) { | ||||
case ixgbe_mac_82598EB: | case ixgbe_mac_82598EB: | ||||
ret = ixgbe_dcb_config_pfc_82598(hw, pfc_en); | ret = ixgbe_dcb_config_pfc_82598(hw, pfc_en); | ||||
break; | break; | ||||
case ixgbe_mac_82599EB: | case ixgbe_mac_82599EB: | ||||
case ixgbe_mac_X540: | case ixgbe_mac_X540: | ||||
case ixgbe_mac_X550: | case ixgbe_mac_X550: | ||||
case ixgbe_mac_X550EM_x: | case ixgbe_mac_X550EM_x: | ||||
case ixgbe_mac_X550EM_a: | |||||
#if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) | #if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) | ||||
ret = ixgbe_dcb_config_pfc_82599(hw, pfc_en, map); | ret = ixgbe_dcb_config_pfc_82599(hw, pfc_en, map); | ||||
break; | break; | ||||
#endif | #endif | ||||
default: | default: | ||||
break; | break; | ||||
} | } | ||||
return ret; | return ret; | ||||
Show All 9 Lines | ixgbe_dcb_config_tx_desc_arbiter_82598(hw, refill, max, bwg_id, | ||||
tsa); | tsa); | ||||
ixgbe_dcb_config_tx_data_arbiter_82598(hw, refill, max, bwg_id, | ixgbe_dcb_config_tx_data_arbiter_82598(hw, refill, max, bwg_id, | ||||
tsa); | tsa); | ||||
break; | break; | ||||
case ixgbe_mac_82599EB: | case ixgbe_mac_82599EB: | ||||
case ixgbe_mac_X540: | case ixgbe_mac_X540: | ||||
case ixgbe_mac_X550: | case ixgbe_mac_X550: | ||||
case ixgbe_mac_X550EM_x: | case ixgbe_mac_X550EM_x: | ||||
case ixgbe_mac_X550EM_a: | |||||
#if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) | #if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) | ||||
ixgbe_dcb_config_rx_arbiter_82599(hw, refill, max, bwg_id, | ixgbe_dcb_config_rx_arbiter_82599(hw, refill, max, bwg_id, | ||||
tsa, map); | tsa, map); | ||||
ixgbe_dcb_config_tx_desc_arbiter_82599(hw, refill, max, bwg_id, | ixgbe_dcb_config_tx_desc_arbiter_82599(hw, refill, max, bwg_id, | ||||
tsa); | tsa); | ||||
ixgbe_dcb_config_tx_data_arbiter_82599(hw, refill, max, bwg_id, | ixgbe_dcb_config_tx_data_arbiter_82599(hw, refill, max, bwg_id, | ||||
tsa, map); | tsa, map); | ||||
break; | break; | ||||
#endif | #endif | ||||
default: | default: | ||||
break; | break; | ||||
} | } | ||||
return 0; | return 0; | ||||
} | } |