summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2016-09-23 08:23:11 +0000
committerhselasky <hselasky@FreeBSD.org>2016-09-23 08:23:11 +0000
commitb92c3f857abcfb96bc4c61370fb00ceaf7cc9cb5 (patch)
tree34fd5e9341a03dfd63b6a304b6391a1bc6aa400f /sys/dev
parent426c3c35d18f5187c8227d496929b4b4bfecd73c (diff)
downloadFreeBSD-src-b92c3f857abcfb96bc4c61370fb00ceaf7cc9cb5.zip
FreeBSD-src-b92c3f857abcfb96bc4c61370fb00ceaf7cc9cb5.tar.gz
MFC r305872:
mlx5en: Properly declare doorbell lock for 32-bit CPUs. Sponsored by: Mellanox Technologies
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/mlx5/mlx5_en/en.h4
-rw-r--r--sys/dev/mlx5/mlx5_en/mlx5_en_main.c1
2 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/mlx5/mlx5_en/en.h b/sys/dev/mlx5/mlx5_en/en.h
index 984542e..ad23164 100644
--- a/sys/dev/mlx5/mlx5_en/en.h
+++ b/sys/dev/mlx5/mlx5_en/en.h
@@ -662,6 +662,7 @@ struct mlx5e_priv {
struct work_struct update_stats_work;
struct work_struct update_carrier_work;
struct work_struct set_rx_mode_work;
+ MLX5_DECLARE_DOORBELL_LOCK(doorbell_lock)
struct mlx5_core_dev *mdev;
struct ifnet *ifp;
@@ -784,7 +785,8 @@ mlx5e_tx_notify_hw(struct mlx5e_sq *sq, u32 *wqe, int bf_sz)
wmb();
} else {
- mlx5_write64(wqe, sq->uar.map + ofst, NULL);
+ mlx5_write64(wqe, sq->uar.map + ofst,
+ MLX5_GET_DOORBELL_LOCK(&sq->priv->doorbell_lock));
}
sq->bf_offset ^= sq->bf_buf_size;
diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
index 0bbe16b..8b0e368 100644
--- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
+++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
@@ -2753,6 +2753,7 @@ mlx5e_priv_mtx_init(struct mlx5e_priv *priv)
mtx_init(&priv->async_events_mtx, "mlx5async", MTX_NETWORK_LOCK, MTX_DEF);
sx_init(&priv->state_lock, "mlx5state");
callout_init_mtx(&priv->watchdog, &priv->async_events_mtx, 0);
+ MLX5_INIT_DOORBELL_LOCK(&priv->doorbell_lock);
}
static void
OpenPOWER on IntegriCloud