Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp487703lqs; Thu, 13 Jun 2024 17:05:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW4k/pjJefx6wVZxjzgWy4fVrPqlykpHT3re4phHyyNb1HH/55dldQh/cjyMwr29GqCa6U6nQwyAiFwXchh+nBY7wVKjIbPWkuFkVD+3Q== X-Google-Smtp-Source: AGHT+IEk/jjhvTke+e22ojHNvBQKrdUnc+MCTgOE7EUlxGZXolbmcDE/Ud260gZ22pC2Bdj9UhiO X-Received: by 2002:a17:90b:1c02:b0:2c2:db4e:16eb with SMTP id 98e67ed59e1d1-2c4da54259amr1905439a91.7.1718323531993; Thu, 13 Jun 2024 17:05:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718323531; cv=pass; d=google.com; s=arc-20160816; b=TWG9uQVEdzmGr3qEMzaGYgG1EjfT0T565xvpysNYqI9YR01Zr1+bICBjuSHPsWBnJR h4smT9qiQ55qhhRJ6BhdP5+2Fh+BfTxWuT9XigW9CLgiVyzYnVjDrABHD9O3EZvNbq/s ZHjvoeltpxTN8P5S6EQoDsHUdTxErFWq2mL4gYJQSiSFmbH62NRh5sP3Ics222lqumtD 6PPPL60BJeOThj+h8DKuKDOHQZ3S5zxWeG4woc19mby6StYbDR4uZ+fxbgj1/eDcUvFF /nCC3cGiht3Fc9OAwBjeW7JUQLTGJS4iWJGoZHHuqL8q2g/yX47EhY3hPetuAAL4mdyx l3QA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=mYhgGk/dOH501C7PDToEYMAg5sqzmIcv9BnJcurdvZE=; fh=kWyngfCl/5w6v9EjLpOtRJNwD33R3GgJUb34Q+/XbOs=; b=mjrEgKUHmplNAayFpR+qG5YinE0r10IRDIVP5O9BNm39CZkytjhyTIzo1+bpqhgiYT AAk0Sd7AlO+MS3cy1+VheXFT72XPutyCTsdhC+MC1xwtQH55o2tBoYZIl7pSWagIQO98 2leEy2zabihe1umanu90Q4VsF8qYeiBjKXyHSZtUtiyKQ4YocGn/BhjIig3g7NgkhoO7 VIdH3/ddWE69vh20IN8TyxkssTwGP49KBjBtAW78LGvUVcLG7lzRSGxdJ2Th6W9S4vE1 1pmEIcxSOmFsWj32Le5Jd7uW36x96RCG+j2N6kUazfv50u4zrHi7UYaU0Z47U1We9oDW WRIQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F3YK6jHZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-214136-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214136-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c4c4764b27si2418292a91.137.2024.06.13.17.05.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 17:05:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214136-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F3YK6jHZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-214136-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214136-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9A63828405F for ; Fri, 14 Jun 2024 00:05:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8EAF4EDE; Fri, 14 Jun 2024 00:05:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="F3YK6jHZ" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4F9436C; Fri, 14 Jun 2024 00:05:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718323523; cv=none; b=ZTj/a1f1EwULgHlNM9/AG09cVxawMD37m9bxC7MoRBNmkQiUh1QHC8Y0gkna1kKsi2HydPitypwI5GSO+QVFww9QZPwBH5h/psDcY1BjO8Mm/tv6c0PD6gpLwhYNpHZekVoj64PeOOng3BHPszqTF9McPvodA0Xo6jF0HFBGPlM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718323523; c=relaxed/simple; bh=Tk/dh+spZSrmoPxZSBkQvt8dVNeejP0S+XKt7FjCMgE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CXl8yJfI5L/js4UIbu7bHpKqJ6/+NAcFG5pvdnv9gnMoaA5i3FPLBtQdCQxQVesGQGycw+B8xrJ5LK/zKXCPUmVgIG0gSDXM7pUrrajedT/eWlwrZ19YCUfhRzx4YgcJeXIePX16Dn3iCNETVJDTg6dkI5SkbdtwIQYY/75KZn8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=F3YK6jHZ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 055A0C2BBFC; Fri, 14 Jun 2024 00:05:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718323523; bh=Tk/dh+spZSrmoPxZSBkQvt8dVNeejP0S+XKt7FjCMgE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=F3YK6jHZweq8ERTiE2Yxuef/VSKTggOsD3eT2DybprJiyIinMBXHBgDO33Vn9b0Gp z6QLIFrO3lrHQJvsA0cNw/mA6i2XK9coEDWk70rHSmcKGpp5bcblOFuEOaw0vOqTEG sr9gTbinGnHBtB0VdX0UFtSYkq1Fw0VnZb/nN3i6k58Q3phgGdGhtwE6jgR14ILyul s4D1p5/Nbr+6sqr6yGGgGnN/Xgv+vC1SdKmgP6ZwE8nblTLbMMblrStn0W9T3fc1JN 1uQST6uaOgl19uEfKdQ+P+jK+DX0uFc+Llk+J2MzyJ04sSNVClEC7fvuQxihxnatkm Zz2FY9P/5YODA== Date: Thu, 13 Jun 2024 17:05:22 -0700 From: Jakub Kicinski To: Qingfang Deng Cc: "David S. Miller" , Eric Dumazet , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Joe Perches , Qingfang Deng Subject: Re: [PATCH net-next] etherdevice: Optimize is_broadcast_ether_addr Message-ID: <20240613170522.0961c781@kernel.org> In-Reply-To: <20240613073441.781919-1-dqfext@gmail.com> References: <20240613073441.781919-1-dqfext@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 13 Jun 2024 15:34:41 +0800 Qingfang Deng wrote: > Like is_zero_ether_addr, is_broadcast_ether_addr can also be optimized > by using a 32-bit load if CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is set. > Sign extension is used to populate the upper 16-bit of the 16-bit load. Can you provide more context on why it's beneficial. I mean, there's a lot of code in the kernel one could micro-optimize... Show us the assembly, cycle counts, where it's used on fast paths... -- pw-bot: cr