Thread (24 messages) 24 messages, 4 authors, 2026-03-27

Re: [PATCH net-next v2 07/12] ethtool: Add MAC loopback support via ethtool_ops

From: Breno Leitao <leitao@debian.org>
Date: 2026-03-26 09:49:31
Also in: linux-kselftest, linux-rdma, lkml

On Wed, Mar 25, 2026 at 03:50:14PM +0100, Björn Töpel wrote:
quoted hunk ↗ jump to hunk
@@ -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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help