Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1347511
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| Newsgroups | linux.kernel |
| Subject | [PATCH 4.4 003/342] net: dp83640: Fix tx timestamp overflow handling. |
| Date | Wed, 02 Mar 2016 02:40:03 +0100 |
| Message-ID | <r83VF-sE-43@gated-at.bofh.it> (permalink) |
| References | <r82mS-7Ml-9@gated-at.bofh.it> |
| X-Original-To | <linux-kernel@vger.kernel.org> |
| Dkim-Signature | v=1; a=rsa-sha1; c=relaxed/relaxed; s=mandrill; d=linuxfoundation.org; h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Date:MIME-Version:Content-Type:Content-Transfer-Encoding; i=gregkh@linuxfoundation.org; bh=ilym4wgEQu/zfS1NmSO1VYg1wgM=; b=CiaYz39NIu0pYHE6BrcyqkpX83EOQhJi3ln3b7vcwDVIjfbGHH/9bYyN0qrjFXu0jH65IjHcowmr gvOFOIFW3NN0dtaJwDmiG5vuXuKNcvxDHo2QErg4/zJV8mTfd6LBVjbMogk705HUVgU4ERRYfJZc tQVs/o/z7GZ3pb5UN/o= |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; i=@mandrillapp.com; q=dns/txt; s=mandrill; t=1456876432; h=From : Subject : To : Cc : Message-Id : In-Reply-To : References : Date : MIME-Version : Content-Type : Content-Transfer-Encoding : From : Subject : Date : X-Mandrill-User : List-Unsubscribe; bh=xp0VoOzCqdgOx2qRC8U/Btcr5ozqgS2xA8kVBmjFwe0=; b=esgNPU4vjNCalZXaVf7+Xs737VLR91M/D3ZMpItF1NnDArTrXDG3saJg49YNXXpuwat+cN uAvan5vkINWppods4emimpOBMU46I+U4pD4f+vwV+Y+LqFG9ESoZdpLVnI1IWYtkILY5wGDM ZtGGZJvIOys1jyaCx/OpAdp98nckA= |
| X-Mailer | git-send-email 2.7.2 |
| X-Report-Abuse | Please forward a copy of this message, including all headers, to abuse@mandrill.com |
| X-Report-Abuse | You can also report abuse here: http://mandrillapp.com/contact/abuse?id=30481620.770b358b2863425c99fcdb67ae4bfdc7 |
| X-Mandrill-User | md_30481620 |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | 7bit |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 67 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Greg Kroah-Hartman <gregkh@linuxfoundation.org>, <stable@vger.kernel.org>, Manfred Rudigier <manfred.rudigier@omicron.at>, Richard Cochran <richardcochran@gmail.com>, "David S. Miller" <davem@davemloft.net> |
| X-Original-Date | Tue, 01 Mar 2016 23:53:52 +0000 |
| X-Original-Message-ID | <20160301234528.102491391@linuxfoundation.org> |
| X-Original-References | <20160301234527.990448862@linuxfoundation.org> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1347511 |
Show key headers only | View raw
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Manfred Rudigier <Manfred.Rudigier@omicron.at>
[ Upstream commit 81e8f2e930fe76b9814c71b9d87c30760b5eb705 ]
PHY status frames are not reliable, the PHY may not be able to send them
during heavy receive traffic. This overflow condition is signaled by the
PHY in the next status frame, but the driver did not make use of it.
Instead it always reported wrong tx timestamps to user space after an
overflow happened because it assigned newly received tx timestamps to old
packets in the queue.
This commit fixes this issue by clearing the tx timestamp queue every time
an overflow happens, so that no timestamps are delivered for overflow
packets. This way time stamping will continue correctly after an overflow.
Signed-off-by: Manfred Rudigier <manfred.rudigier@omicron.at>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/phy/dp83640.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
--- a/drivers/net/phy/dp83640.c
+++ b/drivers/net/phy/dp83640.c
@@ -845,6 +845,11 @@ static void decode_rxts(struct dp83640_p
struct skb_shared_hwtstamps *shhwtstamps = NULL;
struct sk_buff *skb;
unsigned long flags;
+ u8 overflow;
+
+ overflow = (phy_rxts->ns_hi >> 14) & 0x3;
+ if (overflow)
+ pr_debug("rx timestamp queue overflow, count %d\n", overflow);
spin_lock_irqsave(&dp83640->rx_lock, flags);
@@ -887,6 +892,7 @@ static void decode_txts(struct dp83640_p
struct skb_shared_hwtstamps shhwtstamps;
struct sk_buff *skb;
u64 ns;
+ u8 overflow;
/* We must already have the skb that triggered this. */
@@ -896,6 +902,17 @@ static void decode_txts(struct dp83640_p
pr_debug("have timestamp but tx_queue empty\n");
return;
}
+
+ overflow = (phy_txts->ns_hi >> 14) & 0x3;
+ if (overflow) {
+ pr_debug("tx timestamp queue overflow, count %d\n", overflow);
+ while (skb) {
+ skb_complete_tx_timestamp(skb, NULL);
+ skb = skb_dequeue(&dp83640->tx_queue);
+ }
+ return;
+ }
+
ns = phy2txts(phy_txts);
memset(&shhwtstamps, 0, sizeof(shhwtstamps));
shhwtstamps.hwtstamp = ns_to_ktime(ns);
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 4.4 003/342] net: dp83640: Fix tx timestamp overflow handling. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-02 02:40 +0100
csiph-web