Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1672502imm; Tue, 10 Jul 2018 06:06:57 -0700 (PDT) X-Google-Smtp-Source: AAOMgpem8Os5IXbSc3D3mz+kG19Mpuc7YCkMuBrhmDZDIgGZdZKe4a2z2+T9KjDyfBYvKY2FZEVc X-Received: by 2002:a17:902:6b0b:: with SMTP id o11-v6mr2740988plk.101.1531228017830; Tue, 10 Jul 2018 06:06:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531228017; cv=none; d=google.com; s=arc-20160816; b=uVE7nOza1PMbr7QlERj+lzI+jTOme8VpY1/QNwp6qLqil9XHS/9QRMM+8oEWCAkID7 sH2F977eE4RaGkC4tnHtrB3+c1D/Jh03teYV8hIFMSENVQMjn3uqLLfLLCHAQj02NseB ScqoK0ch8BziWovfmnjddhNeV2YhOXzdWzJjjFZGj81npHCsbKS8ssE8tg92MilQLwF7 tPkANN12GZbTAJt6ZZCa9tciZsQd7rzddZqiO/trio11NXFJrqsp9iU8icbjfh6ky3HW vr7vQl0oXPK1gso8c4VLj7sVWT0RXRx9YyFzl1ZOm9OIgRHh8nBF5doRuHp6NMy0f6cl Qwtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=uHIN3MKxPbo+c7W9ejWFkU9dJZMFUhJns/R6zTKMOYU=; b=D918fT55AZp+tVGphYEtdlATqjGriCaDL2vyFkjxyxBwjqTCS61YmHtcd9rBBTOaby /IvGF5wRZRR2R3gCg5HXpzJ02LfdlHbn4nCZ7Y33r9rkOvpw13syDnEGKBGJApRsO3tk D22Iw7JOHz+w6dT/bDqFEaIdPxxr8/JJV04o2doKneWFlT14h1JHzcsG7J0idEoUtShb Z6LsBDpBQL5/Xxp7ZBFDPkJ6d53fDFeMzMQhuNeX8MwEyaCSPY8dgb3iavaW4QacXkMw mq28TCyzABz7hksCY6XMYFcrlT+Lwrv1w2wygoiGidiCB+baj4e82hYdes/mLSFV7C5Y YoDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=If1GAh4x; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c4-v6si142060pgc.284.2018.07.10.06.06.23; Tue, 10 Jul 2018 06:06:57 -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=@linaro.org header.s=google header.b=If1GAh4x; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933294AbeGJNEU (ORCPT + 99 others); Tue, 10 Jul 2018 09:04:20 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:41248 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753168AbeGJNES (ORCPT ); Tue, 10 Jul 2018 09:04:18 -0400 Received: by mail-lf0-f66.google.com with SMTP id v22-v6so4726467lfe.8 for ; Tue, 10 Jul 2018 06:04:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=uHIN3MKxPbo+c7W9ejWFkU9dJZMFUhJns/R6zTKMOYU=; b=If1GAh4xgYKGL7xawrDtsA3nJQg7QrKPYdQ4tPPIyI3J1QGDjGNw8YdP4k1kYZJ+sB Zy49OKvoWNCSms5+1+o3jOv7vtZFDAReSw5xwB5KfyWL614BEsaRMSuFjdXtLj8BRnFs fXWjBxwDF9vz8nnmIF+Ffws4f0t7lvCV/dTYM= 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; bh=uHIN3MKxPbo+c7W9ejWFkU9dJZMFUhJns/R6zTKMOYU=; b=cUZ775wKQOlrXVRP+4QE05yG7UfziCgOSyM6I0AC1Y1WP2GT1J1+784OH3EpTkBoRb V4QYJbGIhYtTgEBC1QquiC6yw4XSquNFuJcm6YNHqnk7ER8jKs5xrZJrTKg6HsIlKyXK 7/TPThlsimQnlCizhedvmVr0XKOMFpjdsT+cRbX1Dx7L3TG2eq6Xtj+Ubg3KdXbjd012 PnGNdCVsraYlQ+Gq74yGxk+cCGGkxjZhSeCOOIqUtQQbbJjFMcPJAcFVCDLt3jd1EFzp gMeOOAyV5yGngdGYubp4EMoiAtnzPCObBYoFiBgvG+qNi6NMQcgC5zUuDkogDsnKb45V RVRA== X-Gm-Message-State: APt69E0RquR/H5ub2pDLDR4uuxCj4CEaP25TCefW05CVXveWNu3Mo116 Zg2La2s4EzPod+3BdWNj6SKwx8Eseso= X-Received: by 2002:a19:cf95:: with SMTP id f143-v6mr2955151lfg.101.1531227857377; Tue, 10 Jul 2018 06:04:17 -0700 (PDT) Received: from localhost.localdomain (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id g16-v6sm1609399lje.1.2018.07.10.06.04.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Jul 2018 06:04:16 -0700 (PDT) From: Ivan Khoronzhuk To: davem@davemloft.net, grygorii.strashko@ti.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Ivan Khoronzhuk Subject: [PATCH] net: ethernet: ti: cpts: break cycle once late ts is matched Date: Tue, 10 Jul 2018 16:04:04 +0300 Message-Id: <20180710130404.3437-1-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- Based on net-next/master drivers/net/ethernet/ti/cpts.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c index 6f63c8729afc..b4ea58dc8caf 100644 --- a/drivers/net/ethernet/ti/cpts.c +++ b/drivers/net/ethernet/ti/cpts.c @@ -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", -- 2.17.1