Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1507572ybl; Tue, 13 Aug 2019 13:58:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqztRunLiJ2lini9k88TmGYRPoGdzjno9ucnk/IvjC26vQIQ8fVKOUyXOBghE4r35i5PoKUf X-Received: by 2002:a62:7789:: with SMTP id s131mr10020341pfc.50.1565729917735; Tue, 13 Aug 2019 13:58:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565729917; cv=none; d=google.com; s=arc-20160816; b=A89/RuhY6T33ZNHnQMm036s12YhPTPjpXnmWI4T1vPj7ncQvEGbVzUDkh3saDZkMfA QmtXosTF6ryPWtLfqKwxdBCJl1jcCd8JgxFfiKbMNnqR432KSveQ637J4ptatt7Qg9wJ oaMCvdYUL7To0xQfJUuNR/705M5j+UXgbwtwOsNylkq/uHlBhQZXbanGghvzuTw1By1d ESiu+2cpZKs0Utsse1R79vo0Sx3BTgfE5Hi2/O8HttI1cf46vD30kDEBRojfAeqOKt2L 1CndSfeTTYbOjdRhe/nKX508jx7VEZkLpkYmITSY4ZdggeJrEfkB/RXWpgrwtE88uB1X BNow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=bNfCPQHfFfS05Ua0jgfTWRkNVMemAI0m1k8K0MkNCfo=; b=FpZqt0tvARYCOawvoWSB7Xtmj1+EdhMzm747rJ+OLB9qP1fNQu5bAGVV/P9DTU9Ca8 fHHjWnOzUhj8RCKBjsmLwbuCToFJMsEOsBakROq05W22nGBCrVn+79IFEsYXYpvJqwNw 51WPZU8jd1NPvOtJ6CJdR2HRhPoVXMzhGri5eWiE6Mrtc4/wvELO7LW/7F8xRl5R6dQA PsIDD6LyNVc4Rb07cN0zSuHuRLf/7IIuRqiyZtqFl4iGQHmSloqBLgXRNyvYKbZMTwHn f5ot91dNRRnnGJJmcpunfxDo0arCquAVGZU/nqPAR61m6NYTx3oaQZKlAq/T/jRBXI2c 9G6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=YwV4nGNR; 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 i4si17284823pgj.558.2019.08.13.13.58.18; Tue, 13 Aug 2019 13:58:37 -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; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=YwV4nGNR; 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 S1726347AbfHMU5g (ORCPT + 99 others); Tue, 13 Aug 2019 16:57:36 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:37941 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725903AbfHMU5f (ORCPT ); Tue, 13 Aug 2019 16:57:35 -0400 Received: by mail-qk1-f196.google.com with SMTP id u190so17193708qkh.5 for ; Tue, 13 Aug 2019 13:57:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=bNfCPQHfFfS05Ua0jgfTWRkNVMemAI0m1k8K0MkNCfo=; b=YwV4nGNRSR1A1eVJ/QD41sekOqfOp8xgyNC95HHYPXad4HG7a2JDRShmZhBlpGQUUt WSHEMsmrJ19lmUCYMUrWkocjF2D0hTI4iyF5PpD0ZhSAQO+GkBFVViFj9Gx4u0oJPIWS y1GYX3DWqvmZ4Sjfdt+P0aNDrEQX9tP/jtldhK1rGqsPbAAoJ+Bk7SDMmzBcjGOfTvwg Pp/zVhGRjz7gsjbgYw3pqzG15i7zJ0RUecjBuDopi4mFQbblrWUTjCHFH52oWPytiFD4 IVpRDmpauS0ZvJMBttPhzfi9MdcVF7kuk2lhyfa2uX4iQdFXBu9gUfwyrmRD5IvX2NgN LlvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=bNfCPQHfFfS05Ua0jgfTWRkNVMemAI0m1k8K0MkNCfo=; b=SL24B/M4lPLWYEVSV+V74mkUh5VYLGm7CxsFpPYHo6JkRvFarNqmqaTrvQ2zcUBohs tzbJqQOcqNoquRWSvlarPWtseLG8hZ2uMdQ75RDdFaUSDpv58mD6KMXr6P7m7CDy14bZ srzSu7bSb9/Gad0T5Y50zMC1uw4DWkn030O+KT526dvWiwlmGsP4rtb2LUP+wmo1ryGT lJtAdcqFoqVAwAdhsI2AtgSZV1VuVDC2mffwzXEYKwAbSB1cPGOLfBKY0iEyjNVQ36MT Hl9o39lsMmh9CaAcCGWR/q+BGeGZWmTFLlKg8uOVO8R87OL9ma+WT3YEo6eYopMPbBdB 1MSg== X-Gm-Message-State: APjAAAUcMAJ/gmMFwi8lNMetIexU3KvIAZODq5y9O3Cc0VeiWrCA8pkl 3+R++uQYf6nUYDHUfWu96ptfsWj7geU= X-Received: by 2002:a37:b82:: with SMTP id 124mr33996866qkl.260.1565729854473; Tue, 13 Aug 2019 13:57:34 -0700 (PDT) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id d71sm11374918qkg.70.2019.08.13.13.57.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2019 13:57:34 -0700 (PDT) Date: Tue, 13 Aug 2019 13:57:22 -0700 From: Jakub Kicinski To: Jose Abreu Cc: netdev@vger.kernel.org, Joao Pinto , Giuseppe Cavallaro , Alexandre Torgue , "David S. Miller" , Maxime Coquelin , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v2 01/12] net: stmmac: Get correct timestamp values from XGMAC Message-ID: <20190813135722.22ea671d@cakuba.netronome.com> In-Reply-To: <195f374a0b46e5e65a691742fc2dbeffacfaf148.1565602974.git.joabreu@synopsys.com> References: <195f374a0b46e5e65a691742fc2dbeffacfaf148.1565602974.git.joabreu@synopsys.com> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 12 Aug 2019 11:44:00 +0200, Jose Abreu wrote: > TX Timestamp in XGMAC comes from MAC instead of descriptors. Implement > this in a new callback. > > Also, RX Timestamp in XGMAC must be cheked against corruption and we need > a barrier to make sure that descriptor fields are read correctly. > > Changes from v1: > - Rework the get timestamp function (David) > > Signed-off-by: Jose Abreu The barrier sounds like it might be a bug fix, does it occur in he wild? > @@ -113,13 +119,11 @@ static int dwxgmac2_get_rx_timestamp_status(void *desc, void *next_desc, > unsigned int rdes3 = le32_to_cpu(p->des3); > int ret = -EBUSY; > > - if (likely(rdes3 & XGMAC_RDES3_CDA)) { > + if (likely(rdes3 & XGMAC_RDES3_CDA)) > ret = dwxgmac2_rx_check_timestamp(next_desc); > - if (ret) > - return ret; > - } > - > - return ret; > + if (!ret) > + return 1; > + return 0; nit: return !ret; > } > > static void dwxgmac2_init_rx_desc(struct dma_desc *p, int disable_rx_ic,