From patchwork Mon Jun 5 09:20:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Pirko X-Patchwork-Id: 771153 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wh8VJ1rGQz9s06 for ; Mon, 5 Jun 2017 19:22:32 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=resnulli-us.20150623.gappssmtp.com header.i=@resnulli-us.20150623.gappssmtp.com header.b="vMCaInDN"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751761AbdFEJU4 (ORCPT ); Mon, 5 Jun 2017 05:20:56 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35152 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751723AbdFEJUr (ORCPT ); Mon, 5 Jun 2017 05:20:47 -0400 Received: by mail-wm0-f68.google.com with SMTP id g15so28759638wmc.2 for ; Mon, 05 Jun 2017 02:20:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nv5cXOMFCGHJV6srDiolNj2g9Zp1yuuma7l+fjJu4UI=; b=vMCaInDNUKJZET4GDiBF62HeGrPHzpF98yJHlNB1nE24D0XHfEo5Uv0/kZ3iSKuvv8 4qdxqEaG6kydgqvlpfXfkk3SxJZgC2VuGSBdCQTm5P7yagNE+daNKkMDB7P4ARxmFIFR /CiY6ER3w7iterCyq88Mze45flAFoyN+NP/LOBF/kJHmRb7ZBIqqHJ/iuGoBU2HzWmpw TQiLekFD3V+ihR3B+K4ZE5mNeLa0JMsltSo/6xjwfvSqJ+O2q78kmO9oZqlmK3D3FX4i dFf1EzJ6ZEou6rWwASLhURck6yu2Vc3Xs9vslOtdwZQYfZpDC6QEU0AUX3DiFs35hGLW RMPA== 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=nv5cXOMFCGHJV6srDiolNj2g9Zp1yuuma7l+fjJu4UI=; b=Elo0av98TXlIs5QtsGvGLHPikW+5bLzKGHTC22zYglqmGugx1THx0Bm2Yz0QI3jSHr 1/d/0eHTQoXXi4vLkduN0et/loqMjdVvgXhTsAMdT7t5nLT3DIdZl2XaDTYiNpf7W0TF MgxayEWhxIR7MKEUnyH7sPPkbv/hxN34dS7LtTl/EYXeWt1Do5VhAYqXXBJgS5Cv4ieR J7oROsIjxtvGj3UfKZMEovWihSUiE00f+NoJuxQdlIfMV6j9MhGMkQocffcOGQ1gZ7Ox wrNbCIa4a24qdceKKDnzq9fVWLnd+duAVcYPWdVawZSIT4CPKPBW8WqvSq+DIcsejWNI lqXQ== X-Gm-Message-State: AODbwcDAX6oe5xvuEXK2Z03J/qoGEnYWAst5dkzzQzjg3q15iMCP7pE5 umGwZagT1EOm8NVlH2c= X-Received: by 10.28.51.73 with SMTP id z70mr6814375wmz.65.1496654445829; Mon, 05 Jun 2017 02:20:45 -0700 (PDT) Received: from localhost (jirka.pirko.cz. [84.16.102.26]) by smtp.gmail.com with ESMTPSA id g3sm5433668wrd.11.2017.06.05.02.20.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 05 Jun 2017 02:20:45 -0700 (PDT) From: Jiri Pirko To: netdev@vger.kernel.org Cc: davem@davemloft.net, idosch@mellanox.com, arkadis@mellanox.com, mlxsw@mellanox.com, roopa@cumulusnetworks.com, stephen@networkplumber.org, ivecera@redhat.com Subject: [patch net-next 01/19] net: switchdev: Add support for querying supported bridge flags by hardware Date: Mon, 5 Jun 2017 11:20:25 +0200 Message-Id: <20170605092043.3523-2-jiri@resnulli.us> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170605092043.3523-1-jiri@resnulli.us> References: <20170605092043.3523-1-jiri@resnulli.us> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Arkadi Sharshevsky This is done as a preparation stage before setting the bridge port flags from the bridge code. Currently the device can be queried for the bridge flags state, but the querier cannot distinguish if the flag is disabled or if it is not supported at all. Thus, add new attr and a bit-mask which include information regarding the support on a per-flag basis. Drivers that support bridge offload but not support bridge flags should return zeroed bitmask. Signed-off-by: Arkadi Sharshevsky Reviewed-by: Ido Schimmel Signed-off-by: Jiri Pirko Reviewed-by: Ivan Vecera --- include/net/switchdev.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/net/switchdev.h b/include/net/switchdev.h index 929d6af..63a754d 100644 --- a/include/net/switchdev.h +++ b/include/net/switchdev.h @@ -46,6 +46,7 @@ enum switchdev_attr_id { SWITCHDEV_ATTR_ID_PORT_PARENT_ID, SWITCHDEV_ATTR_ID_PORT_STP_STATE, SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS, + SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT, SWITCHDEV_ATTR_ID_PORT_MROUTER, SWITCHDEV_ATTR_ID_BRIDGE_AGEING_TIME, SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING, @@ -62,6 +63,7 @@ struct switchdev_attr { struct netdev_phys_item_id ppid; /* PORT_PARENT_ID */ u8 stp_state; /* PORT_STP_STATE */ unsigned long brport_flags; /* PORT_BRIDGE_FLAGS */ + unsigned long brport_flags_support; /* PORT_BRIDGE_FLAGS_SUPPORT */ bool mrouter; /* PORT_MROUTER */ clock_t ageing_time; /* BRIDGE_AGEING_TIME */ bool vlan_filtering; /* BRIDGE_VLAN_FILTERING */