Skip to content

Commit b64f2ac

Browse files
mstarovodavem330
authored andcommitted
net: atlantic: change the order of arguments for TC weight/credit setters
This patch changes the order of arguments for TC weight/credit setter functions. Having the "value to be set" on the right is slightly more robust in a sense that it's more natural for the humans, so it's a bit more error-proof this way. Signed-off-by: Mark Starovoytov <mstarovoitov@marvell.com> Signed-off-by: Igor Russkikh <irusskikh@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5479e84 commit b64f2ac

File tree

6 files changed

+35
-35
lines changed

6 files changed

+35
-35
lines changed

drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ static int hw_atl_a0_hw_qos_set(struct aq_hw_s *self)
136136
hw_atl_tps_tx_pkt_shed_desc_tc_arb_mode_set(self, 0U);
137137
hw_atl_tps_tx_pkt_shed_data_arb_mode_set(self, 0U);
138138

139-
hw_atl_tps_tx_pkt_shed_tc_data_max_credit_set(self, 0xFFF, 0U);
140-
hw_atl_tps_tx_pkt_shed_tc_data_weight_set(self, 0x64, 0U);
141-
hw_atl_tps_tx_pkt_shed_desc_tc_max_credit_set(self, 0x50, 0U);
142-
hw_atl_tps_tx_pkt_shed_desc_tc_weight_set(self, 0x1E, 0U);
139+
hw_atl_tps_tx_pkt_shed_tc_data_max_credit_set(self, 0U, 0xFFF);
140+
hw_atl_tps_tx_pkt_shed_tc_data_weight_set(self, 0U, 0x64);
141+
hw_atl_tps_tx_pkt_shed_desc_tc_max_credit_set(self, 0U, 0x50);
142+
hw_atl_tps_tx_pkt_shed_desc_tc_weight_set(self, 0U, 0x1E);
143143

144144
/* Tx buf size */
145145
buff_size = HW_ATL_A0_TXBUF_MAX;

drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ static int hw_atl_b0_hw_qos_set(struct aq_hw_s *self)
161161
u32 threshold = 0U;
162162

163163
/* TX Packet Scheduler Data TC0 */
164-
hw_atl_tps_tx_pkt_shed_tc_data_max_credit_set(self, 0xFFF, tc);
165-
hw_atl_tps_tx_pkt_shed_tc_data_weight_set(self, 0x64, tc);
164+
hw_atl_tps_tx_pkt_shed_tc_data_max_credit_set(self, tc, 0xFFF);
165+
hw_atl_tps_tx_pkt_shed_tc_data_weight_set(self, tc, 0x64);
166166

167167
/* Tx buf size TC0 */
168168
hw_atl_tpb_tx_pkt_buff_size_per_tc_set(self, tx_buff_size, tc);
@@ -334,8 +334,8 @@ int hw_atl_b0_hw_init_tx_tc_rate_limit(struct aq_hw_s *self)
334334
const u32 en = (nic_cfg->tc_max_rate[tc] != 0) ? 1U : 0U;
335335
const u32 desc = AQ_NIC_CFG_TCVEC2RING(nic_cfg, tc, 0);
336336

337-
hw_atl_tps_tx_pkt_shed_desc_tc_max_credit_set(self, 0x50, tc);
338-
hw_atl_tps_tx_pkt_shed_desc_tc_weight_set(self, 0x1E, tc);
337+
hw_atl_tps_tx_pkt_shed_desc_tc_max_credit_set(self, tc, 0x50);
338+
hw_atl_tps_tx_pkt_shed_desc_tc_weight_set(self, tc, 0x1E);
339339

340340
hw_atl_tps_tx_desc_rate_en_set(self, desc, en);
341341

drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,8 +1463,8 @@ void hw_atl_tps_tx_pkt_shed_desc_tc_arb_mode_set(struct aq_hw_s *aq_hw,
14631463
}
14641464

