From patchwork Thu Jan 21 20:40:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 12037649 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AA9DC433E6 for ; Thu, 21 Jan 2021 20:41:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 38542239D1 for ; Thu, 21 Jan 2021 20:41:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727340AbhAUUlj (ORCPT ); Thu, 21 Jan 2021 15:41:39 -0500 Received: from mail-eopbgr80094.outbound.protection.outlook.com ([40.107.8.94]:39028 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726609AbhAUUlg (ORCPT ); Thu, 21 Jan 2021 15:41:36 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z2olWdshACjiz6+goxYeNDGFlXD+kT5dpJm9RLKpy2T1VyNLwJciGomxDswM2qqfiZ4uecPNPUYgUzP7Ldyiq/EW3nO0g83qvvxX109F24iX3hbQX+gwG1TGM3K0kouusRKcIMHPMaIYxO6lZR8ooqHafB1raPTXmMqq79rBKVhGCBB0IOqgYoCZZqu0D4WyXCWdRjLUJVZSWPYAjw/vqhSAdhF2WnJwnDpUji+ADgN2PnX9UeLogW9bCld1gP3AAX2xPOaCc4k7Z6I3MkkS5STlWbgg72XWgxy43vnaGBuR6vtBmhVm8lxaq+dvoLLp8EUv96yG7VF9kugeX43Dpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aFZ0HHuleuUIgP28zu2sJ1XgRIpq7ow4D856zIIdynM=; b=FgISAlSZW1gRtZFKx5yMtnsN9kZIPaG/JnmDQk8i2nFp91z9HmbTm9y0kKIuj7zVL+c1hfvJxEkomxpIp4XrSyjtb/IEOGmsf4zI7FqBvoRRpc3FGYY6j6hTyoF+hmWSTFsZ4w13HXwbS6MHwEr5FYQcA8WsB6XavgZ/JUD67ndWgoz1utpyl9nd17KJwd6EOCM64n70CxkGCspE9WwazbMT5u4r4/YnMXWTRlIzWVupUgtYIwBRCKX/VuJVjHE6OPDly/H1lAap4K11M+LCJY1oegc6GI3QNPhgy3DCKDKg0UCrOfqXZx23oHTKvqaWoMXRnkvbkPL/rD8fgEENTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aFZ0HHuleuUIgP28zu2sJ1XgRIpq7ow4D856zIIdynM=; b=D6/NNOPOqPMDzlLFyyYO4yrXpMmuHq9vR3c7c7duztgEUXcjr7lGvlIYoqRGP0HSN6iU3dWzwZ8kMXMAQtn6YWgMRF1WgIuk9GuLG2N9cNCaI9MklsgkEl1dML0lkmFD6yO0Fmn12Tjr/4B8RSC705jFI1y86LxgUcinP/ZZiXo= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=prevas.dk; Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) by AM0PR10MB3011.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:15e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.12; Thu, 21 Jan 2021 20:40:48 +0000 Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3]) by AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3%6]) with mapi id 15.20.3763.014; Thu, 21 Jan 2021 20:40:48 +0000 From: Rasmus Villemoes To: netdev@vger.kernel.org Cc: Horatiu Vultur , Andrew Lunn , Jakub Kicinski , "David S . Miller" , linux-kernel@vger.kernel.org, Rasmus Villemoes Subject: [PATCH net v2 1/2] net: mrp: fix definitions of MRP test packets Date: Thu, 21 Jan 2021 21:40:36 +0100 Message-Id: <20210121204037.61390-2-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20210121204037.61390-1-rasmus.villemoes@prevas.dk> References: <20210121204037.61390-1-rasmus.villemoes@prevas.dk> X-Originating-IP: [5.186.115.188] X-ClientProxiedBy: AM6P195CA0047.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:87::24) To AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from prevas-ravi.prevas.se (5.186.115.188) by AM6P195CA0047.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:87::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.11 via Frontend Transport; Thu, 21 Jan 2021 20:40:47 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f336f4d3-3d3b-4efa-18e0-08d8be4cd548 X-MS-TrafficTypeDiagnostic: AM0PR10MB3011: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LQDbmyu3weGnyXkMq8RtzaaDM2SnCAaBzscHDyl6BIy+OpC6WP1Mg/6m4AjsWc867VHPXp1jg03aTGGwKSuc9rRyXCI66tN+746uJYdMXkn30go3xi0gepJ/t7XdFdhOog4SmwWIUMm2TRC1eQXkKBrMhJP4Px6Z0jQGMLHVNoU9UysQosH/B6atAlidYv+htSygDB/FxBpc71KZc6LeMyBjjA4nziXdbkfyGBWpWdCB6QVVJ0NR1eYh4GdGT5Qg+x9QLndywqDT0iss8BclPE81zC4hsc4tg3bhdyESn7FrfiLY3X3PVF+wxvAfmX9P/3ITLtWrX6nUR0rADW1ZzeAE1UT8VP4U8zp/EDsYb+EkEPClfF3SnQFwRpS7McobjsB+Zlsiwq9jYoMB2a736w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(366004)(376002)(136003)(396003)(39830400003)(346002)(478600001)(2616005)(52116002)(107886003)(6506007)(5660300002)(6486002)(6666004)(44832011)(26005)(1076003)(86362001)(83380400001)(4326008)(186003)(316002)(66556008)(8936002)(6916009)(8676002)(66476007)(956004)(8976002)(6512007)(36756003)(66946007)(16526019)(54906003)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: A9/OdzmOazoJVFXFdmmUw+o9V3OY8jIfAlfmXnuIIU2N8j7+0iPgIrdzWcrhWGNTYAis7SshBWQxknsSMJpWYAjxk+890XoMDsm7RiUQhaq9BP1x7fC0GR0jgQbhmGVQNM+xTbUYZfrwxANouUZ3NGjfRdnMf3Z+scyC8Uw5wrrHE8X/R+OTitZ2yEXq55QdGfC08m4RBCyx5Sv8iX0VeKSgtRH1IISsgeo0Ooocru5tf4arrSDN0xo4pB0YMFQ/R9RqTm5sjoDLqorGlHfdXT/nXaaKl+kprmUlWW2vRRP42v4Jyj0Q0Ha+uo7s8mAGc6x/9PlfSjKdMji6iZjLc9StGPxq7bwsYaPQtFi30EqNcjI80Cx53lIzTgAyG8yNnAsvCn043oXab6bK5d0hohBIhp2QjcjpmBepFqzMw6Sl9x0T4CKTWA4mXxJv/p1lB7204FvSaabRo0QEQpfR7/vQmg00s68DyGD/lgxQrItY9gKlsn7cJQ2jR+bBrKgdqqdtV9VslZM6w/eH1wvsorKG0du/0B9bwS/NBlStusWPlucW7C9a2bMz/vL6Klm3OpuJMAOGoaYKeDgNRos38PO5iNhDHkO7CsVHOkNClEpEOAwccDLcDh6DpmJww1XCO4dMWHJFZmoQs38nudqNZDX0JGJT0QegFwxmfkQ9D/kAxKzBbjrTWq5b86m2sjmpUnAOHVDeAvpKVGdZsP98pEbwIMhXkad4c2IuiFF9i7b768NuL9unHOx4W/qSCZR2po3SGthfEtf5oSXlUTx5kMTinvt+AN5VEBgjAWGbuTe9K8IUXPrU2ouYk7CI/beNUpiP4yDcgt6/YjxJxM+0hZckXNRbUVXl7fS9msNTIQzK+HIlGSqKb6NLVKeOsdBHdrxyWCqL9ev8GYJhn2qGbaMJAJzklsKIzztzsC33Ox2Sesf+dLvSNSeZUOmGLYYC9NHmy6Cz3JUyrPfU5qv/0KEEeXXtCcElxs/b5spMhwx0fp0PbDJRvVYcDEm+Hc9G X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: f336f4d3-3d3b-4efa-18e0-08d8be4cd548 X-MS-Exchange-CrossTenant-AuthSource: AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2021 20:40:48.1117 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TTUB4nXm7w+aZO5i7WfFOa87sAZX0zQCOCvPjBw8IIqC1Jdgx7AnYsD9Op4OyPEYhE7RiCPe+6EWIzlVCF4ky2nndXIIdtT3tC8LXgSQELI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR10MB3011 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Wireshark says that the MRP test packets cannot be decoded - and the reason for that is that there's a two-byte hole filled with garbage between the "transitions" and "timestamp" members. So Wireshark decodes the two garbage bytes and the top two bytes of the timestamp written by the kernel as the timestamp value (which thus fluctuates wildly), and interprets the lower two bytes of the timestamp as a new (type, length) pair, which is of course broken. Even though this makes the timestamp field in the struct unaligned, it actually makes it end up on a 32 bit boundary in the frame as mandated by the standard, since it is preceded by a two byte TLV header. The struct definitions live under include/uapi/, but they are not really part of any kernel<->userspace API/ABI, so fixing the definitions by adding the packed attribute should not cause any compatibility issues. Signed-off-by: Rasmus Villemoes Reviewed-by: Horatiu Vultur --- include/uapi/linux/mrp_bridge.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/mrp_bridge.h b/include/uapi/linux/mrp_bridge.h index 6aeb13ef0b1e..d1d0cf65916d 100644 --- a/include/uapi/linux/mrp_bridge.h +++ b/include/uapi/linux/mrp_bridge.h @@ -96,7 +96,7 @@ struct br_mrp_ring_test_hdr { __be16 state; __be16 transitions; __be32 timestamp; -}; +} __attribute__((__packed__)); struct br_mrp_ring_topo_hdr { __be16 prio; @@ -141,7 +141,7 @@ struct br_mrp_in_test_hdr { __be16 state; __be16 transitions; __be32 timestamp; -}; +} __attribute__((__packed__)); struct br_mrp_in_topo_hdr { __u8 sa[ETH_ALEN]; From patchwork Thu Jan 21 20:40:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 12037651 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8092CC433E0 for ; Thu, 21 Jan 2021 20:42:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4E6C62389F for ; Thu, 21 Jan 2021 20:42:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727075AbhAUUmD (ORCPT ); Thu, 21 Jan 2021 15:42:03 -0500 Received: from mail-eopbgr80094.outbound.protection.outlook.com ([40.107.8.94]:39028 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726840AbhAUUl7 (ORCPT ); Thu, 21 Jan 2021 15:41:59 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lNPu0LF2fIObruj1wVaGS1lk/YASGeKmpcT7CQBoJevwrPTmMW6uTdYxRC6zGoIj1Q0czXwEpeSijKaXa9b6EEeET4ATi8vHuQvFArevJOZCRtZ3Twveg7s6TvGumk5kMxw8QsYxLxBIQkuay5WLXNCzBVW5REz6SU6Hwtk0l9Igl/mmXHvNyyxqYAm1l3f8PmnV35WXMuHnT9597vvdbGMdnM79meDbclZdv/VBBkd1eTaBrMCC6Qq+Fcxc90LXWxtDMc0rZrDhFqdr/2kaTzk1953cm76bkIuruz2WHgnpYF1UJONZCJvevXhydcsRYEimlmPGpArRuDKojW76UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hhgZT6QYTvk92IBF2mM2SkPFSXetXZtfY7F6+o4+8CU=; b=jcEK1fy9bzG9wLrseeGTB1XeprMxQInRNLmAVTHEjV2/Yoyn8My2ZgHV20jNg9odg2R75iYAhweA0alW/MI3elOOMF0m3dAP3WlERAIn/O2AT5cE12u2fjQYhdI8jNqabD/6TGUM68Ao/EKIJbjwraUcgyZlfGRfz+yAjtI7xs+vAXeKRqCEt6jxBQmG/FX5GSvJKmnMLLvsK4+YwBSfDmT+x0TnMAM4ve2Th2pipO6HwrEu1i83/fTFB+BitIxcsd7G+l+FkiH26JGUWNMiVy9SAOrP6Z3XHfAUR0z4HwzKNXgFD0HBCZV7xks89g1faUrCS8swP7WjvyuUJvNpoA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hhgZT6QYTvk92IBF2mM2SkPFSXetXZtfY7F6+o4+8CU=; b=OWyNUCIlVf73SfrHinnti5o79m2XM2T8srFQs9E+ix7rGCqCN5jtlmFwy4NRXqv+AaIxLC1j0yrzQW03+ggwpJ4k8AqQtAalFLLE/pzBZ0RMFFG8A1H/OH+zRS0Ilyxm4EaYSY6ujaDmOO40JuskZjwSiHUnydWVehQfpO097V0= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=prevas.dk; Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) by AM0PR10MB3011.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:15e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.12; Thu, 21 Jan 2021 20:40:49 +0000 Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3]) by AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3%6]) with mapi id 15.20.3763.014; Thu, 21 Jan 2021 20:40:49 +0000 From: Rasmus Villemoes To: netdev@vger.kernel.org Cc: Horatiu Vultur , Andrew Lunn , Jakub Kicinski , "David S . Miller" , linux-kernel@vger.kernel.org, Rasmus Villemoes Subject: [PATCH net v2 2/2] net: mrp: move struct definitions out of uapi Date: Thu, 21 Jan 2021 21:40:37 +0100 Message-Id: <20210121204037.61390-3-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20210121204037.61390-1-rasmus.villemoes@prevas.dk> References: <20210121204037.61390-1-rasmus.villemoes@prevas.dk> X-Originating-IP: [5.186.115.188] X-ClientProxiedBy: AM6P195CA0047.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:87::24) To AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from prevas-ravi.prevas.se (5.186.115.188) by AM6P195CA0047.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:87::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.11 via Frontend Transport; Thu, 21 Jan 2021 20:40:48 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: da5ab660-0a8b-4d79-2b39-08d8be4cd5ba X-MS-TrafficTypeDiagnostic: AM0PR10MB3011: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uVHu0Tw8gzsdusP1DC4zUABs73mwpPcMzd1vRJxGg2VJeg4bsadCLmSNVOV0a4TFMiy1kVYxs7xpa8ubG9p6cM+P386ssGcX+Wdw2Ryvr25nclipk854A0M7VZslo0j52jCFHGotIX4upBF1BRhafSCJPOpC3wv6RyvZuKH8LDVJnFWnJQNP13gSNgWCwEycSQ/SqHE5wUZIiUgvT18W4IzJuch9fOBVN2EIY00QlW4WXyEMt0F37BH/z689KkqL5aem5orPY/NE8EODOiSu5S9S6aJhBYDlnJiKI54lDY+Hr/I5gZfEdtA0lNlH7zW7b4ItVIBhVcEzN/hTlbWstpSifajv5ccr8YO76OaU6lyQPLSXA74DGpIoDeajb50UkMae4PZBL4o9PZv4U/Gt2Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(366004)(376002)(136003)(396003)(39830400003)(346002)(478600001)(2616005)(52116002)(107886003)(6506007)(5660300002)(6486002)(6666004)(44832011)(26005)(1076003)(86362001)(83380400001)(4326008)(186003)(316002)(66556008)(8936002)(6916009)(8676002)(66476007)(956004)(8976002)(6512007)(36756003)(66946007)(16526019)(54906003)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: Nv8vsdlh+zbH//88zanJQ8BEdeGq3+jeEHlsav34DzcNyDXUBcTh0dFt2aSF0ZzdWoNoxhXQSYYW2PfX7MUgMMxX+f9B/Thiq1bo4Ue0FRFImmzPGe8nGDVJd8cqEJHG3ihg50qq05/47gxXUg/Za8+k+arypCdBYsfpeFmuEB0vDa+kTprMl7fZosL0Z9IiMb5hsgqp2TF56gwaA9WiaL4e6onjRg6S5CmbnacxZkIgaqr0xTEL6tkVtaeTU4afbJB9kgTlSUMBXLJ0pnIM3SedzDEcugXcBesaKPcVg67X7BYD10YIkFT3RoTkFVj2jboHEfEso6TobTSy/UD4DMpEXDcq3Vd7PgAilocPpwGw689ri8C7JhN+1+xQ011k7rL28LsGTfthgmOJupDossS2iFVDgVWMhoqMj35/D6Q7aPejRFDvb88hsdcmXUlzehcTQHgIxyZfaynxg0K5kuW4KXuwEVDhpxqAGdz07Pg4r1mLv/B/DWS3Jxq9OopxV1gnAf5pvc2OVsEqQwCT4s4uyNy6sUluGVnGch1c9UW9IWb7+zU+kMWCWxbOyNtVzJL2XWDnLWyl7KbFIxcdG8XUVi+ceG77IUUTYqe26eEzWrpUV0Blbd0qn41VeAoO/1A1sye80cog42VVRjVWOfPeQ7xsRq7+ozadcRMuUK861kIrR43klc1NvSNb+osexFFnbpIQB2hKmVGhatwk824HlM+qm6Sm1GR2iUq5fDYg4VziHHgjayc5GU5nZgG2tTAvNtbLVAOWCGHV+B7kD3CvJUUwdCeUtMBm86JBTzhsmGhgketZq9R9xKtPJOe71r2ww3EqQ81foQ5/LI9VYlSLCj6F2zhf1HvwxNH0XL6/JJuO6NLxsaYrR6FIdlkGtNwfv/jMJZ5+HdHAW5AfS+xCqRTsWr+q+tJQd6MY5v5yzJLZMyAl+1/vZA/KaQRxAsKSLF/p2LY0pDnbxs5zwqfDBis3mQkGJvQaQ1JfyPwENka3A3lBVwvaBHlXGkKX X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: da5ab660-0a8b-4d79-2b39-08d8be4cd5ba X-MS-Exchange-CrossTenant-AuthSource: AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2021 20:40:49.0631 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: NWNlYxK/A9ifOsBguORqyPXJbcuiIR7Voo1FgISYdhi3Cka1XHIQJ/OJ3PY+bNIeCz+Msz83FEeaC8qsARv6sDV8bTHFygZki1wUoUzEf9U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR10MB3011 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org None of these are actually used in the kernel/userspace interface - there's a userspace component of implementing MRP, and userspace will need to construct certain frames to put on the wire, but there's no reason the kernel should provide the relevant definitions in a UAPI header. In fact, most of these structs are unused in the kernel, so only keep the few that are actually referenced in the kernel code, and move them to the br_private_mrp.h header. Signed-off-by: Rasmus Villemoes --- include/uapi/linux/mrp_bridge.h | 86 --------------------------------- net/bridge/br_private_mrp.h | 29 +++++++++++ 2 files changed, 29 insertions(+), 86 deletions(-) diff --git a/include/uapi/linux/mrp_bridge.h b/include/uapi/linux/mrp_bridge.h index d1d0cf65916d..f090acd4f6c4 100644 --- a/include/uapi/linux/mrp_bridge.h +++ b/include/uapi/linux/mrp_bridge.h @@ -70,90 +70,4 @@ enum br_mrp_sub_tlv_header_type { BR_MRP_SUB_TLV_HEADER_TEST_AUTO_MGR = 0x3, }; -struct br_mrp_tlv_hdr { - __u8 type; - __u8 length; -}; - -struct br_mrp_sub_tlv_hdr { - __u8 type; - __u8 length; -}; - -struct br_mrp_end_hdr { - struct br_mrp_tlv_hdr hdr; -}; - -struct br_mrp_common_hdr { - __be16 seq_id; - __u8 domain[MRP_DOMAIN_UUID_LENGTH]; -}; - -struct br_mrp_ring_test_hdr { - __be16 prio; - __u8 sa[ETH_ALEN]; - __be16 port_role; - __be16 state; - __be16 transitions; - __be32 timestamp; -} __attribute__((__packed__)); - -struct br_mrp_ring_topo_hdr { - __be16 prio; - __u8 sa[ETH_ALEN]; - __be16 interval; -}; - -struct br_mrp_ring_link_hdr { - __u8 sa[ETH_ALEN]; - __be16 port_role; - __be16 interval; - __be16 blocked; -}; - -struct br_mrp_sub_opt_hdr { - __u8 type; - __u8 manufacture_data[MRP_MANUFACTURE_DATA_LENGTH]; -}; - -struct br_mrp_test_mgr_nack_hdr { - __be16 prio; - __u8 sa[ETH_ALEN]; - __be16 other_prio; - __u8 other_sa[ETH_ALEN]; -}; - -struct br_mrp_test_prop_hdr { - __be16 prio; - __u8 sa[ETH_ALEN]; - __be16 other_prio; - __u8 other_sa[ETH_ALEN]; -}; - -struct br_mrp_oui_hdr { - __u8 oui[MRP_OUI_LENGTH]; -}; - -struct br_mrp_in_test_hdr { - __be16 id; - __u8 sa[ETH_ALEN]; - __be16 port_role; - __be16 state; - __be16 transitions; - __be32 timestamp; -} __attribute__((__packed__)); - -struct br_mrp_in_topo_hdr { - __u8 sa[ETH_ALEN]; - __be16 id; - __be16 interval; -}; - -struct br_mrp_in_link_hdr { - __u8 sa[ETH_ALEN]; - __be16 port_role; - __be16 id; - __be16 interval; -}; - #endif diff --git a/net/bridge/br_private_mrp.h b/net/bridge/br_private_mrp.h index af0e9eff6549..3f80a0a79a32 100644 --- a/net/bridge/br_private_mrp.h +++ b/net/bridge/br_private_mrp.h @@ -88,4 +88,33 @@ int br_mrp_switchdev_send_in_test(struct net_bridge *br, struct br_mrp *mrp, int br_mrp_ring_port_open(struct net_device *dev, u8 loc); int br_mrp_in_port_open(struct net_device *dev, u8 loc); +/* MRP protocol data units */ +struct br_mrp_tlv_hdr { + __u8 type; + __u8 length; +}; + +struct br_mrp_common_hdr { + __be16 seq_id; + __u8 domain[MRP_DOMAIN_UUID_LENGTH]; +}; + +struct br_mrp_ring_test_hdr { + __be16 prio; + __u8 sa[ETH_ALEN]; + __be16 port_role; + __be16 state; + __be16 transitions; + __be32 timestamp; +} __attribute__((__packed__)); + +struct br_mrp_in_test_hdr { + __be16 id; + __u8 sa[ETH_ALEN]; + __be16 port_role; + __be16 state; + __be16 transitions; + __be32 timestamp; +} __attribute__((__packed__)); + #endif /* _BR_PRIVATE_MRP_H */