From patchwork Tue Jul 24 21:05:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 10543205 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 4796D184F for ; Tue, 24 Jul 2018 21:08:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35FB4294BF for ; Tue, 24 Jul 2018 21:08:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A1EF294CD; Tue, 24 Jul 2018 21:08:41 +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 4826E294BF for ; Tue, 24 Jul 2018 21:08:40 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41ZrYy4VWDzDsFQ for ; Wed, 25 Jul 2018 07:08:38 +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="mDBTQErH"; 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.6.78; helo=eur04-db3-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="mDBTQErH"; dkim-atps=neutral Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60078.outbound.protection.outlook.com [40.107.6.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41ZrVr4NpMzDrM8 for ; Wed, 25 Jul 2018 07:05:56 +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=dcXSrS8J9ZckL2tOiCosc4WSKYYDRgjZlxRzWcYqS9A=; b=mDBTQErHRyyqpEq4u2tnznmi564TwWby/zCA2uaZ/rjzeXw98E8eVoEiBhgwD2DQcPYWbee7U/ai/3rTqlos5TSzKxGUwcQgmSbkowHYMstDpf9v3qvkXAlClrndN7thj01E7wrWC9NwZwg5jBDdwrC3gtMTkZkzQyKrTurB3qM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; Received: from t540p (78.45.160.211) by VI1PR05MB4191.eurprd05.prod.outlook.com (2603:10a6:803:4e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Tue, 24 Jul 2018 21:05:49 +0000 From: Petr Machata To: Subject: [PATCH net-next mlxsw 2/8] net: dcb: Add priority-to-DSCP map getters In-Reply-To: References: Message-Id: <48dd521a44e5025415795996a9bff4b090de1f0a.1532465553.git.petrm@mellanox.com> Date: Tue, 24 Jul 2018 23:05:45 +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: VI1PR0202CA0019.eurprd02.prod.outlook.com (2603:10a6:803:14::32) To VI1PR05MB4191.eurprd05.prod.outlook.com (2603:10a6:803:4e::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cbc01a15-e66f-4de0-d433-08d5f1a93b6a X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4618075)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB4191; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4191; 3:ks4gp8CPbh+gr6yIlgqQiXf65XJ/RXHFfykaXA3k3HXZv3F6p6XAyDAF7/E+A8OnDLmA307JZICUdz1nE9yXP5PRS1iVjRtd8Ore1w/cUyUcvwhwsG3ZJxcYbEycVxFPkoExHFI/S2BnUxF71eH57kQeU4IurBJ/n637akfqDE7eY4iHC1Kyl3ItjeXdraO/6IKHOjY7ZIQcY44f9ge+uawK3PTId98uXZiwRJ5Eb7V71KWf5inEBz4pBOYFoIeg; 25:KeAAAZnkhSb62E3m4tYXChTjnmYZgTy4ARKzXsgzqGexuGiShq7gRDlGMBUMk3J8jkocAAgY2+ln9KfssyT5YeFMJ5vwodL4LpgpU5OjPBB8REEMn+T6f2HtriTQ4iX4qfguzaSdMMLFy7ihgSOD5JgXg8br0gzVUQeRTOmpYctrl7BU80rKmivjewBLTPddYAIbP9QUlbLVpegA7S0CnQP4gK613YVYa2FG9gqO5Q4t/C7UQXKX3QC7ibi8GLQbaRUEPbghl0G7VYMe8ogRxIhuABmdtCdYobIOH3mV6BXTbsfD5rJE6NFbTubcO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FhHsYg6MoGr3IKqx31GqSuZjHnEu/Hi9NKBnKx4nGXzeF/1F1/wfy5Ag== 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)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:VI1PR05MB4191; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB4191; X-Forefront-PRVS: 0743E8D0A6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(136003)(366004)(39860400002)(396003)(376002)(346002)(189003)(199004)(66066001)(53936002)(3846002)(8936002)(81156014)(81166006)(7736002)(476003)(2616005)(118296001)(11346002)(956004)(486006)(446003)(47776003)(6116002)(8676002)(6862004)(2906002)(6496006)(48376002)(50466002)(14444005)(97736004)(186003)(16526019)(25786009)(6666003)(305945005)(6486002)(16586007)(478600001)(58126008)(37006003)(316002)(5660300001)(6636002)(86362001)(575784001)(386003)(106356001)(105586002)(52116002)(76176011)(51416003)(26005)(36756003)(2351001)(68736007); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4191; 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; VI1PR05MB4191; 23:v8tHW7NBrxe1E9F+vfa6ZxDMW1lUP5FC5A7LN7Wor?= Mri8O3M2EcJcFHBn7DfkHKyiI8izQwUi9qq3gWq29FbCC4L9Sz7egYeOHjE7ZxYRuwopVnukMJRgKx1RvLJhgwW7rnXNbhj50FW8h8Q+TMkcRTDzZDO0HrR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RuIBtY4NSX9kuR8rA9c3g= X-Microsoft-Antispam-Message-Info: w9d98MLVwClZMLyK6dgFl1BHIq8Zto68srTGfCX9Ns/hCRfGTEZWCajV23VwKKgV94WmD319drFQXBfxos31BZIy8MBUTuv5CddrcFfxAZCN7kCFS9NX7Vz+hlEdUCSYShkH5VAw7KuE6ni2uQ3jnYxd/y9kjaneU47ovf4fgg/5oA2Xu3iBtDFCkp9rBwEYYSNl1qbMokpIhGpbZY9+ym7FRe17bi84lioExexKUnBRMod0dANk3b4CtB1QXuWU2+l+DgWz4t6f+HHmPaCUveIDUtIm3UcbwZjF8vHctKUOeq+ha2XU/UTMKJfAkuN3XuoswJyOcgnD1uoKEfTPVgblKXenC7j90oeuRn0Hx7k= X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4191; 6:53L+J9A2086v3YRnBSjZiBh17jjhyGqmc5Yyi9DPd4Dnzvdu0o1w5abj+mxojSmxv4+mQpWICaIGSwgUBUt45nfCTpxrwKsBotzLVoYAxI3MscsN9oRfTBYwWaOg0znHE2BVhRVi8n/53yw6YH4HR1ODWcNQdHZFoDBS2qA2rKOB0bGvAvv3pypoSX9DEnNWhhRUScoKHwNXLCothD3YWPLT0HWzdMaQz7kKvOFrdeC8qsi0R8Ik2naYn3be44IJ3Kt7LdNA4hwcMANozk6H9HGn1iONCB3N10nZDZN97Poc8G2NC8pq7S0RPJhuQhljq8RHKegIkL6uxTdeAp/9E4rv9VZiER4oKbLttWlpZQ2+ZZDKOfy7xRvvicvGGiTKacsgFW4wfmjBfaz/a1brheyeRivnBWRPrne6TNfCsYJv2M16l4aJ5BvdzvEXoARshtaM/vsULL0eJIs5VbO/1A==; 5:LGqqVNAh3jyLBGWfqp2F+mqsUZYd7DP1U2hJmwB02C6sDesKbcrEH7h8SMnv+HNrSQXXgzM+0479evQvgrEF9Y7WudvecdFr8miJMmLsx2UZPvjtw1NtV98RZF726DeaKzvzbqn603NPHMdycIzawg7F2lDNizo8b4oV5i1r/Sk=; 7:AgZH6bYjrlhhk5eD/wsuNQnkR1ErtQkCKfDAEqbfRyfMdm0z9RRPNpjEVGrKK1OODdaAqEc4dhMtn9WJinf+psATAvPMJtT+7o5/ftvdE5ut4jshEY51A8nMNUTQdNUJM0VPeGOsLNERJhX06A394wIXa6O+alpLoJwmIjNawt8+ezP46gtZcMFQTPJiySnGbKnOJ7e95K2Rfbi9AT+6Hv49/DN8Pqc8qUhm9SKzi9bauEdzHlWl0m301hg72D7Q SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2018 21:05:49.0792 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cbc01a15-e66f-4de0-d433-08d5f1a93b6a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4191 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 --- include/net/dcbnl.h | 13 ++++++++ net/dcb/dcbnl.c | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h index 0e5e91be2d30..ea4055c59b3a 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[8]; +}; +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..6e78a0dab323 100644 --- a/net/dcb/dcbnl.c +++ b/net/dcb/dcbnl.c @@ -1958,6 +1958,91 @@ 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->app.selector == IEEE_8021QAZ_APP_SEL_DSCP && + itr->app.protocol < 64 && + itr->app.priority < ARRAY_SIZE(p_map->map) && + itr->ifindex == ifindex) { + 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->app.selector == IEEE_8021QAZ_APP_SEL_DSCP && + itr->app.priority < 8 && + itr->app.protocol < ARRAY_SIZE(p_map->map) && + itr->ifindex == ifindex) + 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->app.selector == IEEE_8021QAZ_APP_SEL_ETHERTYPE && + itr->app.protocol == 0 && + itr->ifindex == ifindex) + 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);