diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2015-04-28 12:33:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-04-29 14:59:16 -0400 |
commit | 46c264daaaa569e24f8aba877d0fd8167c42a9a4 (patch) | |
tree | 355db83db4d85e7ebb8f42cb96ba9a71dace8750 | |
parent | 821996795973fd52703c35811a03db9fec1ac141 (diff) |
bridge/nl: remove wrong use of NLM_F_MULTI
NLM_F_MULTI must be used only when a NLMSG_DONE message is sent. In fact,
it is sent only at the end of a dump.
Libraries like libnl will wait forever for NLMSG_DONE.
Fixes: e5a55a898720 ("net: create generic bridge ops")
Fixes: 815cccbf10b2 ("ixgbe: add setlink, getlink support to ixgbe and ixgbevf")
CC: John Fastabend <john.r.fastabend@intel.com>
CC: Sathya Perla <sathya.perla@emulex.com>
CC: Subbu Seetharaman <subbu.seetharaman@emulex.com>
CC: Ajit Khaparde <ajit.khaparde@emulex.com>
CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
CC: intel-wired-lan@lists.osuosl.org
CC: Jiri Pirko <jiri@resnulli.us>
CC: Scott Feldman <sfeldma@gmail.com>
CC: Stephen Hemminger <stephen@networkplumber.org>
CC: bridge@lists.linux-foundation.org
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_main.c | 5 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_main.c | 7 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/rocker/rocker.c | 5 | ||||
-rw-r--r-- | include/linux/netdevice.h | 6 | ||||
-rw-r--r-- | include/linux/rtnetlink.h | 2 | ||||
-rw-r--r-- | net/bridge/br_netlink.c | 4 | ||||
-rw-r--r-- | net/bridge/br_private.h | 2 | ||||
-rw-r--r-- | net/core/rtnetlink.c | 12 |
9 files changed, 27 insertions, 20 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index fb0bc3c3620e..a6dcbf850c1f 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -4846,7 +4846,8 @@ err: | |||
4846 | } | 4846 | } |
4847 | 4847 | ||
4848 | static int be_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, | 4848 | static int be_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, |
4849 | struct net_device *dev, u32 filter_mask) | 4849 | struct net_device *dev, u32 filter_mask, |
4850 | int nlflags) | ||
4850 | { | 4851 | { |
4851 | struct be_adapter *adapter = netdev_priv(dev); | 4852 | struct be_adapter *adapter = netdev_priv(dev); |
4852 | int status = 0; | 4853 | int status = 0; |
@@ -4868,7 +4869,7 @@ static int be_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, | |||
4868 | return ndo_dflt_bridge_getlink(skb, pid, seq, dev, | 4869 | return ndo_dflt_bridge_getlink(skb, pid, seq, dev, |
4869 | hsw_mode == PORT_FWD_TYPE_VEPA ? | 4870 | hsw_mode == PORT_FWD_TYPE_VEPA ? |
4870 | BRIDGE_MODE_VEPA : BRIDGE_MODE_VEB, | 4871 | BRIDGE_MODE_VEPA : BRIDGE_MODE_VEB, |
4871 | 0, 0); | 4872 | 0, 0, nlflags); |
4872 | } | 4873 | } |
4873 | 4874 | ||
4874 | #ifdef CONFIG_BE2NET_VXLAN | 4875 | #ifdef CONFIG_BE2NET_VXLAN |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 24481cd7e59a..a54c14491e3b 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | |||
@@ -8053,10 +8053,10 @@ static int i40e_ndo_bridge_setlink(struct net_device *dev, | |||
8053 | #ifdef HAVE_BRIDGE_FILTER | 8053 | #ifdef HAVE_BRIDGE_FILTER |
8054 | static int i40e_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, | 8054 | static int i40e_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, |
8055 | struct net_device *dev, | 8055 | struct net_device *dev, |
8056 | u32 __always_unused filter_mask) | 8056 | u32 __always_unused filter_mask, int nlflags) |
8057 | #else | 8057 | #else |
8058 | static int i40e_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, | 8058 | static int i40e_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, |
8059 | struct net_device *dev) | 8059 | struct net_device *dev, int nlflags) |
8060 | #endif /* HAVE_BRIDGE_FILTER */ | 8060 | #endif /* HAVE_BRIDGE_FILTER */ |
8061 | { | 8061 | { |
8062 | struct i40e_netdev_priv *np = netdev_priv(dev); | 8062 | struct i40e_netdev_priv *np = netdev_priv(dev); |
@@ -8078,7 +8078,8 @@ static int i40e_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, | |||
8078 | if (!veb) | 8078 | if (!veb) |
8079 | return 0; | 8079 | return 0; |
8080 | 8080 | ||
8081 | return ndo_dflt_bridge_getlink(skb, pid, seq, dev, veb->bridge_mode); | 8081 | return ndo_dflt_bridge_getlink(skb, pid, seq, dev, veb->bridge_mode, |
8082 | nlflags); | ||
8082 | } | 8083 | } |
8083 | #endif /* HAVE_BRIDGE_ATTRIBS */ | 8084 | #endif /* HAVE_BRIDGE_ATTRIBS */ |
8084 | 8085 | ||
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index d3f4b0ceb3f7..5be12a00e1f4 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -8044,7 +8044,7 @@ static int ixgbe_ndo_bridge_setlink(struct net_device *dev, | |||
8044 | 8044 | ||
8045 | static int ixgbe_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, | 8045 | static int ixgbe_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, |
8046 | struct net_device *dev, | 8046 | struct net_device *dev, |
8047 | u32 filter_mask) | 8047 | u32 filter_mask, int nlflags) |
8048 | { | 8048 | { |
8049 | struct ixgbe_adapter *adapter = netdev_priv(dev); | 8049 | struct ixgbe_adapter *adapter = netdev_priv(dev); |
8050 | 8050 | ||
@@ -8052,7 +8052,7 @@ static int ixgbe_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, | |||
8052 | return 0; | 8052 | return 0; |
8053 | 8053 | ||
8054 | return ndo_dflt_bridge_getlink(skb, pid, seq, dev, | 8054 | return ndo_dflt_bridge_getlink(skb, pid, seq, dev, |
8055 | adapter->bridge_mode, 0, 0); | 8055 | adapter->bridge_mode, 0, 0, nlflags); |
8056 | } | 8056 | } |
8057 | 8057 | ||
8058 | static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev) | 8058 | static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev) |
diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c index a570a60533be..ec251531bd9f 100644 --- a/drivers/net/ethernet/rocker/rocker.c +++ b/drivers/net/ethernet/rocker/rocker.c | |||
@@ -4176,14 +4176,15 @@ static int rocker_port_bridge_setlink(struct net_device *dev, | |||
4176 | 4176 | ||
4177 | static int rocker_port_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, | 4177 | static int rocker_port_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, |
4178 | struct net_device *dev, | 4178 | struct net_device *dev, |
4179 | u32 filter_mask) | 4179 | u32 filter_mask, int nlflags) |
4180 | { | 4180 | { |
4181 | struct rocker_port *rocker_port = netdev_priv(dev); | 4181 | struct rocker_port *rocker_port = netdev_priv(dev); |
4182 | u16 mode = BRIDGE_MODE_UNDEF; | 4182 | u16 mode = BRIDGE_MODE_UNDEF; |
4183 | u32 mask = BR_LEARNING | BR_LEARNING_SYNC; | 4183 | u32 mask = BR_LEARNING | BR_LEARNING_SYNC; |
4184 | 4184 | ||
4185 | return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, | 4185 | return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, |
4186 | rocker_port->brport_flags, mask); | 4186 | rocker_port->brport_flags, mask, |
4187 | nlflags); | ||
4187 | } | 4188 | } |
4188 | 4189 | ||
4189 | static int rocker_port_get_phys_port_name(struct net_device *dev, | 4190 | static int rocker_port_get_phys_port_name(struct net_device *dev, |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index dbad4d728b4b..1899c74a7127 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -977,7 +977,8 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev, | |||
977 | * int (*ndo_bridge_setlink)(struct net_device *dev, struct nlmsghdr *nlh, | 977 | * int (*ndo_bridge_setlink)(struct net_device *dev, struct nlmsghdr *nlh, |
978 | * u16 flags) | 978 | * u16 flags) |
979 | * int (*ndo_bridge_getlink)(struct sk_buff *skb, u32 pid, u32 seq, | 979 | * int (*ndo_bridge_getlink)(struct sk_buff *skb, u32 pid, u32 seq, |
980 | * struct net_device *dev, u32 filter_mask) | 980 | * struct net_device *dev, u32 filter_mask, |
981 | * int nlflags) | ||
981 | * int (*ndo_bridge_dellink)(struct net_device *dev, struct nlmsghdr *nlh, | 982 | * int (*ndo_bridge_dellink)(struct net_device *dev, struct nlmsghdr *nlh, |
982 | * u16 flags); | 983 | * u16 flags); |
983 | * | 984 | * |
@@ -1173,7 +1174,8 @@ struct net_device_ops { | |||
1173 | int (*ndo_bridge_getlink)(struct sk_buff *skb, | 1174 | int (*ndo_bridge_getlink)(struct sk_buff *skb, |
1174 | u32 pid, u32 seq, | 1175 | u32 pid, u32 seq, |
1175 | struct net_device *dev, | 1176 | struct net_device *dev, |
1176 | u32 filter_mask); | 1177 | u32 filter_mask, |
1178 | int nlflags); | ||
1177 | int (*ndo_bridge_dellink)(struct net_device *dev, | 1179 | int (*ndo_bridge_dellink)(struct net_device *dev, |
1178 | struct nlmsghdr *nlh, | 1180 | struct nlmsghdr *nlh, |
1179 | u16 flags); | 1181 | u16 flags); |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 2da5d1081ad9..7b8e260c4a27 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -122,5 +122,5 @@ extern int ndo_dflt_fdb_del(struct ndmsg *ndm, | |||
122 | 122 | ||
123 | extern int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, | 123 | extern int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, |
124 | struct net_device *dev, u16 mode, | 124 | struct net_device *dev, u16 mode, |
125 | u32 flags, u32 mask); | 125 | u32 flags, u32 mask, int nlflags); |
126 | #endif /* __LINUX_RTNETLINK_H */ | 126 | #endif /* __LINUX_RTNETLINK_H */ |
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c index 0e4ddb81610d..4b5c236998ff 100644 --- a/net/bridge/br_netlink.c +++ b/net/bridge/br_netlink.c | |||
@@ -394,7 +394,7 @@ errout: | |||
394 | * Dump information about all ports, in response to GETLINK | 394 | * Dump information about all ports, in response to GETLINK |
395 | */ | 395 | */ |
396 | int br_getlink(struct sk_buff *skb, u32 pid, u32 seq, | 396 | int br_getlink(struct sk_buff *skb, u32 pid, u32 seq, |
397 | struct net_device *dev, u32 filter_mask) | 397 | struct net_device *dev, u32 filter_mask, int nlflags) |
398 | { | 398 | { |
399 | struct net_bridge_port *port = br_port_get_rtnl(dev); | 399 | struct net_bridge_port *port = br_port_get_rtnl(dev); |
400 | 400 | ||
@@ -402,7 +402,7 @@ int br_getlink(struct sk_buff *skb, u32 pid, u32 seq, | |||
402 | !(filter_mask & RTEXT_FILTER_BRVLAN_COMPRESSED)) | 402 | !(filter_mask & RTEXT_FILTER_BRVLAN_COMPRESSED)) |
403 | return 0; | 403 | return 0; |
404 | 404 | ||
405 | return br_fill_ifinfo(skb, port, pid, seq, RTM_NEWLINK, NLM_F_MULTI, | 405 | return br_fill_ifinfo(skb, port, pid, seq, RTM_NEWLINK, nlflags, |
406 | filter_mask, dev); | 406 | filter_mask, dev); |
407 | } | 407 | } |
408 | 408 | ||
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index 6ca0251cb478..3362c29400f1 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h | |||
@@ -828,7 +828,7 @@ void br_ifinfo_notify(int event, struct net_bridge_port *port); | |||
828 | int br_setlink(struct net_device *dev, struct nlmsghdr *nlmsg, u16 flags); | 828 | int br_setlink(struct net_device *dev, struct nlmsghdr *nlmsg, u16 flags); |
829 | int br_dellink(struct net_device *dev, struct nlmsghdr *nlmsg, u16 flags); | 829 | int br_dellink(struct net_device *dev, struct nlmsghdr *nlmsg, u16 flags); |
830 | int br_getlink(struct sk_buff *skb, u32 pid, u32 seq, struct net_device *dev, | 830 | int br_getlink(struct sk_buff *skb, u32 pid, u32 seq, struct net_device *dev, |
831 | u32 filter_mask); | 831 | u32 filter_mask, int nlflags); |
832 | 832 | ||
833 | #ifdef CONFIG_SYSFS | 833 | #ifdef CONFIG_SYSFS |
834 | /* br_sysfs_if.c */ | 834 | /* br_sysfs_if.c */ |
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 358d52a38533..666e0928ba40 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -2854,7 +2854,7 @@ static int brport_nla_put_flag(struct sk_buff *skb, u32 flags, u32 mask, | |||
2854 | 2854 | ||
2855 | int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, | 2855 | int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, |
2856 | struct net_device *dev, u16 mode, | 2856 | struct net_device *dev, u16 mode, |
2857 | u32 flags, u32 mask) | 2857 | u32 flags, u32 mask, int nlflags) |
2858 | { | 2858 | { |
2859 | struct nlmsghdr *nlh; | 2859 | struct nlmsghdr *nlh; |
2860 | struct ifinfomsg *ifm; | 2860 | struct ifinfomsg *ifm; |
@@ -2863,7 +2863,7 @@ int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, | |||
2863 | u8 operstate = netif_running(dev) ? dev->operstate : IF_OPER_DOWN; | 2863 | u8 operstate = netif_running(dev) ? dev->operstate : IF_OPER_DOWN; |
2864 | struct net_device *br_dev = netdev_master_upper_dev_get(dev); | 2864 | struct net_device *br_dev = netdev_master_upper_dev_get(dev); |
2865 | 2865 | ||
2866 | nlh = nlmsg_put(skb, pid, seq, RTM_NEWLINK, sizeof(*ifm), NLM_F_MULTI); | 2866 | nlh = nlmsg_put(skb, pid, seq, RTM_NEWLINK, sizeof(*ifm), nlflags); |
2867 | if (nlh == NULL) | 2867 | if (nlh == NULL) |
2868 | return -EMSGSIZE; | 2868 | return -EMSGSIZE; |
2869 | 2869 | ||
@@ -2969,7 +2969,8 @@ static int rtnl_bridge_getlink(struct sk_buff *skb, struct netlink_callback *cb) | |||
2969 | if (br_dev && br_dev->netdev_ops->ndo_bridge_getlink) { | 2969 | if (br_dev && br_dev->netdev_ops->ndo_bridge_getlink) { |
2970 | if (idx >= cb->args[0] && | 2970 | if (idx >= cb->args[0] && |
2971 | br_dev->netdev_ops->ndo_bridge_getlink( | 2971 | br_dev->netdev_ops->ndo_bridge_getlink( |
2972 | skb, portid, seq, dev, filter_mask) < 0) | 2972 | skb, portid, seq, dev, filter_mask, |
2973 | NLM_F_MULTI) < 0) | ||
2973 | break; | 2974 | break; |
2974 | idx++; | 2975 | idx++; |
2975 | } | 2976 | } |
@@ -2977,7 +2978,8 @@ static int rtnl_bridge_getlink(struct sk_buff *skb, struct netlink_callback *cb) | |||
2977 | if (ops->ndo_bridge_getlink) { | 2978 | if (ops->ndo_bridge_getlink) { |
2978 | if (idx >= cb->args[0] && | 2979 | if (idx >= cb->args[0] && |
2979 | ops->ndo_bridge_getlink(skb, portid, seq, dev, | 2980 | ops->ndo_bridge_getlink(skb, portid, seq, dev, |
2980 | filter_mask) < 0) | 2981 | filter_mask, |
2982 | NLM_F_MULTI) < 0) | ||
2981 | break; | 2983 | break; |
2982 | idx++; | 2984 | idx++; |
2983 | } | 2985 | } |
@@ -3018,7 +3020,7 @@ static int rtnl_bridge_notify(struct net_device *dev) | |||
3018 | goto errout; | 3020 | goto errout; |
3019 | } | 3021 | } |
3020 | 3022 | ||
3021 | err = dev->netdev_ops->ndo_bridge_getlink(skb, 0, 0, dev, 0); | 3023 | err = dev->netdev_ops->ndo_bridge_getlink(skb, 0, 0, dev, 0, 0); |
3022 | if (err < 0) | 3024 | if (err < 0) |
3023 | goto errout; | 3025 | goto errout; |
3024 | 3026 | ||