From patchwork Wed Aug 1 14:29:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 10552395 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 3B88913BB for ; Wed, 1 Aug 2018 14:30:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B3352B725 for ; Wed, 1 Aug 2018 14:30:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 299F92B720; Wed, 1 Aug 2018 14:30:12 +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 4B7BD2B741 for ; Wed, 1 Aug 2018 14:30:11 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41gbLS68G4zF18f for ; Thu, 2 Aug 2018 00:30:08 +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="ooKDE+c0"; 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=2a01:111:f400:fe0a::609; helo=eur03-db5-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="ooKDE+c0"; dkim-atps=neutral Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-db5eur03on0609.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0a::609]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41gbLH0xJ3zF10S for ; Thu, 2 Aug 2018 00:29:58 +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=YhCBCupTtR5vpeDdSXp/T4F+4LFBKtF0VbrtvVlBy7Y=; b=ooKDE+c0cxEKvCs3EG/T5q4jH3kO6V9N8Y6yC6fqAB0eyKoS77vuX6ciPlhkpZPkgpNOoD9N7qYK03ylq+ltqWlp3HoN2cWqF4ZikArB3bEnFKZm0HVrKfO7Jy59BD1sL3aTvYRIY2a9LRCg5wRTmVmHLqDnZLR5oV7SBeY+/i0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; Received: from t540p (78.45.160.211) by AM6PR05MB4181.eurprd05.prod.outlook.com (2603:10a6:209:40::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.14; Wed, 1 Aug 2018 14:29:50 +0000 From: Petr Machata To: Subject: [PATCH net-next mlxsw v2 0/3] mlxsw: Enable MC-aware mode for mlxsw ports Message-Id: Date: Wed, 01 Aug 2018 16:29:43 +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: LO2P265CA0100.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:c::16) To AM6PR05MB4181.eurprd05.prod.outlook.com (2603:10a6:209:40::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 99dad551-923e-4e9c-f4dc-08d5f7bb3d90 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR05MB4181; X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4181; 3:3NIkX636St7lvu92Api8ZA5o+eEMbAssUplSeBTllZsaE6OLlRQmgXHtEo/42v3u9uf55HDW7MDNonn6BXAaXfqB2DUadrBkgY/cOmXqq1kHjOVePsoAJ2UBoQ/8XN5C9DKbaeB/YvcjtjsFzjIlgj2IWstwu1kjOyQgsyTT+/QrlyWu71Udrp0CqK95HKO8T8QkKPigue3IEzgTXDWOLTsrABTGIuPb7Yil2Vh0FHOCxPypodzrIIajq400NYJG; 25:NZZgc7Xuv6u3Vg9zUg3c7MYQ5s7sXn9Rzidm71+1oPU+1RaZ+SZj4UPIcxkcbnB+Ti9JfXE8RQREio98XGvBWFjIx4+7Gu6OOPxPRAicgDhpzP3c3aAZIlrr2CBhDj4qCbqojygPKiQTOky3oRmYmlhNe9eqxqbn2q94RzxBSJni5cl+rbqmhD0dz3xj2FNIIX45pg21mgoiCD6Ir9ZpF/3tI5rNT49vNtTDSh4wZpt6hjEArma0eq+FxGyV5MXvzNuq8oOZwxa4PwrMc1U29Zb9bBh8oyLgG7WzeDVnb0AUf2hCYdN2xJrzeSwZUjcmFCO94iwG7MfYC7XnQBwtzg==; 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watvwXChBEufgpzxJxziH8Cr01jOc/LQ== X-Microsoft-Antispam-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)(3231311)(944501410)(52105095)(10201501046)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:AM6PR05MB4181; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4181; X-Forefront-PRVS: 0751474A44 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(346002)(39850400004)(396003)(136003)(376002)(199004)(189003)(52314003)(16526019)(316002)(186003)(386003)(97736004)(53936002)(37006003)(16586007)(52116002)(51416003)(68736007)(81156014)(8936002)(81166006)(86362001)(105586002)(106356001)(26005)(7736002)(58126008)(305945005)(2351001)(8676002)(25786009)(6636002)(6666003)(6486002)(486006)(66066001)(14444005)(36756003)(2906002)(6496006)(476003)(2616005)(956004)(47776003)(50466002)(6116002)(5660300001)(478600001)(6862004)(3846002)(48376002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4181; 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; AM6PR05MB4181; 23:zW0QtZPi/1VjJ5fHTraGVNulsx/HvJlXsrvcEXVay?= BqtOMhgrMUGvlotyPmkntWiZIHmFNEXSraVEcN28JnLz77sBMQ3GXXxeUjcza+gAKAtPzjSeSZeVzOfP4zQHIUOtLoCRXJomz9Gw01lqK06VVcxobKh+D4SbSqhFarzVdJNyN+F0YBRX5TDNEFqTrW1LIFZDul58h+KUEACXN9SxzGtcdLHQy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wv3AIIosSxRqQkDzRlzbNlQ8QkQsWBL/dVzvP7xNuFlzguv2r3SvpJOFID/FHWU+VOPVW16+Vh/YMUeXID7WC71KLnmBdeaUnxZ/jUaUY6NfGmPuHrfTdf+o13dOm SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2018 14:29:50.2635 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 99dad551-923e-4e9c-f4dc-08d5f7bb3d90 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4181 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 the same queue as BUM traffic, and there is a congestion, the BUM traffic is admitted to the queue anyway, thus pushing out all UC traffic. In order to give unicast traffic precedence over BUM traffic, configure multicast-aware mode on all ports. 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. Changes from v1 to v2: - In patch #3, disable MC mode again on error path of mlxsw_sp_port_create() and in mlxsw_sp_port_remove(). 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 | 29 +++++++++++++++++++- 2 files changed, 65 insertions(+), 1 deletion(-)