Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp69356pxt; Wed, 11 Aug 2021 14:48:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzn5eYTXilb3Lj295046Nltnq2ZS6Fp0nIrEs5wv9gHTEktASRtPkI73Kx5xQhFx3/oDXkx X-Received: by 2002:a17:906:1cd1:: with SMTP id i17mr558131ejh.173.1628718515575; Wed, 11 Aug 2021 14:48:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628718515; cv=none; d=google.com; s=arc-20160816; b=I8Gxlpn+cV/Kb0Ch8S8OWr3DIHj4KmnBuTBBrj/EFUpihOpdJzbHDtyrBzPPBDUvuZ FnvTari11OZOW2LacIUO7KYEUaZL9scc8cF2MwS6m3XkRFG+IeV3jzm73RM0kD1R6JaW 3Ixs2htIvq/ip7/e/FA37mTsflOYBu+9kke6Uku2/dj+8xFDE0nG8Lk9laL9ZIOfTyH5 K1sCD4dphI21H2dJpuf7TJn09zEwO6iKWs9mKWqCkEnbWh0ff7sDKFXWx+5TlgMWQANJ r8Zw49yo6s76vQup9iGythfU+AHCuzGJyvXT0u4NZAx7ZBKLphwEOLX+2fml/L8P0rCV d50Q== 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=L+XK7Qk5Y2p36ge4CexpmpUnKhHpaYlCSYaz/IyqAE4=; b=O5asgXrl16GAQ0txfAbZlMH627KONNrxZ6j+dvf9fnxS+684IqQLPdac7HzYMJgQ7p Gwm62QAS9HGZRG2VBYpMXnbPAv51xkaRzx9icSvvGjemy01AL/TNmkes4d2XCnZoD6bq SK+XWJhHbLR9o8afY12o3q39fkC/RG+6OtuxFQaQQEmF8ShRg5/Kxxh80OCnxEEOqCm6 i8Z/Xxl+wOr5rPTwSmJ7qaHGydG+gH5yTZ4kDCdYtwMfWQVLdx7WnVxMfiklwJsIljOj tZjrJsVVTkLpZ27Iw/iWH6cVjT8178YeYN8R/ZLpcqZWK71nOeXBPeiRRubphsef4GDk W3yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tJ7O2fOI; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qk39si318414ejc.261.2021.08.11.14.48.10; Wed, 11 Aug 2021 14:48:35 -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=@gmail.com header.s=20161025 header.b=tJ7O2fOI; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232318AbhHKVps (ORCPT + 99 others); Wed, 11 Aug 2021 17:45:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232335AbhHKVpq (ORCPT ); Wed, 11 Aug 2021 17:45:46 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 982BEC0613D3; Wed, 11 Aug 2021 14:45:09 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id o23so7150372ejc.3; Wed, 11 Aug 2021 14:45:09 -0700 (PDT) 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=L+XK7Qk5Y2p36ge4CexpmpUnKhHpaYlCSYaz/IyqAE4=; b=tJ7O2fOIjUrVETc7EGgmzQBQ3UFDdaE98MZN1nJj+IqEJ/rF1UpBvXAA8ZgqcXtBrs KYvWXKXoA7GZaS7XjPu/leRt1RjiFsJj7pc9QbDX/ZZp0FNSjPihO4mmhmdhGyL3pWT4 mIAZdYLcjLhdSW4bXZexgkff/bJPt4Co/X3gtNF9Tv/vRScIL16SGCrKOrWwdK7FxEWw Wiym9YDBI0Z5yExE16J1HtdCdtPa5VQH73b7gXDb3lCZScqwvMEpkKDH9JHHmowKtuyB RCmjmCBl4Fi59fg/2opwQfK+BzvcKcLdnijLKr6GbRGyUcmhORpODelGCgOucwJtjf0O crSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=L+XK7Qk5Y2p36ge4CexpmpUnKhHpaYlCSYaz/IyqAE4=; b=DQpFKCKUdOpau8ChyUWlIKkstNHRzUlcIJEyGPI/wN1Bt6Cy6OnkwHUhnLRdiFeWdR NChX9zOz3w9qnHZD7/dwabQwSV1bYd6CJbp7qf0jYDRXgTK9fh7J1/9uo+YC++H7gZ3I +JbdBmZy7HyWox8cbMGW02au+gQAYCPZ/Jk/nFNUPse2ggjBy1Qd8uGAzQvIymrnzD45 L9zZTX6xM6N+TN5zg3ZUtsZqR6IgOEPtGxs6kNCG26GqszdSF7463orpg3LTwlELmGn1 W743oMK6YnWpKTgYFJJOEHZNCi0jHo1bxVXZJndSPcBXVoHeIT0VWpKcUqVk/1c79/c0 Jh9w== X-Gm-Message-State: AOAM530bps5lI7lHm3LPVTZagtj2BpgfU1oKFNt9b4yO9HmQzlmF8qlR 2C/QqLgX/qHvcs4Zs7JyCCQ= X-Received: by 2002:a17:906:d183:: with SMTP id c3mr547453ejz.283.1628718308227; Wed, 11 Aug 2021 14:45:08 -0700 (PDT) Received: from skbuf ([188.25.144.60]) by smtp.gmail.com with ESMTPSA id e22sm210965eds.45.2021.08.11.14.45.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 14:45:07 -0700 (PDT) Date: Thu, 12 Aug 2021 00:45:06 +0300 From: Vladimir Oltean To: Ido Schimmel 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: <20210811214506.4pf5t3wgabs5blqj@skbuf> References: <20210811135247.1703496-1-dqfext@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. (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)