From patchwork Tue Jul 10 13:04:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 141510 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3858548ljj; Tue, 10 Jul 2018 06:04:35 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd/jvJYcV4Cem1EwratlKhyjQSPrsoBTbgvFAnf/QGTOukskyoLp7So9AmNeKImeuLCmWze X-Received: by 2002:a17:902:7790:: with SMTP id o16-v6mr24484026pll.130.1531227875180; Tue, 10 Jul 2018 06:04:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531227875; cv=none; d=google.com; s=arc-20160816; b=YWqtE1G5Q1vkOQNEny+DFg33KuHe9vDb5ZQyBtD9fBxKbwnMQsExDGisVvZN/5ksid A9FXvwq9GuKVTQc+WW3uobPmwB59PdImOhEr47z1BhUOEdFHXrlGVs7bxkkmqbtNCkqN 5edIUw04SvCl7HCRnNOnSU7Ff8qxVM6HkpedOCcYZ1gFpo9CA2Jxfif6Q9LKzPUWFxgH L5ujZT+L6x84soEH4s0bpqQbJ5otz9hd8nKYojPpyzTptBlihhHYbzIsFVli6L5Io/6s D38aYZrxmc6jflxswQUVZa3lyTWHWShfGqqQhp/fEmIyHoy4ZSaXzJb0gSXeYrJWgTHC TPSw== 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 s197-v6si15411572pgs.637.2018.07.10.06.04.25; Tue, 10 Jul 2018 06:04:35 -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 S933303AbeGJNEU (ORCPT + 15 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(-) -- 2.17.1 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",