14651465
void hw_atl_tps_tx_pkt_shed_desc_tc_max_credit_set(struct aq_hw_s *aq_hw,
1466-
u32 max_credit,
1467-
u32 tc)
1466+
const u32 tc,
1467+
const u32 max_credit)
14681468
{
14691469
aq_hw_write_reg_bit(aq_hw, HW_ATL_TPS_DESC_TCTCREDIT_MAX_ADR(tc),
14701470
HW_ATL_TPS_DESC_TCTCREDIT_MAX_MSK,
@@ -1473,13 +1473,13 @@ void hw_atl_tps_tx_pkt_shed_desc_tc_max_credit_set(struct aq_hw_s *aq_hw,
14731473
}
14741474

14751475
void hw_atl_tps_tx_pkt_shed_desc_tc_weight_set(struct aq_hw_s *aq_hw,
1476-
u32 tx_pkt_shed_desc_tc_weight,
1477-
u32 tc)
1476+
const u32 tc,
1477+
const u32 weight)
14781478
{
14791479
aq_hw_write_reg_bit(aq_hw, HW_ATL_TPS_DESC_TCTWEIGHT_ADR(tc),
14801480
HW_ATL_TPS_DESC_TCTWEIGHT_MSK,
14811481
HW_ATL_TPS_DESC_TCTWEIGHT_SHIFT,
1482-
tx_pkt_shed_desc_tc_weight);
1482+
weight);
14831483
}
14841484

14851485
void hw_atl_tps_tx_pkt_shed_desc_vm_arb_mode_set(struct aq_hw_s *aq_hw,
@@ -1492,8 +1492,8 @@ void hw_atl_tps_tx_pkt_shed_desc_vm_arb_mode_set(struct aq_hw_s *aq_hw,
14921492
}
14931493

14941494
void hw_atl_tps_tx_pkt_shed_tc_data_max_credit_set(struct aq_hw_s *aq_hw,
1495-
u32 max_credit,
1496-
u32 tc)
1495+
const u32 tc,
1496+
const u32 max_credit)
14971497
{
14981498
aq_hw_write_reg_bit(aq_hw, HW_ATL_TPS_DATA_TCTCREDIT_MAX_ADR(tc),
14991499
HW_ATL_TPS_DATA_TCTCREDIT_MAX_MSK,
@@ -1502,13 +1502,13 @@ void hw_atl_tps_tx_pkt_shed_tc_data_max_credit_set(struct aq_hw_s *aq_hw,
15021502
}
15031503

15041504
void hw_atl_tps_tx_pkt_shed_tc_data_weight_set(struct aq_hw_s *aq_hw,
1505-
u32 tx_pkt_shed_tc_data_weight,
1506-
u32 tc)
1505+
const u32 tc,
1506+
const u32 weight)
15071507
{
15081508
aq_hw_write_reg_bit(aq_hw, HW_ATL_TPS_DATA_TCTWEIGHT_ADR(tc),
15091509
HW_ATL_TPS_DATA_TCTWEIGHT_MSK,
15101510
HW_ATL_TPS_DATA_TCTWEIGHT_SHIFT,
1511-
tx_pkt_shed_tc_data_weight);
1511+
weight);
15121512
}
15131513

15141514
void hw_atl_tps_tx_desc_rate_mode_set(struct aq_hw_s *aq_hw,

drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -688,27 +688,27 @@ void hw_atl_tps_tx_pkt_shed_desc_tc_arb_mode_set(struct aq_hw_s *aq_hw,
688688

689689
/* set tx packet scheduler descriptor tc max credit */
690690
void hw_atl_tps_tx_pkt_shed_desc_tc_max_credit_set(struct aq_hw_s *aq_hw,
691-
u32 max_credit,
692-
u32 tc);
691+
const u32 tc,
692+
const u32 max_credit);
693693

694694
/* set tx packet scheduler descriptor tc weight */
695695
void hw_atl_tps_tx_pkt_shed_desc_tc_weight_set(struct aq_hw_s *aq_hw,
696-
u32 tx_pkt_shed_desc_tc_weight,
697-
u32 tc);
696+
const u32 tc,
697+
const u32 weight);
698698

