net/mlx5e: Rename misleading skb_pc/cc references in ptp code
The 'skb_pc/cc' naming is misleading as the values hold the producer/consumer indices (masked values), not the counters. Rename to 'skb_pi/ci'. Signed-off-by: Gal Pressman <gal@nvidia.com> Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com> Reviewed-by: Adham Faris <afaris@nvidia.com>
This commit is contained in:
parent
6a40109275
commit
cf1cccae79
@ -81,23 +81,23 @@ void mlx5e_skb_cb_hwtstamp_handler(struct sk_buff *skb, int hwtstamp_type,
|
||||
|
||||
#define PTP_WQE_CTR2IDX(val) ((val) & ptpsq->ts_cqe_ctr_mask)
|
||||
|
||||
static bool mlx5e_ptp_ts_cqe_drop(struct mlx5e_ptpsq *ptpsq, u16 skb_cc, u16 skb_id)
|
||||
static bool mlx5e_ptp_ts_cqe_drop(struct mlx5e_ptpsq *ptpsq, u16 skb_ci, u16 skb_id)
|
||||
{
|
||||
return (ptpsq->ts_cqe_ctr_mask && (skb_cc != skb_id));
|
||||
return (ptpsq->ts_cqe_ctr_mask && (skb_ci != skb_id));
|
||||
}
|
||||
|
||||
static bool mlx5e_ptp_ts_cqe_ooo(struct mlx5e_ptpsq *ptpsq, u16 skb_id)
|
||||
{
|
||||
u16 skb_cc = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_cc);
|
||||
u16 skb_pc = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_pc);
|
||||
u16 skb_ci = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_cc);
|
||||
u16 skb_pi = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_pc);
|
||||
|
||||
if (PTP_WQE_CTR2IDX(skb_id - skb_cc) >= PTP_WQE_CTR2IDX(skb_pc - skb_cc))
|
||||
if (PTP_WQE_CTR2IDX(skb_id - skb_ci) >= PTP_WQE_CTR2IDX(skb_pi - skb_ci))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void mlx5e_ptp_skb_fifo_ts_cqe_resync(struct mlx5e_ptpsq *ptpsq, u16 skb_cc,
|
||||
static void mlx5e_ptp_skb_fifo_ts_cqe_resync(struct mlx5e_ptpsq *ptpsq, u16 skb_ci,
|
||||
u16 skb_id, int budget)
|
||||
{
|
||||
struct skb_shared_hwtstamps hwts = {};
|
||||
@ -105,13 +105,13 @@ static void mlx5e_ptp_skb_fifo_ts_cqe_resync(struct mlx5e_ptpsq *ptpsq, u16 skb_
|
||||
|
||||
ptpsq->cq_stats->resync_event++;
|
||||
|
||||
while (skb_cc != skb_id) {
|
||||
while (skb_ci != skb_id) {
|
||||
skb = mlx5e_skb_fifo_pop(&ptpsq->skb_fifo);
|
||||
hwts.hwtstamp = mlx5e_skb_cb_get_hwts(skb)->cqe_hwtstamp;
|
||||
skb_tstamp_tx(skb, &hwts);
|
||||
ptpsq->cq_stats->resync_cqe++;
|
||||
napi_consume_skb(skb, budget);
|
||||
skb_cc = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_cc);
|
||||
skb_ci = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_cc);
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ static void mlx5e_ptp_handle_ts_cqe(struct mlx5e_ptpsq *ptpsq,
|
||||
int budget)
|
||||
{
|
||||
u16 skb_id = PTP_WQE_CTR2IDX(be16_to_cpu(cqe->wqe_counter));
|
||||
u16 skb_cc = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_cc);
|
||||
u16 skb_ci = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_cc);
|
||||
struct mlx5e_txqsq *sq = &ptpsq->txqsq;
|
||||
struct sk_buff *skb;
|
||||
ktime_t hwtstamp;
|
||||
@ -131,13 +131,13 @@ static void mlx5e_ptp_handle_ts_cqe(struct mlx5e_ptpsq *ptpsq,
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (mlx5e_ptp_ts_cqe_drop(ptpsq, skb_cc, skb_id)) {
|
||||
if (mlx5e_ptp_ts_cqe_drop(ptpsq, skb_ci, skb_id)) {
|
||||
if (mlx5e_ptp_ts_cqe_ooo(ptpsq, skb_id)) {
|
||||
/* already handled by a previous resync */
|
||||
ptpsq->cq_stats->ooo_cqe_drop++;
|
||||
return;
|
||||
}
|
||||
mlx5e_ptp_skb_fifo_ts_cqe_resync(ptpsq, skb_cc, skb_id, budget);
|
||||
mlx5e_ptp_skb_fifo_ts_cqe_resync(ptpsq, skb_ci, skb_id, budget);
|
||||
}
|
||||
|
||||
skb = mlx5e_skb_fifo_pop(&ptpsq->skb_fifo);
|
||||
|
Loading…
x
Reference in New Issue
Block a user