@@ -1711,7 +1711,7 @@ static int mlx5e_open_sqs(struct mlx5e_channel *c,
17111711{
17121712 int err , tc ;
17131713
1714- for (tc = 0 ; tc < params -> num_tc ; tc ++ ) {
1714+ for (tc = 0 ; tc < mlx5e_get_dcb_num_tc ( params ) ; tc ++ ) {
17151715 int txq_ix = c -> ix + tc * params -> num_channels ;
17161716
17171717 err = mlx5e_open_txqsq (c , c -> priv -> tisn [c -> lag_port ][tc ], txq_ix ,
@@ -1992,7 +1992,7 @@ static int mlx5e_open_channel(struct mlx5e_priv *priv, int ix,
19921992 c -> pdev = mlx5_core_dma_dev (priv -> mdev );
19931993 c -> netdev = priv -> netdev ;
19941994 c -> mkey_be = cpu_to_be32 (priv -> mdev -> mlx5e_res .hw_objs .mkey .key );
1995- c -> num_tc = params -> num_tc ;
1995+ c -> num_tc = mlx5e_get_dcb_num_tc ( params ) ;
19961996 c -> xdp = !!params -> xdp_prog ;
19971997 c -> stats = & priv -> channel_stats [ix ].ch ;
19981998 c -> aff_mask = irq_get_effective_affinity_mask (irq );
@@ -2288,7 +2288,7 @@ int mlx5e_update_tx_netdev_queues(struct mlx5e_priv *priv)
22882288 qos_queues = mlx5e_qos_cur_leaf_nodes (priv );
22892289
22902290 nch = priv -> channels .params .num_channels ;
2291- ntc = priv -> channels .params . num_tc ;
2291+ ntc = mlx5e_get_dcb_num_tc ( & priv -> channels .params ) ;
22922292 num_txqs = nch * ntc + qos_queues ;
22932293 if (MLX5E_GET_PFLAG (& priv -> channels .params , MLX5E_PFLAG_TX_PORT_TS ))
22942294 num_txqs += ntc ;
@@ -2312,7 +2312,7 @@ static int mlx5e_update_netdev_queues(struct mlx5e_priv *priv)
23122312 old_ntc = netdev -> num_tc ? : 1 ;
23132313
23142314 nch = priv -> channels .params .num_channels ;
2315- ntc = priv -> channels .params . num_tc ;
2315+ ntc = mlx5e_get_dcb_num_tc ( & priv -> channels .params ) ;
23162316 num_rxqs = nch * priv -> profile -> rq_groups ;
23172317
23182318 mlx5e_netdev_set_tcs (netdev , nch , ntc );
@@ -2387,7 +2387,7 @@ static void mlx5e_build_txq_maps(struct mlx5e_priv *priv)
23872387 int i , ch , tc , num_tc ;
23882388
23892389 ch = priv -> channels .num ;
2390- num_tc = priv -> channels .params . num_tc ;
2390+ num_tc = mlx5e_get_dcb_num_tc ( & priv -> channels .params ) ;
23912391
23922392 for (i = 0 ; i < ch ; i ++ ) {
23932393 for (tc = 0 ; tc < num_tc ; tc ++ ) {
@@ -2418,7 +2418,7 @@ static void mlx5e_update_num_tc_x_num_ch(struct mlx5e_priv *priv)
24182418{
24192419 /* Sync with mlx5e_select_queue. */
24202420 WRITE_ONCE (priv -> num_tc_x_num_ch ,
2421- priv -> channels .params . num_tc * priv -> channels .num );
2421+ mlx5e_get_dcb_num_tc ( & priv -> channels .params ) * priv -> channels .num );
24222422}
24232423
24242424void mlx5e_activate_priv_channels (struct mlx5e_priv * priv )
@@ -2870,14 +2870,14 @@ static int mlx5e_setup_tc_mqprio(struct mlx5e_priv *priv,
28702870 }
28712871
28722872 new_params = priv -> channels .params ;
2873- new_params .num_tc = tc ? tc : 1 ;
2873+ new_params .mqprio . num_tc = tc ? tc : 1 ;
28742874
28752875 err = mlx5e_safe_switch_params (priv , & new_params ,
28762876 mlx5e_num_channels_changed_ctx , NULL , true);
28772877
28782878out :
28792879 priv -> max_opened_tc = max_t (u8 , priv -> max_opened_tc ,
2880- priv -> channels .params . num_tc );
2880+ mlx5e_get_dcb_num_tc ( & priv -> channels .params ) );
28812881 mutex_unlock (& priv -> state_lock );
28822882 return err ;
28832883}
@@ -4093,12 +4093,12 @@ void mlx5e_build_nic_params(struct mlx5e_priv *priv, struct mlx5e_xsk *xsk, u16
40934093 params -> hard_mtu = MLX5E_ETH_HARD_MTU ;
40944094 params -> num_channels = min_t (unsigned int , MLX5E_MAX_NUM_CHANNELS / 2 ,
40954095 priv -> max_nch );
4096- params -> num_tc = 1 ;
4096+ params -> mqprio . num_tc = 1 ;
40974097
40984098 /* Set an initial non-zero value, so that mlx5e_select_queue won't
40994099 * divide by zero if called before first activating channels.
41004100 */
4101- priv -> num_tc_x_num_ch = params -> num_channels * params -> num_tc ;
4101+ priv -> num_tc_x_num_ch = params -> num_channels * params -> mqprio . num_tc ;
41024102
41034103 /* SQ */
41044104 params -> log_sq_size = is_kdump_kernel () ?
0 commit comments