提交 add511b3 编写于 作者: R Roopa Prabhu 提交者: David S. Miller

bridge: add flags argument to ndo_bridge_setlink and ndo_bridge_dellink

bridge flags are needed inside ndo_bridge_setlink/dellink handlers to
avoid another call to parse IFLA_AF_SPEC inside these handlers

This is used later in this series
Signed-off-by: NRoopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 aafb3e98
...@@ -4327,7 +4327,8 @@ int be_load_fw(struct be_adapter *adapter, u8 *fw_file) ...@@ -4327,7 +4327,8 @@ int be_load_fw(struct be_adapter *adapter, u8 *fw_file)
return status; return status;
} }
static int be_ndo_bridge_setlink(struct net_device *dev, struct nlmsghdr *nlh) static int be_ndo_bridge_setlink(struct net_device *dev, struct nlmsghdr *nlh,
u16 flags)
{ {
struct be_adapter *adapter = netdev_priv(dev); struct be_adapter *adapter = netdev_priv(dev);
struct nlattr *attr, *br_spec; struct nlattr *attr, *br_spec;
......
...@@ -7786,7 +7786,7 @@ static int ixgbe_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], ...@@ -7786,7 +7786,7 @@ static int ixgbe_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
} }
static int ixgbe_ndo_bridge_setlink(struct net_device *dev, static int ixgbe_ndo_bridge_setlink(struct net_device *dev,
struct nlmsghdr *nlh) struct nlmsghdr *nlh, u16 flags)
{ {
struct ixgbe_adapter *adapter = netdev_priv(dev); struct ixgbe_adapter *adapter = netdev_priv(dev);
struct nlattr *attr, *br_spec; struct nlattr *attr, *br_spec;
......
...@@ -3722,7 +3722,7 @@ static int rocker_port_fdb_dump(struct sk_buff *skb, ...@@ -3722,7 +3722,7 @@ static int rocker_port_fdb_dump(struct sk_buff *skb,
} }
static int rocker_port_bridge_setlink(struct net_device *dev, static int rocker_port_bridge_setlink(struct net_device *dev,
struct nlmsghdr *nlh) struct nlmsghdr *nlh, u16 flags)
{ {
struct rocker_port *rocker_port = netdev_priv(dev); struct rocker_port *rocker_port = netdev_priv(dev);
struct nlattr *protinfo; struct nlattr *protinfo;
......
...@@ -1154,13 +1154,15 @@ struct net_device_ops { ...@@ -1154,13 +1154,15 @@ struct net_device_ops {
int idx); int idx);
int (*ndo_bridge_setlink)(struct net_device *dev, int (*ndo_bridge_setlink)(struct net_device *dev,
struct nlmsghdr *nlh); struct nlmsghdr *nlh,
u16 flags);
int (*ndo_bridge_getlink)(struct sk_buff *skb, int (*ndo_bridge_getlink)(struct sk_buff *skb,
u32 pid, u32 seq, u32 pid, u32 seq,
struct net_device *dev, struct net_device *dev,
u32 filter_mask); u32 filter_mask);
int (*ndo_bridge_dellink)(struct net_device *dev, int (*ndo_bridge_dellink)(struct net_device *dev,
struct nlmsghdr *nlh); struct nlmsghdr *nlh,
u16 flags);
int (*ndo_change_carrier)(struct net_device *dev, int (*ndo_change_carrier)(struct net_device *dev,
bool new_carrier); bool new_carrier);
int (*ndo_get_phys_port_id)(struct net_device *dev, int (*ndo_get_phys_port_id)(struct net_device *dev,
......
...@@ -494,7 +494,7 @@ static int br_setport(struct net_bridge_port *p, struct nlattr *tb[]) ...@@ -494,7 +494,7 @@ static int br_setport(struct net_bridge_port *p, struct nlattr *tb[])
} }
/* Change state and parameters on port. */ /* Change state and parameters on port. */
int br_setlink(struct net_device *dev, struct nlmsghdr *nlh) int br_setlink(struct net_device *dev, struct nlmsghdr *nlh, u16 flags)
{ {
struct nlattr *protinfo; struct nlattr *protinfo;
struct nlattr *afspec; struct nlattr *afspec;
...@@ -550,7 +550,7 @@ int br_setlink(struct net_device *dev, struct nlmsghdr *nlh) ...@@ -550,7 +550,7 @@ int br_setlink(struct net_device *dev, struct nlmsghdr *nlh)
} }
/* Delete port information */ /* Delete port information */
int br_dellink(struct net_device *dev, struct nlmsghdr *nlh) int br_dellink(struct net_device *dev, struct nlmsghdr *nlh, u16 flags)
{ {
struct nlattr *afspec; struct nlattr *afspec;
struct net_bridge_port *p; struct net_bridge_port *p;
......
...@@ -819,8 +819,8 @@ extern struct rtnl_link_ops br_link_ops; ...@@ -819,8 +819,8 @@ extern struct rtnl_link_ops br_link_ops;
int br_netlink_init(void); int br_netlink_init(void);
void br_netlink_fini(void); void br_netlink_fini(void);
void br_ifinfo_notify(int event, struct net_bridge_port *port); void br_ifinfo_notify(int event, struct net_bridge_port *port);
int br_setlink(struct net_device *dev, struct nlmsghdr *nlmsg); int br_setlink(struct net_device *dev, struct nlmsghdr *nlmsg, u16 flags);
int br_dellink(struct net_device *dev, struct nlmsghdr *nlmsg); int br_dellink(struct net_device *dev, struct nlmsghdr *nlmsg, u16 flags);
int br_getlink(struct sk_buff *skb, u32 pid, u32 seq, struct net_device *dev, int br_getlink(struct sk_buff *skb, u32 pid, u32 seq, struct net_device *dev,
u32 filter_mask); u32 filter_mask);
......
...@@ -2991,7 +2991,7 @@ static int rtnl_bridge_setlink(struct sk_buff *skb, struct nlmsghdr *nlh) ...@@ -2991,7 +2991,7 @@ static int rtnl_bridge_setlink(struct sk_buff *skb, struct nlmsghdr *nlh)
goto out; goto out;
} }
err = br_dev->netdev_ops->ndo_bridge_setlink(dev, nlh); err = br_dev->netdev_ops->ndo_bridge_setlink(dev, nlh, flags);
if (err) if (err)
goto out; goto out;
...@@ -3002,7 +3002,8 @@ static int rtnl_bridge_setlink(struct sk_buff *skb, struct nlmsghdr *nlh) ...@@ -3002,7 +3002,8 @@ static int rtnl_bridge_setlink(struct sk_buff *skb, struct nlmsghdr *nlh)
if (!dev->netdev_ops->ndo_bridge_setlink) if (!dev->netdev_ops->ndo_bridge_setlink)
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
else else
err = dev->netdev_ops->ndo_bridge_setlink(dev, nlh); err = dev->netdev_ops->ndo_bridge_setlink(dev, nlh,
flags);
if (!err) { if (!err) {
flags &= ~BRIDGE_FLAGS_SELF; flags &= ~BRIDGE_FLAGS_SELF;
...@@ -3064,7 +3065,7 @@ static int rtnl_bridge_dellink(struct sk_buff *skb, struct nlmsghdr *nlh) ...@@ -3064,7 +3065,7 @@ static int rtnl_bridge_dellink(struct sk_buff *skb, struct nlmsghdr *nlh)
goto out; goto out;
} }
err = br_dev->netdev_ops->ndo_bridge_dellink(dev, nlh); err = br_dev->netdev_ops->ndo_bridge_dellink(dev, nlh, flags);
if (err) if (err)
goto out; goto out;
...@@ -3075,7 +3076,8 @@ static int rtnl_bridge_dellink(struct sk_buff *skb, struct nlmsghdr *nlh) ...@@ -3075,7 +3076,8 @@ static int rtnl_bridge_dellink(struct sk_buff *skb, struct nlmsghdr *nlh)
if (!dev->netdev_ops->ndo_bridge_dellink) if (!dev->netdev_ops->ndo_bridge_dellink)
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
else else
err = dev->netdev_ops->ndo_bridge_dellink(dev, nlh); err = dev->netdev_ops->ndo_bridge_dellink(dev, nlh,
flags);
if (!err) { if (!err) {
flags &= ~BRIDGE_FLAGS_SELF; flags &= ~BRIDGE_FLAGS_SELF;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册