Received: by 10.213.65.68 with SMTP id h4csp257593imn; Fri, 30 Mar 2018 05:05:31 -0700 (PDT) X-Google-Smtp-Source: AIpwx49lJHoTo1cu58n6+5Ixxve/0zn+FXS8kdlAOr2ocvfILaKubeFFRmB+Fl4dlEXm1TWvq/Yf X-Received: by 2002:a17:902:8214:: with SMTP id x20-v6mr12966682pln.182.1522411531445; Fri, 30 Mar 2018 05:05:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522411531; cv=none; d=google.com; s=arc-20160816; b=ElCMfG2Gx0ALRw/YvE06bW3bWRaXkWY47JnBr7EksMwUptuOcv7ZiQi0RjIU3s1EvL X5I1k4o6yzEPp8t0SBsLS5e805adWoquN0bJYTyfd0jy7RSD64iOoDGFKrSM0NvzBDr2 KKRpeytrkZWwjsec5coApXRb7naw3ekGdVD3/vso98425aMimGspRnY13hb0pEKU0pvy 3az/JZ5bKRjEV7OqB5KBPzt5G/affKJ18b1biihf2dIUwW9T1K5hyGahYmjJRNPaT49f ZLbnUyBDuV91J7K8UZ0sQqRyl6cZDYEs3CXdIU5sJTSLlWg25oBg/3d/uLPsjXsb/LJq CtLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:arc-authentication-results; bh=DipfMG81wBol58UZhNm6e18HTZqmazsh+SP7Pm1tJns=; b=J0CzGjak65OFsdsWt7kTHB38qZ98mfNG9b7tpspY8WB8E0Vr5yKss+D62eKlk5St5M eMEtqVHwHujIVlQ2kJLAbMwPTklmRx9WcCkCKxRzZUvpzL0ndei1mKVDwtLU0NxiDCRw B1TPvJaRueW4Dz8OWeHDlBvhkR4kkoGdyG6peuwCLkIXXVK4yEbI68YhwiNgXEuYyTcY wSjVLzzwnbPZKr0qDMGBP5xwDHldjyN68HvHofyMiPvJklOpYzNZG7LthF4lKqFjGd84 Q6OCTqhJMLjOfBep0rd+Xon+yhQD8zQFbFAmts0itOOvQZ368GCwJv6jmucTFBhJx5Z5 4dGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=eeZ0pVQu; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z30si6156641pfg.145.2018.03.30.05.05.16; Fri, 30 Mar 2018 05:05:31 -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=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=eeZ0pVQu; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752760AbeC3MCG (ORCPT + 99 others); Fri, 30 Mar 2018 08:02:06 -0400 Received: from mail-by2nam01on0085.outbound.protection.outlook.com ([104.47.34.85]:43643 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752072AbeC3MAZ (ORCPT ); Fri, 30 Mar 2018 08:00:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=DipfMG81wBol58UZhNm6e18HTZqmazsh+SP7Pm1tJns=; b=eeZ0pVQuJafEtLFEI2BPu5FX5fIZSvvdWeoFL3me8UsRs4b+66lKEKcEt4BjtgX+2kAKPfV3aY6unNP+VhHPMMzQbgfz36plueUbUij4xhlabyHBwInwqSoRbZ7Rr6jm3E+4LbIDz6oOMX3qIcNAj/lM8gtY/3fKVizAihpAbi8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Vadim.Lomovtsev@cavium.com; Received: from localhost.localdomain.com (50.233.148.156) by CY4PR07MB2997.namprd07.prod.outlook.com (2603:10b6:903:d0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.609.10; Fri, 30 Mar 2018 12:00:23 +0000 From: Vadim Lomovtsev To: sgoutham@cavium.com, sunil.kovvuri@gmail.com, rric@kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, davem@davemloft.net Cc: dnelson@redhat.com, ynorov@caviumnetworks.com, Vadim Lomovtsev Subject: [PATCH v2 2/7] net: thunderx: add MAC address filter tracking for LMAC Date: Fri, 30 Mar 2018 04:59:48 -0700 Message-Id: <20180330115953.17154-3-Vadim.Lomovtsev@caviumnetworks.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180330115953.17154-1-Vadim.Lomovtsev@caviumnetworks.com> References: <20180327150736.10718-1-Vadim.Lomovtsev@caviumnetworks.com> <20180330115953.17154-1-Vadim.Lomovtsev@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: CO2PR04CA0006.namprd04.prod.outlook.com (2603:10b6:102:1::16) To CY4PR07MB2997.namprd07.prod.outlook.com (2603:10b6:903:d0::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 31fa2611-052d-4abd-b9e8-08d59635d18b X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603328)(7153060)(7193020);SRVR:CY4PR07MB2997; X-Microsoft-Exchange-Diagnostics: 1;CY4PR07MB2997;3:/X24axXaAqlfA57YaFl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8ZpOY8gUceWFt7vPVitWMEZ5PNhiX/JNPyK4H9xzSl/FGqpMtbumhLuxWiyLKHxK2gIU/DiCvSbMABxVa3g4SuVNSZXKM2NMTRSS/VT2M5YLVZoy/OFqDLLua7syUkVpFxV4aW/4HQ1AudYpmDQoCfaAYgMLLwfi2A34tvdozeJx/79jH1SlVuN1xHCGbni3MfqCV8/zEGPb98TqKJX7MfGazeZJW0MljpfztcYaRx/JtcYMBEHtTpTA3RBxY+SQ24MKQcHwf5oQSlkZda6BXIjXzs5McHpNjRptDR8QVOXwK0NxC3AQHO4n7iYl/dtWgSjicFtNOG8NtwMYKocTsx/hveyzATvA/3Fxuv+LOgsjc8DQ3JP6PDpdZpltRCXmNpic9A5w5HToNTvU5BOpTUJyxNJa6TUAKJQpiUoDydWpRe7elUKE=;4:MKKfxqW30Z3almd3xztUatuMSUQGTNBgIPHGSfDTuM5LQ+VZNPmPobr5srRb1ylZ599X/4l9XAyjL/2fiV5I8a4/WHXplrU7zr6o5VjROf7qbdE/unbqEPtfq1InFaA+hEiTvj/rkh/ARzu+jkmr8cE6Dn/Bw5djUpKiLGJM53fo7Z4K7DRKgYxlGVwnKfxz4dm6nG6DCapUO0ReG1xlO4RCV7p6g2jkB/qmlBt/ggRQL7Tag4jUcMjXeQ/gbPLw7sbPRGtRcvzbNkFYGauqVg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(10201501046)(3002001)(3231221)(944501327)(52105095)(6041310)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(6072148)(201708071742011);SRVR:CY4PR07MB2997;BCL:0;PCL:0;RULEID:;SRVR:CY4PR07MB2997; X-Forefront-PRVS: 06274D1C43 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(396003)(376002)(39380400002)(346002)(366004)(39850400004)(189003)(199004)(3846002)(6116002)(1076002)(105586002)(81156014)(81166006)(8676002)(48376002)(50466002)(53416004)(5660300001)(52116002)(97736004)(51416003)(6506007)(8936002)(59450400001)(76176011)(386003)(69596002)(2906002)(6486002)(6512007)(72206003)(39060400002)(6666003)(47776003)(316002)(7736002)(16586007)(106356001)(486005)(486005)(476003)(107886003)(446003)(305945005)(53936002)(11346002)(2616005)(66066001)(16526019)(956004)(478600001)(68736007)(36756003)(50226002)(26005)(4326008)(42882007)(25786009);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR07MB2997;H:localhost.localdomain.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR07MB2997;23:3AWxX65dcTKrzqn5a7zgLswHI34IG0YUhqM5agD1n?= =?us-ascii?Q?klmtoke+ysvh/mUVOs97aB+YqK8lARbGZLRxO4HywbKxQMiU+sSt5ts/qJKP?= =?us-ascii?Q?20I4EccJndONPrdxGZL4Ch3AkNhA/mhd0OJsmjTEREBbQhmUe5otjFZrSQeZ?= =?us-ascii?Q?3Cw1Gsnco1JcZM2HoseWt1Qfiev/n+N7LrMnRJ6vfej81pGNddLEN9gpynDJ?= =?us-ascii?Q?mtMyfJr6O/Atvezwef417yxavX28WNaEh99RBKpJBkziHHmSlKdg+GYsQZY5?= =?us-ascii?Q?WezYcCM5prznQabzN9zUsxuNUTFeoR62kyua4eXBNGrrA42u1saCjYVl1sky?= =?us-ascii?Q?Au8+raT0A0o8FCbCBcDzP7Cg/lhMnWgEogNpIFxCtHTY+3Kk5ynx5o446TLX?= =?us-ascii?Q?DuBI/AdCwn6B0mQsckH9LsT6p2PHZkvDvXCyYXu6ks+/dRoucNy1LlCeX5fl?= =?us-ascii?Q?9OpnjcZr6oAxaU1W/I0e9HXkRkgdym+1cUdvo1ZAzLEDUH5pXYPaq/Q02VCy?= =?us-ascii?Q?iPeNLnBWtUErMpW9RA8+R/pDgYdQVECW3PWymKFxFWO/khj/g1xGbhbM6u0U?= =?us-ascii?Q?unGbcqs+UnchGT+4ye/oYBVK4bmHB9dXmkw7f9t9skK8up1l3AkYaI8sWIp0?= =?us-ascii?Q?2itO4tIfQQrd2ovMQGyFY1kFg3BiINqqmUyUakGdovGr3+Hm+MLVueZIShbd?= =?us-ascii?Q?m3tbG1pGqvuzRAzH8R5mtuyF0/F+eC4tluuKMkLKBAjmDBaktlEt6JcQJQ+I?= =?us-ascii?Q?H+sBABLIcOsDCfDN2VXEQva8UYEcyXGlH6HzAXUoU2PxB6S0WvGYi2LxcKO2?= =?us-ascii?Q?iA6LND1/0yylB9WWTRCaZJSYb8WQv5hg3+lbSjfJ5/u0dsByNHWc0JWnMh8l?= =?us-ascii?Q?W+av/OTOinZFv011PvLbPHWCLNzR1dKc+HWvNUgP6AfFNVWHZPcqYWE5XriK?= =?us-ascii?Q?y9RvMm3WrCwEigAMiE9GmSh2pigXEgmSn1GhW8n0ol0WunyhRwcCXLDjRvht?= =?us-ascii?Q?sSghbxf/FO9xi7psVX7FxlToAHxyylIU9KMVCJnj9494u8jCVqCwywoaI1JW?= =?us-ascii?Q?0EMvBzubjPym0gOGL9IWaEdlFapvJT3sYafSNCP7qzosOwdK6HFYTdDSFuGG?= =?us-ascii?Q?ACSYV9461+yGsCWtYBnNeZYQ5Ts4JRnAJddbiOuJeUGi7aoaD5EYMi6aLkj0?= =?us-ascii?Q?o9AEGTbnaeym9JRdL8zq0QK6SEIOEL6C5Khhjx1sRD6UYefVeBJVV/4Z/hbP?= =?us-ascii?Q?ck37IgNCeYXQIzfpgEBfsl6l76Ttjo+7SKc+7z3HmCb37N5W8nG69h8d1/Fr?= =?us-ascii?Q?8/ObiqnlMh097ZG8NMSpLS5ckz6AFeTZST9HPQmQkxV?= X-Microsoft-Antispam-Message-Info: wzT7AXbLL7Lmt1R0FQFxU+O7+dGqLz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KbEscEBB1bTg9Hk8JxP6eVp2xNAIKkZ5qohAoS3VNqLKtyf3tNbmV5ZLFRXgTpW7p0uan8v/12zmFAkgw73XOi065VWZwA2nAloUbMY7NKDYa3aeReSoBYalD1FJy+RiEZKRtrEaU+O4bWzlRWiYc1+Sj/urZ/QVpq0XaYHFvWB/WSY97dtjft5klOv50mi6rIuFsRktPJhxtWUYYEE1tXv8eTDuJ X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2018 12:00:23.0196 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 31fa2611-052d-4abd-b9e8-08d59635d18b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB2997 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vadim Lomovtsev The ThunderX NIC has two Ethernet Interfaces (BGX) each of them could has up to four Logical MACs configured. Each of BGX has 32 filters to be configured for filtering ingress packets. The number of filters available to particular LMAC is from 8 (if we have four LMACs configured per BGX) up to 32 (in case of only one LMAC is configured per BGX). At the same time the NIC could present up to 128 VFs to OS as network interfaces, each of them kernel will configure with set of MAC addresses for filtering. So to prevent dupes in BGX filter registers from different network interfaces it is required to cache and track all filter configuration requests prior to applying them onto BGX filter registers. This commit is to update LMAC structures with control fields to allocate/releasing filters tracking list along with implementing dmac array allocate/release per LMAC. Signed-off-by: Vadim Lomovtsev --- drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 44 +++++++++++++++-------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c index 0dd211605eb1..de90e6aa5a4f 100644 --- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c +++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c @@ -37,9 +37,18 @@ enum MCAST_MODE { #define MCAST_MODE_MASK 0x3 #define BGX_MCAST_MODE(x) (x << 1) +struct dmac_map { + u64 vf_map; + u64 dmac; +}; + struct lmac { struct bgx *bgx; - int dmac; + /* actual number of DMACs configured */ + u8 dmacs_cfg; + /* overal number of possible DMACs could be configured per LMAC */ + u8 dmacs_count; + struct dmac_map *dmacs; /* DMAC:VFs tracking filter array */ u8 mac[ETH_ALEN]; u8 lmac_type; u8 lane_to_sds; @@ -236,6 +245,19 @@ void bgx_set_lmac_mac(int node, int bgx_idx, int lmacid, const u8 *mac) } EXPORT_SYMBOL(bgx_set_lmac_mac); +static void bgx_flush_dmac_cam_filter(struct bgx *bgx, int lmacid) +{ + struct lmac *lmac = NULL; + u8 idx = 0; + + lmac = &bgx->lmac[lmacid]; + /* reset CAM filters */ + for (idx = 0; idx < lmac->dmacs_count; idx++) + bgx_reg_write(bgx, 0, BGX_CMR_RX_DMACX_CAM + + ((lmacid * lmac->dmacs_count) + idx) * + sizeof(u64), 0); +} + void bgx_lmac_rx_tx_enable(int node, int bgx_idx, int lmacid, bool enable) { struct bgx *bgx = get_bgx(node, bgx_idx); @@ -481,18 +503,6 @@ u64 bgx_get_tx_stats(int node, int bgx_idx, int lmac, int idx) } EXPORT_SYMBOL(bgx_get_tx_stats); -static void bgx_flush_dmac_addrs(struct bgx *bgx, int lmac) -{ - u64 offset; - - while (bgx->lmac[lmac].dmac > 0) { - offset = ((bgx->lmac[lmac].dmac - 1) * sizeof(u64)) + - (lmac * MAX_DMAC_PER_LMAC * sizeof(u64)); - bgx_reg_write(bgx, 0, BGX_CMR_RX_DMACX_CAM + offset, 0); - bgx->lmac[lmac].dmac--; - } -} - /* Configure BGX LMAC in internal loopback mode */ void bgx_lmac_internal_loopback(int node, int bgx_idx, int lmac_idx, bool enable) @@ -925,6 +935,11 @@ static int bgx_lmac_enable(struct bgx *bgx, u8 lmacid) bgx_reg_write(bgx, lmacid, BGX_SMUX_TX_MIN_PKT, 60 + 4); } + /* actual number of filters available to exact LMAC */ + lmac->dmacs_count = (RX_DMAC_COUNT / bgx->lmac_count); + lmac->dmacs = kcalloc(lmac->dmacs_count, sizeof(*lmac->dmacs), + GFP_KERNEL); + /* Enable lmac */ bgx_reg_modify(bgx, lmacid, BGX_CMRX_CFG, CMR_EN); @@ -1011,7 +1026,8 @@ static void bgx_lmac_disable(struct bgx *bgx, u8 lmacid) cfg &= ~CMR_EN; bgx_reg_write(bgx, lmacid, BGX_CMRX_CFG, cfg); - bgx_flush_dmac_addrs(bgx, lmacid); + bgx_flush_dmac_cam_filter(bgx, lmacid); + kfree(lmac->dmacs); if ((lmac->lmac_type != BGX_MODE_XFI) && (lmac->lmac_type != BGX_MODE_XLAUI) && -- 2.14.3