[patch net-next 0/3] team: couple of fixes

STALE5094d

9 messages, 3 authors, 2012-08-24 · open the first message on its own page

[patch net-next 0/3] team: couple of fixes

From: Jiri Pirko <jiri@resnulli.us>
Date: 2012-08-23 13:27:06

+ vlan helper

Jiri Pirko (3):
  teamd: don't print warn message on -ESRCH during event send
  vlan: add helper which can be called to se it device is used by vlan
  team: do not allow to add VLAN challenged port when vlan is used

 drivers/net/team/team.c | 15 +++++++++++----
 include/linux/if_vlan.h |  9 +++++++--
 net/8021q/vlan_core.c   |  6 ++++++
 3 files changed, 24 insertions(+), 6 deletions(-)

-- 
1.7.11.4

[patch net-next 1/3] teamd: don't print warn message on -ESRCH during event send

From: Jiri Pirko <jiri@resnulli.us>
Date: 2012-08-23 13:27:17

When no one is listening on NL socket, -ESRCH is returned and warning
message is printed. This message is confusing people and in fact has no
meaning. So do not print it in this case.

Reported-by: Or Gerlitz <redacted>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
 drivers/net/team/team.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 17ce11b..4010bcd 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -2487,7 +2487,7 @@ static void __team_options_change_check(struct team *team)
 			list_add_tail(&opt_inst->tmp_list, &sel_opt_inst_list);
 	}
 	err = team_nl_send_event_options_get(team, &sel_opt_inst_list);
-	if (err)
+	if (err && err != -ESRCH)
 		netdev_warn(team->dev, "Failed to send options change via netlink (err %d)\n",
 			    err);
 }
@@ -2518,9 +2518,9 @@ static void __team_port_change_check(struct team_port *port, bool linkup)
 
 send_event:
 	err = team_nl_send_event_port_list_get(port->team);
-	if (err)
-		netdev_warn(port->team->dev, "Failed to send port change of device %s via netlink\n",
-			    port->dev->name);
+	if (err && err != -ESRCH)
+		netdev_warn(port->team->dev, "Failed to send port change of device %s via netlink (err %d)\n",
+			    port->dev->name, err);
 
 }
 
-- 
1.7.11.4

[patch net-next 2/3] vlan: add helper which can be called to se it device is used by vlan

From: Jiri Pirko <jiri@resnulli.us>
Date: 2012-08-23 13:27:19

also, remove unused vlan_info definition from header

CC: Patrick McHardy <redacted>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
 include/linux/if_vlan.h | 9 +++++++--
 net/8021q/vlan_core.c   | 6 ++++++
 2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index a810987..e6ff12d 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -74,8 +74,6 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb)
 /* found in socket.c */
 extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *));
 
