Subject: Re: [PATCH net-next 11/11] net/mlx5: Ethernet driver

From: Alexander Duyck <[email-masked]>
Date: Wed, 08 Apr 2015 19:07:39 -0700

On 04/08/2015 07:51 AM, Amir Vadai wrote:
> Signed-off-by: Amir Vadai <[email-masked]>

> --- /dev/null
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
> @@ -0,0 +1,518 @@

<snip>

> +			     struct mlx5e_params *new_params);
> +
> +static inline void mlx5e_tx_notify_hw(struct mlx5e_sq *sq,
> +				      struct mlx5e_tx_wqe *wqe)
> +{
> +	/* ensure wqe is visible to device before updating doorbell record */
> +	wmb();
> +

Could this be replaced with a dma_wmb() since it seems like you are just 
doing two memory writes here between the wqe and *sq->wq.db.

> +	*sq->wq.db = cpu_to_be32(sq->pc);
> +
> +	/* ensure doorbell record is visible to device before ringing the
> +	 * doorbell */
> +	wmb();
> +
> +	mlx5_write64((__be32 *)&wqe->ctrl,
> +		     sq->uar_map + MLX5_BF_OFFSET + sq->bf_offset,
> +		     NULL);
> +
> +	sq->bf_offset ^= sq->bf_buf_size;
> +}
> +
> +static inline void mlx5e_cq_arm(struct mlx5e_cq *cq)
> +{
> +	struct mlx5_core_cq *mcq;
> +
> +	mcq = &cq->mcq;
> +	mlx5_cq_arm(mcq, MLX5_CQ_DB_REQ_NOT, mcq->uar->map, NULL, cq->wq.cc);
> +}
> +
> +extern const struct ethtool_ops mlx5e_ethtool_ops;