Return-Path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=bytmtoINOEdkBtL4V2XAs15+q8GmAS7yZKBoJvhkgLk=; b=akE2ozj4n+Syf78UgJqCInvzuDDz+8VmFwiwu0NVDiPEtd9yuZancJkUYDsXQzYUbp ObndXxrSoodxkK60wJ6CouUlchzBZ3QP8k4bGVwfdMaQGNShPX5gMyLHokdta2A9EPEP DEApGNbbS247uAc79ayPDzMVwo1pC/QOSoxC2xFMT3tSTWuPrGkZqDtrKvfi0c+4YG1v kKxdMB4aFm280e4uW/KM2G4eO3f0iQkqyTYgX5pdNZKGS+IqNofZo2HkZD+KsnCZs9kZ RaHYXbRaeC1CMggg6p0Lw0mzj7wAvEO/tfwHENqV3oJSpWqbcOcPesH9LsuuO+2V3Sd2 SRuQ== References: <20210212151600.3357121-1-olteanv@gmail.com> <20210212151600.3357121-6-olteanv@gmail.com> From: Florian Fainelli Message-ID: <9a1efd0d-9930-cbc7-5450-ffb47a0034e4@gmail.com> Date: Fri, 12 Feb 2021 10:10:37 -0800 MIME-Version: 1.0 In-Reply-To: <20210212151600.3357121-6-olteanv@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Bridge] [PATCH v5 net-next 05/10] net: switchdev: pass flags and mask to both {PRE_, }BRIDGE_FLAGS attributes List-Id: Linux Ethernet Bridging List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladimir Oltean , Jakub Kicinski , "David S. Miller" Cc: Ivan Vecera , Andrew Lunn , Alexandre Belloni , Grygorii Strashko , Jiri Pirko , Vignesh Raghavendra , Vadym Kochan , netdev@vger.kernel.org, bridge@lists.linux-foundation.org, Ioana Ciornei , linux-kernel@vger.kernel.org, UNGLinuxDriver@microchip.com, Taras Chornyi , Ido Schimmel , Claudiu Manoil , Nikolay Aleksandrov , Roopa Prabhu , linux-omap@vger.kernel.org, Vivien Didelot On 2/12/2021 7:15 AM, Vladimir Oltean wrote: > From: Vladimir Oltean > > This switchdev attribute offers a counterproductive API for a driver > writer, because although br_switchdev_set_port_flag gets passed a > "flags" and a "mask", those are passed piecemeal to the driver, so while > the PRE_BRIDGE_FLAGS listener knows what changed because it has the > "mask", the BRIDGE_FLAGS listener doesn't, because it only has the final > value. But certain drivers can offload only certain combinations of > settings, like for example they cannot change unicast flooding > independently of multicast flooding - they must be both on or both off. > The way the information is passed to switchdev makes drivers not > expressive enough, and unable to reject this request ahead of time, in > the PRE_BRIDGE_FLAGS notifier, so they are forced to reject it during > the deferred BRIDGE_FLAGS attribute, where the rejection is currently > ignored. > > This patch also changes drivers to make use of the "mask" field for edge > detection when possible. > > Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli -- Florian