Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp170836imp; Wed, 20 Feb 2019 16:59:36 -0800 (PST) X-Google-Smtp-Source: AHgI3IbOyzWA97MN+oQgVnH0e3dNWB0nuGh+4RXFjWoMjUAenlUJp15Tqq0uqkxfN1T6p2Nzkvyp X-Received: by 2002:a63:4f58:: with SMTP id p24mr17724365pgl.283.1550710776595; Wed, 20 Feb 2019 16:59:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550710776; cv=none; d=google.com; s=arc-20160816; b=NFpAXSE/xVGP/LfVHnz7LcJnngWKk5g4fy+jCu4hLZE+sWsqsLkV3lKg1VyiZqDtuu OxVnTWVqfq8D8x6FrY06a2VLpOrNVRNyCzsfn5s2mMY/TUAjIwcYizwWJDiz65DgTBFQ O4FE/kmwTq4Muvqk08WGBfpNoCCySVc0QFE8+wCsWyzL5UwM/dKo1qy3ezrhE0tp3cBC SYSHnB5sA7+e+uljXXtIs024zaJoFr4Ies8zjAMZQ39pIdotsqORQ7amgALrdIsTVdzW wcf3fzLBUitVqG/1nlv4YCU+13zqnrhsk/0M18u/WBz5VMvgV02MdDosfzA9+6/KDHfG PJuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=eZxdWd5BQlnzdNHuRiN/vDhYfkVgZqkkTonly3+6XNg=; b=evtuCLxF2+2ebHkq/FdL0+uXCe5oHuCF3XQ+0tkOOorT0bItKYqj27TSLSaSrAJ1KS Yo2ruW/Sp/G8/ncKp5rg6EG+6lLsUy0w8mn7ZXmg6NtBHUu8nU7bGzwePf0+2z5EKe8f /WAVpTZhEePtwcPGE8HpBNFPn01MsMuj6uqpS4quZBst8humOVuC8x6CYojYtKN1r7R6 T6w1V00UexmQSAok2RE+D7QdZBgW0vgicv0JH7otKGctdJhN+nWv0fXN6lPUgv1shemo 5uoEA3OnC2avyb8pIaerYisq4KRRKtCPLb/X+6q6k3oSugl5A/WO7/AapOQ89Q3RsWkM ZTmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bXcOXwYt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id q17si6494916pgv.39.2019.02.20.16.59.21; Wed, 20 Feb 2019 16:59:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bXcOXwYt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726986AbfBUA6u (ORCPT + 99 others); Wed, 20 Feb 2019 19:58:50 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:47031 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725875AbfBUA6s (ORCPT ); Wed, 20 Feb 2019 19:58:48 -0500 Received: by mail-pl1-f196.google.com with SMTP id o6so13182978pls.13; Wed, 20 Feb 2019 16:58:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eZxdWd5BQlnzdNHuRiN/vDhYfkVgZqkkTonly3+6XNg=; b=bXcOXwYtbhyqPtx2gy03bNk8/8R7tM/L1iu2dyH+wXVFAhsCx6o0VQ1qc/dSnhZ+38 LQEUYG6vjjvIqpgCAYzdT3oLXkWrPf06Sr6v5NqzygTmK3yZKXPeXcxlA0PcLsLmn3x4 iF9LuC9X1R95bA5ONPpwcqwQy/R8pHoRkVCynAqs7IxhYNy1jDZdEnwXU8D7P/7IGFdO RYqv5J+4irDAO3u4mPb2YGAKDOKHpBKMw8fbn99v5eQ5kY7tDwq9Ro6sVwKX4T8ya9l6 OFZvDWpclJ3ByYNXXTeSSFPmiXmF6hzDUeuYT9gFMlmdg19h17zvgxAqsnYhgChJB99P R2Fw== 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:in-reply-to :references; bh=eZxdWd5BQlnzdNHuRiN/vDhYfkVgZqkkTonly3+6XNg=; b=m3T7UeARCwgVGEQ3Z/j1nS1UlJBxtZFz4lCHhAdck32FNlkbFiEIg2PvQPK+G7cfSV G+eoWDQOdz1oJSqnU3OabhfXL9KOGFeop0A3eb0RKgkR/adBQ8RzzmwgtcGYR+Gke1G5 6lULwbD75lekHNLY2m27HOpGoGzx8Me7D9UXP5uC3FzsjxDi0msL3UJXqt3A+201FfOH r0/vv7HII64OemM7OANXlqZz8zxQvgGAE+o7ZnABu5640sPCkxft7ABaDW6+KlqM16Mo XSfcHcBREanbLWt1QwZb2t4QODk63va1Crzc3ekYx7OadyF+UdU4chRPhx7J8Ky1lZbH pCBA== X-Gm-Message-State: AHQUAubdUNGQq8FqSjY1UfXeQBhlocgXRP7PcKmvMnoi7/ka53OmW+Sz uXn2iukYllqEef5QsKaSGTdPCYl+ X-Received: by 2002:a17:902:b598:: with SMTP id a24mr22432913pls.27.1550710727459; Wed, 20 Feb 2019 16:58:47 -0800 (PST) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id z15sm17203255pgc.25.2019.02.20.16.58.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Feb 2019 16:58:46 -0800 (PST) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , "David S. Miller" , Ido Schimmel , linux-kernel@vger.kernel.org (open list), devel@driverdev.osuosl.org (open list:STAGING SUBSYSTEM), bridge@lists.linux-foundation.org (moderated list:ETHERNET BRIDGE), jiri@mellanox.com, andrew@lunn.ch, vivien.didelot@gmail.com Subject: [PATCH net-next v3 3/8] staging: fsl-dpaa2: ethsw: Handle PORT_PRE_BRIDGE_FLAGS Date: Wed, 20 Feb 2019 16:58:21 -0800 Message-Id: <20190221005826.26317-4-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190221005826.26317-1-f.fainelli@gmail.com> References: <20190221005826.26317-1-f.fainelli@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In preparation for removing SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT, handle the SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS attribute and check that the bridge port flags being configured are supported. Signed-off-by: Florian Fainelli --- drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c index 1b3943b71254..331625137717 100644 --- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c +++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c @@ -666,6 +666,16 @@ static int port_attr_stp_state_set(struct net_device *netdev, return ethsw_port_set_stp_state(port_priv, state); } +static int port_attr_br_flags_pre_set(struct net_device *netdev, + struct switchdev_trans *trans, + unsigned long flags) +{ + if (flags & ~(BR_LEARNING | BR_FLOOD)) + return -EINVAL; + + return 0; +} + static int port_attr_br_flags_set(struct net_device *netdev, struct switchdev_trans *trans, unsigned long flags) @@ -698,6 +708,10 @@ static int swdev_port_attr_set(struct net_device *netdev, err = port_attr_stp_state_set(netdev, trans, attr->u.stp_state); break; + case SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS: + err = port_attr_br_flags_pre_set(netdev, trans, + attr->u.brport_flags); + break; case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS: err = port_attr_br_flags_set(netdev, trans, attr->u.brport_flags); -- 2.17.1