]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
net: ethernet: ti: cpts: break cycle once late ts is matched
authorIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Tue, 10 Jul 2018 13:04:04 +0000 (16:04 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Jul 2018 07:00:07 +0000 (00:00 -0700)
The late ts queue can contain a bunch of skbs while hi rate testing,
no need to check all of them if timestamp is already matched.

Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpts.c

index 6f63c8729afca1cf4e621bd1b18763850f33ffd3..b4ea58dc8caf878c231e5df845cbfc27357580c4 100644 (file)
@@ -114,7 +114,10 @@ static bool cpts_match_tx_ts(struct cpts *cpts, struct cpts_event *event)
                        dev_consume_skb_any(skb);
                        dev_dbg(cpts->dev, "match tx timestamp mtype %u seqid %04x\n",
                                mtype, seqid);
-               } else if (time_after(jiffies, skb_cb->tmo)) {
+                       break;
+               }
+
+               if (time_after(jiffies, skb_cb->tmo)) {
                        /* timeout any expired skbs over 1s */
                        dev_dbg(cpts->dev,
                                "expiring tx timestamp mtype %u seqid %04x\n",