From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from s106b.cyber-folks.pl (s106b.cyber-folks.pl [195.78.66.88]) (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 9175E34E768; Thu, 26 Mar 2026 11:15:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.78.66.88 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774523741; cv=none; b=TzuAGeFEav7rWTf3B/sBf0W1ewQYLPFH1IioPIuaVKxAws90B6URPYB5yRjhwpPd8/99woI57rL9etfj0utHT4xHCAFw66l8c3gC5gdZ0JH7BzSE7ET08VXKn2sZGHyuccu0zW+pbTmF7cvhd85lQp0+abZAzrU0KzGEmNtdtgk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774523741; c=relaxed/simple; bh=mR/kvvFFzm3z7f5VgS/15AS/3++gtgDHcsLPFvzWnHA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=svalUnrYADUjV/OKkUeYY0kgszXKcHuZSccmTsEs7JLAOXK9fNAadTRPAJfxTmceQqwhRoLkoLVviNkm0nXcgCOvQKJDr5H8rmjvj8IG20vSiTu+yLIUwUiGGwsH3uHG2WS+dcpVro1cUB4SseraWrJedvCAD12UxFQxqPwk0Mk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mmpsystems.pl; spf=pass smtp.mailfrom=mmpsystems.pl; dkim=pass (2048-bit key) header.d=mmpsystems.pl header.i=@mmpsystems.pl header.b=xW/QOBAp; arc=none smtp.client-ip=195.78.66.88 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mmpsystems.pl Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mmpsystems.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mmpsystems.pl header.i=@mmpsystems.pl header.b="xW/QOBAp" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mmpsystems.pl; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=DH6OZbGLz6JBjk1mkEJ81mLvO4rTm1UWMB27HtaTvcM=; b=xW/QOBApGKxhjAHWxrKhsO4paW xK89CYlamTAn1AP6eLV9cfTVNJI/ewzZy4wSLYyakacZky5MH/QjCd+aKaHQx3a/Z/96yfR2syCNf P7Cx+SApeqNc8KkuiEUlIqS+R3iXol9E9BdXOjbht4BGl5zgx7C4J+ncxsMCrBjxcgmQxVoIMCy8O bmV29jQB6/srewPeRNWQ2iusgKWNQnulKaLN4O6Qqy6Jipt82HSlULinu1fjin3ig1Bef4/90SKCV Vuy5IGxBRdNgfYPJr7LNDBpXhCL7zIPubChZXshfZ9GXodTgobhevtupjsvNn+LWl+JYpjAcoyUPY P37m3+bQ==; Received: from user-5-173-16-20.play-internet.pl ([5.173.16.20] helo=localhost) by s106.cyber-folks.pl with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w5igY-00000000ajn-1kSH; Thu, 26 Mar 2026 12:15:34 +0100 Date: Thu, 26 Mar 2026 12:14:44 +0100 From: Michal Piekos To: Ovidiu Panait Cc: Maxime Chevallier , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , "netdev@vger.kernel.org" , "linux-stm32@st-md-mailman.stormreply.com" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2] net: stmmac: skip VLAN restore when VLAN hash ops are missing Message-ID: References: <20260321-vlan-restore-error-v2-1-45cf56a5223d@mmpsystems.pl> Precedence: bulk X-Mailing-List: netdev@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: X-Authenticated-Id: michal.piekos@mmpsystems.pl On Thu, Mar 26, 2026 at 08:07:33AM +0000, Ovidiu Panait wrote: > Hi, > > > > > Hi, > > > > On 21/03/2026 06:38, Michal Piekos wrote: > > > stmmac_vlan_restore() unconditionally calls stmmac_vlan_update() when > > > NETIF_F_VLAN_FEATURES is set. On platforms where priv->hw->vlan (or > > > ->update_vlan_hash) is not provided, stmmac_update_vlan_hash() returns > > > -EINVAL via stmmac_do_void_callback(), resulting in a spurious > > > "Failed to restore VLANs" error even when no VLAN filtering is in use. > > > > > > Check presence of VLAN HW FILTER flags before stmmac_vlan_update(). > > > > > > Tested on Orange Pi Zero 3. > > > > > > Fixes: bd7ad51253a7 ("net: stmmac: Fix VLAN HW state restore") > > > Signed-off-by: Michal Piekos > > > --- > > > This patch fixes a noisy "Failed to restore VLANs" message on platforms > > > where stmmac VLAN hash ops are not implemented. > > > stmmac_vlan_restore() calls stmmac_vlan_update() without checking for > > > VLAN hash ops presence which results in -EINVAL. > > > > I've been seeing the same message on socfpga. My two cents on that is > > that this error messages doesn't bring anything to the table anyways. > > > > As Russell explains, it's either triggered when the vlan op isn't > > implemented (the stmmac callback macro stuff turns that into a -EINVAL), > > or when some capabilities arent present. All in all, it's always stuff > > that users can't really do anything about, as it's HW limitations, I > > think we can simply discard this message. > > > > Also, nothing actually checks what stmmac_vlan_restore() returns, so we > > might as well return void ? > > > > I think this is the best solution until the VLAN capabilities handling is > cleaned up. > > Michal, please let me know if you will be handling this in v3 or I should > send a fix for it. > I will provide the fix for it latest during the weekend. Michal > Thanks, > Ovidiu > > > Maxime > > > > > --- > > > Changes in v2: > > > - Replace check for hash ops with check for HW FILTER flags > > > - Link to v1: https://lore.kernel.org/r/20260314-vlan-restore-error-v1- > > 1-4fc6c3e2115f@mmpsystems.pl > > > --- > > > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++- > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > > index 6827c99bde8c..cfc0ce9cec9c 100644 > > > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > > @@ -6863,7 +6863,8 @@ static int stmmac_vlan_restore(struct stmmac_priv > > *priv) > > > { > > > int ret; > > > > > > - if (!(priv->dev->features & NETIF_F_VLAN_FEATURES)) > > > + if (!(priv->dev->features & > > > + (NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_STAG_FILTER))) > > > return 0; > > > > > > if (priv->hw->num_vlan) > > > > > > --- > > > base-commit: 42bddab0563fe67882b2722620a66dd98c8dbf33 > > > change-id: 20260314-vlan-restore-error-f8b3a1c7f50a > > > > > > Best regards, >