Return-Path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=3IKSUC2PbMBLcmAxJNHDlsNxrnoGLUkLdRWIm40sEpc=; b=LGw97nE1cdPwc3VbbdI7b3jcHyQ5rDSJXCpydItAPA5Duy7SnDry4v7J4PxhT0geS6 Q4VfKF0h844R3hVgCo54tdyExYyz5Mey9SqemYKef05Yhwl4eX8VZhJCjjGd2Xa90O01 PnHKbpH7BtHXyaPZdZzcY8cS02pRNsKUyPv6GdpdSnLDmd10xlE6NysARS0+T9Q2KY8d x+HvCxriBjgv2a78wFPePpW0sqjFfX106VbA50dcMre5AA483PPmKFWlhW2zJyqeYOF0 C+PC6bAZ12wwNYmvAyxSoUAZXPDe8phSMQd5gPunsSFUMFjEqG1rYCstOM4qG53nb86p roMg== Date: Tue, 9 Feb 2021 19:36:31 +0200 From: Vladimir Oltean Message-ID: <20210209173631.c75cdjxphwzipeg5@skbuf> References: <20210209151936.97382-1-olteanv@gmail.com> <20210209151936.97382-4-olteanv@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210209151936.97382-4-olteanv@gmail.com> Subject: Re: [Bridge] [PATCH v2 net-next 03/11] net: bridge: don't print in br_switchdev_set_port_flag List-Id: Linux Ethernet Bridging List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jakub Kicinski , "David S. Miller" Cc: Ivan Vecera , Andrew Lunn , Alexandre Belloni , Florian Fainelli , Jiri Pirko , 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 , Grygorii Strashko , Nikolay Aleksandrov , Roopa Prabhu , linux-omap@vger.kernel.org, Vivien Didelot 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.