Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp72906pxt; Wed, 11 Aug 2021 14:56:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7mNNvdc2afyxmhKqNVZMyFwIfoY9PJzPA/8KwIIMEyDxHvPnbP4eFbbeEMFHqDivwtIQr X-Received: by 2002:a17:906:1919:: with SMTP id a25mr584040eje.161.1628718963588; Wed, 11 Aug 2021 14:56:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628718963; cv=none; d=google.com; s=arc-20160816; b=G9EnB2VmkAGl/i1ippPshFW1aL3vUI73whC1cOAIsaWtOUqdP6OVgedhjCjPs8ILdN vy3cbI2FlWRuc9YSbou3DoPNRzfwJTGXQRG6V/c5j5aduoDeTa6U8Fb81Yu+zuRLy7KT 5Qqu3mDhbgoa1jyibExP8lj4pNuioVyCyBFV5bVrYszlwnlg/PuMHpMSutg5gJr7G4RO OViyYn9IZDUlFglszEc+lwYkFr/t1sdFIyfFjub1l5i1TD75zFaFbmwE/h5dth+HB6oJ c5B9S2gQs2bKkHgJQyE98z9/KG7/9o/DFmnBEzt+iIQc/S47Q4f+C68ougRa0gYmMmvO Tijw== 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=FK7M9kOwfu+KZDsOKjdiQ8lyNCXWTSpz2RJWMEH8QTE=; b=l50E7Da3iCP37sq2tMbpfPOD2SXJBdo60bljGdLZpcrVRxt7alci1hsgOpSt8zP4og P6RL/j5kq6/xhqGqDRab3EsY26psenPSNH+xKrAZ6a7VrCC32AFiVqa1WoMrau30szpx 4cQK3nD6XORbFRDsCl77vTbQrPxcOpU60OrK4DZ/G+I77MQ3P24BOXWl34ZgY4jk/O42 604SAwxZ1tFHleQLpliua1RxP5ACe1Eoa2xLmNpqbfkEIstJMzz/xk1kkcn6EEodSQ4g aB//Wez57rPPKU06BQMUhmTrvAg3irZRKYtvIu4nvajiq8H79M2v93agadaYDDFkckP3 MQWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=myEzfllX; 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 ap14si348936ejc.49.2021.08.11.14.55.40; Wed, 11 Aug 2021 14:56:03 -0700 (PDT) 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=fm3 header.b=myEzfllX; 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 S232318AbhHKVxS (ORCPT + 99 others); Wed, 11 Aug 2021 17:53:18 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:38659 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232166AbhHKVxR (ORCPT ); Wed, 11 Aug 2021 17:53:17 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id AD6435C00BE; Wed, 11 Aug 2021 17:52:52 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 11 Aug 2021 17:52:52 -0400 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=fm3; bh=FK7M9k Owfu+KZDsOKjdiQ8lyNCXWTSpz2RJWMEH8QTE=; b=myEzfllXbQ91dfcBRmK3Yi EIsoDkH8QYIvtmWI06mfJudcL/j9ABgMuHQZ3ULavzfvBITA5nKaqFbyb+yC7wZu NoEcIzQwFqIIoquw6vTg52KjbQQNXrpjLVffJ2xB9BlmaxTD9jrfP2vS2MehMPPI 8GsnpdKafi0DoMVN56gkf/E4fYfS6K2nhhsMmXi9PgU47cIlJOiCQjW4CGT8rLIM fypQcoUzK6i7wIfAzLMHAzmsf4YImpn+iJU4Hd1ryS67+WD7i9cNz/DFMnhZ/b8w skGLGNQ2PEBwVNMBIgMUOR7zwjZKKbgVvqCHqfqu8DB7msNEPpOvSpFw/08a1qKw == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrkedvgddtvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepkfguohcuufgt hhhimhhmvghluceoihguohhstghhsehiughoshgthhdrohhrgheqnecuggftrfgrthhtvg hrnheptdffkeekfeduffevgeeujeffjefhtefgueeugfevtdeiheduueeukefhudehleet necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihguoh hstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 11 Aug 2021 17:52:51 -0400 (EDT) Date: Thu, 12 Aug 2021 00:52:48 +0300 From: Ido Schimmel To: Vladimir Oltean Cc: DENG Qingfang , Roopa Prabhu , Nikolay Aleksandrov , "David S. Miller" , Jakub Kicinski , "moderated list:ETHERNET BRIDGE" , "open list:ETHERNET BRIDGE" , open list , Florian Fainelli Subject: Re: [PATCH net-next] net: bridge: switchdev: allow port isolation to be offloaded Message-ID: References: <20210811135247.1703496-1-dqfext@gmail.com> <20210811214506.4pf5t3wgabs5blqj@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210811214506.4pf5t3wgabs5blqj@skbuf> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 12, 2021 at 12:45:06AM +0300, Vladimir Oltean wrote: > On Thu, Aug 12, 2021 at 12:38:56AM +0300, Ido Schimmel wrote: > > On Wed, Aug 11, 2021 at 09:52:46PM +0800, DENG Qingfang wrote: > > > Add BR_ISOLATED flag to BR_PORT_FLAGS_HW_OFFLOAD, to allow switchdev > > > drivers to offload port isolation. > > > > > > Suggested-by: Vladimir Oltean > > > Signed-off-by: DENG Qingfang > > > --- > > > net/bridge/br_switchdev.c | 3 ++- > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > diff --git a/net/bridge/br_switchdev.c b/net/bridge/br_switchdev.c > > > index 6bf518d78f02..898257153883 100644 > > > --- a/net/bridge/br_switchdev.c > > > +++ b/net/bridge/br_switchdev.c > > > @@ -71,7 +71,8 @@ bool nbp_switchdev_allowed_egress(const struct net_bridge_port *p, > > > > > > /* Flags that can be offloaded to hardware */ > > > #define BR_PORT_FLAGS_HW_OFFLOAD (BR_LEARNING | BR_FLOOD | \ > > > - BR_MCAST_FLOOD | BR_BCAST_FLOOD) > > > + BR_MCAST_FLOOD | BR_BCAST_FLOOD | \ > > > + BR_ISOLATED) > > > > Why add it now and not as part of a patchset that actually makes use of > > the flag in a driver that offloads port isolation? > > The way the information got transmitted is a bit unfortunate. > > Making BR_ISOLATED part of BR_PORT_FLAGS_HW_OFFLOAD is a matter of > correctness when switchdev offloads the data path. Since this feature > will not work correctly without driver intervention, it makes sense that > drivers should reject it currently, which is exactly what this patch > accomplishes - it makes the code path go through the > SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS driver handlers, which return > -EINVAL for everything they don't recognize. If the purpose is correctness, then this is not the only flag that was missed. BR_HAIRPIN_MODE is also relevant for the data path, for example. Anyway, the commit message needs to be reworded to reflect the true purpose of the patch. > > (yes, we do still have a problem for drivers that don't catch > SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS at all, switchdev will return > -EOPNOTSUPP for those which is then ignored, but those are in the > minority)