Home | History | Annotate | Line # | Download | only in ixgbe
ixgbe_dcb_82598.c revision 1.5
      1  1.1  msaitoh /******************************************************************************
      2  1.5  msaitoh   SPDX-License-Identifier: BSD-3-Clause
      3  1.1  msaitoh 
      4  1.4  msaitoh   Copyright (c) 2001-2017, Intel Corporation
      5  1.1  msaitoh   All rights reserved.
      6  1.4  msaitoh 
      7  1.4  msaitoh   Redistribution and use in source and binary forms, with or without
      8  1.1  msaitoh   modification, are permitted provided that the following conditions are met:
      9  1.4  msaitoh 
     10  1.4  msaitoh    1. Redistributions of source code must retain the above copyright notice,
     11  1.1  msaitoh       this list of conditions and the following disclaimer.
     12  1.4  msaitoh 
     13  1.4  msaitoh    2. Redistributions in binary form must reproduce the above copyright
     14  1.4  msaitoh       notice, this list of conditions and the following disclaimer in the
     15  1.1  msaitoh       documentation and/or other materials provided with the distribution.
     16  1.4  msaitoh 
     17  1.4  msaitoh    3. Neither the name of the Intel Corporation nor the names of its
     18  1.4  msaitoh       contributors may be used to endorse or promote products derived from
     19  1.1  msaitoh       this software without specific prior written permission.
     20  1.4  msaitoh 
     21  1.1  msaitoh   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22  1.4  msaitoh   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23  1.4  msaitoh   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24  1.4  msaitoh   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     25  1.4  msaitoh   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26  1.4  msaitoh   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27  1.4  msaitoh   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28  1.4  msaitoh   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29  1.4  msaitoh   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30  1.1  msaitoh   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     31  1.1  msaitoh   POSSIBILITY OF SUCH DAMAGE.
     32  1.1  msaitoh 
     33  1.1  msaitoh ******************************************************************************/
     34  1.4  msaitoh /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb_82598.c 320688 2017-07-05 17:27:03Z erj $*/
     35  1.1  msaitoh 
     36  1.1  msaitoh 
     37  1.1  msaitoh #include "ixgbe_type.h"
     38  1.1  msaitoh #include "ixgbe_dcb.h"
     39  1.1  msaitoh #include "ixgbe_dcb_82598.h"
     40  1.1  msaitoh 
     41  1.1  msaitoh /**
     42  1.1  msaitoh  * ixgbe_dcb_get_tc_stats_82598 - Return status data for each traffic class
     43  1.1  msaitoh  * @hw: pointer to hardware structure
     44  1.1  msaitoh  * @stats: pointer to statistics structure
     45  1.1  msaitoh  * @tc_count:  Number of elements in bwg_array.
     46  1.1  msaitoh  *
     47  1.1  msaitoh  * This function returns the status data for each of the Traffic Classes in use.
     48  1.1  msaitoh  */
     49  1.1  msaitoh s32 ixgbe_dcb_get_tc_stats_82598(struct ixgbe_hw *hw,
     50  1.1  msaitoh 				 struct ixgbe_hw_stats *stats,
     51  1.1  msaitoh 				 u8 tc_count)
     52  1.1  msaitoh {
     53  1.1  msaitoh 	int tc;
     54  1.1  msaitoh 
     55  1.1  msaitoh 	DEBUGFUNC("dcb_get_tc_stats");
     56  1.1  msaitoh 
     57  1.1  msaitoh 	if (tc_count > IXGBE_DCB_MAX_TRAFFIC_CLASS)
     58  1.1  msaitoh 		return IXGBE_ERR_PARAM;
     59  1.1  msaitoh 
     60  1.1  msaitoh 	/* Statistics pertaining to each traffic class */
     61  1.1  msaitoh 	for (tc = 0; tc < tc_count; tc++) {
     62  1.1  msaitoh 		/* Transmitted Packets */
     63  1.1  msaitoh 		stats->qptc[tc] += IXGBE_READ_REG(hw, IXGBE_QPTC(tc));
     64  1.1  msaitoh 		/* Transmitted Bytes */
     65  1.1  msaitoh 		stats->qbtc[tc] += IXGBE_READ_REG(hw, IXGBE_QBTC(tc));
     66  1.1  msaitoh 		/* Received Packets */
     67  1.1  msaitoh 		stats->qprc[tc] += IXGBE_READ_REG(hw, IXGBE_QPRC(tc));
     68  1.1  msaitoh 		/* Received Bytes */
     69  1.1  msaitoh 		stats->qbrc[tc] += IXGBE_READ_REG(hw, IXGBE_QBRC(tc));
     70  1.1  msaitoh 
     71  1.1  msaitoh #if 0
     72  1.1  msaitoh 		/* Can we get rid of these??  Consequently, getting rid
     73  1.1  msaitoh 		 * of the tc_stats structure.
     74  1.1  msaitoh 		 */
     75  1.1  msaitoh 		tc_stats_array[up]->in_overflow_discards = 0;
     76  1.1  msaitoh 		tc_stats_array[up]->out_overflow_discards = 0;
     77  1.1  msaitoh #endif
     78  1.1  msaitoh 	}
     79  1.1  msaitoh 
     80  1.1  msaitoh 	return IXGBE_SUCCESS;
     81  1.1  msaitoh }
     82  1.1  msaitoh 
     83  1.1  msaitoh /**
     84  1.1  msaitoh  * ixgbe_dcb_get_pfc_stats_82598 - Returns CBFC status data
     85  1.1  msaitoh  * @hw: pointer to hardware structure
     86  1.1  msaitoh  * @stats: pointer to statistics structure
     87  1.1  msaitoh  * @tc_count:  Number of elements in bwg_array.
     88  1.1  msaitoh  *
     89  1.1  msaitoh  * This function returns the CBFC status data for each of the Traffic Classes.
     90  1.1  msaitoh  */
     91  1.1  msaitoh s32 ixgbe_dcb_get_pfc_stats_82598(struct ixgbe_hw *hw,
     92  1.1  msaitoh 				  struct ixgbe_hw_stats *stats,
     93  1.1  msaitoh 				  u8 tc_count)
     94  1.1  msaitoh {
     95  1.1  msaitoh 	int tc;
     96  1.1  msaitoh 
     97  1.1  msaitoh 	DEBUGFUNC("dcb_get_pfc_stats");
     98  1.1  msaitoh 
     99  1.1  msaitoh 	if (tc_count > IXGBE_DCB_MAX_TRAFFIC_CLASS)
    100  1.1  msaitoh 		return IXGBE_ERR_PARAM;
    101  1.1  msaitoh 
    102  1.1  msaitoh 	for (tc = 0; tc < tc_count; tc++) {
    103  1.1  msaitoh 		/* Priority XOFF Transmitted */
    104  1.1  msaitoh 		stats->pxofftxc[tc] += IXGBE_READ_REG(hw, IXGBE_PXOFFTXC(tc));
    105  1.1  msaitoh 		/* Priority XOFF Received */
    106  1.1  msaitoh 		stats->pxoffrxc[tc] += IXGBE_READ_REG(hw, IXGBE_PXOFFRXC(tc));
    107  1.1  msaitoh 	}
    108  1.1  msaitoh 
    109  1.1  msaitoh 	return IXGBE_SUCCESS;
    110  1.1  msaitoh }
    111  1.1  msaitoh 
    112  1.1  msaitoh /**
    113  1.1  msaitoh  * ixgbe_dcb_config_rx_arbiter_82598 - Config Rx data arbiter
    114  1.1  msaitoh  * @hw: pointer to hardware structure
    115  1.1  msaitoh  * @dcb_config: pointer to ixgbe_dcb_config structure
    116  1.1  msaitoh  *
    117  1.1  msaitoh  * Configure Rx Data Arbiter and credits for each traffic class.
    118  1.1  msaitoh  */
    119  1.1  msaitoh s32 ixgbe_dcb_config_rx_arbiter_82598(struct ixgbe_hw *hw, u16 *refill,
    120  1.1  msaitoh 				      u16 *max, u8 *tsa)
    121  1.1  msaitoh {
    122  1.1  msaitoh 	u32 reg = 0;
    123  1.1  msaitoh 	u32 credit_refill = 0;
    124  1.1  msaitoh 	u32 credit_max = 0;
    125  1.1  msaitoh 	u8 i = 0;
    126  1.1  msaitoh 
    127  1.1  msaitoh 	reg = IXGBE_READ_REG(hw, IXGBE_RUPPBMR) | IXGBE_RUPPBMR_MQA;
    128  1.1  msaitoh 	IXGBE_WRITE_REG(hw, IXGBE_RUPPBMR, reg);
    129  1.1  msaitoh 
    130  1.1  msaitoh 	reg = IXGBE_READ_REG(hw, IXGBE_RMCS);
    131  1.1  msaitoh 	/* Enable Arbiter */
    132  1.1  msaitoh 	reg &= ~IXGBE_RMCS_ARBDIS;
    133  1.1  msaitoh 	/* Enable Receive Recycle within the BWG */
    134  1.1  msaitoh 	reg |= IXGBE_RMCS_RRM;
    135  1.1  msaitoh 	/* Enable Deficit Fixed Priority arbitration*/
    136  1.1  msaitoh 	reg |= IXGBE_RMCS_DFP;
    137  1.1  msaitoh 
    138  1.1  msaitoh 	IXGBE_WRITE_REG(hw, IXGBE_RMCS, reg);
    139  1.1  msaitoh 
    140  1.1  msaitoh 	/* Configure traffic class credits and priority */
    141  1.1  msaitoh 	for (i = 0; i < IXGBE_DCB_MAX_TRAFFIC_CLASS; i++) {
    142  1.1  msaitoh 		credit_refill = refill[i];
    143  1.1  msaitoh 		credit_max = max[i];
    144  1.1  msaitoh 
    145  1.1  msaitoh 		reg = credit_refill | (credit_max << IXGBE_RT2CR_MCL_SHIFT);
    146  1.1  msaitoh 
    147  1.1  msaitoh 		if (tsa[i] == ixgbe_dcb_tsa_strict)
    148  1.1  msaitoh 			reg |= IXGBE_RT2CR_LSP;
    149  1.1  msaitoh 
    150  1.1  msaitoh 		IXGBE_WRITE_REG(hw, IXGBE_RT2CR(i), reg);
    151  1.1  msaitoh 	}
    152  1.1  msaitoh 
    153  1.1  msaitoh 	reg = IXGBE_READ_REG(hw, IXGBE_RDRXCTL);
    154  1.1  msaitoh 	reg |= IXGBE_RDRXCTL_RDMTS_1_2;
    155  1.1  msaitoh 	reg |= IXGBE_RDRXCTL_MPBEN;
    156  1.1  msaitoh 	reg |= IXGBE_RDRXCTL_MCEN;
    157  1.1  msaitoh 	IXGBE_WRITE_REG(hw, IXGBE_RDRXCTL, reg);
    158  1.1  msaitoh 
    159  1.1  msaitoh 	reg = IXGBE_READ_REG(hw, IXGBE_RXCTRL);
    160  1.1  msaitoh 	/* Make sure there is enough descriptors before arbitration */
    161  1.1  msaitoh 	reg &= ~IXGBE_RXCTRL_DMBYPS;
    162  1.1  msaitoh 	IXGBE_WRITE_REG(hw, IXGBE_RXCTRL, reg);
    163  1.1  msaitoh 
    164  1.1  msaitoh 	return IXGBE_SUCCESS;
    165  1.1  msaitoh }
    166  1.1  msaitoh 
    167  1.1  msaitoh /**
    168  1.1  msaitoh  * ixgbe_dcb_config_tx_desc_arbiter_82598 - Config Tx Desc. arbiter
    169  1.1  msaitoh  * @hw: pointer to hardware structure
    170  1.1  msaitoh  * @dcb_config: pointer to ixgbe_dcb_config structure
    171  1.1  msaitoh  *
    172  1.1  msaitoh  * Configure Tx Descriptor Arbiter and credits for each traffic class.
    173  1.1  msaitoh  */
    174  1.1  msaitoh s32 ixgbe_dcb_config_tx_desc_arbiter_82598(struct ixgbe_hw *hw,
    175  1.1  msaitoh 					   u16 *refill, u16 *max, u8 *bwg_id,
    176  1.1  msaitoh 					   u8 *tsa)
    177  1.1  msaitoh {
    178  1.1  msaitoh 	u32 reg, max_credits;
    179  1.1  msaitoh 	u8 i;
    180  1.1  msaitoh 
    181  1.1  msaitoh 	reg = IXGBE_READ_REG(hw, IXGBE_DPMCS);
    182  1.1  msaitoh 
    183  1.1  msaitoh 	/* Enable arbiter */
    184  1.1  msaitoh 	reg &= ~IXGBE_DPMCS_ARBDIS;
    185  1.1  msaitoh 	reg |= IXGBE_DPMCS_TSOEF;
    186  1.1  msaitoh 
    187  1.1  msaitoh 	/* Configure Max TSO packet size 34KB including payload and headers */
    188  1.1  msaitoh 	reg |= (0x4 << IXGBE_DPMCS_MTSOS_SHIFT);
    189  1.1  msaitoh 
    190  1.1  msaitoh 	IXGBE_WRITE_REG(hw, IXGBE_DPMCS, reg);
    191  1.1  msaitoh 
    192  1.1  msaitoh 	/* Configure traffic class credits and priority */
    193  1.1  msaitoh 	for (i = 0; i < IXGBE_DCB_MAX_TRAFFIC_CLASS; i++) {
    194  1.1  msaitoh 		max_credits = max[i];
    195  1.1  msaitoh 		reg = max_credits << IXGBE_TDTQ2TCCR_MCL_SHIFT;
    196  1.1  msaitoh 		reg |= refill[i];
    197  1.1  msaitoh 		reg |= (u32)(bwg_id[i]) << IXGBE_TDTQ2TCCR_BWG_SHIFT;
    198  1.1  msaitoh 
    199  1.1  msaitoh 		if (tsa[i] == ixgbe_dcb_tsa_group_strict_cee)
    200  1.1  msaitoh 			reg |= IXGBE_TDTQ2TCCR_GSP;
    201  1.1  msaitoh 
    202  1.1  msaitoh 		if (tsa[i] == ixgbe_dcb_tsa_strict)
    203  1.1  msaitoh 			reg |= IXGBE_TDTQ2TCCR_LSP;
    204  1.1  msaitoh 
    205  1.1  msaitoh 		IXGBE_WRITE_REG(hw, IXGBE_TDTQ2TCCR(i), reg);
    206  1.1  msaitoh 	}
    207  1.1  msaitoh 
    208  1.1  msaitoh 	return IXGBE_SUCCESS;
    209  1.1  msaitoh }
    210  1.1  msaitoh 
    211  1.1  msaitoh /**
    212  1.1  msaitoh  * ixgbe_dcb_config_tx_data_arbiter_82598 - Config Tx data arbiter
    213  1.1  msaitoh  * @hw: pointer to hardware structure
    214  1.1  msaitoh  * @dcb_config: pointer to ixgbe_dcb_config structure
    215  1.1  msaitoh  *
    216  1.1  msaitoh  * Configure Tx Data Arbiter and credits for each traffic class.
    217  1.1  msaitoh  */
    218  1.1  msaitoh s32 ixgbe_dcb_config_tx_data_arbiter_82598(struct ixgbe_hw *hw,
    219  1.1  msaitoh 					   u16 *refill, u16 *max, u8 *bwg_id,
    220  1.1  msaitoh 					   u8 *tsa)
    221  1.1  msaitoh {
    222  1.1  msaitoh 	u32 reg;
    223  1.1  msaitoh 	u8 i;
    224  1.1  msaitoh 
    225  1.1  msaitoh 	reg = IXGBE_READ_REG(hw, IXGBE_PDPMCS);
    226  1.1  msaitoh 	/* Enable Data Plane Arbiter */
    227  1.1  msaitoh 	reg &= ~IXGBE_PDPMCS_ARBDIS;
    228  1.1  msaitoh 	/* Enable DFP and Transmit Recycle Mode */
    229  1.1  msaitoh 	reg |= (IXGBE_PDPMCS_TPPAC | IXGBE_PDPMCS_TRM);
    230  1.1  msaitoh 
    231  1.1  msaitoh 	IXGBE_WRITE_REG(hw, IXGBE_PDPMCS, reg);
    232  1.1  msaitoh 
    233  1.1  msaitoh 	/* Configure traffic class credits and priority */
    234  1.1  msaitoh 	for (i = 0; i < IXGBE_DCB_MAX_TRAFFIC_CLASS; i++) {
    235  1.1  msaitoh 		reg = refill[i];
    236  1.1  msaitoh 		reg |= (u32)(max[i]) << IXGBE_TDPT2TCCR_MCL_SHIFT;
    237  1.1  msaitoh 		reg |= (u32)(bwg_id[i]) << IXGBE_TDPT2TCCR_BWG_SHIFT;
    238  1.1  msaitoh 
    239  1.1  msaitoh 		if (tsa[i] == ixgbe_dcb_tsa_group_strict_cee)
    240  1.1  msaitoh 			reg |= IXGBE_TDPT2TCCR_GSP;
    241  1.1  msaitoh 
    242  1.1  msaitoh 		if (tsa[i] == ixgbe_dcb_tsa_strict)
    243  1.1  msaitoh 			reg |= IXGBE_TDPT2TCCR_LSP;
    244  1.1  msaitoh 
    245  1.1  msaitoh 		IXGBE_WRITE_REG(hw, IXGBE_TDPT2TCCR(i), reg);
    246  1.1  msaitoh 	}
    247  1.1  msaitoh 
    248  1.1  msaitoh 	/* Enable Tx packet buffer division */
    249  1.1  msaitoh 	reg = IXGBE_READ_REG(hw, IXGBE_DTXCTL);
    250  1.1  msaitoh 	reg |= IXGBE_DTXCTL_ENDBUBD;
    251  1.1  msaitoh 	IXGBE_WRITE_REG(hw, IXGBE_DTXCTL, reg);
    252  1.1  msaitoh 
    253  1.1  msaitoh 	return IXGBE_SUCCESS;
    254  1.1  msaitoh }
    255  1.1  msaitoh 
    256  1.1  msaitoh /**
    257  1.1  msaitoh  * ixgbe_dcb_config_pfc_82598 - Config priority flow control
    258  1.1  msaitoh  * @hw: pointer to hardware structure
    259  1.1  msaitoh  * @dcb_config: pointer to ixgbe_dcb_config structure
    260  1.1  msaitoh  *
    261  1.1  msaitoh  * Configure Priority Flow Control for each traffic class.
    262  1.1  msaitoh  */
    263  1.1  msaitoh s32 ixgbe_dcb_config_pfc_82598(struct ixgbe_hw *hw, u8 pfc_en)
    264  1.1  msaitoh {
    265  1.1  msaitoh 	u32 fcrtl, reg;
    266  1.1  msaitoh 	u8 i;
    267  1.1  msaitoh 
    268  1.1  msaitoh 	/* Enable Transmit Priority Flow Control */
    269  1.1  msaitoh 	reg = IXGBE_READ_REG(hw, IXGBE_RMCS);
    270  1.1  msaitoh 	reg &= ~IXGBE_RMCS_TFCE_802_3X;
    271  1.1  msaitoh 	reg |= IXGBE_RMCS_TFCE_PRIORITY;
    272  1.1  msaitoh 	IXGBE_WRITE_REG(hw, IXGBE_RMCS, reg);
    273  1.1  msaitoh 
    274  1.1  msaitoh 	/* Enable Receive Priority Flow Control */
    275  1.1  msaitoh 	reg = IXGBE_READ_REG(hw, IXGBE_FCTRL);
    276  1.1  msaitoh 	reg &= ~(IXGBE_FCTRL_RPFCE | IXGBE_FCTRL_RFCE);
    277  1.1  msaitoh 
    278  1.1  msaitoh 	if (pfc_en)
    279  1.1  msaitoh 		reg |= IXGBE_FCTRL_RPFCE;
    280  1.1  msaitoh 
    281  1.1  msaitoh 	IXGBE_WRITE_REG(hw, IXGBE_FCTRL, reg);
    282  1.1  msaitoh 
    283  1.1  msaitoh 	/* Configure PFC Tx thresholds per TC */
    284  1.1  msaitoh 	for (i = 0; i < IXGBE_DCB_MAX_TRAFFIC_CLASS; i++) {
    285  1.1  msaitoh 		if (!(pfc_en & (1 << i))) {
    286  1.1  msaitoh 			IXGBE_WRITE_REG(hw, IXGBE_FCRTL(i), 0);
    287  1.1  msaitoh 			IXGBE_WRITE_REG(hw, IXGBE_FCRTH(i), 0);
    288  1.1  msaitoh 			continue;
    289  1.1  msaitoh 		}
    290  1.1  msaitoh 
    291  1.1  msaitoh 		fcrtl = (hw->fc.low_water[i] << 10) | IXGBE_FCRTL_XONE;
    292  1.1  msaitoh 		reg = (hw->fc.high_water[i] << 10) | IXGBE_FCRTH_FCEN;
    293  1.1  msaitoh 		IXGBE_WRITE_REG(hw, IXGBE_FCRTL(i), fcrtl);
    294  1.1  msaitoh 		IXGBE_WRITE_REG(hw, IXGBE_FCRTH(i), reg);
    295  1.1  msaitoh 	}
    296  1.1  msaitoh 
    297  1.1  msaitoh 	/* Configure pause time */
    298  1.1  msaitoh 	reg = hw->fc.pause_time | (hw->fc.pause_time << 16);
    299  1.1  msaitoh 	for (i = 0; i < (IXGBE_DCB_MAX_TRAFFIC_CLASS / 2); i++)
    300  1.1  msaitoh 		IXGBE_WRITE_REG(hw, IXGBE_FCTTV(i), reg);
    301  1.1  msaitoh 
    302  1.1  msaitoh 	/* Configure flow control refresh threshold value */
    303  1.1  msaitoh 	IXGBE_WRITE_REG(hw, IXGBE_FCRTV, hw->fc.pause_time / 2);
    304  1.1  msaitoh 
    305  1.1  msaitoh 	return IXGBE_SUCCESS;
    306  1.1  msaitoh }
    307  1.1  msaitoh 
    308  1.1  msaitoh /**
    309  1.1  msaitoh  * ixgbe_dcb_config_tc_stats_82598 - Configure traffic class statistics
    310  1.1  msaitoh  * @hw: pointer to hardware structure
    311  1.1  msaitoh  *
    312  1.1  msaitoh  * Configure queue statistics registers, all queues belonging to same traffic
    313  1.1  msaitoh  * class uses a single set of queue statistics counters.
    314  1.1  msaitoh  */
    315  1.1  msaitoh s32 ixgbe_dcb_config_tc_stats_82598(struct ixgbe_hw *hw)
    316  1.1  msaitoh {
    317  1.1  msaitoh 	u32 reg = 0;
    318  1.1  msaitoh 	u8 i = 0;
    319  1.1  msaitoh 	u8 j = 0;
    320  1.1  msaitoh 
    321  1.1  msaitoh 	/* Receive Queues stats setting -  8 queues per statistics reg */
    322  1.1  msaitoh 	for (i = 0, j = 0; i < 15 && j < 8; i = i + 2, j++) {
    323  1.1  msaitoh 		reg = IXGBE_READ_REG(hw, IXGBE_RQSMR(i));
    324  1.1  msaitoh 		reg |= ((0x1010101) * j);
    325  1.1  msaitoh 		IXGBE_WRITE_REG(hw, IXGBE_RQSMR(i), reg);
    326  1.1  msaitoh 		reg = IXGBE_READ_REG(hw, IXGBE_RQSMR(i + 1));
    327  1.1  msaitoh 		reg |= ((0x1010101) * j);
    328  1.1  msaitoh 		IXGBE_WRITE_REG(hw, IXGBE_RQSMR(i + 1), reg);
    329  1.1  msaitoh 	}
    330  1.1  msaitoh 	/* Transmit Queues stats setting -  4 queues per statistics reg*/
    331  1.1  msaitoh 	for (i = 0; i < 8; i++) {
    332  1.1  msaitoh 		reg = IXGBE_READ_REG(hw, IXGBE_TQSMR(i));
    333  1.1  msaitoh 		reg |= ((0x1010101) * i);
    334  1.1  msaitoh 		IXGBE_WRITE_REG(hw, IXGBE_TQSMR(i), reg);
    335  1.1  msaitoh 	}
    336  1.1  msaitoh 
    337  1.1  msaitoh 	return IXGBE_SUCCESS;
    338  1.1  msaitoh }
    339  1.1  msaitoh 
    340  1.1  msaitoh /**
    341  1.1  msaitoh  * ixgbe_dcb_hw_config_82598 - Config and enable DCB
    342  1.1  msaitoh  * @hw: pointer to hardware structure
    343  1.1  msaitoh  * @dcb_config: pointer to ixgbe_dcb_config structure
    344  1.1  msaitoh  *
    345  1.1  msaitoh  * Configure dcb settings and enable dcb mode.
    346  1.1  msaitoh  */
    347  1.1  msaitoh s32 ixgbe_dcb_hw_config_82598(struct ixgbe_hw *hw, int link_speed,
    348  1.1  msaitoh 			      u16 *refill, u16 *max, u8 *bwg_id,
    349  1.1  msaitoh 			      u8 *tsa)
    350  1.1  msaitoh {
    351  1.2  msaitoh 	UNREFERENCED_1PARAMETER(link_speed);
    352  1.2  msaitoh 
    353  1.1  msaitoh 	ixgbe_dcb_config_rx_arbiter_82598(hw, refill, max, tsa);
    354  1.1  msaitoh 	ixgbe_dcb_config_tx_desc_arbiter_82598(hw, refill, max, bwg_id,
    355  1.1  msaitoh 					       tsa);
    356  1.1  msaitoh 	ixgbe_dcb_config_tx_data_arbiter_82598(hw, refill, max, bwg_id,
    357  1.1  msaitoh 					       tsa);
    358  1.1  msaitoh 	ixgbe_dcb_config_tc_stats_82598(hw);
    359  1.1  msaitoh 
    360  1.1  msaitoh 
    361  1.1  msaitoh 	return IXGBE_SUCCESS;
    362  1.1  msaitoh }
    363