Skip to content

Commit 1a50cf9

Browse files
Maxim MikityanskiySaeed Mahameed
authored andcommitted
net/mlx5e: Fix incorrect access of RCU-protected xdp_prog
rq->xdp_prog is RCU-protected and should be accessed only with rcu_access_pointer for the NULL check in mlx5e_poll_rx_cq. rq->xdp_prog may change on the fly only from one non-NULL value to another non-NULL value, so the checks in mlx5e_xdp_handle and mlx5e_poll_rx_cq will have the same result during one NAPI cycle, meaning that no additional synchronization is needed. Fixes: fe45386 ("net/mlx5e: Use RCU to protect rq->xdp_prog") Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com> Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
1 parent c5eb51a commit 1a50cf9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • drivers/net/ethernet/mellanox/mlx5/core

drivers/net/ethernet/mellanox/mlx5/core/en_rx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1584,7 +1584,7 @@ int mlx5e_poll_rx_cq(struct mlx5e_cq *cq, int budget)
15841584
} while ((++work_done < budget) && (cqe = mlx5_cqwq_get_cqe(cqwq)));
15851585

15861586
out:
1587-
if (rq->xdp_prog)
1587+
if (rcu_access_pointer(rq->xdp_prog))
15881588
mlx5e_xdp_rx_poll_complete(rq);
15891589

15901590
mlx5_cqwq_update_db_record(cqwq);

0 commit comments

Comments
 (0)