-struct vlan_info;
-
 static inline int is_vlan_dev(struct net_device *dev)
 {
         return dev->priv_flags & IFF_802_1Q_VLAN;
@@ -101,6 +99,8 @@ extern int vlan_vids_add_by_dev(struct net_device *dev,
 				const struct net_device *by_dev);
 extern void vlan_vids_del_by_dev(struct net_device *dev,
 				 const struct net_device *by_dev);
+
+extern bool vlan_uses_dev(const struct net_device *dev);
 #else
 static inline struct net_device *
 __vlan_find_dev_deep(struct net_device *real_dev, u16 vlan_id)
@@ -151,6 +151,11 @@ static inline void vlan_vids_del_by_dev(struct net_device *dev,
 					const struct net_device *by_dev)
 {
 }
+
+static inline bool vlan_uses_dev(const struct net_device *dev)
+{
+	return false;
+}
 #endif
 
 /**
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
index d4babc6..517b940 100644
--- a/net/8021q/vlan_core.c
+++ b/net/8021q/vlan_core.c
@@ -372,3 +372,9 @@ void vlan_vids_del_by_dev(struct net_device *dev,
 		vlan_vid_del(dev, vid_info->vid);
 }
 EXPORT_SYMBOL(vlan_vids_del_by_dev);
+
+bool vlan_uses_dev(const struct net_device *dev)
+{
+	return rtnl_dereference(dev->vlan_info) ? true : false;
+}
+EXPORT_SYMBOL(vlan_uses_dev);
-- 
1.7.11.4

[patch net-next 3/3] team: do not allow to add VLAN challenged port when vlan is used

From: Jiri Pirko <jiri@resnulli.us>
Date: 2012-08-23 13:27:22

Reported-by: Or Gerlitz <redacted>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
 drivers/net/team/team.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 4010bcd..49629fb 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -989,6 +989,13 @@ static int team_port_add(struct team *team, struct net_device *port_dev)
 		return -EBUSY;
 	}
 
+	if (port_dev->features & NETIF_F_VLAN_CHALLENGED &&
+	    vlan_uses_dev(dev)) {
+		netdev_err(dev, "Device %s is VLAN challenged and team device has VLAN set up\n",
+			   portname);
+		return -EPERM;
+	}
+
 	err = team_dev_type_check_change(dev, port_dev);
 	if (err)
 		return err;
-- 
1.7.11.4

Re: [patch net-next 1/3] teamd: don't print warn message on -ESRCH during event send

From: Jiri Pirko <jiri@resnulli.us>
Date: 2012-08-23 13:31:58

Oups. Subject should start with "team:" without "d" :(

David, should I repost?

Thu, Aug 23, 2012 at 03:26:51PM CEST, jiri@resnulli.us wrote:
quoted hunk
When no one is listening on NL socket, -ESRCH is returned and warning
message is printed. This message is confusing people and in fact has no
meaning. So do not print it in this case.

Reported-by: Or Gerlitz <redacted>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
drivers/net/team/team.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 17ce11b..4010bcd 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -2487,7 +2487,7 @@ static void __team_options_change_check(struct team *team)
			list_add_tail(&opt_inst->tmp_list, &sel_opt_inst_list);
	}
	err = team_nl_send_event_options_get(team, &sel_opt_inst_list);
-	if (err)
+	if (err && err != -ESRCH)
		netdev_warn(team->dev, "Failed to send options change via netlink (err %d)\n",
			    err);
}
@@ -2518,9 +2518,9 @@ static void __team_port_change_check(struct team_port *port, bool linkup)
send_event:
	err = team_nl_send_event_port_list_get(port->team);
-	if (err)
-		netdev_warn(port->team->dev, "Failed to send port change of device %s via netlink\n",
-			    port->dev->name);
+	if (err && err != -ESRCH)
+		netdev_warn(port->team->dev, "Failed to send port change of device %s via netlink (err %d)\n",
+			    port->dev->name, err);

}

-- 
1.7.11.4

Re: [patch net-next 2/3] vlan: add helper which can be called to se it device is used by vlan

From: Or Gerlitz <hidden>
Date: 2012-08-23 13:33:18

On 23/08/2012 16:26, Jiri Pirko wrote:
also, remove unused vlan_info definition from header
just a typo in the subject line, you probably wanted to say "see" and 
not "se"?

Or.
quoted hunk
CC: Patrick McHardy <redacted>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
  include/linux/if_vlan.h | 9 +++++++--
  net/8021q/vlan_core.c   | 6 ++++++
  2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index a810987..e6ff12d 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -74,8 +74,6 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb)
  /* found in socket.c */
  extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *));
  
