From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B88CAC2D0C3 for ; Mon, 16 Dec 2019 18:33:34 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8FD0120CC7 for ; Mon, 16 Dec 2019 18:33:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hZ32h8U9"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="q0owXzgW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8FD0120CC7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tSDIFytoGspAZhlmDcK3WpYB6BqRYQ5ejCg9JG3Z30w=; b=hZ32h8U9BE29gv r1J1X3xLA4DVIlLXvqwrz5kJ4GhKmW/VyQoib5TB8AZHYo5e97KjPvZWFut4qssO1+5MdT6ToNKUu DW4P7uccwJphcH5kMETU1qaPYJbdI0UGBBq9X4GmHfsV1ZmcTG8GyaTZg78lgBu4YSQDusu2ORJY7 89pkLFFxJqv5Z/Q5/nxGO3dBH93y+SVUkpmAvT99RaRviXGcBwfcWqR5nmqXhVra0PhneUUVW2tP1 szgTUsw07m7FcWTpHKMPBVTvLZcLpqUasHecmfv2wQPZAg6fwG8I7rcIs4omuARWChFde7unlzyMH eA10RRCkjSKglL0dq4Nw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1igvBP-0002Fv-65; Mon, 16 Dec 2019 18:33:27 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1igvB0-0001pm-72 for linux-arm-kernel@lists.infradead.org; Mon, 16 Dec 2019 18:33:03 +0000 Received: by mail-pl1-x643.google.com with SMTP id c23so4854672plz.4 for ; Mon, 16 Dec 2019 10:33:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=muvIZPXZzFYwA2KnEz8hZgGKrX75pxgv3Lg3oHbwLBw=; b=q0owXzgWorl+IT7EkpCMUN7xBbxlHC/mqAg9W9RTyNS1DZPouBDeAjh2z75XOKd2XM H2zvMJ4+D+vRCyLPoV6/ukez7dhju4BzISB2MFuIgVn9R1bF60KrQ550ejjEjQQhfJ3d R6NMNgCf9eQ1IK4+oUHoP4GJq41qma1QJ5kd37GC7FjKlmfruE/dmor9jXZdFrXVKioA MjjovHVvZIdkz64f6uLojQxp16D0wP4RaCry0+ZHNRAZb/NA2qnA5ZNWLVFXFDoN8Puk qTHH3zv1kSFftAZkAo5ErJVGH268XiYuT8vWzHBZEYjeH53PXUOGImxAgc3iof0dfak+ TCqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=muvIZPXZzFYwA2KnEz8hZgGKrX75pxgv3Lg3oHbwLBw=; b=lnG2VwpkCUOep6RpWCSQ4ELwRjKklGcpUu+gTcSgrelHxy+IHErJC/kxpJj+dEsrKX LpcP4jNVjW0MeZUxk5rs/vTFcn9VXkjO7DEe5HypZ5weugkiX+Ja+bbg3om7tnNM8ZOW KX46+u4c7u/ZOxmoZ0dsGhsMDmja+xhRzWaqeLZCeCb6N2jddTXBIx1oOW6FVdOB16iM L/zwuM0Ni55z4DRXwVYvYwuPi0yPxC6pZAVBcc3jNntm1VI9Pc2FPCTiaX2vz5akc5WT p5JvziK8RZEOLJYhqv67dMH9mJy+QQ+YMLERWqr71xCBula+2bz2Ef4bxhXDUmOl7/WH ASkQ== X-Gm-Message-State: APjAAAWRJvCNaGSZyTkWZcPtL97ohGzYSoqR37fyEsnww8HPi8Z8vBYT Qwsq9Z3P2OKfAevKRVrHNuk= X-Google-Smtp-Source: APXvYqygLqbMNydAuYdfkCmF+8oCs3Vw2xkRqAtHA6tCsjJGXCzAIzsezFGkNLbfktPTVScTqWNo8w== X-Received: by 2002:a17:902:bd85:: with SMTP id q5mr4061608pls.17.1576521181571; Mon, 16 Dec 2019 10:33:01 -0800 (PST) Received: from localhost.localdomain (c-73-241-114-122.hsd1.ca.comcast.net. [73.241.114.122]) by smtp.gmail.com with ESMTPSA id d65sm23400738pfa.159.2019.12.16.10.33.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2019 10:33:00 -0800 (PST) From: Richard Cochran To: netdev@vger.kernel.org Subject: [PATCH net-next 2/3] net: axienet: Support software transmit time stamping. Date: Mon, 16 Dec 2019 10:32:55 -0800 Message-Id: <79b2d20c323484b8f86690ea56dae52b1be6a8e9.1576520432.git.richardcochran@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191216_103302_254833_C5D24301 X-CRM114-Status: GOOD ( 12.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Radhey Shyam Pandey , David Miller , linux-arm-kernel@lists.infradead.org, Michal Simek Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org MAC drivers are expected to invoke the transmit time stamping hook in order to support both software time stamping and PHY time stamping. This patch adds the missing hook. In addition, drivers calling netif_rx() should first check for PHY time stamping by calling skb_defer_rx_timestamp(). Signed-off-by: Richard Cochran --- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 53644abe52da..05fa7371c39a 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -675,6 +675,9 @@ axienet_start_xmit(struct sk_buff *skb, struct net_device *ndev) cur_p->skb = skb; tail_p = lp->tx_bd_p + sizeof(*lp->tx_bd_v) * lp->tx_bd_tail; + + skb_tx_timestamp(skb); + /* Start the transfer */ axienet_dma_out32(lp, XAXIDMA_TX_TDESC_OFFSET, tail_p); if (++lp->tx_bd_tail >= lp->tx_bd_num) @@ -736,7 +739,8 @@ static void axienet_recv(struct net_device *ndev) skb->ip_summed = CHECKSUM_COMPLETE; } - netif_rx(skb); + if (!skb_defer_rx_timestamp(skb)) + netif_rx(skb); size += length; packets++; @@ -1367,6 +1371,7 @@ static const struct ethtool_ops axienet_ethtool_ops = { .set_pauseparam = axienet_ethtools_set_pauseparam, .get_coalesce = axienet_ethtools_get_coalesce, .set_coalesce = axienet_ethtools_set_coalesce, + .get_ts_info = ethtool_op_get_ts_info, .get_link_ksettings = axienet_ethtools_get_link_ksettings, .set_link_ksettings = axienet_ethtools_set_link_ksettings, }; -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel