Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 026a807c authored by Tal Gilboa's avatar Tal Gilboa Committed by David S. Miller
Browse files

net/dim: Rename *_get_profile() functions to *_get_rx_moderation()



Preparation for introducing adaptive TX to net DIM.

Signed-off-by: default avatarTal Gilboa <talgi@mellanox.com>
Reviewed-by: default avatarTariq Toukan <tariqt@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent db688c24
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -654,7 +654,7 @@ static int bcm_sysport_set_coalesce(struct net_device *dev,
	pkts = priv->rx_max_coalesced_frames;

	if (ec->use_adaptive_rx_coalesce && !priv->dim.use_dim) {
		moder = net_dim_get_def_profile(priv->dim.dim.mode);
		moder = net_dim_get_def_rx_moderation(priv->dim.dim.mode);
		usecs = moder.usec;
		pkts = moder.pkts;
	}
@@ -1064,7 +1064,7 @@ static void bcm_sysport_dim_work(struct work_struct *work)
	struct bcm_sysport_priv *priv =
			container_of(ndim, struct bcm_sysport_priv, dim);
	struct net_dim_cq_moder cur_profile =
				net_dim_get_profile(dim->mode, dim->profile_ix);
			net_dim_get_rx_moderation(dim->mode, dim->profile_ix);

	bcm_sysport_set_rx_coalesce(priv, cur_profile.usec, cur_profile.pkts);
	dim->state = NET_DIM_START_MEASURE;
@@ -1437,7 +1437,7 @@ static void bcm_sysport_init_rx_coalesce(struct bcm_sysport_priv *priv)

	/* If DIM was enabled, re-apply default parameters */
	if (dim->use_dim) {
		moder = net_dim_get_def_profile(dim->dim.mode);
		moder = net_dim_get_def_rx_moderation(dim->dim.mode);
		usecs = moder.usec;
		pkts = moder.pkts;
	}
+4 −4
Original line number Diff line number Diff line
@@ -21,11 +21,11 @@ void bnxt_dim_work(struct work_struct *work)
	struct bnxt_napi *bnapi = container_of(cpr,
					       struct bnxt_napi,
					       cp_ring);
	struct net_dim_cq_moder cur_profile = net_dim_get_profile(dim->mode,
								  dim->profile_ix);
	struct net_dim_cq_moder cur_moder =
		net_dim_get_rx_moderation(dim->mode, dim->profile_ix);

	cpr->rx_ring_coal.coal_ticks = cur_profile.usec;
	cpr->rx_ring_coal.coal_bufs = cur_profile.pkts;
	cpr->rx_ring_coal.coal_ticks = cur_moder.usec;
	cpr->rx_ring_coal.coal_bufs = cur_moder.pkts;

	bnxt_hwrm_set_ring_coal(bnapi->bp, bnapi);
	dim->state = NET_DIM_START_MEASURE;
+3 −3
Original line number Diff line number Diff line
@@ -652,7 +652,7 @@ static void bcmgenet_set_ring_rx_coalesce(struct bcmgenet_rx_ring *ring,
	pkts = ring->rx_max_coalesced_frames;

	if (ec->use_adaptive_rx_coalesce && !ring->dim.use_dim) {
		moder = net_dim_get_def_profile(ring->dim.dim.mode);
		moder = net_dim_get_def_rx_moderation(ring->dim.dim.mode);
		usecs = moder.usec;
		pkts = moder.pkts;
	}
@@ -1925,7 +1925,7 @@ static void bcmgenet_dim_work(struct work_struct *work)
	struct bcmgenet_rx_ring *ring =
			container_of(ndim, struct bcmgenet_rx_ring, dim);
	struct net_dim_cq_moder cur_profile =
			net_dim_get_profile(dim->mode, dim->profile_ix);
			net_dim_get_rx_moderation(dim->mode, dim->profile_ix);

	bcmgenet_set_rx_coalesce(ring, cur_profile.usec, cur_profile.pkts);
	dim->state = NET_DIM_START_MEASURE;
@@ -2102,7 +2102,7 @@ static void bcmgenet_init_rx_coalesce(struct bcmgenet_rx_ring *ring)

	/* If DIM was enabled, re-apply default parameters */
	if (dim->use_dim) {
		moder = net_dim_get_def_profile(dim->dim.mode);
		moder = net_dim_get_def_rx_moderation(dim->dim.mode);
		usecs = moder.usec;
		pkts = moder.pkts;
	}
+3 −3
Original line number Diff line number Diff line
@@ -38,11 +38,11 @@ void mlx5e_rx_dim_work(struct work_struct *work)
	struct net_dim *dim = container_of(work, struct net_dim,
					   work);
	struct mlx5e_rq *rq = container_of(dim, struct mlx5e_rq, dim);
	struct net_dim_cq_moder cur_profile = net_dim_get_profile(dim->mode,
								  dim->profile_ix);
	struct net_dim_cq_moder cur_moder =
		net_dim_get_rx_moderation(dim->mode, dim->profile_ix);

	mlx5_core_modify_cq_moderation(rq->mdev, &rq->cq.mcq,
				       cur_profile.usec, cur_profile.pkts);
				       cur_moder.usec, cur_moder.pkts);

	dim->state = NET_DIM_START_MEASURE;
}
+4 −2
Original line number Diff line number Diff line
@@ -4119,12 +4119,14 @@ void mlx5e_set_rx_cq_mode_params(struct mlx5e_params *params, u8 cq_period_mode)
		switch (cq_period_mode) {
		case MLX5_CQ_PERIOD_MODE_START_FROM_CQE:
			params->rx_cq_moderation =
				net_dim_get_def_profile(NET_DIM_CQ_PERIOD_MODE_START_FROM_CQE);
				net_dim_get_def_rx_moderation(
					NET_DIM_CQ_PERIOD_MODE_START_FROM_CQE);
			break;
		case MLX5_CQ_PERIOD_MODE_START_FROM_EQE:
		default:
			params->rx_cq_moderation =
				net_dim_get_def_profile(NET_DIM_CQ_PERIOD_MODE_START_FROM_EQE);
				net_dim_get_def_rx_moderation(
					NET_DIM_CQ_PERIOD_MODE_START_FROM_EQE);
		}
	}

Loading