From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (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 CF33A399009; Thu, 26 Mar 2026 09:49:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774518579; cv=none; b=FRnPI5lCTjq71YD95DLLDbIENPt9MtQtWx88p2uYxnZ9dO/jfPikdtlPoe64Lif4r/8+/FlDiCv489bYHEG7IuebXBpGwDUY1xMYRS7qEJ528/qnQZM96GYdEuw1FTQCzkF6LuhRw//dnwoysrIK2Lz5bUNCJHIq06BpWsBITqQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774518579; c=relaxed/simple; bh=Hcv3BUfw7txA6r1Uh0brIkEpZiRcbZGhRP2mGVojuDw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WSOr15c7bXLPBFy60o/PxUF5Os8+qx2q8nC4goAWe7e7QvEsVoIhGuVVn31xvhwwRgiLqURIIWEjQyLjYQL1Gw3p6jD0i+pNyiv+HHmIgvDX+Vqnqq8Sl/BQ1Ci/WCpKOdxE97GxQY0pfeOVnAa+Zh+ED8UNM0nNxMlkBn5MBf0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org; spf=none smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=Lx5lLr5z; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="Lx5lLr5z" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-ID:Content-Description; bh=HcQDeEXUnBzf8mzWuF6SYQrZaKhw3Qa8vqAtbSFc0L4=; b=Lx5lLr5z64BFlzlHMTBnFoVN/t WgrBdnb8ho5fX46P8yJoRr3fKAFe1N5ektWSviptYWri9+DCdCN3qW6JE6ch4VWin0wMfWJZI+d2B dfDjVMOtTihKKeJC5iVVH4AlftYrMnZK3OubHEO4QIj0RDaNwEIjWHaPN1g1NKu/DawENBeBzJJoo Y1LxmXSkT14X6wS/lukC3ejt7dbYaPb5Rd5iVzHOVKIXeQ16fpsUVP+5UfW2U1poq4PzYvWAmI1/Y GhY0bPYwzMGArS31EVTh5sjcC5k10m3JUXVnlBd1rVh7sXLf1SqfkllsA1m/fyvz+t8HIF9YXRoEs nrROrD8A==; Received: from authenticated user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2) (envelope-from ) id 1w5hLB-009lLm-UG; Thu, 26 Mar 2026 09:49:26 +0000 Date: Thu, 26 Mar 2026 02:49:18 -0700 From: Breno Leitao To: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= Cc: netdev@vger.kernel.org, "David S. Miller" , Andrew Lunn , Donald Hunter , Eric Dumazet , Jakub Kicinski , Maxime Chevallier , Naveen Mamindlapalli , Paolo Abeni , Simon Horman , Danielle Ratson , Hariprasad Kelam , Ido Schimmel , Kory Maincent , Leon Romanovsky , Michael Chan , Oleksij Rempel , Pavan Chebbi , Piergiorgio Beruto , Russell King , Saeed Mahameed , Shuah Khan , Tariq Toukan , Willem de Bruijn , Kees Cook , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-rdma@vger.kernel.org Subject: Re: [PATCH net-next v2 07/12] ethtool: Add MAC loopback support via ethtool_ops Message-ID: References: <20260325145022.2607545-1-bjorn@kernel.org> <20260325145022.2607545-8-bjorn@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260325145022.2607545-8-bjorn@kernel.org> X-Debian-User: leitao On Wed, Mar 25, 2026 at 03:50:14PM +0100, Björn Töpel wrote: > @@ -284,20 +305,31 @@ static int loopback_dump_one_dev(struct sk_buff *skb, > { > struct loopback_req_info *req_info = > container_of(ctx->req_info, struct loopback_req_info, base); > + /* pos_sub encodes: upper 16 bits = component phase, lower 16 = index > + * within that component. dump_one_dev is called repeatedly with > + * increasing pos_sub until all components are exhausted. > + */ > + enum ethtool_loopback_component phase = *pos_sub >> 16; > + u32 idx = *pos_sub & 0xffff; Consider introducing macros for these bit operations to improve code readability. Named macros would make the shift and mask operations more self-documenting and facilitate future changes, if we eventually get there.