699699
/* set tx packet scheduler descriptor vm arbitration mode */
700700
void hw_atl_tps_tx_pkt_shed_desc_vm_arb_mode_set(struct aq_hw_s *aq_hw,
701701
u32 arb_mode);
702702

703703
/* set tx packet scheduler tc data max credit */
704704
void hw_atl_tps_tx_pkt_shed_tc_data_max_credit_set(struct aq_hw_s *aq_hw,
705-
u32 max_credit,
706-
u32 tc);
705+
const u32 tc,
706+
const u32 max_credit);
707707

708708
/* set tx packet scheduler tc data weight */
709709
void hw_atl_tps_tx_pkt_shed_tc_data_weight_set(struct aq_hw_s *aq_hw,
710-
u32 tx_pkt_shed_tc_data_weight,
711-
u32 tc);
710+
const u32 tc,
711+
const u32 weight);
712712

713713
/* set tx descriptor rate mode */
714714
void hw_atl_tps_tx_desc_rate_mode_set(struct aq_hw_s *aq_hw,

drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_llh.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ void hw_atl2_reg_tx_intr_moder_ctrl_set(struct aq_hw_s *aq_hw,
9494
}
9595

9696
void hw_atl2_tps_tx_pkt_shed_tc_data_max_credit_set(struct aq_hw_s *aq_hw,
97-
u32 max_credit,
98-
u32 tc)
97+
const u32 tc,
98+
const u32 max_credit)
9999
{
100100
aq_hw_write_reg_bit(aq_hw, HW_ATL2_TPS_DATA_TCTCREDIT_MAX_ADR(tc),
101101
HW_ATL2_TPS_DATA_TCTCREDIT_MAX_MSK,
@@ -104,13 +104,13 @@ void hw_atl2_tps_tx_pkt_shed_tc_data_max_credit_set(struct aq_hw_s *aq_hw,
104104
}
105105

106106
void hw_atl2_tps_tx_pkt_shed_tc_data_weight_set(struct aq_hw_s *aq_hw,
107-
u32 tx_pkt_shed_tc_data_weight,
108-
u32 tc)
107+
const u32 tc,
108+
const u32 weight)
109109
{
110110
aq_hw_write_reg_bit(aq_hw, HW_ATL2_TPS_DATA_TCTWEIGHT_ADR(tc),
111111
HW_ATL2_TPS_DATA_TCTWEIGHT_MSK,
112112
HW_ATL2_TPS_DATA_TCTWEIGHT_SHIFT,
113-
tx_pkt_shed_tc_data_weight);
113+
weight);
114114
}
115115

116116
u32 hw_atl2_get_hw_version(struct aq_hw_s *aq_hw)

drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_llh.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ void hw_atl2_tpb_tx_buf_clk_gate_en_set(struct aq_hw_s *aq_hw, u32 clk_gate_en);
4747

4848
/* set tx packet scheduler tc data max credit */
4949
void hw_atl2_tps_tx_pkt_shed_tc_data_max_credit_set(struct aq_hw_s *aq_hw,
50-
u32 max_credit,
51-
u32 tc);
50+
const u32 tc,
51+
const u32 max_credit);
5252

5353
/* set tx packet scheduler tc data weight */
5454
void hw_atl2_tps_tx_pkt_shed_tc_data_weight_set(struct aq_hw_s *aq_hw,
55-
u32 tx_pkt_shed_tc_data_weight,
56-
u32 tc);
55+
const u32 tc,
56+
const u32 weight);
5757

5858
u32 hw_atl2_get_hw_version(struct aq_hw_s *aq_hw);
5959

0 commit comments

Comments
 (0)