From patchwork Wed Jan 5 13:21:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12704330 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6D73C433F5 for ; Wed, 5 Jan 2022 13:22:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240290AbiAENWY (ORCPT ); Wed, 5 Jan 2022 08:22:24 -0500 Received: from mail-vi1eur05on2060.outbound.protection.outlook.com ([40.107.21.60]:53697 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S240296AbiAENWI (ORCPT ); Wed, 5 Jan 2022 08:22:08 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R6c4TTTOpZ+oGKcO0TtX0NdqGxjVsLVrL6uGzJLSLpE69Uy4NoKnvF8grCK+2acDk59AE6Nr20pzyPtznnbs24wsNc24eV9DfwL67a6N4eBvwbSxA1j8co1cZjC7CriCY0S+bgetQux8n2fMrkRqgYqOqDq6m+6+z8aSJjlPngyOfHFfXznRwJCGLybm5TJ5RDvMVmRzufHY3LlkdYwbabwT65ivz/YjMBpiP/YQNBVOojY+vOlw2GqmMxFqDqMN+sic0q2cOQyRVtW7Egl/WRN8t7zy7WX5KshFLtKXlWG0fG14dI7Hz+CJdJx2dx9Ft30yiGedsFJeJB6HzNp9Mg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mavQUYFYXwhcIFmdkles8ujxVOHZYvjvkNhUq/6aKME=; b=mUo5IziB9/cgzVYmmU7AcQ7EuCwidQogz4e8xBjmdG0eK9UudPXNb2b0Yv23OqN56kUt31kTYhorbGFv1cUxTSeENVoJNnz/JX34iBr9jjki8GBGcCkCrK+YgZ6dKOYTmZkDRAr3eYglbmcdy37qVUv8OX7OVJLIhLP/17dGCwF/cFr085XztmYw+fBwE03IWfR1vrDyE/U3ADF1a7J/iFbyhMzSjdOvwcYBD799SnfJDeV9/rC80qBXg2BHp4f/CLdo7jqND4pMpS4f1xkbIuxwaUvl/0Prb4UmI3nJUXGhQ1X0cmb1c0FikmtmXwc1OtUfgRiIexIHQJbojxi96A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mavQUYFYXwhcIFmdkles8ujxVOHZYvjvkNhUq/6aKME=; b=MBNtUMpPvefCm99PIgPt3B8fNd/U1+w60U2LSghaR9b5yR/qqSmItb4cBqR+aPFPwMRj531fD3lOcAtGy+gVZPcSISM8iy9F3X+82dBBNWbtY2BIxgH2BVCjbwqemAS5uBr6OcEVJI+x4TWVNOm8vBwKcuknXLhrj1gTZBxLyGg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) by VE1PR04MB7408.eurprd04.prod.outlook.com (2603:10a6:800:1b3::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.15; Wed, 5 Jan 2022 13:21:58 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::c84:1f0b:cc79:9226]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::c84:1f0b:cc79:9226%3]) with mapi id 15.20.4844.016; Wed, 5 Jan 2022 13:21:58 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Jakub Kicinski , Andrew Lunn , Vivien Didelot , Florian Fainelli Subject: [PATCH v2 net-next 7/7] net: dsa: combine two holes in struct dsa_switch_tree Date: Wed, 5 Jan 2022 15:21:41 +0200 Message-Id: <20220105132141.2648876-8-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220105132141.2648876-1-vladimir.oltean@nxp.com> References: <20220105132141.2648876-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS9PR06CA0150.eurprd06.prod.outlook.com (2603:10a6:20b:467::16) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5979138e-a47c-4951-16d7-08d9d04e59a0 X-MS-TrafficTypeDiagnostic: VE1PR04MB7408:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B370eCpC29spFidJ8zv67Guw00/lofCC2b3YoxjYYtCazPShRwl7xOXe27Hr0mb74EPqIT9wTHLIT3iN9nOauP0MoLXkKWMRmxf7BDF/zB0LaKuVu2HF0KyHuYXPwq/nnNsKfxuOXrL5Inef28gT3uThissiTzusThGz79Q8+Drg6cY9UQmqpxgKM6r4jLrlWpsPMjk6Yxdd8oMd19ShrY9TEW3prTT0RinrhEoIwDut5R1vMoByU0tx2h1AMFTfwxvf168YmYxP1U3oCjnxlND1We72Gy0nCLwBHGq/tLA0C79fEEgPCXaer6SZNTzsp7l98CuUOy5knXk1OQrBAhAsytvZuEsCOstZGVAgi9idL3fpLjZhtp3tdZ5axwHL0dsTV5OfCt/cigBLL0fHf5TerIECMNwkLsdRiT1GRNRf7vqtaDb4LnRP9YsvjuOSUxAF+Gb2qvCcEdSBt4ilWa42T1h7AEEjsfnLHu0vt2BG5ia46xoUVyMzoq1qH+ixFSiGW8Kgy0VilKMxQKfnstSNbSUKK58qnEgO6DjlbTvgtLevUiNdJHjvfKdf1tRxJz31u3b78Xw+hDCVVt0PS6VKsRHN9z8Skqy6sxfC3AY2ZKq482h3ZkaJ9a1sDBSK32Oi9+wpzJywTlk2/ifU6Ae3HtQ4bOhYYMCsBsEdeUIuMBAK5jQu+mb5HInycYUovkTrj5BsbG02ZFwWyi6aiJmwZwCsSik/mCdZJqr9KrY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5136.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(6506007)(66476007)(8936002)(38100700002)(38350700002)(316002)(36756003)(2616005)(2906002)(6486002)(66556008)(66946007)(6916009)(5660300002)(44832011)(83380400001)(6512007)(508600001)(86362001)(54906003)(4326008)(8676002)(1076003)(186003)(26005)(6666004)(52116002)(21314003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: A6nTh91pxXI0H/48mQ7Qf3cwhicCVbIE/JyOsyQXyQLBzS9RVGmezqOQCcF02lvogcKeZ+e0eCuIkwBHlqGZEXYMO+WaO+uFe2GMiRJmDFCAqlx70/a1ohh0XexNzJ36Or/Po8xY/RAqrAIgxWSlSGjv/DQWclXo4a3FV5EHBzBPnin1MfLYV52rGISWr8GjoUMsN0Jo9JJ09uf3VUmPRZNGLbD40e9BPExRCLG0pOauBX7jqySAZeuhdzAFZevTu3mRJUyXydYZDC/JdHri3o/qUYvDgVKhbtewyR97JJ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MU7uVWtt25XJApCoCRvou1cQo9VS7jQSz/VmItierDaRoDgYcAmwyz0K4gLdjEP3ze+9I0ol95FipuwgKTJvTKfy33dKSinGG8S6hBjvXjHWyZvwIFY6RcywX696XkPiKKbdLx8mLDcLGhy/19VNahHE9huwXIou5zOx4lY/UdauAtkOL5mcIcQruuTfEnbFGF1ZfcqyPQzTMcZXzGrTjQvI7R93Wb8BwPW+UDD1TsP3tpPD9Xuh0qmQoPkh8yJCIze58XnchMc= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5979138e-a47c-4951-16d7-08d9d04e59a0 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2022 13:21:58.1357 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: zs+zscVjYLCIRyfgYGdysqrJR+7kx1TvYGUVFtXBlYL2z23vuE/g4zY3nF7oE4TkkrNZMlpMfOxtjnglwLwLuA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7408 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org There is a 7 byte hole after dst->setup and a 4 byte hole after dst->default_proto. Combining them, we have a single hole of just 3 bytes on 64 bit machines. Before: pahole -C dsa_switch_tree net/dsa/slave.o struct dsa_switch_tree { struct list_head list; /* 0 16 */ struct list_head ports; /* 16 16 */ struct raw_notifier_head nh; /* 32 8 */ unsigned int index; /* 40 4 */ struct kref refcount; /* 44 4 */ struct net_device * * lags; /* 48 8 */ bool setup; /* 56 1 */ /* XXX 7 bytes hole, try to pack */ /* --- cacheline 1 boundary (64 bytes) --- */ const struct dsa_device_ops * tag_ops; /* 64 8 */ enum dsa_tag_protocol default_proto; /* 72 4 */ /* XXX 4 bytes hole, try to pack */ struct dsa_platform_data * pd; /* 80 8 */ struct list_head rtable; /* 88 16 */ unsigned int lags_len; /* 104 4 */ unsigned int last_switch; /* 108 4 */ /* size: 112, cachelines: 2, members: 13 */ /* sum members: 101, holes: 2, sum holes: 11 */ /* last cacheline: 48 bytes */ }; After: pahole -C dsa_switch_tree net/dsa/slave.o struct dsa_switch_tree { struct list_head list; /* 0 16 */ struct list_head ports; /* 16 16 */ struct raw_notifier_head nh; /* 32 8 */ unsigned int index; /* 40 4 */ struct kref refcount; /* 44 4 */ struct net_device * * lags; /* 48 8 */ const struct dsa_device_ops * tag_ops; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ enum dsa_tag_protocol default_proto; /* 64 4 */ bool setup; /* 68 1 */ /* XXX 3 bytes hole, try to pack */ struct dsa_platform_data * pd; /* 72 8 */ struct list_head rtable; /* 80 16 */ unsigned int lags_len; /* 96 4 */ unsigned int last_switch; /* 100 4 */ /* size: 104, cachelines: 2, members: 13 */ /* sum members: 101, holes: 1, sum holes: 3 */ /* last cacheline: 40 bytes */ }; Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli --- include/net/dsa.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/net/dsa.h b/include/net/dsa.h index cbbac75138d9..5d0fec6db3ae 100644 --- a/include/net/dsa.h +++ b/include/net/dsa.h @@ -136,9 +136,6 @@ struct dsa_switch_tree { */ struct net_device **lags; - /* Has this tree been applied to the hardware? */ - bool setup; - /* Tagging protocol operations */ const struct dsa_device_ops *tag_ops; @@ -147,6 +144,9 @@ struct dsa_switch_tree { */ enum dsa_tag_protocol default_proto; + /* Has this tree been applied to the hardware? */ + bool setup; + /* * Configuration data for the platform device that owns * this dsa switch tree instance.