Skip to content

Commit dc0ecab

Browse files
Arkadi Sharshevskydavem330
authored andcommitted
net: switchdev: Add support for querying supported bridge flags by hardware
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 <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Reviewed-by: Ivan Vecera <[email protected]> Signed-off-by: Jiri Pirko <[email protected]> Reviewed-by: Ivan Vecera <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6c8607e commit dc0ecab

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/net/switchdev.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ enum switchdev_attr_id {
4646
SWITCHDEV_ATTR_ID_PORT_PARENT_ID,
4747
SWITCHDEV_ATTR_ID_PORT_STP_STATE,
4848
SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS,
49+
SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT,
4950
SWITCHDEV_ATTR_ID_PORT_MROUTER,
5051
SWITCHDEV_ATTR_ID_BRIDGE_AGEING_TIME,
5152
SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING,
@@ -62,6 +63,7 @@ struct switchdev_attr {
6263
struct netdev_phys_item_id ppid; /* PORT_PARENT_ID */
6364
u8 stp_state; /* PORT_STP_STATE */
6465
unsigned long brport_flags; /* PORT_BRIDGE_FLAGS */
66+
unsigned long brport_flags_support; /* PORT_BRIDGE_FLAGS_SUPPORT */
6567
bool mrouter; /* PORT_MROUTER */
6668
clock_t ageing_time; /* BRIDGE_AGEING_TIME */
6769
bool vlan_filtering; /* BRIDGE_VLAN_FILTERING */

0 commit comments

Comments
 (0)