-struct vlan_info;
-
  static inline int is_vlan_dev(struct net_device *dev)
  {
          return dev->priv_flags & IFF_802_1Q_VLAN;
@@ -101,6 +99,8 @@ extern int vlan_vids_add_by_dev(struct net_device *dev,
  				const struct net_device *by_dev);
  extern void vlan_vids_del_by_dev(struct net_device *dev,
  				 const struct net_device *by_dev);
+
+extern bool vlan_uses_dev(const struct net_device *dev);
  #else
  static inline struct net_device *
  __vlan_find_dev_deep(struct net_device *real_dev, u16 vlan_id)
@@ -151,6 +151,11 @@ static inline void vlan_vids_del_by_dev(struct net_device *dev,
  					const struct net_device *by_dev)
  {
  }
+
+static inline bool vlan_uses_dev(const struct net_device *dev)
+{
+	return false;
+}
  #endif
  
  /**
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
index d4babc6..517b940 100644
--- a/net/8021q/vlan_core.c
+++ b/net/8021q/vlan_core.c
@@ -372,3 +372,9 @@ void vlan_vids_del_by_dev(struct net_device *dev,
  		vlan_vid_del(dev, vid_info->vid);
  }
  EXPORT_SYMBOL(vlan_vids_del_by_dev);
+
+bool vlan_uses_dev(const struct net_device *dev)
+{
+	return rtnl_dereference(dev->vlan_info) ? true : false;
+}
+EXPORT_SYMBOL(vlan_uses_dev);

Re: [patch net-next 2/3] vlan: add helper which can be called to se it device is used by vlan

From: Jiri Pirko <jiri@resnulli.us>
Date: 2012-08-23 13:42:19

Thu, Aug 23, 2012 at 03:33:06PM CEST, ogerlitz@mellanox.com wrote:
On 23/08/2012 16:26, Jiri Pirko wrote:
quoted
also, remove unused vlan_info definition from header
just a typo in the subject line, you probably wanted to say "see" and
not "se"?
Yes. I need some coffe :(
Or.
quoted
CC: Patrick McHardy <redacted>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
 include/linux/if_vlan.h | 9 +++++++--
 net/8021q/vlan_core.c   | 6 ++++++
 2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index a810987..e6ff12d 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -74,8 +74,6 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb)
 /* found in socket.c */
 extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *));
-struct vlan_info;
-
 static inline int is_vlan_dev(struct net_device *dev)
 {
         return dev->priv_flags & IFF_802_1Q_VLAN;
@@ -101,6 +99,8 @@ extern int vlan_vids_add_by_dev(struct net_device *dev,
 				const struct net_device *by_dev);
 extern void vlan_vids_del_by_dev(struct net_device *dev,
 				 const struct net_device *by_dev);
+
+extern bool vlan_uses_dev(const struct net_device *dev);
 #else
 static inline struct net_device *
 __vlan_find_dev_deep(struct net_device *real_dev, u16 vlan_id)
@@ -151,6 +151,11 @@ static inline void vlan_vids_del_by_dev(struct net_device *dev,
 					const struct net_device *by_dev)
 {
 }
+
+static inline bool vlan_uses_dev(const struct net_device *dev)
+{
+	return false;
+}
 #endif
 /**
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
index d4babc6..517b940 100644
--- a/net/8021q/vlan_core.c
+++ b/net/8021q/vlan_core.c
@@ -372,3 +372,9 @@ void vlan_vids_del_by_dev(struct net_device *dev,
 		vlan_vid_del(dev, vid_info->vid);
 }
 EXPORT_SYMBOL(vlan_vids_del_by_dev);
+
+bool vlan_uses_dev(const struct net_device *dev)
+{
+	return rtnl_dereference(dev->vlan_info) ? true : false;
+}
+EXPORT_SYMBOL(vlan_uses_dev);

Re: [patch net-next 0/3] team: couple of fixes

From: David Miller <davem@davemloft.net>
Date: 2012-08-24 17:47:08

From: Jiri Pirko <jiri@resnulli.us>
Date: Thu, 23 Aug 2012 15:26:50 +0200
+ vlan helper

Jiri Pirko (3):
  teamd: don't print warn message on -ESRCH during event send
  vlan: add helper which can be called to se it device is used by vlan
  team: do not allow to add VLAN challenged port when vlan is used
Applied with typos corrected :-)

Re: [patch net-next 0/3] team: couple of fixes

From: Jiri Pirko <jiri@resnulli.us>
Date: 2012-08-24 18:53:21

24. 8. 2012 v 19:47, David Miller [off-list ref]:
From: Jiri Pirko <jiri@resnulli.us>
Date: Thu, 23 Aug 2012 15:26:50 +0200
quoted
+ vlan helper

Jiri Pirko (3):
 teamd: don't print warn message on -ESRCH during event send
 vlan: add helper which can be called to se it device is used by vlan
 team: do not allow to add VLAN challenged port when vlan is used
Applied with typos corrected :-)
I owe you a beer :)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help