From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7287248382C for ; Wed, 12 Aug 2026 18:24:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786559058; cv=none; b=WxH7MPEeySW1HZKKUpo9xEbbRM1U57NhnMt8BWNQVP/y1nzc2Cs6QI8DEi6D0cPnWVDlitcUWDmYC+Iqs01GHq0umA9KLBuFn4lUtbHL1VVB0eUk/0rps6ZCUquCeozSd8D09+NLqIUrBwfQ/32ULHoFUE3ghPp0qXvGXO2I8GA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786559058; c=relaxed/simple; bh=XO3NucALKGhPzeGqUGsWUNBJvuCvo7AHykTGH8wD3Ys=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hFXnCH9fbG1K904zB9JHz4WNTRTQd2IX6CQ4TK6GtiBZFt9U95h2+c6R3qQAdUrSLvBQnBfrcLEXx0cm02V2NOwGeNa3c/hV75BJjhYdhzWs+QkBQ59ITMI4YOuQUoVDOWjhl218BDIC6+uzIVfHo6I5kll/yNrVvj9qWKcu8C4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dama.to; spf=none smtp.mailfrom=dama.to; dkim=pass (2048-bit key) header.d=dama-to.20251104.gappssmtp.com header.i=@dama-to.20251104.gappssmtp.com header.b=pFcCFO3F; arc=none smtp.client-ip=209.85.216.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dama.to Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=dama.to Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dama-to.20251104.gappssmtp.com header.i=@dama-to.20251104.gappssmtp.com header.b="pFcCFO3F" Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-38dc69c74b8so1667783a91.0 for ; Wed, 12 Aug 2026 11:24:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dama-to.20251104.gappssmtp.com; s=20251104; t=1786559056; x=1787163856; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date:from :to:cc:subject:date:message-id:reply-to:content-type; bh=eLPd2gik+ydyShlsoX0SM+lk6p7EV+mYUqTb977v6HI=; b=pFcCFO3Fgw46A3I7yVj4KWOayhBlmaY/uyWtc8dzdFhCnFbq88VRA4z27m4ljhwL16 N6kmSKOCwMQsFSh7xpsnZi2KGzkt9oMtUHsdLCW+MjBtoFP0bVP9mHgrdWWX8xwQ6jg+ P5z3WXnuxapYD7bZopgLdfqa8pwQGlSEXXAcD0B3PRt+kQlpMU5lUgtr37xiNGhyO2+H ab5hBqCNdrn5tMWMba1oCeki9Bb+3eQdl4IvmA/M75aeNRM96GwJ8wzr4QMSdorrSi0+ JFAeLUScG3XGL7SMFVeeugS8u66NWpNZXTvXlf+IpD35gPBPgNZyx/l/0cfm9BReN/h7 4zmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786559056; x=1787163856; h=in-reply-to:content-disposition:content-type:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=eLPd2gik+ydyShlsoX0SM+lk6p7EV+mYUqTb977v6HI=; b=TBqy7f9Js+qd/e0BJKUO0gNqyt8XWH1pSixmBtUf1isjLz4Is2E5cGvXXgtiMf0Ixs 4hC260uMzXisRWMvaHZjvubpmx79Bmccb2RMC5ECgkDeV1D8s3Te7eL1KgQZNjXuZKzK mlWsYMQXlhR0SsAm65qfUEevsyj4YtcV1uQCowT24jg8mW6KwsCh9NGKxKW/C1IIP05p 9wjeHIpfe5p046r8ZXL9I0eOfLAqBnxAZsO80qECF522f/LUiEEZOYyslO7DIpu1yfUz v5CAfYUPb+S+WPyIjttVOOWwvhThFlyenBFY9mu9KNxKuxAUjh+r3xPkBSqzTmlDJIgW CP3g== X-Forwarded-Encrypted: i=1; AHgh+RrHKIwh1Yf+ugWfEyEdv4PuVlPYwrDK/B4KAIZBx/0PPl4NVIXTQuUpt0kH2kHpkBgaG0hUiMf0mvqx2Fk=@vger.kernel.org X-Gm-Message-State: AOJu0YzKwypVZpT5xY0lFoXvi4lVZR7B9bmovKHX/y24yxu7M5p4nKAo AS2aL030JhhsHxAWWaq2Uh9RdxKd1bQMeMT0osVd5VRdJVdDq9BJhMO/Dbx1Q+pN/4pNloyX6b1 PTg+Y X-Gm-Gg: AR+sD13LhKHhpupQkbokiI7K+okihMIzZOVIcQ/PS4acf1lO7VnL+5PUTkZRBxpo8i3 eCU6MEnLtjkYcc8Q6eRQKspvjmdfMiLAM7zxqLclng5SGbkco/dcgVUtVPMXtFu1iGuHoVz49ux sHUcxF3qma6t5c1R7jCCbp4A/bMLj5kLsauaEvcnKQwwM5om25dEPwWX8a/72KbhRqHxne3Epwi AprbhR81nEfNs/JdW+QJJSYM1TV9Hxbw3qCYh6sHqxzEqeu+Y+ZKPZvGaG5yQSCHKlfsiZnEwpI FuXC4sY/A3aqmmEzXdBqSOCcjXB4T1ejBs2d3LMSohjtYwpKtALJ/6lbE0p0XS77PaMMmWsOH85 YpUkb/3xvUJ8UnSj2WYMLrAmxZwoe7+PHDOGXpVMhxide77PUK20hhjOybfiVwJudJa12VQrV0P lKRpVIp0RM+8LXnG3ULJCmZANvd7ROYpj/oIYRwISt X-Received: by 2002:a17:90b:540c:b0:390:b41a:b92f with SMTP id 98e67ed59e1d1-3931e31bd38mr87086a91.18.1786559055080; Wed, 12 Aug 2026 11:24:15 -0700 (PDT) Received: from localhost ([2a03:2880:2ff:5::]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3931cefe8efsm338390a91.15.2026.08.12.11.24.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2026 11:24:14 -0700 (PDT) Date: Wed, 12 Aug 2026 11:24:13 -0700 From: Joe Damato To: Willem de Bruijn Cc: netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , andrew+netdev@lunn.ch, willemb@google.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 1/2] net/packet: Reduce VLAN tag code duplication Message-ID: Mail-Followup-To: Joe Damato , Willem de Bruijn , netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , andrew+netdev@lunn.ch, willemb@google.com, linux-kernel@vger.kernel.org References: <20260811184722.2612345-1-joe@dama.to> <20260811184722.2612345-2-joe@dama.to> 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-Disposition: inline In-Reply-To: On Wed, Aug 12, 2026 at 08:28:39AM -0400, Willem de Bruijn wrote: > Joe Damato wrote: > > Reduce code duplication for VLAN tag extraction by factoring the > > repeated code into a helper and using it. > > > > Signed-off-by: Joe Damato > > Especially with the improving AI bots, we're getting even more fixes > to PF_PACKET lately. Cleanup patches can block fix backports to stable. > The bar for pure cleanup patches has to be high to warrant that. > > Plus, they add risk, if it is not trivial to review that they are NOOPs. > > Subjective, but not sure this one warrants the cost. OK. In that case, I'll mark the series as rejected below. I was also working on a test for ORIGDEV because many, many years ago I got bit by unexpected results mixing packet sockets with bonded interfaces. But, I'll refrain from touching anything related to af_packet including tests from now on. > > --- > > net/packet/af_packet.c | 95 +++++++++++++++++++++++------------------- > > 1 file changed, 53 insertions(+), 42 deletions(-) > > > > diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c > > index 435756877aba..ee60dcc639ad 100644 > > --- a/net/packet/af_packet.c > > +++ b/net/packet/af_packet.c [...] > > @@ -997,20 +1018,19 @@ static void prb_fill_vlan_info(struct tpacket_kbdq_core *pkc, > > struct tpacket3_hdr *ppd) > > { > > struct packet_sock *po = container_of(pkc, struct packet_sock, rx_ring.prb_bdqc); > > + struct net_device *dev = NULL; > > + u16 tci, tpid; > > > > - if (skb_vlan_tag_present(pkc->skb)) { > > - ppd->hv1.tp_vlan_tci = skb_vlan_tag_get(pkc->skb); > > - ppd->hv1.tp_vlan_tpid = ntohs(pkc->skb->vlan_proto); > > - ppd->tp_status = TP_STATUS_VLAN_VALID | TP_STATUS_VLAN_TPID_VALID; > > - } else if (unlikely(po->sk.sk_type == SOCK_DGRAM && eth_type_vlan(pkc->skb->protocol))) { > > - ppd->hv1.tp_vlan_tci = vlan_get_tci(pkc->skb, pkc->skb->dev); > > - ppd->hv1.tp_vlan_tpid = ntohs(pkc->skb->protocol); > > + if (po->sk.sk_type == SOCK_DGRAM) > > + dev = pkc->skb->dev; > > + > > + if (packet_get_vlan_tci_tpid(pkc->skb, dev, &tci, &tpid)) > > ppd->tp_status = TP_STATUS_VLAN_VALID | TP_STATUS_VLAN_TPID_VALID; > > Does this change behavior, now setting tp_status also for the second > branch, where previously the flags were not set? If you apply the patch to the tree and look at it, it'll be less confusing. It looks weird because of what git generated, but as far as my reading of the code goes, there is no behavior change. --- pw-bot: rejected