Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp724454pxt; Thu, 12 Aug 2021 08:15:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7O93+40TDSiOZmKU8clIbXWk7lkWOZDBfkppvvfMw7rWK32gjHKzSEJVmNmG+DmCgocDX X-Received: by 2002:aa7:c952:: with SMTP id h18mr6168526edt.18.1628781320923; Thu, 12 Aug 2021 08:15:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628781320; cv=none; d=google.com; s=arc-20160816; b=wPvsXqnA4GMvAsw+YHt5stXdA/mep53CKEd121C+jeTjC1CJ9fTuFFr16drTQQj4RR Zq/LM49eg7p/5qA+Ll7+mXXvMyPX0hV0XCAVHJRjlD/BgAzZYTB8qjziM0YxyiUpT5Z/ 3U0gVwTq+Ph8NogC1/OgwRbvP4Igmc46SN0xfvF9jqmv9Q4/wtDd4um0Qz0EmKYyYiG5 abkgOmJ3f2nk8/490biwJBmSrBfJSqDqh1BVmGf5KYVmMtjhkFAZE6bf72L5bADOQ4Sg DipH1bpAlccRXhlVLjDwvjz9FsYJNUHe0F7VaU4Ows3VL7CwxgCjMqGrCXm9kdqWNs2k NSJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Th9WKl0IW7GpxbqwwqPmaZkhN6z6TMP9nRsqCNvkXyc=; b=0lzrvu0sZ33OickwFjyLGJwi4TTxMdtARL2gD+pwRhzUJaHkSUVIkeYwJl0r3k/o1t FVvaHfSJZn9XoBLHZpuTxcQD34l7QGxLDDuGfQLvtRkg+uucwzebaL2H7Ihm+k1RCbdE rPEX1r8g9ce1agjPRM/6Be3rowE+IVJwQ8Q6VhYcxkHvJevXZzsyIbYsoIuYRKbzztfW xJt9iyOFtrcDCyJFutUkjMdHhkgIWkZQSpAWJE9bZ+TgfI1UFgGjj6A0QEt13dT/yBlM sG3D+W1pdCV6zAvsfEfDoS+nbV3HW/78kY3KJhGtV84uTKWbXMkYEHuUUb5cidul+C+n CzpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B1kZBxgA; 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 h13si2801172edb.198.2021.08.12.08.14.56; Thu, 12 Aug 2021 08:15:20 -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=B1kZBxgA; 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 S237977AbhHLOWt (ORCPT + 99 others); Thu, 12 Aug 2021 10:22:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233282AbhHLOWs (ORCPT ); Thu, 12 Aug 2021 10:22:48 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31CD4C061756; Thu, 12 Aug 2021 07:22:23 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id q2so7449670plr.11; Thu, 12 Aug 2021 07:22:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Th9WKl0IW7GpxbqwwqPmaZkhN6z6TMP9nRsqCNvkXyc=; b=B1kZBxgA7H8EfDvYb+YKpfkgRv4EqGRi2cH1Te2uNIimCZT5XlojbYszrNoi9qIQLx 48uzO637fAGckSKocGF6qT99SFw0+S9cg6QmbUWk9xZF085QvQUC1Udn3QqoeTGM7y2s +QVOfLPW9B7K9hlkEQHBieJ8HT4t2UpyDEJdmo+f7kRlKCROqxlF/jZr9G02q13tsV8l 5FqjNqllTJyw73LCn39+PxASzRsKmbLTeDPoQHU5rMJG51qbyU7nzbQGph6E7u9516r1 RYtVZPTChFfyfGy2NRW53ClkrGI2mCNaHCUg4Uy4rICDjZpi67kB2NBgClxPDeiutpZh Rs1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Th9WKl0IW7GpxbqwwqPmaZkhN6z6TMP9nRsqCNvkXyc=; b=jTgcqGR5fLb84IlSNMq+pxttNK8WyfNwwxKOYOtaD20p1EasocVeE/JCJbpAnQ2t2c g0qBYzRUMAJT0ud29kiL05iw2ura4UTVrywhhc5q+dcCW0p8VnT8dz6TsCNKRYGMSpWz z4rapOSkR/F+aLArgADy9kbkYdjNN6X7GM1zMRBEMsa23iX7F7d5UR+12AkvErqvVhRj GnL1FuIC0t2GWS08ZGqyylZyojU0+Pl+pvZ5JaA/3JysGgjk/pl24ke3gWdK95RZYqyb vyHgo4fxIbc1ntoNRq6KiUVcsoVpai/NcYaizu9G03j94MgrqLDEzYJJtXK4KfE/X4od PVgA== X-Gm-Message-State: AOAM530kB0hFLIPR8XBjuHxylDf3eGEiNhznnzxe0hLHMXy+AKnqk3fR 7TLoohLSOKcPo+DrTPMM9ys= X-Received: by 2002:a63:5815:: with SMTP id m21mr4075188pgb.363.1628778142724; Thu, 12 Aug 2021 07:22:22 -0700 (PDT) Received: from haswell-ubuntu20.lan ([138.197.212.246]) by smtp.gmail.com with ESMTPSA id x81sm3706010pfc.22.2021.08.12.07.22.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Aug 2021 07:22:22 -0700 (PDT) From: DENG Qingfang To: Roopa Prabhu , Nikolay Aleksandrov , "David S. Miller" , Jakub Kicinski , Jiri Pirko , Ivan Vecera , bridge@lists.linux-foundation.org (moderated list:ETHERNET BRIDGE), netdev@vger.kernel.org (open list:ETHERNET BRIDGE), linux-kernel@vger.kernel.org (open list) Cc: Ido Schimmel , Tobias Waldekranz , Vladimir Oltean Subject: [PATCH net-next v2] net: bridge: switchdev: pass more port flags to drivers Date: Thu, 12 Aug 2021 22:22:12 +0800 Message-Id: <20210812142213.2251697-1-dqfext@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These 3 port flags: BR_HAIRPIN_MODE, BR_MULTICAST_TO_UNICAST, and BR_ISOLATED, affect the data path and should be handled by switchdev drivers. Add them to BR_PORT_FLAGS_HW_OFFLOAD so they can be passed down to the drivers. Suggested-by: Vladimir Oltean Signed-off-by: DENG Qingfang --- v1 -> v2: added more flags net/bridge/br_switchdev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/bridge/br_switchdev.c b/net/bridge/br_switchdev.c index 6bf518d78f02..2ab46178c47c 100644 --- a/net/bridge/br_switchdev.c +++ b/net/bridge/br_switchdev.c @@ -70,8 +70,10 @@ 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) +#define BR_PORT_FLAGS_HW_OFFLOAD (BR_HAIRPIN_MODE | BR_LEARNING | \ + BR_FLOOD | BR_MCAST_FLOOD | \ + BR_MULTICAST_TO_UNICAST | \ + BR_BCAST_FLOOD | BR_ISOLATED) int br_switchdev_set_port_flag(struct net_bridge_port *p, unsigned long flags, -- 2.25.1