Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp8350537ybn; Tue, 1 Oct 2019 07:00:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDqsABG50uRb0IsiacQkzSzl4mU7JAvPmXKkhk/PyqxloMIoz110lLDNeEPOmiHu+3O2lm X-Received: by 2002:a50:b501:: with SMTP id y1mr25476921edd.167.1569938422897; Tue, 01 Oct 2019 07:00:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569938422; cv=none; d=google.com; s=arc-20160816; b=RbaSh3THbdm4nmTgkO/TMYpQkdCz0b5p5uSgsAWwWTWiB5WpIzGu9e5MKL3Th5gklX uNLHq8sxAG85BEXJ6yFdugNg7yVyfRR+83PcZWy25Zc75AT5yMhbiMu4o9hcLf7IrL36 Xwf47p5REgTNSFbwDNtyho9mU/UrteJzrK8pgHz3reKTkF5cbaWmOQK7dJ0xZiqbaYPo YaSoe+Ay3qbnoAzOWIlyzuJIZF0ne0HoqG3kgvg/3gDiwqwjN2fUimOCyL9JBUzyyNVA Bm/ZId7GnE4/nUAsG4D2NS8yCOJioh9OBptEQZ5uHFkHN752SsRzE7Ec+TLKu1s93MRH gfrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=qkXVBif3NC9ILGaC6hA9iNiOUQGqCmuYSkQyxbSN1uU=; b=WYYvOTh3hGjo9EoEt4mcaDOIunffk/mDeguSSmDI34myJROd5D728ZhGyIr7F8qv+b WUZ6RAjCkrteHj/scmBztsgmRYW860ayi6N/hjtam+DmH0Z/Ab80td48fMzL46jH0Ehc x28HTf+CR8MRs8PQMbX6YDDlECT8fVhI4c7Dgw2YxYffGGCDbUHdobG+EZ+PXtJa/KFi hzzil58akDLyrqjX4hMOqqPgNDtRHJmajwncPMRcbsMUW6Q4VbyUkVlpPKzcaeUQAkx9 SN2ls6wOiyYAe6Doa6qx3N5SszLPSV2lRidGQ89ccS+++8031RoIM5ZYuyPvwWqvzNHx YHOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z21si8668351ejw.229.2019.10.01.06.59.57; Tue, 01 Oct 2019 07:00:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388901AbfJAN5L (ORCPT + 99 others); Tue, 1 Oct 2019 09:57:11 -0400 Received: from s3.sipsolutions.net ([144.76.43.62]:34512 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388856AbfJAN5L (ORCPT ); Tue, 1 Oct 2019 09:57:11 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.92.2) (envelope-from ) id 1iFIeI-0001pX-G2; Tue, 01 Oct 2019 15:57:06 +0200 Message-ID: <9bbf73e318df17d179014937cb6c1335fb303611.camel@sipsolutions.net> Subject: Re: [PATCH net v4 01/12] net: core: limit nested device depth From: Johannes Berg To: Taehee Yoo Cc: David Miller , Netdev , linux-wireless@vger.kernel.org, Jakub Kicinski , j.vosburgh@gmail.com, vfalico@gmail.com, Andy Gospodarek , =?UTF-8?Q?Ji=C5=99=C3=AD_P=C3=ADrko?= , sd@queasysnail.net, Roopa Prabhu , saeedm@mellanox.com, manishc@marvell.com, rahulv@marvell.com, kys@microsoft.com, haiyangz@microsoft.com, Stephen Hemminger , sashal@kernel.org, hare@suse.de, varun@chelsio.com, ubraun@linux.ibm.com, kgraul@linux.ibm.com, Jay Vosburgh , Cody Schuffelen , bjorn@mork.no Date: Tue, 01 Oct 2019 15:57:05 +0200 In-Reply-To: (sfid-20191001_155348_267769_C0F821E2) References: <20190928164843.31800-1-ap420073@gmail.com> <20190928164843.31800-2-ap420073@gmail.com> <39e879f59ad3b219901839d1511fc96886bf94fb.camel@sipsolutions.net> (sfid-20191001_155348_267769_C0F821E2) Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hi, (jumping out now, forgive me for being so brief) > If I understand correctly, you said about the alignment of > "lower_level" and "upper_level". > I thought this place is a fine position for variables as regards the > alignment and I didn't try to put each variable in different places. > > If I misunderstood your mention, please let me know. Not sure what you mean, alignment doesn't matter for them (they're u8). I was thinking of the packing for the overall struct, we have: unsigned int max_mtu; unsigned short type; unsigned short hard_header_len; unsigned char min_header_len; + unsigned char upper_level, lower_level; unsigned short needed_headroom; unsigned short needed_tailroom; Previously, there was a one byte hole at that spot due to a single "unsigned char" (after something aligned at least 4 bytes) followed by "unsigned short" - now you push that out a bit. If you place the variables a bit lower, below "name_assign_type", you probably fill a hole instead. Check out the 'pahole' tool. johannes