From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sn1nam01on0122.outbound.protection.outlook.com ([104.47.32.122]:60759 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933937AbeCSPtT (ORCPT ); Mon, 19 Mar 2018 11:49:19 -0400 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Feras Daoud , Saeed Mahameed , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 090/124] net/mlx5e: IPoIB, Use correct timestamp in child receive flow Date: Mon, 19 Mar 2018 15:48:39 +0000 Message-ID: <20180319154645.11350-90-alexander.levin@microsoft.com> References: <20180319154645.11350-1-alexander.levin@microsoft.com> In-Reply-To: <20180319154645.11350-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Feras Daoud [ Upstream commit 36e564b76f1862914ad32c35bab433e07da2ebf8 ] The current implementation takes the child timestamp object from the parent since the rq in mlx5i_complete_rx_cqe belongs to the parent. This change fixes the issue by taking the correct timestamp. Fixes: 7e7f4780c340 ("net/mlx5e: IPoIB, Use hash-table to map between QPN t= o child netdev") Signed-off-by: Feras Daoud Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/= ethernet/mellanox/mlx5/core/en_rx.c index 36611b64a91c..f7d9aab2b3b6 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -1196,7 +1196,9 @@ static inline void mlx5i_complete_rx_cqe(struct mlx5e= _rq *rq, u32 cqe_bcnt, struct sk_buff *skb) { + struct hwtstamp_config *tstamp; struct net_device *netdev; + struct mlx5e_priv *priv; char *pseudo_header; u32 qpn; u8 *dgid; @@ -1215,6 +1217,9 @@ static inline void mlx5i_complete_rx_cqe(struct mlx5e= _rq *rq, return; } =20 + priv =3D mlx5i_epriv(netdev); + tstamp =3D &priv->tstamp; + g =3D (be32_to_cpu(cqe->flags_rqpn) >> 28) & 3; dgid =3D skb->data + MLX5_IB_GRH_DGID_OFFSET; if ((!g) || dgid[0] !=3D 0xff) @@ -1235,7 +1240,7 @@ static inline void mlx5i_complete_rx_cqe(struct mlx5e= _rq *rq, skb->ip_summed =3D CHECKSUM_COMPLETE; skb->csum =3D csum_unfold((__force __sum16)cqe->check_sum); =20 - if (unlikely(mlx5e_rx_hw_stamp(rq->tstamp))) + if (unlikely(mlx5e_rx_hw_stamp(tstamp))) skb_hwtstamps(skb)->hwtstamp =3D mlx5_timecounter_cyc2time(rq->clock, get_cqe_ts(cqe)); =20 --=20 2.14.1