From patchwork Wed Jul 25 13:53:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 10544039 X-Patchwork-Delegate: idosch@idosch.org 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 1E27F112B for ; Wed, 25 Jul 2018 13:53:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A95E2A020 for ; Wed, 25 Jul 2018 13:53:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F28112A03E; Wed, 25 Jul 2018 13:53:46 +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 167982A020 for ; Wed, 25 Jul 2018 13:53:46 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41bGsg2GlrzDrdc for ; Wed, 25 Jul 2018 23:53:43 +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="pnnx+AFU"; 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.0.57; helo=eur02-am5-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="pnnx+AFU"; dkim-atps=neutral Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00057.outbound.protection.outlook.com [40.107.0.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41bGsV0VQ0zDrHF for ; Wed, 25 Jul 2018 23:53:33 +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=hFlQrVNEINcGYiZhYEg+ufx3saB2kXrVIgaEYXEaPm0=; b=pnnx+AFUgswzScBIYhlHrBF1oWt88s3RHWV8Yn/Wf/hhMWYHH3SUyYkT94hcht1ukIiFXCt8u50/MXrgFXQMBUFeKY9wCY8YBv1WXLw3FC4+xdGldKQOq1+3va+kaZrykHOyxsQYv2Gb+8FJTSwUSCmSQ1pWHRpvE0ciJfQCM8E= Received: from t540p (78.45.160.211) by AM0PR05MB4180.eurprd05.prod.outlook.com (2603:10a6:208:57::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.16; Wed, 25 Jul 2018 13:53:28 +0000 From: Petr Machata To: Subject: [PATCH net-next mlxsw v2 2/8] net: dcb: Add priority-to-DSCP map getters In-Reply-To: References: Message-Id: Date: Wed, 25 Jul 2018 15:53:23 +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: AM0PR01CA0010.eurprd01.prod.exchangelabs.com (2603:10a6:208:69::23) To AM0PR05MB4180.eurprd05.prod.outlook.com (2603:10a6:208:57::29) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5907e4a5-4d51-4326-b9ab-08d5f2360022 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600073)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR05MB4180; X-Microsoft-Exchange-Diagnostics: 1; AM0PR05MB4180; 3:Gm4GaqOhToK9dLTYRX4/zVmTY7CIrFaFXVkOa6zDzjpqDhtxL8wtcf989UyZT9UrZyCZ0bHQ3IpTDLV6SV3wVsce7A9e9DjvbwdjU4/CtEx3M7fz/aWLQJVZuisJJr3Mrp663uyrkNT7FPuvBFydp9JeoLis6so6afAnY6FuNAdo22ac49mZeAopb1RMi4eRUxs0GP3yeo6wx34kQ4EUme9idIhkNycP0rzO/02TFfkvlh337vkWZq2A79io1Lic; 25:Cn4q872DUGRhFUjLQMn4BBml6yEPQxAP7KOL8d6UGFn1+MZ4jYnj5/Tp+mZjvtZQb8W88Z64PwEWKfypWdZaetd2IaHFmLDkIqfVG/HoOb11BbxlAD1ywRHmYi+7WUrlJMEAAjDVFvmys9DOHasUvHNyJ0xnRMCnQtP5QayME0poI/GEqOrE4ljZALSf2gdFTO7gNoOkrxXSY2A4RGf1Ck3JHgScwqgRSiDjJ6J60f5RJYgfRH4yoSf+BkfP+hrF5qeAE+wG57V8cYwdn2UOzEF12NnNWk/YkKruApoOdhnDs41znfXJXz1Qlxf7uVUbgO097fTFbJHOOEITtHQLTw==; 31:Q1ralZSyVdHoqqXG6fLRQAsFHpRq9czxRr8K9WFXICVqFliYRsq7tCPFqRnLP6J93Dzrgy1G4wRdTVzlcIwqCwgsGtSmqDos/0TdpPqzMPeISGqZGS6eFNCKsrstTntOXeyfUZDXOb8krksAb4BkK0DorthWqWMZgDnKui1XYdRNY8PGeNxCZnT9gwRLKjzXp6PwwO4PXG2XheyKXCoCSlHaONOTWNcaWt828wUc8Qk= X-MS-TrafficTypeDiagnostic: AM0PR05MB4180: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; X-Microsoft-Exchange-Diagnostics: 1; AM0PR05MB4180; 20:SRwMSnewtE/yml6E3DH8Lpxqt3M+SG1+5vz0t3nSYC1cR9XXcvr+iua1IRhSTvLqPfYq0efYbm+un130TQaSX8ylPQBVYBmyPHZLrwWc59eIVHpkyrbd0xWPTcs50ZMf4jUSCcHOHlUwf07ZNvNF/41PFBlomdmIQ3KLhCPLtTeFpkhwFOjAaiCJuV55mD4td9LZgQhFvID+eTRSsnK4XLmq+hJWRJD6bnDCdAjd/6TE3BZZPxxPVjGrOC5IHWKKASxaN6sxPPIvGb80ADot9wmhfkAVNmddP+wbfK5uzaK/Djcmkw79w2h5fRQbU+iVN/wKqrF7p64eB82vG2aBAWO+HofYsog36VIcvDCAzTiUyvGIy0JVBXfi4qs/cx1/S4Xb3u2Y0eoVYlieL91ZmUm1hmMjnpl6tMyv4zsxzxMKySQEhj0/ZvCrzQmMYiyE25IRVBmT3RgxjQfOndh8J9lV5Ty3lq8I6lk+y/5byZG+9tFczQC+KY+SVMeiGFam; 4:/XBSmyQGFpGA6L+98v6x2doY4CnjBVtC2PV3jierR5T3UGgHvEEBSR/IYnWxgtODrXyMOsXQTaQFJIGKg8xIByavP1NZ/G+LqLGliuryQV6i/fxgO0XBmS0GMvXJLCSbxBX7J6Yn8BdyeeNSOmKOCcfQPk/L3Mx+SHo1LITceQTct0mvguSFQdFN3q1BYZAu8WrpbbQYXTxo43KwUWm6x/j1Uh6ptjjI128BMCFKTJcdGyQqn8AeHLrRZowX90Xi5RkVqmaHHzX8HfaW0mOAog== 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)(8121501046)(5005006)(3002001)(3231311)(944501410)(52105095)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:AM0PR05MB4180; BCL:0; PCL:0; RULEID:; SRVR:AM0PR05MB4180; X-Forefront-PRVS: 0744CFB5E8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(376002)(346002)(396003)(136003)(189003)(199004)(478600001)(6666003)(14444005)(76176011)(86362001)(68736007)(81166006)(81156014)(16526019)(956004)(51416003)(52116002)(476003)(2616005)(186003)(26005)(11346002)(25786009)(48376002)(386003)(47776003)(50466002)(53936002)(8676002)(446003)(6862004)(6496006)(6636002)(6116002)(36756003)(105586002)(6486002)(2351001)(118296001)(106356001)(97736004)(486006)(7736002)(66066001)(2906002)(8936002)(5660300001)(37006003)(16586007)(316002)(305945005)(3846002)(58126008); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR05MB4180; H:t540p; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR05MB4180; 23:0rqn3F3vW9pcfpy9c3OI6oDtTrnefG/KlNqYkQqb7?= tgjwGhAxJyNXFtDepqImH9sOyDUrJtnzTUM+5nIuTbLTZm58K2Fgq70zgUf8E4+rR5rNihgq00YXJuklGZaMklvjFyYdAgKegMn8n6Ukfi9h1eCg6QzULrlSbG6bZT1iPh5rSywY0PZO+iPE/fagJ6ZB0LMgviO8RQn3+0kp6IwaTx5Gytx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bu7ToZfBjR7zF5jynZ75yGQ0svV1WAT+yIXCsvnAFHuAVOPkwNX+MhPpPEquQxl0TlQvj0jcc5jSYQeBy7E3/cDoXXYgwe7IKvT7qDlVhiiHlvbXj6rO69fxiXrb69W+A3bPb62dMVQoUupG72H5Hk93ZKUHaG0Wox0X709g3uXSLwkYqvfa/SmDIM6Bsgm0NfVC43N2cjDdBeRIGY7KPt SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2018 13:53:28.4568 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5907e4a5-4d51-4326-b9ab-08d5f2360022 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4180 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 On ingress, a network device such as a switch assigns to packets priority based on various criteria. Common options include interpreting PCP and DSCP fields according to user configuration. When a packet egresses the switch, a reverse process may rewrite PCP and/or DSCP values according to packet priority. The following three functions support a) obtaining a DSCP-to-priority map or vice versa, and b) finding default-priority entries in APP database. The DCB subsystem supports for APP entries a very generous M:N mapping between priorities and protocol identifiers. Understandably, several (say) DSCP values can map to the same priority. But this asymmetry holds the other way around as well--one priority can map to several DSCP values. For this reason, the following functions operate in terms of bitmaps, with ones in positions that match some APP entry. - dcb_ieee_getapp_dscp_prio_mask_map() to compute for a given netdevice a map of DSCP-to-priority-mask, which gives for each DSCP value a bitmap of priorities related to that DSCP value by APP, along the lines of dcb_ieee_getapp_mask(). - dcb_ieee_getapp_prio_dscp_mask_map() similarly to compute for a given netdevice a map from priorities to a bitmap of DSCPs. - dcb_ieee_getapp_default_prio_mask() which finds all default-priority rules for a given port in APP database, and returns a mask of priorities allowed by these default-priority rules. Signed-off-by: Petr Machata --- Notes: Changes from v1 to v2 - Use IEEE_8021QAZ_MAX_TCS instead of literal 8. - Check values of ifindex, selector, protocol, priority consistently in all helpers, and in this order. include/net/dcbnl.h | 13 ++++++++ net/dcb/dcbnl.c | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h index 0e5e91be2d30..e22a8a3c089b 100644 --- a/include/net/dcbnl.h +++ b/include/net/dcbnl.h @@ -34,6 +34,19 @@ int dcb_ieee_setapp(struct net_device *, struct dcb_app *); int dcb_ieee_delapp(struct net_device *, struct dcb_app *); u8 dcb_ieee_getapp_mask(struct net_device *, struct dcb_app *); +struct dcb_ieee_app_prio_map { + u64 map[IEEE_8021QAZ_MAX_TCS]; +}; +void dcb_ieee_getapp_prio_dscp_mask_map(const struct net_device *dev, + struct dcb_ieee_app_prio_map *p_map); + +struct dcb_ieee_app_dscp_map { + u8 map[64]; +}; +void dcb_ieee_getapp_dscp_prio_mask_map(const struct net_device *dev, + struct dcb_ieee_app_dscp_map *p_map); +u8 dcb_ieee_getapp_default_prio_mask(const struct net_device *dev); + int dcbnl_ieee_notify(struct net_device *dev, int event, int cmd, u32 seq, u32 pid); int dcbnl_cee_notify(struct net_device *dev, int event, int cmd, diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c index 013fdb6fa07a..a556cd708885 100644 --- a/net/dcb/dcbnl.c +++ b/net/dcb/dcbnl.c @@ -1958,6 +1958,92 @@ int dcb_ieee_delapp(struct net_device *dev, struct dcb_app *del) } EXPORT_SYMBOL(dcb_ieee_delapp); +/** + * dcb_ieee_getapp_prio_dscp_mask_map - For a given device, find mapping from + * priorities to the DSCP values assigned to that priority. Initialize p_map + * such that each map element holds a bit mask of DSCP values configured for + * that priority by APP entries. + */ +void dcb_ieee_getapp_prio_dscp_mask_map(const struct net_device *dev, + struct dcb_ieee_app_prio_map *p_map) +{ + int ifindex = dev->ifindex; + struct dcb_app_type *itr; + u8 prio; + + memset(p_map->map, 0, sizeof(p_map->map)); + + spin_lock_bh(&dcb_lock); + list_for_each_entry(itr, &dcb_app_list, list) { + if (itr->ifindex == ifindex && + itr->app.selector == IEEE_8021QAZ_APP_SEL_DSCP && + itr->app.protocol < 64 && + itr->app.priority < IEEE_8021QAZ_MAX_TCS) { + prio = itr->app.priority; + p_map->map[prio] |= 1ULL << itr->app.protocol; + } + } + spin_unlock_bh(&dcb_lock); +} +EXPORT_SYMBOL(dcb_ieee_getapp_prio_dscp_mask_map); + +/** + * dcb_ieee_getapp_dscp_prio_mask_map - For a given device, find mapping from + * DSCP values to the priorities assigned to that DSCP value. Initialize p_map + * such that each map element holds a bit mask of priorities configured for a + * given DSCP value by APP entries. + */ +void +dcb_ieee_getapp_dscp_prio_mask_map(const struct net_device *dev, + struct dcb_ieee_app_dscp_map *p_map) +{ + int ifindex = dev->ifindex; + struct dcb_app_type *itr; + + memset(p_map->map, 0, sizeof(p_map->map)); + + spin_lock_bh(&dcb_lock); + list_for_each_entry(itr, &dcb_app_list, list) { + if (itr->ifindex == ifindex && + itr->app.selector == IEEE_8021QAZ_APP_SEL_DSCP && + itr->app.protocol < 64 && + itr->app.priority < IEEE_8021QAZ_MAX_TCS) + p_map->map[itr->app.protocol] |= 1 << itr->app.priority; + } + spin_unlock_bh(&dcb_lock); +} +EXPORT_SYMBOL(dcb_ieee_getapp_dscp_prio_mask_map); + +/** + * Per 802.1Q-2014, the selector value of 1 is used for matching on Ethernet + * type, with valid PID values >= 1536. A special meaning is then assigned to + * protocol value of 0: "default priority. For use when priority is not + * otherwise specified". + * + * dcb_ieee_getapp_default_prio_mask - For a given device, find all APP entries + * of the form {$PRIO, ETHERTYPE, 0} and construct a bit mask of all default + * priorities set by these entries. + */ +u8 dcb_ieee_getapp_default_prio_mask(const struct net_device *dev) +{ + int ifindex = dev->ifindex; + struct dcb_app_type *itr; + u8 mask = 0; + + spin_lock_bh(&dcb_lock); + list_for_each_entry(itr, &dcb_app_list, list) { + if (itr->ifindex == ifindex && + itr->app.selector == IEEE_8021QAZ_APP_SEL_ETHERTYPE && + itr->app.protocol == 0 && + itr->app.priority < IEEE_8021QAZ_MAX_TCS) + mask |= 1 << itr->app.priority; + } + spin_unlock_bh(&dcb_lock); + + return mask; +} +EXPORT_SYMBOL(dcb_ieee_getapp_default_prio_mask); + static int __init dcbnl_init(void) { INIT_LIST_HEAD(&dcb_app_list);