@@ -942,7 +942,7 @@ static int br_setport(struct net_bridge_port *p, struct nlattr *tb[],
changed_mask = old_flags ^ p->flags;
- err = br_switchdev_set_port_flag(p, p->flags, changed_mask, extack);
+ err = br_switchdev_set_dev_flag(p->dev, p->flags, changed_mask, extack);
if (err) {
p->flags = old_flags;
return err;
@@ -2038,7 +2038,7 @@ void nbp_switchdev_frame_mark(const struct net_bridge_port *p,
struct sk_buff *skb);
bool nbp_switchdev_allowed_egress(const struct net_bridge_port *p,
const struct sk_buff *skb);
-int br_switchdev_set_port_flag(struct net_bridge_port *p,
+int br_switchdev_set_dev_flag(struct net_device *dev,
unsigned long flags,
unsigned long mask,
struct netlink_ext_ack *extack);
@@ -2108,7 +2108,7 @@ static inline bool nbp_switchdev_allowed_egress(const struct net_bridge_port *p,
return true;
}
-static inline int br_switchdev_set_port_flag(struct net_bridge_port *p,
+static inline int br_switchdev_set_dev_flag(struct net_device *dev,
unsigned long flags,
unsigned long mask,
struct netlink_ext_ack *extack)
@@ -74,13 +74,13 @@ bool nbp_switchdev_allowed_egress(const struct net_bridge_port *p,
#define BR_PORT_FLAGS_HW_OFFLOAD (BR_LEARNING | BR_FLOOD | \
BR_MCAST_FLOOD | BR_BCAST_FLOOD | BR_PORT_LOCKED)
-int br_switchdev_set_port_flag(struct net_bridge_port *p,
+int br_switchdev_set_dev_flag(struct net_device *dev,
unsigned long flags,
unsigned long mask,
struct netlink_ext_ack *extack)
{
struct switchdev_attr attr = {
- .orig_dev = p->dev,
+ .orig_dev = dev,
};
struct switchdev_notifier_port_attr_info info = {
.attr = &attr,
@@ -96,7 +96,7 @@ int br_switchdev_set_port_flag(struct net_bridge_port *p,
attr.u.brport_flags.mask = mask;
/* We run from atomic context here */
- err = call_switchdev_notifiers(SWITCHDEV_PORT_ATTR_SET, p->dev,
+ err = call_switchdev_notifiers(SWITCHDEV_PORT_ATTR_SET, dev,
&info.info, extack);
err = notifier_to_errno(err);
if (err == -EOPNOTSUPP)
@@ -112,7 +112,7 @@ int br_switchdev_set_port_flag(struct net_bridge_port *p,
attr.id = SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS;
attr.flags = SWITCHDEV_F_DEFER;
- err = switchdev_port_attr_set(p->dev, &attr, extack);
+ err = switchdev_port_attr_set(dev, &attr, extack);
if (err) {
if (extack && !extack->_msg)
NL_SET_ERR_MSG_MOD(extack,
@@ -69,7 +69,7 @@ static int store_flag(struct net_bridge_port *p, unsigned long v,
flags &= ~mask;
if (flags != p->flags) {
- err = br_switchdev_set_port_flag(p, flags, mask, &extack);
+ err = br_switchdev_set_dev_flag(p->dev, flags, mask, &extack);
if (err) {
netdev_err(p->dev, "%s\n", extack._msg);
return err;
The br_switchdev_set_port_flag() function only uses the `p->dev` member of the port, and we also want to reuse it for the bridge itself. Change the first argument and the name of the function to match. Signed-off-by: Joachim Wiberg <troglobit@gmail.com> --- net/bridge/br_netlink.c | 2 +- net/bridge/br_private.h | 4 ++-- net/bridge/br_switchdev.c | 8 ++++---- net/bridge/br_sysfs_if.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-)