Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp885594pxb; Tue, 9 Feb 2021 15:34:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJyHRaRHuXiTNNbqcLoc9WOsbFS6LAHBrtWTxDhFuEclrMLteYYP3BTPiD6aO04cUgyg/9qH X-Received: by 2002:a17:906:1d53:: with SMTP id o19mr136665ejh.512.1612913663159; Tue, 09 Feb 2021 15:34:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612913663; cv=none; d=google.com; s=arc-20160816; b=cmMA6b4825DACFFv+OXRg1bGitz8w30r6KOZi+/A2/LkxlRWqQHyZUOBWlPGAAdR3h /kK26FUPxkdWLHxvZxztLtUz3p+bvnoSbtbZWW7csfVdGoSuCdftIj/56LYYO2dcLX3N /p6Lt3OSzUzeQ8Qq3SnFFS1fBTdiB9gbbAJyy2L0CA1DBPVJOSka3zOqvlp6vQIL/Xh2 Q876lkyNfkLKma7CIGSw//d2Z4iyLiayHAmbPeV2cJC0s/bMxXCY8468jfwSxiDq0UB7 CMXDOWP3pl5nqA+LDKPVg5TOh43jzB0E6bH6uKPmyraBGQ77i8Vtmc+H7CiXh0ha/UZb lkDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=jbTXSEkHbtCMu+f135EDu0ufO51m7hO7fIyJQPnw2cM=; b=UAjQoSrixIdbwsblIAjhOJ2XfV8aGFrzciigOuDVFjpdIN0uh7qwvT8kh9EWNOfi2/ ipqXoviEpu1q4hP/+D449AqzFjo0r75n19mebnlrJiRqPfL8FxIIoLwQUrd4NNqwUgSG X/o4eaqy75CsSNiOGJmYTL77MFeUyLO6w+FSuYIopw7KBYFhM5L+ZkHPQe4HyZlMbY8p iN5FjSrSW/QJmafrlR+mGeeIEzH2qzhZszQACYmM7aLfZleYkZslWY/eyIsVvJHoyl9G LSPBaOEvHd/GABYYBxE/XwR/1sbet+Y58LhNFJWAOxrCI7JjGMcqbAYc81GDIq3rg4UF 6ZbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Av5rWJhy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g23si177143edv.245.2021.02.09.15.33.57; Tue, 09 Feb 2021 15:34:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Av5rWJhy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233568AbhBIX3o (ORCPT + 99 others); Tue, 9 Feb 2021 18:29:44 -0500 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:49983 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233695AbhBITxF (ORCPT ); Tue, 9 Feb 2021 14:53:05 -0500 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailnew.nyi.internal (Postfix) with ESMTP id C2BC9580171; Tue, 9 Feb 2021 13:26:24 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Tue, 09 Feb 2021 13:26:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=jbTXSE kHbtCMu+f135EDu0ufO51m7hO7fIyJQPnw2cM=; b=Av5rWJhyVsredRqpbe+/Uz F6LRuAWYNgnYiqjcioKGv21NJd19zUqh8Yz62DRSZbvWqOEATjoeCug2VAQND4o3 rSu7q7pXakLyzIaBI89YmdmqqKNzd9PhP4WqX04efbSc5lGj193sXRzM2g4Gd6/z pwrWh8hiX4DvPGJat9nzP4a2GPMF5KgWu3vYqg0IW/xV6cKuPD50OP2+FSJIMK3x G7lOEM4+dZWPDWW0F69f1QqzHpN0r+mvCTEHNUAjFT6lJdiOqr7wyCC/VrXdbKJ9 L9y+7Q7imyAVmXrCRAw42xW2hVQWj9u4dYh6Q/QxgFHcLo5YGsB1PLeUb6e2ee+Q == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrheehgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpefkughoucfu tghhihhmmhgvlhcuoehiughoshgthhesihguohhstghhrdhorhhgqeenucggtffrrghtth gvrhhnpefgvefgveeuudeuffeiffehieffgfejleevtdetueetueffkeevgffgtddugfek veenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecukfhppeekgedrvddvledrudehfe drgeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep ihguohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: from localhost (igld-84-229-153-44.inter.net.il [84.229.153.44]) by mail.messagingengine.com (Postfix) with ESMTPA id 7364424005D; Tue, 9 Feb 2021 13:26:20 -0500 (EST) Date: Tue, 9 Feb 2021 20:26:17 +0200 From: Ido Schimmel To: Vladimir Oltean Cc: Jakub Kicinski , "David S. Miller" , Andrew Lunn , Vivien Didelot , Florian Fainelli , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bridge@lists.linux-foundation.org, Roopa Prabhu , Nikolay Aleksandrov , Jiri Pirko , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Vadym Kochan , Taras Chornyi , Grygorii Strashko , Ioana Ciornei , Ivan Vecera , linux-omap@vger.kernel.org Subject: Re: [PATCH v2 net-next 03/11] net: bridge: don't print in br_switchdev_set_port_flag Message-ID: <20210209182617.GB262892@shredder.lan> References: <20210209151936.97382-1-olteanv@gmail.com> <20210209151936.97382-4-olteanv@gmail.com> <20210209173631.c75cdjxphwzipeg5@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210209173631.c75cdjxphwzipeg5@skbuf> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 09, 2021 at 07:36:31PM +0200, Vladimir Oltean wrote: > On Tue, Feb 09, 2021 at 05:19:28PM +0200, Vladimir Oltean wrote: > > From: Vladimir Oltean > > > > Currently br_switchdev_set_port_flag has two options for error handling > > and neither is good: > > - The driver returns -EOPNOTSUPP in PRE_BRIDGE_FLAGS if it doesn't > > support offloading that flag, and this gets silently ignored and > > converted to an errno of 0. Nobody does this. > > - The driver returns some other error code, like -EINVAL, in > > PRE_BRIDGE_FLAGS, and br_switchdev_set_port_flag shouts loudly. > > > > The problem is that we'd like to offload some port flags during bridge > > join and leave, but also not have the bridge shout at us if those fail. > > But on the other hand we'd like the user to know that we can't offload > > something when they set that through netlink. And since we can't have > > the driver return -EOPNOTSUPP or -EINVAL depending on whether it's > > called by the user or internally by the bridge, let's just add an extack > > argument to br_switchdev_set_port_flag and propagate it to its callers. > > Then, when we need offloading to really fail silently, this can simply > > be passed a NULL argument. > > > > Signed-off-by: Vladimir Oltean > > --- > > The build fails because since I started working on v2 and until I sent > it, Jakub merged net into net-next which contained this fix: > https://patchwork.kernel.org/project/netdevbpf/patch/20210207194733.1811529-1-olteanv@gmail.com/ > for which I couldn't change prototype due to it missing in net-next. > I think I would like to rather wait to gather some feedback first before > respinning v3, if possible. It seems that in the sysfs call path br_switchdev_set_port_flag() will be called with the bridge lock held, which is going to be a problem given that patch #8 allows this function to block.