Received: by 10.192.165.156 with SMTP id m28csp64316imm; Tue, 10 Apr 2018 16:29:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/xaWH1dQnZmWle51ZQ5uvNeMrJYT9vy7dvvMZQ0jsUqjLMTsVtadOOz6X+C1TG/QG/iKlw X-Received: by 2002:a17:902:be08:: with SMTP id r8-v6mr2382428pls.289.1523402983961; Tue, 10 Apr 2018 16:29:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523402983; cv=none; d=google.com; s=arc-20160816; b=bC8+spCoRIGht+9aCK1nL+RkN1fkUilNvPvyAN6Li0ELCCAnktJd5GCQOtsDxV9i4H eaJQ4BARIP+2KNs5xEgEDyaLCQbbcCF+mipOFlsQE75mw5pMSiJwVdo91V8VtE2AdpjR siwam/YAHlPp+XOICXRmIa3V9NUnb0RrNGRhbgd4du8cHsfT8o7mV49l7Hgvqp5Z+QHG ZiFgCXm6MEOdP5EklRE1SpgGPJip+prsjpBhGR9ctLdUzH/0LejsFEHELyneUwztrzH1 vRV/rNKP56hCnaRtqF7bdWcbUT68YtEVJ5KMgS2KzHsx66xugCH0yPOsvKuyjOQgaixp 6I8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=WiwTsk1MEiV1yytlV9p4YvH8kQC99viClXsq152L4ag=; b=XtnBXmTUhmeXftI/l9P1/sp16RFHsHy0XHdbKOGPdyjf1Oyymbau5y1+VZduO+ISS8 jHCZS0suft62f+8ld9X07gX5bLmPwVgw//jjf/P0+82C3QLOzB4NPfCcIiAkiD8xYEn6 VRDdEILq4cROJTh1ek8MH4usrY2FF5sspF6r6JE81wwENLt6Cy3d+i5v43+lfcUvHcni H1AxPl7b/DGxgsq1q4FfH4+pQEtUE9QwLOnLuFzOwM6GIESRMp5tpNeuixfHP/GMEbd6 61IadEtAG7k2dw+WLW0ngzEV463Z/XuIEO/20fNBooHB2DwtWm1OvmsSXpHL4G9yLXy7 bn7Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b31-v6si3703909pla.170.2018.04.10.16.29.07; Tue, 10 Apr 2018 16:29:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754531AbeDJWaS (ORCPT + 99 others); Tue, 10 Apr 2018 18:30:18 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:39906 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754428AbeDJWaQ (ORCPT ); Tue, 10 Apr 2018 18:30:16 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 87E2AD4F; Tue, 10 Apr 2018 22:30:15 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Feras Daoud , Saeed Mahameed , Sasha Levin Subject: [PATCH 4.15 080/168] net/mlx5e: IPoIB, Use correct timestamp in child receive flow Date: Wed, 11 Apr 2018 00:23:42 +0200 Message-Id: <20180410212803.686823298@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212800.144079021@linuxfoundation.org> References: <20180410212800.144079021@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ 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 to child netdev") Signed-off-by: Feras Daoud Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- 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 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 return; } + priv = mlx5i_epriv(netdev); + tstamp = &priv->tstamp; + g = (be32_to_cpu(cqe->flags_rqpn) >> 28) & 3; dgid = skb->data + MLX5_IB_GRH_DGID_OFFSET; if ((!g) || dgid[0] != 0xff) @@ -1235,7 +1240,7 @@ static inline void mlx5i_complete_rx_cqe skb->ip_summed = CHECKSUM_COMPLETE; skb->csum = csum_unfold((__force __sum16)cqe->check_sum); - if (unlikely(mlx5e_rx_hw_stamp(rq->tstamp))) + if (unlikely(mlx5e_rx_hw_stamp(tstamp))) skb_hwtstamps(skb)->hwtstamp = mlx5_timecounter_cyc2time(rq->clock, get_cqe_ts(cqe));