From patchwork Tue Nov 15 12:07:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kovvuri X-Patchwork-Id: 9429563 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9EF2960484 for ; Tue, 15 Nov 2016 12:09:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8AF54286F3 for ; Tue, 15 Nov 2016 12:09:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F7692875F; Tue, 15 Nov 2016 12:09:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 0EF36286F3 for ; Tue, 15 Nov 2016 12:09:23 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c6cWl-00021k-6J; Tue, 15 Nov 2016 12:07:51 +0000 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c6cWh-0001rV-Qy for linux-arm-kernel@lists.infradead.org; Tue, 15 Nov 2016 12:07:48 +0000 Received: by mail-pf0-x244.google.com with SMTP id 144so7952259pfv.0 for ; Tue, 15 Nov 2016 04:07:27 -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; bh=L72fQHjjTvGXKqRkzU5sv+yUihjbYvyJkm4tiEC9Hpw=; b=ZjoCniOpwikQLUa6J3OWtO6qYoajULo1YM5W+TMGzJwePKKHEAUJqJ17yMZr/YADIK 62MlT/0DYJfRqZ99DBFxYO2DdaFp/b1aGlPN3Xm9n0ywvALtEmo1k4O5dtFj3gqaaGOl ITjspy1b16dYhl+pfN0ZsJwS/rB2I4j4w4mbQOe+y5TzlY3dyqrVrrlwoA9dGe6DmKqb AUN8KdqX4ZGyFRNp7JbzsQT7EnWGH5cQR+nVUaOB0UiFHHzhQx8y7zyKalvxhbM1GTjR fnUSef/7UtCkXyxip/YqjPvza0DXe45bzbOBXGgcWt91++faLcZhk+UF8ESy8d1NaoUF 9F+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=L72fQHjjTvGXKqRkzU5sv+yUihjbYvyJkm4tiEC9Hpw=; b=l3XdCLcNskJlSNCaSibmSnniJ4v1ZTREqUvfaRLJM7zRAWVgaUnyQkOfyLpcMulWpw c9wXr8AtfUpjHV3nfGdLU/IhCVYaVnVwj0NgGCL83yjYMcySZhSJRtF904Zh1dZy+7ND lbWJg15VhVzAE0ieANBXU38zCSSI8c5ojvJDCalT3U/+l+KKlUUGXu0/WRX7fdivICyy /Cn2QTbF9F8OxGILcPo07xMnyddrVzeVrQk44RkuhbBPqgalepRwTOizWPy30TWB681Z kegFYBmZkIcdgLz0vmm6t/4nwoI8Y715BmZjKXdaNwfbtNngSRNBPXsvzI7+OFTi4+4W //kQ== X-Gm-Message-State: ABUngvf5mcDoPjFzlSekrZ/vMIJmNNKQeVnek8livBFwPRVocloqVo1rT9tK+vAjezqrdQ== X-Received: by 10.98.11.71 with SMTP id t68mr46224922pfi.136.1479211646143; Tue, 15 Nov 2016 04:07:26 -0800 (PST) Received: from machine421.in.caveonetworks.com ([14.140.2.178]) by smtp.googlemail.com with ESMTPSA id f81sm41535655pfd.71.2016.11.15.04.07.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 15 Nov 2016 04:07:25 -0800 (PST) From: sunil.kovvuri@gmail.com To: netdev@vger.kernel.org Subject: [PATCH v2 1/5] net: thunderx: Introduce BGX_ID_MASK macro to extract bgx_id Date: Tue, 15 Nov 2016 17:37:16 +0530 Message-Id: <1479211636-14270-1-git-send-email-sunil.kovvuri@gmail.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161115_040748_024392_CA95865D X-CRM114-Status: GOOD ( 12.09 ) 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 , Radha Mohan Chintakuntla , 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-Virus-Scanned: ClamAV using ClamSMTP From: Radha Mohan Chintakuntla This patch fixes the 'bgx_id' determination on 83xx where there are 4 BGX blocks instead of 2 on other platforms. Signed-off-by: Radha Mohan Chintakuntla Signed-off-by: Sunil Goutham --- drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 4 ++-- drivers/net/ethernet/cavium/thunder/thunder_bgx.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c index 8bbaedb..050e21f 100644 --- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c +++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c @@ -1242,8 +1242,8 @@ static int bgx_probe(struct pci_dev *pdev, const struct pci_device_id *ent) pci_read_config_word(pdev, PCI_DEVICE_ID, &sdevid); if (sdevid != PCI_DEVICE_ID_THUNDER_RGX) { - bgx->bgx_id = - (pci_resource_start(pdev, PCI_CFG_REG_BAR_NUM) >> 24) & 1; + bgx->bgx_id = (pci_resource_start(pdev, + PCI_CFG_REG_BAR_NUM) >> 24) & BGX_ID_MASK; bgx->bgx_id += nic_get_node_id(pdev) * MAX_BGX_PER_NODE; bgx->max_lmac = MAX_LMAC_PER_BGX; bgx_vnic[bgx->bgx_id] = bgx; diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.h b/drivers/net/ethernet/cavium/thunder/thunder_bgx.h index d59c71e..01cc7c8 100644 --- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.h +++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.h @@ -28,6 +28,8 @@ #define MAX_DMAC_PER_LMAC 8 #define MAX_FRAME_SIZE 9216 +#define BGX_ID_MASK 0x3 + #define MAX_DMAC_PER_LMAC_TNS_BYPASS_MODE 2 /* Registers */