mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linkui Xiao <xiaolinkui@126.com>
To: Maxime Chevallier <maxime.chevallier@bootlin.com>,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, mcoquelin.stm32@gmail.com,
	alexandre.torgue@foss.st.com,
	Ovidiu Panait <ovidiu.panait.rb@renesas.com>
Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Linkui Xiao <xiaolinkui@kylinos.cn>,
	stable@vger.kernel.org
Subject: Re: [PATCH net] net: stmmac: fix the invalid VID programmed by VLAN perfect filtering
Date: Fri, 18 Sep 2026 15:10:45 +0800	[thread overview]
Message-ID: <6b00a649-8672-47c2-ab31-8b7d68ce1dcc@126.com> (raw)
In-Reply-To: <b521308c-34b8-40dc-831a-757a163902d6@bootlin.com>

Hi Maxime,

On 2026/9/17 23:57, Maxime Chevallier wrote:
> Hi,
> 
> +Ovidiu
> 
> On 9/17/26 14:22, Linkui Xiao wrote:
>> From: Linkui Xiao <xiaolinkui@kylinos.cn>
>>
>> for_each_set_bit() leaves its iterator equal to the bitmap size once the
>> loop terminates, so the 'vid' read after the loop in stmmac_vlan_update()
>> is always VLAN_N_VID (4096) and never the last VLAN ID that was found.
>>
>> Cores that do not support VLAN hash filtering (dma_cap.vlhash == 0) fall
>> back to the single VID perfect match filter and hand that value straight
>> to the MAC. vlan_update_hash() therefore programs MAC_VLAN_Tag with
>> VID 4096, a value that can never match an incoming 802.1Q tag, so the
>> perfect filter ends up discarding all VLAN tagged traffic. Both
>> stmmac_test_vlanfilt_perfect() and stmmac_test_dvlanfilt_perfect() walk
>> this path and fail as a result.
>>
>> Remember the VID while iterating so that the last active VLAN ID is the
>> one passed to the perfect match filter. When hash filtering is available
>> 'hash' is non-zero as soon as at least one VID is active, so
>> vlan_update_hash() keeps ignoring 'pmatch' and nothing changes there.
>>
>> Fixes: c7ab0b8088d7 ("net: stmmac: Fallback to VLAN Perfect filtering if HASH is not available")
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Linkui Xiao <xiaolinkui@kylinos.cn>
> 
> Thank you for proposing this fix, however this code is currently being removed :
> 
> https://lore.kernel.org/r/20260908164309.59282-1-ovidiu.panait.rb@renesas.com
> 
> So no need for this patch :)

Thanks for the heads-up. I'll drop this patch then.

Ovidiu, I'll keep an eye on your series. If the fallback path
still needs a valid VID after the removal, feel free to ping me.

Thanks,
Linkui
> 
> Maxime


      reply	other threads:[~2026-09-18  7:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17 12:22 Linkui Xiao
2026-09-17 15:57 ` Maxime Chevallier
2026-09-18  7:10   ` Linkui Xiao [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6b00a649-8672-47c2-ab31-8b7d68ce1dcc@126.com \
    --to=xiaolinkui@126.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=ovidiu.panait.rb@renesas.com \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=xiaolinkui@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®