Skip to content

Commit f455a93

Browse files
Binary-EaterBrian Maly
authored andcommitted
net/mlx5e: Switch to using _bh variant of of spinlock API in port timestamping NAPI poll context
The NAPI poll context is a softirq context. Do not use normal spinlock API in this context to prevent concurrency issues. Fixes: 3178308 ("net/mlx5e: Make tx_port_ts logic resilient to out-of-order CQEs") Signed-off-by: Rahul Rameshbabu <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> CC: Vadim Fedorenko <[email protected]> Orabug: 36811057 (cherry picked from commit 90502d4) cherry-pick-repo=kernel/git/torvalds/linux.git unmodified-from-upstream: 90502d4 Signed-off-by: Mikhael Goikhman <[email protected]> Signed-off-by: Qing Huang <[email protected]> Reviewed-by: Sharath Srinivasan <[email protected]> Signed-off-by: Brian Maly <[email protected]>
1 parent 4666a70 commit f455a93

File tree

1 file changed

+6
-6
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/en

1 file changed

+6
-6
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ mlx5e_ptp_port_ts_cqe_list_add(struct mlx5e_ptp_port_ts_cqe_list *list, u8 metad
4242

4343
WARN_ON_ONCE(tracker->inuse);
4444
tracker->inuse = true;
45-
spin_lock(&list->tracker_list_lock);
45+
spin_lock_bh(&list->tracker_list_lock);
4646
list_add_tail(&tracker->entry, &list->tracker_list_head);
47-
spin_unlock(&list->tracker_list_lock);
47+
spin_unlock_bh(&list->tracker_list_lock);
4848
}
4949

5050
static void
@@ -54,9 +54,9 @@ mlx5e_ptp_port_ts_cqe_list_remove(struct mlx5e_ptp_port_ts_cqe_list *list, u8 me
5454

5555
WARN_ON_ONCE(!tracker->inuse);
5656
tracker->inuse = false;
57-
spin_lock(&list->tracker_list_lock);
57+
spin_lock_bh(&list->tracker_list_lock);
5858
list_del(&tracker->entry);
59-
spin_unlock(&list->tracker_list_lock);
59+
spin_unlock_bh(&list->tracker_list_lock);
6060
}
6161

6262
void mlx5e_ptpsq_track_metadata(struct mlx5e_ptpsq *ptpsq, u8 metadata)
@@ -155,7 +155,7 @@ static void mlx5e_ptpsq_mark_ts_cqes_undelivered(struct mlx5e_ptpsq *ptpsq,
155155
struct mlx5e_ptp_metadata_map *metadata_map = &ptpsq->metadata_map;
156156
struct mlx5e_ptp_port_ts_cqe_tracker *pos, *n;
157157

158-
spin_lock(&cqe_list->tracker_list_lock);
158+
spin_lock_bh(&cqe_list->tracker_list_lock);
159159
list_for_each_entry_safe(pos, n, &cqe_list->tracker_list_head, entry) {
160160
struct sk_buff *skb =
161161
mlx5e_ptp_metadata_map_lookup(metadata_map, pos->metadata_id);
@@ -170,7 +170,7 @@ static void mlx5e_ptpsq_mark_ts_cqes_undelivered(struct mlx5e_ptpsq *ptpsq,
170170
pos->inuse = false;
171171
list_del(&pos->entry);
172172
}
173-
spin_unlock(&cqe_list->tracker_list_lock);
173+
spin_unlock_bh(&cqe_list->tracker_list_lock);
174174
}
175175

176176
#define PTP_WQE_CTR2IDX(val) ((val) & ptpsq->ts_cqe_ctr_mask)

0 commit comments

Comments
 (0)