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=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED 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 2CDA0C282C4 for ; Mon, 4 Feb 2019 16:55:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F417120815 for ; Mon, 4 Feb 2019 16:55:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730260AbfBDQzn (ORCPT ); Mon, 4 Feb 2019 11:55:43 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:53622 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727308AbfBDQzn (ORCPT ); Mon, 4 Feb 2019 11:55:43 -0500 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::bf5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id CA46B108B84E6; Mon, 4 Feb 2019 08:55:42 -0800 (PST) Date: Mon, 04 Feb 2019 08:55:42 -0800 (PST) Message-Id: <20190204.085542.854494905866961416.davem@davemloft.net> To: bigeasy@linutronix.de Cc: andrew@lunn.ch, richardcochran@gmail.com, f.fainelli@gmail.com, hkallweit1@gmail.com, netdev@vger.kernel.org Subject: Re: [PATCH net v3] net: dp83640: expire old TX-skb From: David Miller In-Reply-To: <20190204102029.ls7qdzgexrkgcis4@linutronix.de> References: <20190201210918.gvufqxpqzvuzfk5n@linutronix.de> <20190201211551.GD8274@lunn.ch> <20190204102029.ls7qdzgexrkgcis4@linutronix.de> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Mon, 04 Feb 2019 08:55:43 -0800 (PST) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Sebastian Andrzej Siewior Date: Mon, 4 Feb 2019 11:20:29 +0100 > During sendmsg() a cloned skb is saved via dp83640_txtstamp() in > ->tx_queue. After the NIC sends this packet, the PHY will reply with a > timestamp for that TX packet. If the cable is pulled at the right time I > don't see that packet. It might gets flushed as part of queue shutdown > on NIC's side. > Once the link is up again then after the next sendmsg() we enqueue > another skb in dp83640_txtstamp() and have two on the list. Then the PHY > will send a reply and decode_txts() attaches it to the first skb on the > list. > No crash occurs since refcounting works but we are one packet behind. > linuxptp/ptp4l usually closes the socket and opens a new one (in such a > timeout case) so those "stale" replies never get there. However it does > not resume normal operation anymore. > > Purge old skbs in decode_txts(). > > Fixes: cb646e2b02b2 ("ptp: Added a clock driver for the National Semiconductor PHYTER.") > Signed-off-by: Sebastian Andrzej Siewior > Reviewed-by: Kurt Kanzenbach > Acked-by: Richard Cochran Applied and queued up for -stable, thanks.