From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3989C433F5 for ; Mon, 4 Oct 2021 12:18:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A52DD6124C for ; Mon, 4 Oct 2021 12:18:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233167AbhJDMUq (ORCPT ); Mon, 4 Oct 2021 08:20:46 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:47374 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229778AbhJDMUp (ORCPT ); Mon, 4 Oct 2021 08:20:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=wnM2im3ufvccxVTb57umAjuJY+JPdwLkdD8qwKSUKpE=; b=zlTxWnoIPG58Q/uH2SdnGtUEpj WdpDlaA/bKJpvAjN37oaTs9jzaCm93IR9W8NH6cff1jmwJwNIGWeX8dODGjvAUvdQGFkqTsusvwSM UF6r4ZT8D787cXyNOix9tQW55brjkT67IbVrwac7VI/VegUar1SB7TPb7NfmoKjB1NMA=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mXMvm-009XIC-U2; Mon, 04 Oct 2021 14:18:54 +0200 Date: Mon, 4 Oct 2021 14:18:54 +0200 From: Andrew Lunn To: Vladimir Oltean Cc: netdev , Tobias Waldekranz , Florian Fainelli Subject: Re: [PATCH net] dsa: tag_dsa: Handle !CONFIG_BRIDGE_VLAN_FILTERING case Message-ID: References: <20211003155141.2241314-1-andrew@lunn.ch> <20211003210354.tiyaqsdje6ju7arz@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211003210354.tiyaqsdje6ju7arz@skbuf> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sun, Oct 03, 2021 at 09:03:55PM +0000, Vladimir Oltean wrote: > On Sun, Oct 03, 2021 at 05:51:41PM +0200, Andrew Lunn wrote: > > If CONFIG_BRIDGE_VLAN_FILTERING is disabled, br_vlan_enabled() is > > replaced with a stub which returns -EINVAL. > > br_vlan_enabled() returns bool, so it cannot hold -EINVAL. The stub for > that returns false. We negate that false, make it true, and then call > br_vlan_get_pvid_rcu() which returns -EINVAL because of _its_ stub > implementation. Yeh, i got the names of the functions wrong. I will fix that. > In fact it is actually wrong to inject into the switch using the > bridge's pvid, if VLAN awareness is turned off. We should be able to > send and receive packets in that mode regardless of whether a pvid > exists for the bridge device or not. That is also what we document in > Documentation/networking/switchdev.rst. > > So if VLAN 0 does that trick, perfect, we should just delete the entire > "if (!br_vlan_enabled(br))" block. I will rework the patch and test it without the if. Thanks Andrew