From patchwork Wed Feb 7 21:57:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 870650 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="umMtnT7Q"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mbRWTek4"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zcFYR3wbYz9t3l for ; Thu, 8 Feb 2018 08:57:31 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=M4XOycPo/XykCe/1F8zuqxvi/xDwT0C+i+cGvKLsL5o=; b=umMtnT7QPYSKjr TA/T7B0B4yt2ptNrB03pXjQUCAealaY9mWzoaFNlZChpL9I+X/wlhblAezIf4CT8BgR6pI9LXJ5HC E5zuF6rhLxOclvksMLgTzIqYN08AMcQ/h96J2yJG8cMZA+dTzKkAvp3jII/zeStOj1+4kDlnuw6jo B8IAToLB7/atny7JDTQZu2RrAO85fAmz0vxmwB/9z0+JU6H9Qp79KNTkSy/KyJETST6quwCJxPwxt GpmjuQpFsUfmYxoLpRKCgnk5io/xNY6CpzKWGPoxDMBRRraDqsFQe0YxzZiHCK/YnynFy9G91c98z ETlh4czFr49oAiRnAOnA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ejXiZ-00054J-LH; Wed, 07 Feb 2018 21:57:27 +0000 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ejXiW-00053Q-7X for lede-dev@lists.infradead.org; Wed, 07 Feb 2018 21:57:26 +0000 Received: by mail-pf0-x242.google.com with SMTP id a14so918097pfi.7 for ; Wed, 07 Feb 2018 13:57:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TBrMP/tTlIMWKhhxtWR2YMdiJ7sjn+ODkpPksUqs8uE=; b=mbRWTek4CjUaz7TRvjmwidGKV2aHp0DKCrSfY/itTsafZtgi/huSCqP4gCI3skRcRp LrrMZSx2G08trxzMAvt3WAHwbaKvF1+4nvi0jXzeTzoQTh2ys6vzlXWi9Qe+9dc33y5q RAOWuxahtSLu10SkEqYkUIn48/8NWCfgBlkxc8K+UnnJBHFv9ee9lCFvDuQDbspV+9PU 5KMtdk7gzNgKKrUom8VH5xncmr8x+O0URCEYjLGZDZ3OPakgXRh9TrOOwp/iGa0Juag2 xAFicl2L0tN3LxlxXzEE9yQRCKk57ixzYhyeom9vqgfquLzw2ap3iaieFo9ujWpLwRwS RoQA== 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:in-reply-to :references; bh=TBrMP/tTlIMWKhhxtWR2YMdiJ7sjn+ODkpPksUqs8uE=; b=rt4snBeBcLwazP4LJgO0qQrzTa6yLMBkyLjK7IdMDQ6tYP5isv7K7oeui2q2mQCVfp Rgl2GPnxXExl9XzewiNb7AVNRQZBW0ldC8hAD1TZ3EVjtHLdwMhqMgMWZG/ZBaUUYMJK psS6m/pXvIyDfVFx3hYOFoc89ojYeYnXQR6GncewOarYjn2SJC8Yln5o08D0qd7DR9+m l30Gb3Satf3RR/q5WDdexCx32U2kgbpYg4B1UgpAJCdwHHHrqo0aZaDi3Q7tIieWvZlR P61ve16+IEYfCHIOvkDf3BjtDY4MdI/b4JgCWnR5RwelsI7Thd9iIc7fyi8ODt9qtdXD m64g== X-Gm-Message-State: APf1xPAiQ1YQHZGYS1wCR5JbX1eWHfJ4kYAohyernWXhdPZMuxo/I0W1 knYXL96EzO5EUthPGwt4cB1/wuQg X-Google-Smtp-Source: AH8x224KxzLKKlZ7kTBL6f9pZzLyfn2/bkfVYds/FzCx1gryAoFijQmnIVvSXc0W8NyEXAEnn3DU9w== X-Received: by 10.98.11.201 with SMTP id 70mr7307123pfl.16.1518040632619; Wed, 07 Feb 2018 13:57:12 -0800 (PST) Received: from DESKTOP-CEH0M93.lan ([2001:470:1f05:c3e:f514:58b1:db93:a44a]) by smtp.gmail.com with ESMTPSA id o70sm5574252pfi.6.2018.02.07.13.57.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Feb 2018 13:57:12 -0800 (PST) From: Rosen Penev To: lede-dev@lists.infradead.org Date: Wed, 7 Feb 2018 13:57:30 -0800 Message-Id: <1518040650-780-1-git-send-email-rosenp@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517956050-32412-1-git-send-email-rosenp@gmail.com> References: <1517956050-32412-1-git-send-email-rosenp@gmail.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:400e:c00:0:0:0:242 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (rosenp[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain Subject: [LEDE-DEV] [PATCH 1/3] ag71xx: Move timestamp struct member outside of struct. X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rosen Penev MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org With this change, the timestamp variable is only used in ag71xx_check_dma_stuck. Small tx speedup. Based on a Qualcomm commit. ag->timestamp = jiffies was not replaced with netif_trans_update(dev) because of this quote: It should be noted that after this series several instances of netif_trans_update() are useless (if they occur in .ndo_start_xmit and driver doesn't set LLTX flag -- stack already did an update). From: http://lists.openwall.net/netdev/2016/05/03/87 Signed-off-by: Rosen Penev --- .../linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h | 2 -- .../ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h index cea172e..d7897a9 100644 --- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h +++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h @@ -172,8 +172,6 @@ struct ag71xx { struct napi_struct napi; u32 msg_enable; - unsigned long timestamp; - /* * From this point onwards we're not looking at per-packet fields. */ diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c index 47b4c69..95682b7 100644 --- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c +++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c @@ -816,7 +816,6 @@ static netdev_tx_t ag71xx_hard_start_xmit(struct sk_buff *skb, i = (ring->curr + n - 1) & ring_mask; ring->buf[i].len = skb->len; ring->buf[i].skb = skb; - ag->timestamp = jiffies; netdev_sent_queue(dev, skb->len); @@ -928,9 +927,11 @@ static void ag71xx_restart_work_func(struct work_struct *work) static bool ag71xx_check_dma_stuck(struct ag71xx *ag) { + unsigned long timestamp; u32 rx_sm, tx_sm, rx_fd; - if (likely(time_before(jiffies, ag->timestamp + HZ/10))) + timestamp = netdev_get_tx_queue(ag->dev, 0)->trans_start; + if (likely(time_before(jiffies, timestamp + HZ/10))) return false; if (!netif_carrier_ok(ag->dev))