From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 7CF133E6390 for ; Thu, 2 Apr 2026 12:59:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775134796; cv=none; b=rqHH2nBJvUiEWEeViAiHtXGaSBzD7zzDjbxBn/ydhsFuL1YjQ/cgDzdP4mAHwSVQKZiNf5PEQlYPx35a2THXcof7gRp/3+GM9HYP2pwLBKywkGq4szLVfSshZu2unkVpRjwV75k5WN5gQH4rvgKDHRJyUk8w6MpvhCiOzOCV7E4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775134796; c=relaxed/simple; bh=KukBV6WGKRPi1Kds2J/Oz3l26tHgaeKoWXdQFvqvEvA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bVy6cVj51XXYFU77ywgVGE+mXisXko5K1EJumCQC5YxlIsYyDNk19JiaU73/Wwx+BsAXt3fsBrZymINKxjkRbjx2Uyn3NkmeCjr1yugcP1rUM0c0XfVIKjrYUiXsEo1c5aK1dPLFaAd8Rcu8S2Lyy9oUeunaoQWyk33jaJNqceY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=WbLXCquc; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="WbLXCquc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1775134784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aakrSKhK37sQCyaPYMW6k7c3cbgfBIms5977wT19pQ0=; b=WbLXCquc2DMxWfkY2FSOwfH1tFVzi+KmKrNdARFPLmvtHCQKfT5ND5e9V1R+/LPSYu+HQy Gl57Dum20BsWXfmHRl5DHLilYa6Rvj8WsGNTsCDV2Y/uKl+DngAwowI2iLMIgO4cJcRTK3 idFUuwCokKSTv9dLgat/c/UYJ5C95/8= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-152-ShtkL7SBMCucRdN--DM6Kw-1; Thu, 02 Apr 2026 08:59:40 -0400 X-MC-Unique: ShtkL7SBMCucRdN--DM6Kw-1 X-Mimecast-MFC-AGG-ID: ShtkL7SBMCucRdN--DM6Kw_1775134779 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2C3801956089; Thu, 2 Apr 2026 12:59:39 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.44.32.195]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1A98F180076C; Thu, 2 Apr 2026 12:59:34 +0000 (UTC) From: Paolo Abeni To: michael.dege@renesas.com Cc: paul@pbarker.dev, niklas.soderlund@ragnatech.se, kuba@kernel.org, yoshihiro.shimoda.uh@renesas.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, edumazet@google.com, pabeni@redhat.com, linux-renesas-soc@vger.kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net Subject: Re: [net-next,v3,06/13] net: renesas: rswitch: add forwarding rules for gwca Date: Thu, 2 Apr 2026 14:59:32 +0200 Message-ID: <20260402125933.234477-1-pabeni@redhat.com> In-Reply-To: <20260331-rswitch_add_vlans-v3-6-c37f41b1c556@renesas.com> References: <20260331-rswitch_add_vlans-v3-6-c37f41b1c556@renesas.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 This is an AI-generated review of your patch. The human sending this email has considered the AI review valid, or at least plausible. For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html --- net: renesas: rswitch: add forwarding rules for gwca Add rules to forward packets from the Ethernet ports to the CPU port (GWCA) using L2 forwarding instead of port forwarding. > diff --git a/drivers/net/ethernet/renesas/rswitch_l2.c b/drivers/net/ethernet/renesas/rswitch_l2.c > index 709524c8a5c4..cabf1f92ad0c 100644 > --- a/drivers/net/ethernet/renesas/rswitch_l2.c > +++ b/drivers/net/ethernet/renesas/rswitch_l2.c > @@ -93,10 +93,32 @@ static void rswitch_update_l2_hw_forwarding(struct rswitch_private *priv) > } > } > > +static void rswitch_update_l2_hw_forwarding_gwca(struct rswitch_private *priv) > +{ > + struct rswitch_device *rdev; > + u32 fwpc0_set, fwpc0_clr, fwpc2_set, fwpc2_clr; > + > + fwpc0_clr = FWPC0_MACSSA | FWPC0_MACDSA | FWPC0_MACRUDA; > + fwpc0_set = fwpc0_clr; > + fwpc2_clr = FIELD_PREP(FWPC2_LTWFW, BIT(AGENT_INDEX_GWCA)); > + fwpc2_set = fwpc2_clr; > + > + (priv->offload_brdev) ? (fwpc0_clr = 0, fwpc2_set = 0) > + : (fwpc0_set = 0, fwpc2_set = 0); > ^^^^^^^^^^^ Does the false branch have a copy-paste error? Looking at the ternary operator: The TRUE branch (when offload_brdev is set) assigns: fwpc0_clr = 0 fwpc2_set = 0 The FALSE branch (when offload_brdev is NULL) assigns: fwpc0_set = 0 fwpc2_set = 0 <- assigns to fwpc2_set Both branches assign to fwpc2_set, leaving fwpc2_clr unchanged with the initialized value FIELD_PREP(FWPC2_LTWFW, BIT(AGENT_INDEX_GWCA)). This appears to break the logic for non-offloaded mode. The FALSE branch passes fwpc2_clr with the GWCA bit set to rswitch_modify(), which clears the GWCA bit from the FWPC2 registers. Is this the intended behavior when bridge offload is disabled? The symmetric pattern in the TRUE branch suggests the FALSE branch should be (fwpc0_set = 0, fwpc2_clr = 0) instead. > + > + rswitch_modify(priv->addr, FWPC0(AGENT_INDEX_GWCA), fwpc0_clr, fwpc0_set); > + > + rswitch_for_all_ports(priv, rdev) { > + rswitch_modify(priv->addr, FWPC2(rdev->etha->index), > + fwpc2_clr, fwpc2_set); > + } > +} > + > void rswitch_update_l2_offload(struct rswitch_private *priv) > { > rswitch_update_l2_hw_learning(priv); > rswitch_update_l2_hw_forwarding(priv); > + rswitch_update_l2_hw_forwarding_gwca(priv); > } [ ... ]