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