From patchwork Wed Dec 9 11:38:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kovvuri X-Patchwork-Id: 7807571 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AAA0DBEEE1 for ; Wed, 9 Dec 2015 11:38:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D01252049D for ; Wed, 9 Dec 2015 11:38:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 035E220445 for ; Wed, 9 Dec 2015 11:38:33 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a6d2x-0000y8-OS; Wed, 09 Dec 2015 11:36:35 +0000 Received: from mail-pa0-x234.google.com ([2607:f8b0:400e:c03::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a6d2a-0000i1-2m for linux-arm-kernel@lists.infradead.org; Wed, 09 Dec 2015 11:36:13 +0000 Received: by pacej9 with SMTP id ej9so28774541pac.2 for ; Wed, 09 Dec 2015 03:35:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QSakC2MZMHDtcMs3w4n7toxg7RIH8mYoDPcBxS+b3Ls=; b=Y/f2816bBYE9Hj2lU86Sri1bjT1rBT7ZYVqUe2E5bC1SeaYooenjdVmIiE+oyVYc4b 7BcqLazcJ8jYP0Q5YJotxLQBYsdDN9PQIxK4YMHJI/qfZn/mUE8JfsknvqhBuuzAkLF8 ZS/sjN/FmSjIJ1oOFwwPjb7AJwsrR2lt1pRerBLCFQxNOaDnzPFKVuUUv2Igt2MhBJlj Ikv+Z3rsPpuxAuCDCEw6IEMBaDP+epYAp/ouLOybz5L64Hkzij5WT++t0ILTEVM6CKOS OdqxTU33s0oxjAIwDMiGYBy5xSQU5FVmvZWHZuEO8Du0CFTqhwVxx3VeXynqN3ykwdV4 vglQ== X-Received: by 10.66.232.170 with SMTP id tp10mr7219299pac.38.1449660951263; Wed, 09 Dec 2015 03:35:51 -0800 (PST) Received: from localhost.localdomain ([14.140.2.178]) by smtp.googlemail.com with ESMTPSA id hz8sm11234864pac.10.2015.12.09.03.35.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2015 03:35:50 -0800 (PST) From: Sunil Goutham To: netdev@vger.kernel.org Subject: [PATCH 2/2] net: thunderx: Enable CQE count threshold interrupt Date: Wed, 9 Dec 2015 17:08:01 +0530 Message-Id: <1449661081-15435-3-git-send-email-sunil.kovvuri@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151209_033612_495205_28D2B327 X-CRM114-Status: GOOD ( 13.49 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sunil Goutham , Sunil.Goutham@caviumnetworks.com, p.fedin@samsung.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sunil Goutham This feature is introduced in pass-2 chip and with this CQ interrupt coalescing will work based on both timer and count. Signed-off-by: Sunil Goutham --- drivers/net/ethernet/cavium/thunder/nic.h | 2 ++ drivers/net/ethernet/cavium/thunder/nicvf_main.c | 2 +- drivers/net/ethernet/cavium/thunder/nicvf_queues.c | 5 ++++- drivers/net/ethernet/cavium/thunder/nicvf_queues.h | 3 ++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/cavium/thunder/nic.h b/drivers/net/ethernet/cavium/thunder/nic.h index 02571f4..e782856 100644 --- a/drivers/net/ethernet/cavium/thunder/nic.h +++ b/drivers/net/ethernet/cavium/thunder/nic.h @@ -34,6 +34,8 @@ /* NIC priv flags */ #define NIC_SRIOV_ENABLED BIT(0) +#define VNIC_NAPI_WEIGHT NAPI_POLL_WEIGHT + /* Min/Max packet size */ #define NIC_HW_MIN_FRS 64 #define NIC_HW_MAX_FRS 9200 /* 9216 max packet including FCS */ diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c index c24cb2a..e06a7f8 100644 --- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c +++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c @@ -1155,7 +1155,7 @@ int nicvf_open(struct net_device *netdev) cq_poll->cq_idx = qidx; cq_poll->nicvf = nic; netif_napi_add(netdev, &cq_poll->napi, nicvf_poll, - NAPI_POLL_WEIGHT); + VNIC_NAPI_WEIGHT); napi_enable(&cq_poll->napi); nic->napi[qidx] = cq_poll; } diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_queues.c b/drivers/net/ethernet/cavium/thunder/nicvf_queues.c index b11fc09..4e9709e 100644 --- a/drivers/net/ethernet/cavium/thunder/nicvf_queues.c +++ b/drivers/net/ethernet/cavium/thunder/nicvf_queues.c @@ -299,7 +299,10 @@ static int nicvf_init_cmp_queue(struct nicvf *nic, return err; cq->desc = cq->dmem.base; - cq->thresh = CMP_QUEUE_CQE_THRESH; + if (!pass1_silicon(nic->pdev)) + cq->thresh = CMP_QUEUE_CQE_THRESH; + else + cq->thresh = 0; nic->cq_coalesce_usecs = (CMP_QUEUE_TIMER_THRESH * 0.05) - 1; return 0; diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_queues.h b/drivers/net/ethernet/cavium/thunder/nicvf_queues.h index a4f6667..0fae6ad 100644 --- a/drivers/net/ethernet/cavium/thunder/nicvf_queues.h +++ b/drivers/net/ethernet/cavium/thunder/nicvf_queues.h @@ -10,6 +10,7 @@ #define NICVF_QUEUES_H #include +#include "nic.h" #include "q_struct.h" #define MAX_QUEUE_SET 128 @@ -75,7 +76,7 @@ */ #define CMP_QSIZE CMP_QUEUE_SIZE2 #define CMP_QUEUE_LEN (1ULL << (CMP_QSIZE + 10)) -#define CMP_QUEUE_CQE_THRESH 0 +#define CMP_QUEUE_CQE_THRESH (VNIC_NAPI_WEIGHT / 2) #define CMP_QUEUE_TIMER_THRESH 80 /* ~2usec */ #define RBDR_SIZE RBDR_SIZE0