Skip to content

Commit e123024

Browse files
ffainellidavem330
authored andcommitted
staging: fsl-dpaa2: ethsw: Handle PORT_PRE_BRIDGE_FLAGS
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 <f.fainelli@gmail.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c19c44f commit e123024

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

  • drivers/staging/fsl-dpaa2/ethsw

‎drivers/staging/fsl-dpaa2/ethsw/ethsw.c‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,16 @@ static int port_attr_stp_state_set(struct net_device *netdev,
666666
return ethsw_port_set_stp_state(port_priv, state);
667667
}
668668

669+
static int port_attr_br_flags_pre_set(struct net_device *netdev,
670+
struct switchdev_trans *trans,
671+
unsigned long flags)
672+
{
673+
if (flags & ~(BR_LEARNING | BR_FLOOD))
674+
return -EINVAL;
675+
676+
return 0;
677+
}
678+
669679
static int port_attr_br_flags_set(struct net_device *netdev,
670680
struct switchdev_trans *trans,
671681
unsigned long flags)
@@ -698,6 +708,10 @@ static int swdev_port_attr_set(struct net_device *netdev,
698708
err = port_attr_stp_state_set(netdev, trans,
699709
attr->u.stp_state);
700710
break;
711+
case SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS:
712+
err = port_attr_br_flags_pre_set(netdev, trans,
713+
attr->u.brport_flags);
714+
break;
701715
case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS:
702716
err = port_attr_br_flags_set(netdev, trans,
703717
attr->u.brport_flags);

0 commit comments

Comments
 (0)