From patchwork Tue Jul 31 10:34:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 10550603 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 41847139A for ; Tue, 31 Jul 2018 10:35:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D2DB2A769 for ; Tue, 31 Jul 2018 10:35:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1EB5D2A7B1; Tue, 31 Jul 2018 10:35:06 +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=-2.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B83D22A769 for ; Tue, 31 Jul 2018 10:35:04 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41ft9f0wYWzF14s for ; Tue, 31 Jul 2018 20:35:02 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="D6l2AUWy"; dkim-atps=neutral X-Original-To: linux-mlxsw@lists.ozlabs.org Delivered-To: linux-mlxsw@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=mellanox.com (client-ip=40.107.2.54; helo=eur02-ve1-obe.outbound.protection.outlook.com; envelope-from=petrm@mellanox.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="D6l2AUWy"; dkim-atps=neutral Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20054.outbound.protection.outlook.com [40.107.2.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41ft9X5CbFzF14l for ; Tue, 31 Jul 2018 20:34:54 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=owrLDX6p8sh8sLtE6apq5r8+2VWp5RBkCAe12slBY+0=; b=D6l2AUWyu/wierNYcriiAI2mOsCTKBZC5A8uKBT8l53I8IVpxZp2TBDP3KARZuucGPdXWSYYudcCRaRy5Y5W/8zf4Npkk42uLFGBDeCSVLUa6Xw6ejj+jpVC9AfeYDLiNs8CcrStcCktZJgxbnNLoSDLGkMIzbkRZv58TGeiLAI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; Received: from t540p (78.45.160.211) by AM6PR05MB4183.eurprd05.prod.outlook.com (2603:10a6:209:40::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.17; Tue, 31 Jul 2018 10:34:47 +0000 From: Petr Machata To: Subject: [PATCH net-next mlxsw 0/3] mlxsw: Enable MC-aware mode for mlxsw ports Message-Id: Date: Tue, 31 Jul 2018 12:34:42 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 X-Originating-IP: [78.45.160.211] X-ClientProxiedBy: HE1PR05CA0142.eurprd05.prod.outlook.com (2603:10a6:7:28::29) To AM6PR05MB4183.eurprd05.prod.outlook.com (2603:10a6:209:40::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a083c1fe-3779-42bc-3f99-08d5f6d13d33 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4618075)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:AM6PR05MB4183; X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4183; 3:qQSx+mL+axxeKpGwonwpMGmzSZToVrMFf8iCRSaq5DqBsoGdQ8vn+D9TkMgc/RL8UoMF7q4Pn7o3oGZy59QfjEETkiPVSasrFoYV6VnbHSRgayVvETRH0TOaVKurIijxV5xzXBjNNf+M/iUKeqzKWpL3vEIkArb9WvsPkFea4NKM9LEG2ofsLNJUyE8i6ZNtYbzeVwlOsMvyneIgotEbtIPy4EKy20UlxhirORNDPoSFHIgWvTYlXE3bS4VGWk6E; 25:2OMGF+qippJ7F6G1XxcijJ2zYSi4JMaEZj+MXdFrQN3WxpoVaHS7wQtVue6IjnufxSwCQqQgE0oUU7VK1FSNID5DMzIIdXBypO1r1WhTUv7nbOnDx2zvEJfGtVzaNxyo7KMHz+I0yvM/TVyZor5w3om5EZmOQTNeKixOcH65qq+DqcWqi3LJ88ySyO+PRy0BINvtBeBi//3LsbYCBWBZguE8voB+JHLiQAc6lH7W4VHu9IdwDW+lgKot9sJ+PmREikRFcUm9IWe2YwjmoaJD9am12AGMMwjWHkkLb6X0K4Ahnd33IqCrS/FWfz4wXhCPpmSeXQJBaAzc7KfUTYneUQ==; 31:4yrc06qqb0b0CQVgomqT8qis/eDD/ZEPcTrzki4eoL2A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am-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:AM6PR05MB4183; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4183; X-Forefront-PRVS: 0750463DC9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(136003)(39860400002)(396003)(346002)(376002)(52314003)(199004)(189003)(956004)(47776003)(16526019)(86362001)(478600001)(97736004)(6636002)(6666003)(5660300001)(14444005)(486006)(16586007)(51416003)(36756003)(186003)(476003)(2616005)(6486002)(386003)(2351001)(8936002)(53936002)(81166006)(105586002)(26005)(305945005)(25786009)(106356001)(6862004)(58126008)(66066001)(68736007)(48376002)(6496006)(50466002)(37006003)(3846002)(52116002)(81156014)(6116002)(2906002)(8676002)(7736002)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4183; H:t540p; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM6PR05MB4183; 23:Y2eyvcfq/PrRyxhY9g9tnVFnQGBhMev2exVm0MEcs?= pdzUVGyPqwfsdzk9HWyKIjhWSmNcRN2rmzxJiBtcRQgFzeLqqWfFUB1AQyWBlmGfRAKRscMVdRHfjNZ+XB6ggmuES3gIOas9wlQwjtvWvaTjIgW2cyQH6IHm0gWD8LjCV58Ry+Mi717jncnUIG0Sk0gAJYfUd55UB7xsZWaFGIpmoGt84cT119DTJ5iqbDqMF9nYVJXOe0/02ACoeXzs2jff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ROh6D+/MGd8xbLRCq6xCbgnXywGA1iG5kU28GJjbdBkDbqh5hXK6Ou9q9cIPUS7rmYz4ELSt/wnf3wcw23f1EHC0i2I22S7Eq2mpO9Yo3Boa6oLBXwt85670spDjTxIj29Nk7Sta4YbZqZNHoaa SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2018 10:34:47.3003 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a083c1fe-3779-42bc-3f99-08d5f6d13d33 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4183 X-BeenThere: linux-mlxsw@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: mlxsw driver development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-mlxsw-bounces+patchwork-linux-mlxsw=patchwork.kernel.org@lists.ozlabs.org X-Virus-Scanned: ClamAV using ClamSMTP Due to an issue in Spectrum chips, when unicast traffic shares TC with BUM traffic, and there is a congestion, the BUM traffic is not dropped as it should. In order to give unicast traffic precedence over BUM traffic, configure multicast-aware mode on all ports. ** Note ** I pieced the above from memory, guesswork and Onyx release notes. I need to pass it by Matty, but for review of the code here, I think it's good enough. Under multicast-aware regime, when assigning traffic class to a packet, the switch doesn't merely take the value prescribed by the QTCT register. For BUM traffic, it instead assigns that value plus 8. That limits the number of available TCs, but since mlxsw currently only uses the lower eight anyway, it is no real loss. The two TCs (UC and MC one) are then mapped to the same subgroup and strictly prioritized so that UC traffic is preferred in case of congestion. In patch #1, introduce a new register, QTCTM, which enables the multicast-aware mode. In patch #2, fix a typo in related code. In patch #3, set up TCs and QTCTM to enable multicast-aware mode. Petr Machata (3): mlxsw: reg: Add QoS Switch Traffic Class Table is Multicast-Aware Register mlxsw: spectrum: Fix a typo mlxsw: spectrum: Configure MC-aware mode on mlxsw ports drivers/net/ethernet/mellanox/mlxsw/reg.h | 37 ++++++++++++++++++++++++++ drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 26 +++++++++++++++++- 2 files changed, 62 insertions(+), 1 deletion(-)