Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH net-next-2.6] veth: remove unneeded ifname code from veth_newlink()
From: Jiri Pirko @ 2011-04-30 10:16 UTC (permalink / raw)
  To: Michał Mirosław; +Cc: netdev, davem, xemul
In-Reply-To: <BANLkTikUAGWhNnCrebQpVttorqVxfD6KWw@mail.gmail.com>

Fri, Apr 22, 2011 at 11:49:40AM CEST, mirqus@gmail.com wrote:
>W dniu 22 kwietnia 2011 11:43 użytkownik Michał Mirosław
><mirqus@gmail.com> napisał:
>> 2011/1/24 Jiri Pirko <jpirko@redhat.com>:
>>> The code is not needed because tb[IFLA_IFNAME] is already
>>> processed in rtnl_newlink(). Remove this redundancy.
>> Hi. This patch broke creation of veth devices. Reverting it fixes the issue.
>>
>> Symptoms:
>>
>> icybox:~# ip link add type veth
>> RTNETLINK answers: File exists
>> icybox:~# ip link add type veth peer veth1
>> icybox:~# ip addr
>> [...]
>> 56: D: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
>>    link/ether e6:57:58:52:03:50 brd ff:ff:ff:ff:ff:ff
>> 57: veth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
>>    link/ether c2:c2:a2:d5:d5:3a brd ff:ff:ff:ff:ff:ff
>
>Hmm. I was too quick. Reverting it fixes only first problem - "ip link
>add type veth" adds new veth pair now, but "ip link add type veth peer
>veth1" gives the same result as above.

I gusee you should do:
ip link add type veth peer name veth1
>
>Best Regards,
>Michał Mirosław

^ permalink raw reply

* [patch net-next-2.6] net: call dev_alloc_name from register_netdevice
From: Jiri Pirko @ 2011-04-30 11:21 UTC (permalink / raw)
  To: netdev; +Cc: davem, eric.dumazet, mirqus, xemul

Force dev_alloc_name() to be called from register_netdevice() by
dev_get_valid_name(). That allows to remove multiple explicit
dev_alloc_name() calls.

The possibility to call dev_alloc_name in advance remains.

This also fixes veth creation regresion caused by
84c49d8c3e4abefb0a41a77b25aa37ebe8d6b743

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
 drivers/ieee802154/fakehard.c             |   10 ----------
 drivers/net/bonding/bond_main.c           |   21 +++------------------
 drivers/net/dummy.c                       |    4 ----
 drivers/net/hamradio/bpqether.c           |    4 ----
 drivers/net/ifb.c                         |    4 ----
 drivers/net/tun.c                         |    6 ------
 drivers/net/wan/dlci.c                    |    4 ----
 drivers/net/wan/hdlc_fr.c                 |    9 +--------
 drivers/net/wan/lapbether.c               |    4 ----
 drivers/net/wireless/hostap/hostap_main.c |    7 +------
 drivers/net/wireless/mac80211_hwsim.c     |   11 +----------
 drivers/net/wireless/mwifiex/main.c       |    4 ----
 drivers/s390/net/netiucv.c                |    2 --
 net/core/dev.c                            |   24 ++++++------------------
 net/core/rtnetlink.c                      |    8 --------
 net/ipv4/ip_gre.c                         |    5 -----
 net/ipv4/ipip.c                           |    5 -----
 net/ipv6/ip6_tunnel.c                     |    5 -----
 net/ipv6/sit.c                            |    5 -----
 net/mac80211/iface.c                      |    4 ----
 20 files changed, 12 insertions(+), 134 deletions(-)

diff --git a/drivers/ieee802154/fakehard.c b/drivers/ieee802154/fakehard.c
index d9d0e13..a5a49a1 100644
--- a/drivers/ieee802154/fakehard.c
+++ b/drivers/ieee802154/fakehard.c
@@ -393,16 +393,6 @@ static int __devinit ieee802154fake_probe(struct platform_device *pdev)
 	priv = netdev_priv(dev);
 	priv->phy = phy;
 
-	/*
-	 * If the name is a format string the caller wants us to do a
-	 * name allocation.
-	 */
-	if (strchr(dev->name, '%')) {
-		err = dev_alloc_name(dev, dev->name);
-		if (err < 0)
-			goto out;
-	}
-
 	wpan_phy_set_dev(phy, &pdev->dev);
 	SET_NETDEV_DEV(dev, &phy->dev);
 
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 66d9dc6..fa5382e0 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4858,8 +4858,9 @@ int bond_create(struct net *net, const char *name)
 
 	rtnl_lock();
 
-	bond_dev = alloc_netdev_mq(sizeof(struct bonding), name ? name : "",
-				bond_setup, tx_queues);
+	bond_dev = alloc_netdev_mq(sizeof(struct bonding),
+				   name ? name : "bond%d",
+				   bond_setup, tx_queues);
 	if (!bond_dev) {
 		pr_err("%s: eek! can't alloc netdev!\n", name);
 		rtnl_unlock();
@@ -4869,26 +4870,10 @@ int bond_create(struct net *net, const char *name)
 	dev_net_set(bond_dev, net);
 	bond_dev->rtnl_link_ops = &bond_link_ops;
 
-	if (!name) {
-		res = dev_alloc_name(bond_dev, "bond%d");
-		if (res < 0)
-			goto out;
-	} else {
-		/*
-		 * If we're given a name to register
-		 * we need to ensure that its not already
-		 * registered
-		 */
-		res = -EEXIST;
-		if (__dev_get_by_name(net, name) != NULL)
-			goto out;
-	}
-
 	res = register_netdevice(bond_dev);
 
 	netif_carrier_off(bond_dev);
 
-out:
 	rtnl_unlock();
 	if (res < 0)
 		bond_destructor(bond_dev);
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
index ff2d29b..39cf9b9 100644
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -168,10 +168,6 @@ static int __init dummy_init_one(void)
 	if (!dev_dummy)
 		return -ENOMEM;
 
-	err = dev_alloc_name(dev_dummy, dev_dummy->name);
-	if (err < 0)
-		goto err;
-
 	dev_dummy->rtnl_link_ops = &dummy_link_ops;
 	err = register_netdevice(dev_dummy);
 	if (err < 0)
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
index 8931168..18d8aff 100644
--- a/drivers/net/hamradio/bpqether.c
+++ b/drivers/net/hamradio/bpqether.c
@@ -516,10 +516,6 @@ static int bpq_new_device(struct net_device *edev)
 	memcpy(bpq->dest_addr, bcast_addr, sizeof(bpq_eth_addr));
 	memcpy(bpq->acpt_addr, bcast_addr, sizeof(bpq_eth_addr));
 
-	err = dev_alloc_name(ndev, ndev->name);
-	if (err < 0) 
-		goto error;
-
 	err = register_netdevice(ndev);
 	if (err)
 		goto error;
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
index e07d487..4fecaed 100644
--- a/drivers/net/ifb.c
+++ b/drivers/net/ifb.c
@@ -233,10 +233,6 @@ static int __init ifb_init_one(int index)
 	if (!dev_ifb)
 		return -ENOMEM;
 
-	err = dev_alloc_name(dev_ifb, dev_ifb->name);
-	if (err < 0)
-		goto err;
-
 	dev_ifb->rtnl_link_ops = &ifb_link_ops;
 	err = register_netdevice(dev_ifb);
 	if (err < 0)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index ade3cf9..334b5ad 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1099,12 +1099,6 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
 
 		tun_net_init(dev);
 
-		if (strchr(dev->name, '%')) {
-			err = dev_alloc_name(dev, dev->name);
-			if (err < 0)
-				goto err_free_sk;
-		}
-
 		dev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST |
 			TUN_USER_FEATURES;
 		dev->features = dev->hw_features;
diff --git a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c
index 1481a44..21b104d 100644
--- a/drivers/net/wan/dlci.c
+++ b/drivers/net/wan/dlci.c
@@ -341,10 +341,6 @@ static int dlci_add(struct dlci_add *dlci)
 		}
 	}
 
-	err = dev_alloc_name(master, master->name);
-	if (err < 0)
-		goto err2;
-
 	*(short *)(master->dev_addr) = dlci->dlci;
 
 	dlp = netdev_priv(master);
diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c
index 0edb535..fc433f2 100644
--- a/drivers/net/wan/hdlc_fr.c
+++ b/drivers/net/wan/hdlc_fr.c
@@ -1070,7 +1070,7 @@ static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type)
 	hdlc_device *hdlc = dev_to_hdlc(frad);
 	pvc_device *pvc;
 	struct net_device *dev;
-	int result, used;
+	int used;
 
 	if ((pvc = add_pvc(frad, dlci)) == NULL) {
 		printk(KERN_WARNING "%s: Memory squeeze on fr_add_pvc()\n",
@@ -1106,13 +1106,6 @@ static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type)
 	dev->tx_queue_len = 0;
 	dev->ml_priv = pvc;
 
-	result = dev_alloc_name(dev, dev->name);
-	if (result < 0) {
-		free_netdev(dev);
-		delete_unused_pvcs(hdlc);
-		return result;
-	}
-
 	if (register_netdevice(dev) != 0) {
 		free_netdev(dev);
 		delete_unused_pvcs(hdlc);
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c
index 7f5bb91..eec463f 100644
--- a/drivers/net/wan/lapbether.c
+++ b/drivers/net/wan/lapbether.c
@@ -338,10 +338,6 @@ static int lapbeth_new_device(struct net_device *dev)
 	dev_hold(dev);
 	lapbeth->ethdev = dev;
 
-	rc = dev_alloc_name(ndev, ndev->name);
-	if (rc < 0) 
-		goto fail;
-
 	rc = -EIO;
 	if (register_netdevice(ndev))
 		goto fail;
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
index 1d9aed6..d508482 100644
--- a/drivers/net/wireless/hostap/hostap_main.c
+++ b/drivers/net/wireless/hostap/hostap_main.c
@@ -79,13 +79,8 @@ struct net_device * hostap_add_interface(struct local_info *local,
 	if (!rtnl_locked)
 		rtnl_lock();
 
-	ret = 0;
-	if (strchr(dev->name, '%'))
-		ret = dev_alloc_name(dev, dev->name);
-
 	SET_NETDEV_DEV(dev, mdev->dev.parent);
-	if (ret >= 0)
-		ret = register_netdevice(dev);
+	ret = register_netdevice(dev);
 
 	if (!rtnl_locked)
 		rtnl_unlock();
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index f4f4257..9d4a40e 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -1515,19 +1515,10 @@ static int __init init_mac80211_hwsim(void)
 	if (hwsim_mon == NULL)
 		goto failed;
 
-	rtnl_lock();
-
-	err = dev_alloc_name(hwsim_mon, hwsim_mon->name);
+	err = register_netdev(hwsim_mon);
 	if (err < 0)
 		goto failed_mon;
 
-
-	err = register_netdevice(hwsim_mon);
-	if (err < 0)
-		goto failed_mon;
-
-	rtnl_unlock();
-
 	return 0;
 
 failed_mon:
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index c597188..d16cea7 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -706,10 +706,6 @@ static struct mwifiex_private *mwifiex_add_interface(
 		dev_err(adapter->dev, "no memory available for netdevice\n");
 		goto error;
 	}
-	if (dev_alloc_name(dev, dev->name)) {
-		dev_err(adapter->dev, "unable to alloc name for netdevice\n");
-		goto error;
-	}
 
 	if (mwifiex_register_cfg80211(dev, adapter->priv[bss_index]->curr_addr,
 				      adapter->priv[bss_index]) != 0) {
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
index b6a6356..3251333 100644
--- a/drivers/s390/net/netiucv.c
+++ b/drivers/s390/net/netiucv.c
@@ -1994,8 +1994,6 @@ static struct net_device *netiucv_init_netdevice(char *username)
 			   netiucv_setup_netdevice);
 	if (!dev)
 		return NULL;
-	if (dev_alloc_name(dev, dev->name) < 0)
-		goto out_netdev;
 
 	privptr = netdev_priv(dev);
 	privptr->fsm = init_fsm("netiucvdev", dev_state_names,
diff --git a/net/core/dev.c b/net/core/dev.c
index 7db99b5..992574a 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -948,7 +948,7 @@ int dev_alloc_name(struct net_device *dev, const char *name)
 }
 EXPORT_SYMBOL(dev_alloc_name);
 
-static int dev_get_valid_name(struct net_device *dev, const char *name, bool fmt)
+static int dev_get_valid_name(struct net_device *dev, const char *name)
 {
 	struct net *net;
 
@@ -958,7 +958,7 @@ static int dev_get_valid_name(struct net_device *dev, const char *name, bool fmt
 	if (!dev_valid_name(name))
 		return -EINVAL;
 
-	if (fmt && strchr(name, '%'))
+	if (strchr(name, '%'))
 		return dev_alloc_name(dev, name);
 	else if (__dev_get_by_name(net, name))
 		return -EEXIST;
@@ -995,7 +995,7 @@ int dev_change_name(struct net_device *dev, const char *newname)
 
 	memcpy(oldname, dev->name, IFNAMSIZ);
 
-	err = dev_get_valid_name(dev, newname, 1);
+	err = dev_get_valid_name(dev, newname);
 	if (err < 0)
 		return err;
 
@@ -5396,8 +5396,8 @@ int register_netdevice(struct net_device *dev)
 		}
 	}
 
-	ret = dev_get_valid_name(dev, dev->name, 0);
-	if (ret)
+	ret = dev_get_valid_name(dev, dev->name);
+	if (ret < 0)
 		goto err_uninit;
 
 	dev->ifindex = dev_new_index(net);
@@ -5538,19 +5538,7 @@ int register_netdev(struct net_device *dev)
 	int err;
 
 	rtnl_lock();
-
-	/*
-	 * If the name is a format string the caller wants us to do a
-	 * name allocation.
-	 */
-	if (strchr(dev->name, '%')) {
-		err = dev_alloc_name(dev, dev->name);
-		if (err < 0)
-			goto out;
-	}
-
 	err = register_netdevice(dev);
-out:
 	rtnl_unlock();
 	return err;
 }
@@ -6032,7 +6020,7 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char
 		/* We get here if we can't use the current device name */
 		if (!pat)
 			goto out;
-		if (dev_get_valid_name(dev, pat, 1))
+		if (dev_get_valid_name(dev, pat) < 0)
 			goto out;
 	}
 
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index d7c4bb4..d4dec8c 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1570,12 +1570,6 @@ struct net_device *rtnl_create_link(struct net *src_net, struct net *net,
 	dev->rtnl_link_state = RTNL_LINK_INITIALIZING;
 	dev->real_num_tx_queues = real_num_queues;
 
-	if (strchr(dev->name, '%')) {
-		err = dev_alloc_name(dev, dev->name);
-		if (err < 0)
-			goto err_free;
-	}
-
 	if (tb[IFLA_MTU])
 		dev->mtu = nla_get_u32(tb[IFLA_MTU]);
 	if (tb[IFLA_ADDRESS])
@@ -1595,8 +1589,6 @@ struct net_device *rtnl_create_link(struct net *src_net, struct net *net,
 
 	return dev;
 
-err_free:
-	free_netdev(dev);
 err:
 	return ERR_PTR(err);
 }
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 24efd35..0d536f2 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -413,11 +413,6 @@ static struct ip_tunnel *ipgre_tunnel_locate(struct net *net,
 
 	dev_net_set(dev, net);
 
-	if (strchr(name, '%')) {
-		if (dev_alloc_name(dev, name) < 0)
-			goto failed_free;
-	}
-
 	nt = netdev_priv(dev);
 	nt->parms = *parms;
 	dev->rtnl_link_ops = &ipgre_link_ops;
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index ef16377..f0e0fb2 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -276,11 +276,6 @@ static struct ip_tunnel * ipip_tunnel_locate(struct net *net,
 
 	dev_net_set(dev, net);
 
-	if (strchr(name, '%')) {
-		if (dev_alloc_name(dev, name) < 0)
-			goto failed_free;
-	}
-
 	nt = netdev_priv(dev);
 	nt->parms = *parms;
 
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 9dd0e96..ae244d3 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -280,11 +280,6 @@ static struct ip6_tnl *ip6_tnl_create(struct net *net, struct ip6_tnl_parm *p)
 
 	dev_net_set(dev, net);
 
-	if (strchr(name, '%')) {
-		if (dev_alloc_name(dev, name) < 0)
-			goto failed_free;
-	}
-
 	t = netdev_priv(dev);
 	t->parms = *p;
 	err = ip6_tnl_dev_init(dev);
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 34d8964..87a547e 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -250,11 +250,6 @@ static struct ip_tunnel *ipip6_tunnel_locate(struct net *net,
 
 	dev_net_set(dev, net);
 
-	if (strchr(name, '%')) {
-		if (dev_alloc_name(dev, name) < 0)
-			goto failed_free;
-	}
-
 	nt = netdev_priv(dev);
 
 	nt->parms = *parms;
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 4054399..80c29d6 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -1144,10 +1144,6 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
 				+ IEEE80211_ENCRYPT_HEADROOM;
 	ndev->needed_tailroom = IEEE80211_ENCRYPT_TAILROOM;
 
-	ret = dev_alloc_name(ndev, ndev->name);
-	if (ret < 0)
-		goto fail;
-
 	ieee80211_assign_perm_addr(local, ndev, type);
 	memcpy(ndev->dev_addr, ndev->perm_addr, ETH_ALEN);
 	SET_NETDEV_DEV(ndev, wiphy_dev(local->hw.wiphy));
-- 
1.7.4.2


^ permalink raw reply related

* Re: [PATCH net-next-2.6] veth: remove unneeded ifname code from veth_newlink()
From: Jiri Pirko @ 2011-04-30 11:28 UTC (permalink / raw)
  To: Michał Mirosław; +Cc: netdev, davem, xemul
In-Reply-To: <BANLkTi=x8xi7-g3SZdva7Ndg0a4EY1NK8g@mail.gmail.com>

Fri, Apr 22, 2011 at 11:43:10AM CEST, mirqus@gmail.com wrote:
>2011/1/24 Jiri Pirko <jpirko@redhat.com>:
>> The code is not needed because tb[IFLA_IFNAME] is already
>> processed in rtnl_newlink(). Remove this redundancy.
>>
>> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>
>Hi. This patch broke creation of veth devices. Reverting it fixes the issue.

Sorry for troubles.

For net-next-2.6 this is fixed by:
http://patchwork.ozlabs.org/patch/93498/

For net-2.6 I suggest to revert this patch:

Subject: [PATCH net-2.6] Revert: veth: remove unneeded ifname code from veth_newlink()

84c49d8c3e4abefb0a41a77b25aa37ebe8d6b743 caused regression on veth
creation. This patch reverts the original one.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
 drivers/net/veth.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 2de9b90..3b99f64 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -403,6 +403,17 @@ static int veth_newlink(struct net *src_net, struct net_device *dev,
 	if (tb[IFLA_ADDRESS] == NULL)
 		random_ether_addr(dev->dev_addr);
 
+	if (tb[IFLA_IFNAME])
+		nla_strlcpy(dev->name, tb[IFLA_IFNAME], IFNAMSIZ);
+	else
+		snprintf(dev->name, IFNAMSIZ, DRV_NAME "%%d");
+
+	if (strchr(dev->name, '%')) {
+		err = dev_alloc_name(dev, dev->name);
+		if (err < 0)
+			goto err_alloc_name;
+	}
+
 	err = register_netdevice(dev);
 	if (err < 0)
 		goto err_register_dev;
@@ -422,6 +433,7 @@ static int veth_newlink(struct net *src_net, struct net_device *dev,
 
 err_register_dev:
 	/* nothing to do */
+err_alloc_name:
 err_configure_peer:
 	unregister_netdevice(peer);
 	return err;
-- 
1.7.4.2


^ permalink raw reply related

* Re: [RFC PATCH 0/2] Multiqueue support for qemu(virtio-net)
From: Jason Wang @ 2011-04-30 14:55 UTC (permalink / raw)
  To: Anthony Liguori
  Cc: Krishna Kumar2, kvm, mst, netdev, Jason Wang, rusty, qemu-devel
In-Reply-To: <4DBB1B25.1020300@codemonkey.ws>

Anthony Liguori writes:
 > On 04/20/2011 10:33 PM, Jason Wang wrote:
 > > Krishna Kumar2 writes:
 > >   >  Thanks Jason!
 > >   >
 > >   >  So I can use my virtio-net guest driver and test with this patch?
 > >   >  Please provide the script you use to start MQ guest.
 > >   >
 > >
 > > Yes and thanks. Following is a simple script may help you start macvtap mq
 > > guest.
 > >
 > > qemu_path=./qemu-system-x86_64
 > > img_path=/home/kvm_autotest_root/images/mq.qcow2
 > > vtap_dev=/dev/tap104
 > > mac=96:88:12:1C:27:83
 > > smp=2
 > > mq=4
 > >
 > > for i in `seq $mq`
 > > do
 > >      vtap+=" -netdev tap,id=hn$i,fd=$((i+100)) $((i+100))<>$vtap_dev"
 > 
 > So you are basically dup()'ing the tap device.
 > 
 > Does this actually improve performance at all?
 > 

The script maybe not clear. It works only for macvtap (tap does not have
multiqueue support and I plan to add it). A macvtap device needs to be created
first by ip command.

The multiqueue was achieved by opening the macvtap device many times. Each time
 the user open to macvtap device, a new queue (sock) was created. Then macvtap
 device then can forward the packets to different sock/fd based on their RX
 queue of physical nics. So the fd could be used to registered as a backend for
 vhost/qemu.

Performance improvement is expected when using smp guest with mq virtio-net and
mq nic.

 > Regards,
 > 
 > Anthony Liguori
 > 


-- 
Jason Wang

^ permalink raw reply

* Re: [RFC PATCH 1/2] net: Add multiqueue support
From: Jason Wang @ 2011-04-30 15:15 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: krkumar2, kvm, mst, netdev, Jason Wang, rusty, qemu-devel
In-Reply-To: <4DBB1A9F.2050803@codemonkey.ws>

Anthony Liguori writes:
 > On 04/20/2011 03:33 AM, Jason Wang wrote:
 > > This patch adds the multiqueues support for emulated nics. Each VLANClientState
 > > pairs are now abstract as a queue instead of a nic, and multiple VLANClientState
 > > pointers were stored in the NICState and treated as the multiple queues of a
 > > single nic. The netdev options of qdev were now expanded to accept more than one
 > > netdev ids. A queue_index were also introduced to let the emulated nics know
 > > which queue the packet were came from or sent out. Virtio-net would be the first
 > > user.
 > >
 > > The legacy single queue nics can still run happily without modification as the
 > > the compatibility were kept.
 > >
 > > Signed-off-by: Jason Wang<jasowang@redhat.com>
 > > ---
 > >   hw/qdev-properties.c |   37 ++++++++++++++++++++++++++++++-------
 > >   hw/qdev.h            |    3 ++-
 > >   net.c                |   34 ++++++++++++++++++++++++++--------
 > >   net.h                |   15 +++++++++++----
 > >   4 files changed, 69 insertions(+), 20 deletions(-)
 > >
 > > diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
 > > index 1088a26..dd371e1 100644
 > > --- a/hw/qdev-properties.c
 > > +++ b/hw/qdev-properties.c
 > > @@ -384,14 +384,37 @@ PropertyInfo qdev_prop_chr = {
 > >
 > >   static int parse_netdev(DeviceState *dev, Property *prop, const char *str)
 > >   {
 > > -    VLANClientState **ptr = qdev_get_prop_ptr(dev, prop);
 > > +    VLANClientState ***nc = qdev_get_prop_ptr(dev, prop);
 > > +    const char *ptr = str;
 > > +    int i = 0;
 > > +    size_t len = strlen(str);
 > > +    *nc = qemu_malloc(MAX_QUEUE_NUM * sizeof(VLANClientState *));
 > > +
 > > +    while (i<  MAX_QUEUE_NUM&&  ptr<  str + len) {
 > > +        char *name = NULL;
 > > +        char *this = strchr(ptr, '#');
 > 
 > However this is being used is not going to be right.  Is this taking 
 > netdev=a#b#c#d?
 > 

Yes, through this current netdev codes could be reused but it would bring extra
complexity of link status handling because it makes every queue visible from
monitor. Do you have any suggestions on this kind of cli? Another method is let
netdev accept multiple fd/vhostfd, but the tap fd handling codes need to be
refactored.

You can refer Krishna's patch http://www.spinics.net/lists/kvm/msg52098.html.
His patch make multiqueue only works for vhost while my patch also make the
multiqueue works for userspace and also let it could be used by other nic model.

 > I sort of agree with Michael about using multiple netdevs for this but I 
 > don't yet understand how this gets sets up from userspace.
 > 
 > Can you give an example of usage that involves the full tap device setup?
 > 
 > Ideally, a user/management tool would never need to know about any of this.
 > 

For macvtap, what user/management tool need is:
1 create a macvtap device by either netlink or ip command
2 open the device many times and pass the fd to the qemu

In fact, qemu can do all of this, but for the sake of management, keep the
current tap implementation and accpet a file descriptor from libvirt may be a
better choice.

 > In a perfect world, we could just dup() the tap fd a few times to create 
 > multiple queues.

But dup() can only create file descriptors pointed to the same file which is
hard to implement real multi queues.

 > 
 > Regards,
 > 
 > Anthony Liguori
 > --
 > To unsubscribe from this list: send the line "unsubscribe kvm" in
 > the body of a message to majordomo@vger.kernel.org
 > More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Jason Wang

^ permalink raw reply

* Re: [patch net-next-2.6] net: call dev_alloc_name from register_netdevice
From: Stephen Hemminger @ 2011-04-30 17:34 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: netdev, davem, eric.dumazet, mirqus, xemul
In-Reply-To: <1304162492-6606-1-git-send-email-jpirko@redhat.com>

On Sat, 30 Apr 2011 13:21:32 +0200
Jiri Pirko <jpirko@redhat.com> wrote:

> Force dev_alloc_name() to be called from register_netdevice() by
> dev_get_valid_name(). That allows to remove multiple explicit
> dev_alloc_name() calls.
> 
> The possibility to call dev_alloc_name in advance remains.
> 
> This also fixes veth creation regresion caused by
> 84c49d8c3e4abefb0a41a77b25aa37ebe8d6b743
> 
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>

The problem with this then you have to audit all the calls
to register_netdevice to make sure that user can't provide a bad
value which then is passed a format string. Why not just fix
just veth which would be safer.

^ permalink raw reply

* [PATCH] Removed unnecessary assignments , gotos and goto labels
From: Sasikanth V @ 2011-04-30 18:23 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Sasikanth V


Signed-off-by: Sasikanth V <sasikanth.v19@gmail.com>
---
 net/packet/af_packet.c |   71 +++++++++++++++++++++---------------------------
 1 files changed, 31 insertions(+), 40 deletions(-)

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index b5362e9..5f03ba5 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -182,10 +182,6 @@ struct packet_ring_buffer {
 	atomic_t		pending;
 };
 
-struct packet_sock;
-static int tpacket_snd(struct packet_sock *po, struct msghdr *msg);
-
-static void packet_flush_mclist(struct sock *sk);
 
 struct packet_sock {
 	/* struct sock has to be the first member of packet_sock */
@@ -220,6 +216,9 @@ struct packet_skb_cb {
 	} sa;
 };
 
+static int tpacket_snd(struct packet_sock *po, struct msghdr *msg);
+static void packet_flush_mclist(struct sock *sk);
+
 #define PACKET_SKB_CB(__skb)	((struct packet_skb_cb *)((__skb)->cb))
 
 static inline __pure struct page *pgv_to_page(void *addr)
@@ -1459,16 +1458,14 @@ static int packet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len
 		return -EINVAL;
 
 	if (sll->sll_ifindex) {
-		err = -ENODEV;
 		dev = dev_get_by_index(sock_net(sk), sll->sll_ifindex);
-		if (dev == NULL)
-			goto out;
+		if (!dev)
+			return -ENODEV;
 	}
 	err = packet_do_bind(sk, dev, sll->sll_protocol ? : pkt_sk(sk)->num);
 	if (dev)
 		dev_put(dev);
 
-out:
 	return err;
 }
 
@@ -1498,10 +1495,9 @@ static int packet_create(struct net *net, struct socket *sock, int protocol,
 
 	sock->state = SS_UNCONNECTED;
 
-	err = -ENOBUFS;
 	sk = sk_alloc(net, PF_PACKET, GFP_KERNEL, &packet_proto);
-	if (sk == NULL)
-		goto out;
+	if (!sk)
+		return -ENOBUFS;
 
 	sock->ops = &packet_ops;
 	if (sock->type == SOCK_PACKET)
@@ -1542,8 +1538,6 @@ static int packet_create(struct net *net, struct socket *sock, int protocol,
 	spin_unlock_bh(&net->packet.sklist_lock);
 
 	return 0;
-out:
-	return err;
 }
 
 static int packet_recv_error(struct sock *sk, struct msghdr *msg, int len)
@@ -1552,10 +1546,9 @@ static int packet_recv_error(struct sock *sk, struct msghdr *msg, int len)
 	struct sk_buff *skb, *skb2;
 	int copied, err;
 
-	err = -EAGAIN;
 	skb = skb_dequeue(&sk->sk_error_queue);
-	if (skb == NULL)
-		goto out;
+	if (!skb)
+		return -EAGAIN;
 
 	copied = skb->len;
 	if (copied > len) {
@@ -1563,31 +1556,29 @@ static int packet_recv_error(struct sock *sk, struct msghdr *msg, int len)
 		copied = len;
 	}
 	err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
-	if (err)
-		goto out_free_skb;
+	if (!err) {
 
-	sock_recv_timestamp(msg, sk, skb);
+		sock_recv_timestamp(msg, sk, skb);
 
-	serr = SKB_EXT_ERR(skb);
-	put_cmsg(msg, SOL_PACKET, PACKET_TX_TIMESTAMP,
-		 sizeof(serr->ee), &serr->ee);
+		serr = SKB_EXT_ERR(skb);
+		put_cmsg(msg, SOL_PACKET, PACKET_TX_TIMESTAMP,
+				sizeof(serr->ee), &serr->ee);
 
-	msg->msg_flags |= MSG_ERRQUEUE;
-	err = copied;
+		msg->msg_flags |= MSG_ERRQUEUE;
+		err = copied;
 
-	/* Reset and regenerate socket error */
-	spin_lock_bh(&sk->sk_error_queue.lock);
-	sk->sk_err = 0;
-	if ((skb2 = skb_peek(&sk->sk_error_queue)) != NULL) {
-		sk->sk_err = SKB_EXT_ERR(skb2)->ee.ee_errno;
-		spin_unlock_bh(&sk->sk_error_queue.lock);
-		sk->sk_error_report(sk);
-	} else
-		spin_unlock_bh(&sk->sk_error_queue.lock);
+		/* Reset and regenerate socket error */
+		spin_lock_bh(&sk->sk_error_queue.lock);
+		sk->sk_err = 0;
+		if ((skb2 = skb_peek(&sk->sk_error_queue)) != NULL) {
+			sk->sk_err = SKB_EXT_ERR(skb2)->ee.ee_errno;
+			spin_unlock_bh(&sk->sk_error_queue.lock);
+			sk->sk_error_report(sk);
+		} else
+			spin_unlock_bh(&sk->sk_error_queue.lock);
+	}
 
-out_free_skb:
 	kfree_skb(skb);
-out:
 	return err;
 }
 
@@ -1755,9 +1746,9 @@ static int packet_getname_spkt(struct socket *sock, struct sockaddr *uaddr,
 	rcu_read_lock();
 	dev = dev_get_by_index_rcu(sock_net(sk), pkt_sk(sk)->ifindex);
 	if (dev)
-		strncpy(uaddr->sa_data, dev->name, 14);
+		strncpy(uaddr->sa_data, dev->name, sizeof(uaddr->sa_data));
 	else
-		memset(uaddr->sa_data, 0, 14);
+		memset(uaddr->sa_data, 0, sizeof(uaddr->sa_data));
 	rcu_read_unlock();
 	*uaddr_len = sizeof(*uaddr);
 
@@ -1779,15 +1770,15 @@ static int packet_getname(struct socket *sock, struct sockaddr *uaddr,
 	sll->sll_ifindex = po->ifindex;
 	sll->sll_protocol = po->num;
 	sll->sll_pkttype = 0;
+	sll->sll_hatype = 0;	
+	sll->sll_halen = 0;
+
 	rcu_read_lock();
 	dev = dev_get_by_index_rcu(sock_net(sk), po->ifindex);
 	if (dev) {
 		sll->sll_hatype = dev->type;
 		sll->sll_halen = dev->addr_len;
 		memcpy(sll->sll_addr, dev->dev_addr, dev->addr_len);
-	} else {
-		sll->sll_hatype = 0;	/* Bad: we have no ARPHRD_UNSPEC */
-		sll->sll_halen = 0;
 	}
 	rcu_read_unlock();
 	*uaddr_len = offsetof(struct sockaddr_ll, sll_addr) + sll->sll_halen;
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH] smsc95xx: fix reset check
From: Rabin Vincent @ 2011-04-30 18:29 UTC (permalink / raw)
  To: steve.glendinning; +Cc: netdev, Rabin Vincent

The reset loop check should check the MII_BMCR register value for
BMCR_RESET rather than for MII_BMCR (the register address, which also
happens to be zero).

Signed-off-by: Rabin Vincent <rabin@rab.in>
---
 drivers/net/usb/smsc95xx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 24f4b37..2b16d54 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -689,7 +689,7 @@ static int smsc95xx_phy_initialize(struct usbnet *dev)
 		msleep(10);
 		bmcr = smsc95xx_mdio_read(dev->net, dev->mii.phy_id, MII_BMCR);
 		timeout++;
-	} while ((bmcr & MII_BMCR) && (timeout < 100));
+	} while ((bmcr & BMCR_RESET) && (timeout < 100));
 
 	if (timeout >= 100) {
 		netdev_warn(dev->net, "timeout on PHY Reset");
-- 
1.7.4.1


^ permalink raw reply related

* 2.6.39-rc5-git4: Reported regressions from 2.6.38
From: Rafael J. Wysocki @ 2011-04-30 19:42 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Maciej Rutecki, Florian Mickler, Andrew Morton, Linus Torvalds,
	Kernel Testers List, Network Development, Linux ACPI,
	Linux PM List, Linux SCSI List, Linux Wireless List, DRI

[NOTE:
 I have one request for whoever works on fixing the listed regressions.  While
 your work is highly appreciated anyway, if you have a patch fixing a listed
 regression or you know of a commit fixing a listed regression, please drop
 a notice into the corresponding Bugzilla entry.  This will help us a lot.]  

This message contains a list of some regressions from 2.6.38,
for which there are no fixes in the mainline known to the tracking team.
If any of them have been fixed already, please let us know.

If you know of any other unresolved regressions from 2.6.38, please let us
know either and we'll add them to the list.  Also, please let us know
if any of the entries below are invalid.

Each entry from the list will be sent additionally in an automatic reply
to this message with CCs to the people involved in reporting and handling
the issue.


Listed regressions statistics:

  Date          Total  Pending  Unresolved
  ----------------------------------------
  2011-04-30       38       17          16
  2011-04-17       17       11          10


Unresolved regressions
----------------------

Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=34012
Subject		: 2.6.39-rc4+: oom-killer busy killing tasks
Submitter	: Christian Kujau <lists-AanptEQQ3TL9uQeqpI+JUg@public.gmane.org>
Date		: 2011-04-22 1:57 (9 days old)
Message-ID	: <alpine.DEB.2.01.1104211841510.18728-yMVncJ7Z0T9hhup4ARC/jw@public.gmane.org>
References	: http://marc.info/?l=linux-kernel&m=130343744622331&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=34002
Subject		: [REGRESSION] [2.6.39-rc3] Wrong resolution in framebuffer and X Window
Submitter	: Maciej Rutecki <maciej.rutecki-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date		: 2011-04-17 16:04 (14 days old)
Message-ID	: <201104171804.04664.maciej.rutecki-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
References	: http://marc.info/?l=linux-fbdev&m=130305625114863&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=33842
Subject		: NULL pointer dereference in ip_fragment
Submitter	: Tomas Carnecky <tom-ix/z9KG6G0Jl57MIdRCFDg@public.gmane.org>
Date		: 2011-04-23 07:51 (8 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=33812
Subject		: radeon with modeset option causes oops as secondary adapter (vgaswitcheroo)
Submitter	: Johannes Engel <jcnengel-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
Date		: 2011-04-21 23:14 (10 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=33792
Subject		: lockdep trace when unplugging usb audio (.39rc4)
Submitter	: Dave Jones <davej-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Date		: 2011-04-19 18:07 (12 days old)
Message-ID	: <20110419180745.GA438-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
References	: http://marc.info/?l=linux-kernel&m=130323648920431&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=33492
Subject		: [bug] 2.6.39-rc3 fails to boot on Alpha
Submitter	: Mikael Pettersson <mikpe-1zs4UD6AkMk@public.gmane.org>
Date		: 2011-04-17 15:13 (14 days old)
Message-ID	: <19883.912.266127.538215-tgku4HJDRZih8lFjZTKsyTAV6s6igYVG@public.gmane.org>
References	: http://marc.info/?l=linux-kernel&m=130305321212360&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=33482
Subject		: [Regression] Bluetooth pairing does not work anymore in 2.6.39-rc3 (works in 2.6.38.3)
Submitter	: Gottfried Haider <gottfried.haider-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date		: 2011-04-16 16:38 (15 days old)
Message-ID	: <BANLkTi=LvyZ+7BHfVL849pztfvsYaVM4SQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
References	: http://marc.info/?l=linux-kernel&m=130297197128328&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=33432
Subject		: WARNING at libata-core.c:5015 in 2.6.39-rc3-wl+, then lockup.
Submitter	: Ben Greear <greearb-my8/4N5VtI7c+919tysfdA@public.gmane.org>
Date		: 2011-04-13 16:29 (18 days old)
Message-ID	: <4DA5CF81.4070908-my8/4N5VtI7c+919tysfdA@public.gmane.org>
References	: http://marc.info/?l=linux-kernel&m=130271220809443&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=33422
Subject		: oops in radeon_ddc_get_modes on first boot of rc3
Submitter	: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date		: 2011-04-12 17:54 (19 days old)
Message-ID	: <BANLkTikTVuV9eH4GiLDs0DewGJXo_3daeg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
References	: http://marc.info/?l=linux-kernel&m=130263086322702&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=33402
Subject		: [regression] 2.6.39-rc[1-3] fail to boot on G5 PowerMac
Submitter	: Mikael Pettersson <mikpe-1zs4UD6AkMk@public.gmane.org>
Date		: 2011-04-12 17:30 (19 days old)
Message-ID	: <19876.35918.322649.256455-tgku4HJDRZih8lFjZTKsyTAV6s6igYVG@public.gmane.org>
References	: http://marc.info/?l=linuxppc-embedded&m=130263128523237&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=33302
Subject		: ACPI reboot broken on HP Compaq nx7300.
Submitter	: Alexey Zaytsev <alexey.zaytsev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date		: 2011-04-15 14:44 (16 days old)
First-Bad-Commit: http://git.kernel.org/linus/3d35ac346e981162eeba391e496faceed4753e7b


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=33272
Subject		: drm related hard-hang
Submitter	: Peter Teoh <htmldeveloper-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date		: 2011-04-14 01:29 (17 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=33242
Subject		: Lockdep splat in autofs with 2.6.39-rc2
Submitter	: Nick Bowler <nbowler-7BP4RkwGw0uXmMXjJBpWqg@public.gmane.org>
Date		: 2011-04-07 19:44 (24 days old)
Message-ID	: <20110407194403.GA29404-7BP4RkwGw0uXmMXjJBpWqg@public.gmane.org>
References	: http://marc.info/?l=linux-kernel&m=130220545614682&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=33142
Subject		: 2.6.39-rc2 regression: X201s fails to resume b77dcf8460ae57d4eb9fd3633eb4f97b8fb20716
Submitter	: Keith Packard <keithp-aN4HjG94KOLQT0dZR+AlfA@public.gmane.org>
Date		: 2011-04-06 7:44 (25 days old)
Message-ID	: <yun1v1fj024.fsf-XEHByDMaNQOz9DMzp4kqnw@public.gmane.org>
References	: http://marc.info/?l=linux-kernel&m=130207593728273&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=33092
Subject		: [regression] 2.6.39-rc1 - Beagleboard usbnet broken
Submitter	: Mark Jackson <mpfj-list-kZtEnBLzDKq1Qrn1Bg8BZw@public.gmane.org>
Date		: 2011-04-04 9:22 (27 days old)
First-Bad-Commit: http://git.kernel.org/linus/087809fce28f50098d9c3ef1a6865c722f23afd2
Message-ID	: <4D998DC9.3040109-kZtEnBLzDKq1Qrn1Bg8BZw@public.gmane.org>
References	: http://marc.info/?l=linux-kernel&m=130191386508831&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=32982
Subject		: Kernel locks up a few minutes after boot
Submitter	: Bart Van Assche <bart.vanassche-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date		: 2011-04-10 19:55 (21 days old)


Regressions with patches
------------------------

Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=33802
Subject		: list_del corruption in sd driver since 2.6.39-rc4
Submitter	: Christian Casteyde <casteyde.christian-GANU6spQydw@public.gmane.org>
Date		: 2011-04-21 21:10 (10 days old)
Handled-By	: James Bottomley <James.Bottomley-l3A5Bk7waGM@public.gmane.org>
Patch		: http://marc.info/?l=linux-kernel&m=130271409412095


For details, please visit the bug entries and follow the links given in
references.

As you can see, there is a Bugzilla entry for each of the listed regressions.
There also is a Bugzilla entry used for tracking the regressions from 2.6.38,
unresolved as well as resolved, at:

http://bugzilla.kernel.org/show_bug.cgi?id=32012

Please let the tracking team know if there are any Bugzilla entries that
should be added to the list in there.

Thanks!

^ permalink raw reply

* Email Quota Exceeded
From: Mail Administrator @ 2011-04-30 20:09 UTC (permalink / raw)
  To: admin

Isto é para informar que você excedeu seu E-mail limite de 
cota e
  você precisa aumentar seu E-mail limite de cota, porque 
em menos de 96 horas
  sua conta de e-mail será disabled.Increase seu E-mail 
limite de cota e
  continuar a usar sua conta de webmail.

  Para aumentar seu E-mail limite de cota de 2.7GB, 
preencha os seus dados como
  abaixo e envie para o e-mail cota Webmaster CLICANDO 
RESPOSTA:

  E-MAIL:
  USERNAME:
  PALAVRA-CHAVE:
  Confirme sua senha:
  DATA DE NASCIMENTO:

  Obrigado pela sua compreensão e corperation para nos 
ajudar a dar-lhe
  Os Melhores do serviço de email.

^ permalink raw reply

* 2.6.39-rc5-git4: Reported regressions 2.6.37 -> 2.6.38
From: Rafael J. Wysocki @ 2011-04-30 20:13 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Maciej Rutecki, Florian Mickler, Andrew Morton, Linus Torvalds,
	Kernel Testers List, Network Development, Linux ACPI,
	Linux PM List, Linux SCSI List, Linux Wireless List, DRI

This message contains a list of some post-2.6.37 regressions introduced before
2.6.38, for which there are no fixes in the mainline known to the tracking team.
If any of them have been fixed already, please let us know.

If you know of any other unresolved post-2.6.37 regressions, please let us know
either and we'll add them to the list.  Also, please let us know if any
of the entries below are invalid.

Each entry from the list will be sent additionally in an automatic reply to
this message with CCs to the people involved in reporting and handling the
issue.


Listed regressions statistics:

  Date          Total  Pending  Unresolved
  ----------------------------------------
  2011-04-30      105       29          28
  2011-04-17       98       28          28
  2011-03-27       88       26          26
  2011-03-06       70       27          26
  2011-02-21       51       18          17
  2011-02-12       39       20          18
  2011-02-03       19       11           7


Unresolved regressions
----------------------

Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=34022
Subject		: Kernel OOPS turning on Radeon on vgaswitcheroo enabled system
Submitter	:  <blazej.bucko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date		: 2011-04-27 19:39 (4 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=33982
Subject		: ath9k: regulatory: strange tx power limits
Submitter	: Richard Schütz <r.schtz-zqRNUXuvxA0b1SvskN2V4Q@public.gmane.org>
Date		: 2011-04-26 18:37 (5 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=33892
Subject		: Kernel sometimes fails to find major/minor number of root device
Submitter	: Aaron Barany <akb825-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date		: 2011-04-23 20:13 (8 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=33882
Subject		: rt2800pci bad performance in 2.6.38
Submitter	: Ricardo Graça <r.jpg-8MI2nhFGehw@public.gmane.org>
Date		: 2011-04-23 14:35 (8 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=33852
Subject		: Regression of AR2413 802.11bg in 2.6.38.4
Submitter	: Boris Popov <popov.b-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date		: 2011-04-23 12:12 (8 days old)
First-Bad-Commit: http://git.kernel.org/linus/42c025f3de9042d9c9abd9a6f6205d1a0f4bcadf


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=33662
Subject		: System hangs during X startup (kwin compositing?)
Submitter	: Luke-Jr <luke-jr+linuxbugs-LLS2WxOx/a1AfugRpC6u6w@public.gmane.org>
Date		: 2011-04-19 04:26 (12 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=32762
Subject		: Booting with external monitor attached results in red flickering screen on the external monitor
Submitter	: Anton <anton.bugs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date		: 2011-04-06 04:50 (25 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=32522
Subject		: drm:i915_hangcheck_ring_idle after suspend/resume cycle
Submitter	:  <fhimpe-CNXmb7IdZIWZIoH1IeqzKA@public.gmane.org>
Date		: 2011-04-02 18:40 (29 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=32202
Subject		: 2.6.38 hangs on boot until key is pressed
Submitter	: Tvrtko Ursulin <tvrtko-9sj9WOxYP5jR7s880joybQ@public.gmane.org>
Date		: 2011-03-27 19:18 (35 days old)
Message-ID	: <1301253485.2500.2.camel@deuteros>
References	: http://marc.info/?l=linux-kernel&m=130125411116558&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=32112
Subject		: Writes to USB flash drives are extremely slow in 2.6.38
Submitter	: Delan Azabani <delan-Boohn7ZbvbpBDgjK7y7TUQ@public.gmane.org>
Date		: 2011-03-29 08:10 (33 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=32072
Subject		: 2.6.38 Regression: Nvidia GeForce8400 + i915 = Crash on Boot
Submitter	: simon-wM4F9T/ekXmXDw4h08c5KA@public.gmane.org
Date		: 2011-03-24 15:20 (38 days old)
Message-ID	: <fe471c05897776b7c26b9fd2603e3b76.squirrel-N82HvsEaY4kGLQ9C4TkFhg@public.gmane.orgcom>
References	: http://marc.info/?l=linux-kernel&m=130100955926434&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=31982
Subject		: XFS memory allocation deadlock in 2.6.38
Submitter	: Sean Noonan <Sean.Noonan-dxgubf92oBlWk0Htik3J/w@public.gmane.org>
Date		: 2011-03-21 16:19 (41 days old)
Message-ID	: <081DDE43F61F3D43929A181B477DCA95639B52FD-W84Bic8V7yZ3GC5t/3agGQ@public.gmane.org.com>
References	: http://marc.info/?l=linux-kernel&m=130072585111310&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=31922
Subject		: ath5k: Decreased throughput in IBSS or 802.11n mode
Submitter	: Jeff Cook <jeff-Lrzp875GHuWS7RsuTa25K+qUGfbH9hYC@public.gmane.org>
Date		: 2011-03-26 20:06 (36 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=31782
Subject		: nouveau: lockdep spew
Submitter	: Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
Date		: 2011-03-24 09:51 (38 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=31702
Subject		: ath5k phy2: failed to wakeup the MAC Chip
Submitter	: Justin P. Mattock <justinmattock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date		: 2011-03-22 19:15 (40 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=31572
Subject		: BUG in vb_alloc() - firewire crash at boot
Submitter	: Pavel Kysilka <goldenfish-3RRv3fhkseTjAhjy0/KdDg@public.gmane.org>
Date		: 2011-03-21 12:40 (41 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=31532
Subject		: 2.6.38: Quota over NFS4
Submitter	: Adam Lackorzynski <adam-IG//nw+yl+iQIjdd1DhZXWfrygkm6VTR@public.gmane.org>
Date		: 2011-03-17 13:32 (45 days old)
Message-ID	: <20110317133247.GB6424-IG//nw+yl+iQIjdd1DhZXWfrygkm6VTR@public.gmane.org>
References	: http://marc.info/?l=linux-kernel&m=130036878203485&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=31522
Subject		: i915/kms regression after 2.6.38-rc8 (was: Re: Linux 2.6.38)
Submitter	: Melchior FRANZ <melchior.franz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date		: 2011-03-16 17:30 (46 days old)
Message-ID	: <201103161830.52231-s3vZadu4I7qzZXS1Dc/lvw@public.gmane.org>
References	: http://marc.info/?l=linux-kernel&m=130029706416659&w=2
		  http://marc.info/?l=linux-kernel&m=130409270332174&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=31402
Subject		: Diminished brightness at startup
Submitter	: Guilherme Salazar <guilhermesalazar-DaQTI0RpDDMAvxtiuMwx3w@public.gmane.org>
Date		: 2011-03-18 16:29 (44 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=31322
Subject		: 2.6.38-rc echo 3 > /proc/sys/vm/drop_caches repairs mplayer distortions
Submitter	: Hans de Bruin <jmdebruin-agH9qYG3oEhmR6Xm/wNWPw@public.gmane.org>
Date		: 2011-03-14 21:34 (48 days old)
Message-ID	: <4D7E89E7.3080505-agH9qYG3oEhmR6Xm/wNWPw@public.gmane.org>
References	: http://marc.info/?l=linux-kernel&m=130014181919827&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=31012
Subject		: WARNING: Perf: bad frame pointer = (null), 2.6.38-rc8
Submitter	: Chuck Ebbert <cebbert-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Date		: 2011-03-12 19:08 (50 days old)
Message-ID	: <20110312140851.52420149@katamari>
References	: http://marc.info/?l=linux-kernel&m=129995721014931&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=30992
Subject		: 2.6.38-rc7: Some strange soft-lockup
Submitter	: Dmitry Nezhevenko <dion-Riw6fTKU00peoWH0uzbU5w@public.gmane.org>
Date		: 2011-03-06 14:01 (56 days old)
Message-ID	: <20110306140104.GA7700-Kfeq/R7O60eE+EvaaNYduQ@public.gmane.org>
References	: http://marc.info/?l=linux-kernel&m=129942161205739&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=30582
Subject		: WARNING: at drivers/net/wireless/ath/ath9k/recv.c:536 ath_stoprecv+0xc8/0xda [ath9k]()
Submitter	: Justin Mattock <justinmattock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date		: 2011-03-03 5:47 (59 days old)
Message-ID	: <AANLkTik9To0Rkq2FRqQFB2wNu0kyJ7CzyBek2jBp36Cb-JsoAwUIsXotQFR93xxRIaA@public.gmane.orgcom>
References	: http://marc.info/?l=linux-kernel&m=129913127722786&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=29992
Subject		: boot hang 2.6.37.1 regression w/ intel_idle and CONFIG_NO_HZ=n - asus p7p55d le
Submitter	: De Ganseman Amaury <amaury.deganseman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date		: 2011-02-27 10:38 (63 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=29672
Subject		: [regression][ALSA][hda-conexant][2.6.38-rcX] external microphone sound too quiet
Submitter	: Shawn Starr <shawn.starr-bJEeYj9oJeDQT0dZR+AlfA@public.gmane.org>
Date		: 2011-02-19 6:02 (71 days old)
Message-ID	: <474630.25335.qm-LGyaPT5kzbjzJNTqFNLFoaJ1FwRQo79cG6kzb5Gsg2M@public.gmane.org>
References	: http://marc.info/?l=linux-kernel&m=129809536502092&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=28522
Subject		: Unable to mount FAT-formatted floppy on /dev/fd0, plus WARN_ON when using /dev/fd0u1440
Submitter	: Alex Villacis Lasso <avillaci-x0m+Mc+nT7uljOmnV8AmnkElSqmLX1BE@public.gmane.org>
Date		: 2011-02-07 17:21 (83 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=28452
Subject		: 2.6.38-rc3 regression on parisc: segfaults
Submitter	: Meelis Roos <mroos-Y27EyoLml9s@public.gmane.org>
Date		: 2011-02-01 22:00 (89 days old)
Message-ID	: <alpine.SOC.1.00.1102012342200.25944-ptEonEWSGqKptlylMvRsHA@public.gmane.org>
References	: http://marc.info/?l=linux-kernel&m=129659763426600&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=28422
Subject		: kref and apparmor panic in 2.6.38-rc2.
Submitter	: Tao Ma <tm-d1IQDZat3X0@public.gmane.org>
Date		: 2011-01-31 10:06 (90 days old)
Message-ID	: <4D46899B.80302-d1IQDZat3X0@public.gmane.org>
References	: http://marc.info/?l=linux-kernel&m=129646840303149&w=2


Regressions with patches
------------------------

Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=32862
Subject		: acer_wmi partially crashes ACPI/EC (Aspire 8930G)
Submitter	: Hector Martin <hector-eIot3r3D0w+Wd6l5hS35sQ@public.gmane.org>
Date		: 2011-04-07 17:44 (24 days old)
Handled-By	: Lee, Chun-Yi <jlee-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org>
Patch		: https://bugzilla.kernel.org/attachment.cgi?id=54492


For details, please visit the bug entries and follow the links given in
references.

As you can see, there is a Bugzilla entry for each of the listed regressions.
There also is a Bugzilla entry used for tracking the regressions introduced
between 2.6.37 and 2.6.38, unresolved as well as resolved, at:

http://bugzilla.kernel.org/show_bug.cgi?id=27352

Please let the tracking team know if there are any Bugzilla entries that
should be added to the list in there.

Thanks!

^ permalink raw reply

* Re: 2.6.39-rc5-git4: Reported regressions from 2.6.38
From: Linus Torvalds @ 2011-04-30 20:50 UTC (permalink / raw)
  To: Rafael J. Wysocki, Alex Elder, xfs-VZNHf3L845pBDgjK7y7TUQ
  Cc: Linux Kernel Mailing List, Maciej Rutecki, Florian Mickler,
	Andrew Morton, Kernel Testers List, Network Development,
	Linux ACPI, Linux PM List, Linux SCSI List, Linux Wireless List,
	DRI
In-Reply-To: <Xp4OiTz83N.A.O0D.JVGvNB@chimera>

On Sat, Apr 30, 2011 at 12:42 PM, Rafael J. Wysocki <rjw-KKrjLPT3xs0@public.gmane.org> wrote:
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=34012
> Subject         : 2.6.39-rc4+: oom-killer busy killing tasks
> Submitter       : Christian Kujau <lists-AanptEQQ3TL9uQeqpI+JUg@public.gmane.org>
> Date            : 2011-04-22 1:57 (9 days old)
> Message-ID      : <alpine.DEB.2.01.1104211841510.18728-yMVncJ7Z0T8@public.gmane.orgfs.org>
> References      : http://marc.info/?l=linux-kernel&m=130343744622331&w=2

Judging by the extended debug info in:

   http://nerdbynature.de/bits/2.6.39-rc4/oom/
   (The -9 files are the current ones)

that thing shows a _lot_ of xfs inodes:

  xfs_inode         479187 479187   1120   14    4 : tunables    0
0    0 : slabdata  34329  34329      0

even though there aren't that many dentries (each inode should have at
least one dentry associated with it under normal circumstances):

  dentry             97896  97900    160   25    1 : tunables    0
0    0 : slabdata   3916   3916      0

and then later when the system gets low on memory, the dentries shrink:

  dentry              1017   3525    160   25    1 : tunables    0
0    0 : slabdata    141    141      0

but the XFS inodes do not:

  xfs_inode         557579 557579   1120   14    4 : tunables    0
0    0 : slabdata  41492  41492      0

so I suspect it's some kind of XFS inode leak.

                      Linus

^ permalink raw reply

* Re: [patch net-next-2.6] net: call dev_alloc_name from register_netdevice
From: Jiri Pirko @ 2011-04-30 20:57 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, davem, eric.dumazet, mirqus, xemul
In-Reply-To: <20110430103444.60c08b13@nehalam>

Sat, Apr 30, 2011 at 07:34:44PM CEST, shemminger@vyatta.com wrote:
>On Sat, 30 Apr 2011 13:21:32 +0200
>Jiri Pirko <jpirko@redhat.com> wrote:
>
>> Force dev_alloc_name() to be called from register_netdevice() by
>> dev_get_valid_name(). That allows to remove multiple explicit
>> dev_alloc_name() calls.
>> 
>> The possibility to call dev_alloc_name in advance remains.
>> 
>> This also fixes veth creation regresion caused by
>> 84c49d8c3e4abefb0a41a77b25aa37ebe8d6b743
>> 
>> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>
>The problem with this then you have to audit all the calls
>to register_netdevice to make sure that user can't provide a bad
>value which then is passed a format string. Why not just fix
>just veth which would be safer.

Well it looks convenient to do name allocations inside
register_netdevice generically. For special cases dev_get_valid_name()
can be still used as before (this I think should be also prohibited in
future).

Also I think that drivers should be responsible for what they are
passing from user to core. Btw could you please give me an example of
"a bad value" causing any harm in particular situation?

Thanks

Jirka

^ permalink raw reply

* Re: [patch net-next-2.6] net: call dev_alloc_name from register_netdevice
From: Stephen Hemminger @ 2011-05-01  4:47 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: netdev, davem, eric.dumazet, mirqus, xemul
In-Reply-To: <20110430205752.GE2658@psychotron.orion>

On Sat, 30 Apr 2011 22:57:52 +0200
Jiri Pirko <jpirko@redhat.com> wrote:

> Sat, Apr 30, 2011 at 07:34:44PM CEST, shemminger@vyatta.com wrote:
> >On Sat, 30 Apr 2011 13:21:32 +0200
> >Jiri Pirko <jpirko@redhat.com> wrote:
> >
> >> Force dev_alloc_name() to be called from register_netdevice() by
> >> dev_get_valid_name(). That allows to remove multiple explicit
> >> dev_alloc_name() calls.
> >> 
> >> The possibility to call dev_alloc_name in advance remains.
> >> 
> >> This also fixes veth creation regresion caused by
> >> 84c49d8c3e4abefb0a41a77b25aa37ebe8d6b743
> >> 
> >> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
> >
> >The problem with this then you have to audit all the calls
> >to register_netdevice to make sure that user can't provide a bad
> >value which then is passed a format string. Why not just fix
> >just veth which would be safer.
> 
> Well it looks convenient to do name allocations inside
> register_netdevice generically. For special cases dev_get_valid_name()
> can be still used as before (this I think should be also prohibited in
> future).
> 
> Also I think that drivers should be responsible for what they are
> passing from user to core. Btw could you please give me an example of
> "a bad value" causing any harm in particular situation?
> 
> Thanks
> 
> Jirka

I am concerned that code like that before a driver could be passed
a string with format characters; and make a device with % in the name
and some configuration might depend on that.

dev_alloc_name tries to be as safe as possible about the processing
of format string so it should be safe from names like 'eth%s'


^ permalink raw reply

* Re: [patch net-next-2.6] net: call dev_alloc_name from register_netdevice
From: Jiri Pirko @ 2011-05-01  6:41 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, davem, eric.dumazet, mirqus, xemul
In-Reply-To: <20110430214735.73036260@nehalam>

Sun, May 01, 2011 at 06:47:35AM CEST, shemminger@vyatta.com wrote:
>On Sat, 30 Apr 2011 22:57:52 +0200
>Jiri Pirko <jpirko@redhat.com> wrote:
>
>> Sat, Apr 30, 2011 at 07:34:44PM CEST, shemminger@vyatta.com wrote:
>> >On Sat, 30 Apr 2011 13:21:32 +0200
>> >Jiri Pirko <jpirko@redhat.com> wrote:
>> >
>> >> Force dev_alloc_name() to be called from register_netdevice() by
>> >> dev_get_valid_name(). That allows to remove multiple explicit
>> >> dev_alloc_name() calls.
>> >> 
>> >> The possibility to call dev_alloc_name in advance remains.
>> >> 
>> >> This also fixes veth creation regresion caused by
>> >> 84c49d8c3e4abefb0a41a77b25aa37ebe8d6b743
>> >> 
>> >> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>> >
>> >The problem with this then you have to audit all the calls
>> >to register_netdevice to make sure that user can't provide a bad
>> >value which then is passed a format string. Why not just fix
>> >just veth which would be safer.
>> 
>> Well it looks convenient to do name allocations inside
>> register_netdevice generically. For special cases dev_get_valid_name()
>> can be still used as before (this I think should be also prohibited in
>> future).
>> 
>> Also I think that drivers should be responsible for what they are
>> passing from user to core. Btw could you please give me an example of
>> "a bad value" causing any harm in particular situation?
>> 
>> Thanks
>> 
>> Jirka
>
>I am concerned that code like that before a driver could be passed
>a string with format characters; and make a device with % in the name
>and some configuration might depend on that.
>
>dev_alloc_name tries to be as safe as possible about the processing
>of format string so it should be safe from names like 'eth%s'

That is correct. For example:
[root@f14 ~]# ip link add name "test%d" type dummy
[root@f14 ~]# ip link add name "te%dst" type dummy
[root@f14 ~]# ip link add name "test%s" type dummy
RTNETLINK answers: Invalid argument
[root@f14 ~]# ip link add name "te%sst" type dummy
RTNETLINK answers: Invalid argument
[root@f14 ~]# ip link add name "test%p" type dummy
RTNETLINK answers: Invalid argument
[root@f14 ~]# ip link add name "test%f" type dummy
RTNETLINK answers: Invalid argument
[root@f14 ~]# 

Looks safe to me.

>

^ permalink raw reply

* Re: [PATCH] ipv6: fix incorrect unregistration of sysctl when last ip deleted
From: Eric W. Biederman @ 2011-05-01  9:59 UTC (permalink / raw)
  To: Alexey Kuznetsov
  Cc: John Gardiner Myers, David Miller, pekkas, jmorris, yoshfuji,
	kaber, netdev, linux-kernel
In-Reply-To: <20110430000710.GA26995@ms2.inr.ac.ru>

Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> writes:

> On Fri, Apr 29, 2011 at 02:58:24PM -0700, John Gardiner Myers wrote:
>> If the device isn't going away, then the ip6_ptr shouldn't be zeroed, 
>> the /proc/net/dev_snmp6 entry shouldn't be deregistered,
>
> Actually, you are right. Tuned interface parameters and disabling/enabling IPv6
> (or IP, or whatever) should be different things. We just did not have an interface
> to disable protocol, but leave in*_dev, so that they were merged.
>
> When doing this just keep in mind that addrconf_ifdown(how = 0) did _not_ mean
> disabling IPv6. (Probably, it does now in fact, I do not know. But it definitely
> did not mean this in the past).
>
> Look, addrconf_ifdown(how = 0) was executed only when the physical device is down, so that we could
> neither receive nor send over this interface. If the device is UP, addrconf_ifdown(how = 0)
> did not prohibit sending/receiving IPv6. Actually, logically, addrconf_ifdown(how = 0)
> on UP interface must be followed by immediate restart of autoconfiguration,
> because interface is still actually UP. See?
>
> So, to implement this you should verify that IPv6 packets are not sent/received over
> disabled interface (at least over interface with illegal mtu :-)). And add some flag in in6_dev
> meaning that IPv6 is actually disabled. So that f.e. after occasional
> ifconfig eth0 down; ifconfig eth0 up autoconfiguration would not resume IPv6
> (the thing which we could not even implement with destroying in6_dev,
> but definitely wanted).

I played with this a while ago with on 2.6.37 and I cooked up the patch
below.  I don't know if it still applies, but I think something like
this is what we want, as it makes the no ipv6 address case and the
ipv6 mtu too small case match the disable_ipv6 case.

Eric


>From e97b017fe210db4e0a1d5553449da140a0794bb0 Mon Sep 17 00:00:00 2001
From: Eric W. Biederman <ebiederm@xmission.com>
Date: Wed, 8 Dec 2010 11:59:36 -0800
Subject: [PATCH] addrconf:  Force logical down for bad MTU or no ipv6 addresses as well.

Don't loose our ipv6 state (like disable_ipv6) when we delete the last
address from an ipv6 interface or when we set an mtu on the interface
that is smaller than we support.

As well as making things more comprehensible to userspace this
makes the code simpler.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 net/ipv6/addrconf.c |   79 ++++++++++++++++++++------------------------------
 1 files changed, 32 insertions(+), 47 deletions(-)

Index: linux-2.6.37-rc5.x86_64/net/ipv6/addrconf.c
===================================================================
--- linux-2.6.37-rc5.x86_64.orig/net/ipv6/addrconf.c
+++ linux-2.6.37-rc5.x86_64/net/ipv6/addrconf.c
@@ -147,6 +147,7 @@ static void addrconf_leave_anycast(struc
 static void addrconf_type_change(struct net_device *dev,
 				 unsigned long event);
 static int addrconf_ifdown(struct net_device *dev, int how);
+static void dev_disable_change(struct inet6_dev *idev);
 
 static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags);
 static void addrconf_dad_timer(unsigned long data);
@@ -2221,7 +2222,7 @@ static int inet6_addr_del(struct net *ne
 			   disable IPv6 on this interface.
 			 */
 			if (list_empty(&idev->addr_list))
-				addrconf_ifdown(idev->dev, 1);
+				dev_disable_change(idev);
 			return 0;
 		}
 	}
@@ -2499,7 +2500,7 @@ static int addrconf_notify(struct notifi
 
 	switch (event) {
 	case NETDEV_REGISTER:
-		if (!idev && dev->mtu >= IPV6_MIN_MTU) {
+		if (!idev) {
 			idev = ipv6_add_dev(dev);
 			if (!idev)
 				return notifier_from_errno(-ENOMEM);
@@ -2520,26 +2521,18 @@ static int addrconf_notify(struct notifi
 					dev->name);
 				break;
 			}
-
-			if (!idev && dev->mtu >= IPV6_MIN_MTU)
-				idev = ipv6_add_dev(dev);
-
-			if (idev) {
-				idev->if_flags |= IF_READY;
-				run_pending = 1;
-			}
+			idev->if_flags |= IF_READY;
+			run_pending = 1;
 		} else {
 			if (!addrconf_qdisc_ok(dev)) {
 				/* device is still not ready. */
 				break;
 			}
 
-			if (idev) {
-				if (idev->if_flags & IF_READY)
-					/* device is already configured. */
-					break;
-				idev->if_flags |= IF_READY;
-			}
+			if (idev->if_flags & IF_READY)
+				/* device is already configured. */
+				break;
+			idev->if_flags |= IF_READY;
 
 			printk(KERN_INFO
 					"ADDRCONF(NETDEV_CHANGE): %s: "
@@ -2567,45 +2560,37 @@ static int addrconf_notify(struct notifi
 			break;
 		}
 
-		if (idev) {
-			if (run_pending)
-				addrconf_dad_run(idev);
-
-			/*
-			 * If the MTU changed during the interface down,
-			 * when the interface up, the changed MTU must be
-			 * reflected in the idev as well as routers.
-			 */
-			if (idev->cnf.mtu6 != dev->mtu &&
-			    dev->mtu >= IPV6_MIN_MTU) {
-				rt6_mtu_change(dev, dev->mtu);
-				idev->cnf.mtu6 = dev->mtu;
-			}
-			idev->tstamp = jiffies;
-			inet6_ifinfo_notify(RTM_NEWLINK, idev);
+		if (run_pending)
+			addrconf_dad_run(idev);
 
-			/*
-			 * If the changed mtu during down is lower than
-			 * IPV6_MIN_MTU stop IPv6 on this interface.
-			 */
-			if (dev->mtu < IPV6_MIN_MTU)
-				addrconf_ifdown(dev, 1);
+		/*
+		 * If the MTU changed during the interface down,
+		 * when the interface up, the changed MTU must be
+		 * reflected in the idev as well as routers.
+		 */
+		if (idev->cnf.mtu6 != dev->mtu &&
+		    dev->mtu >= IPV6_MIN_MTU) {
+			rt6_mtu_change(dev, dev->mtu);
+			idev->cnf.mtu6 = dev->mtu;
 		}
+		idev->tstamp = jiffies;
+		inet6_ifinfo_notify(RTM_NEWLINK, idev);
+
+		/*
+		 * If the changed mtu during down is lower than
+		 * IPV6_MIN_MTU stop IPv6 on this interface.
+		 */
+		if (dev->mtu < IPV6_MIN_MTU)
+			dev_disable_change(idev);
 		break;
 
 	case NETDEV_CHANGEMTU:
-		if (idev && dev->mtu >= IPV6_MIN_MTU) {
+		if (dev->mtu >= IPV6_MIN_MTU) {
 			rt6_mtu_change(dev, dev->mtu);
 			idev->cnf.mtu6 = dev->mtu;
 			break;
 		}
 
-		if (!idev && dev->mtu >= IPV6_MIN_MTU) {
-			idev = ipv6_add_dev(dev);
-			if (idev)
-				break;
-		}
-
 		/*
 		 * MTU falled under IPV6_MIN_MTU.
 		 * Stop IPv6 on this interface.
@@ -2616,7 +2601,7 @@ static int addrconf_notify(struct notifi
 		/*
 		 *	Remove all addresses from this interface.
 		 */
-		addrconf_ifdown(dev, event != NETDEV_DOWN);
+		addrconf_ifdown(dev, event == NETDEV_UNREGISTER);
 		break;
 
 	case NETDEV_CHANGENAME:
@@ -4137,6 +4122,18 @@ static void ipv6_ifa_notify(int event, s
 	rcu_read_unlock_bh();
 }
 
+static void dev_disable_change(struct inet6_dev *idev)
+{
+	if (!idev || !idev->dev)
+		return;
+
+	if (idev->cnf.disable_ipv6 || (list_empty(&idev->addr_list)) ||
+	    (idev->dev->mtu < IPV6_MIN_MTU))
+		addrconf_notify(NULL, NETDEV_DOWN, idev->dev);
+	else
+		addrconf_notify(NULL, NETDEV_UP, idev->dev);
+}
+
 #ifdef CONFIG_SYSCTL
 
 static
@@ -4157,17 +4154,6 @@ int addrconf_sysctl_forward(ctl_table *c
 	return ret;
 }
 
-static void dev_disable_change(struct inet6_dev *idev)
-{
-	if (!idev || !idev->dev)
-		return;
-
-	if (idev->cnf.disable_ipv6)
-		addrconf_notify(NULL, NETDEV_DOWN, idev->dev);
-	else
-		addrconf_notify(NULL, NETDEV_UP, idev->dev);
-}
-
 static void addrconf_disable_change(struct net *net, __s32 newf)
 {
 	struct net_device *dev;

^ permalink raw reply

* [PATCH] ipheth.c: Enable IP header alignment
From: L. Alberto Giménez @ 2011-05-01 11:00 UTC (permalink / raw)
  To: linux-kernel
  Cc: dgiagio, dborca, davem, pmcenery, david.hill,
	open list:USB SUBSYSTEM, open list:NETWORKING DRIVERS

From: David Hill <david.hill@ubisoft.com>

Since commit ea812ca1b06113597adcd8e70c0f84a413d97544, NET_IP_ALIGN changed from
2 to 0. Some people have reported that tethering stopped working and David Hill
submited a patch that seems to fix the problem.

I have no more an iPhone device to test it, so it is only compile-tested.

Signed-off-by: L. Alberto Giménez <agimenez@sysvalve.es>
---
 drivers/net/usb/ipheth.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
index 7d42f9a..711346b 100644
--- a/drivers/net/usb/ipheth.c
+++ b/drivers/net/usb/ipheth.c
@@ -54,6 +54,9 @@
 #include <linux/usb.h>
 #include <linux/workqueue.h>
 
+#undef  NET_IP_ALIGN
+#define NET_IP_ALIGN 2
+
 #define USB_VENDOR_APPLE        0x05ac
 #define USB_PRODUCT_IPHONE      0x1290
 #define USB_PRODUCT_IPHONE_3G   0x1292
-- 
1.7.5

^ permalink raw reply related

* [PATCH] sysctl: net: call unregister_net_sysctl_table where needed
From: Lucian Adrian Grijincu @ 2011-05-01 11:44 UTC (permalink / raw)
  To: netdev, davem; +Cc: Lucian Adrian Grijincu

ctl_table_headers registered with register_net_sysctl_table should
have been unregistered with the equivalent unregister_net_sysctl_table

Signed-off-by: Lucian Adrian Grijincu <lucian.grijincu@gmail.com>
---
 net/ipv4/devinet.c  |    2 +-
 net/ipv6/addrconf.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 5345b0b..cd9ca08 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1680,7 +1680,7 @@ static void __devinet_sysctl_unregister(struct ipv4_devconf *cnf)
 		return;
 
 	cnf->sysctl = NULL;
-	unregister_sysctl_table(t->sysctl_header);
+	unregister_net_sysctl_table(t->sysctl_header);
 	kfree(t->dev_name);
 	kfree(t);
 }
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 1493534..a7bda07 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -4537,7 +4537,7 @@ static void __addrconf_sysctl_unregister(struct ipv6_devconf *p)
 
 	t = p->sysctl;
 	p->sysctl = NULL;
-	unregister_sysctl_table(t->sysctl_header);
+	unregister_net_sysctl_table(t->sysctl_header);
 	kfree(t->dev_name);
 	kfree(t);
 }
-- 
1.7.5.134.g1c08b


^ permalink raw reply related

* Re: [PATCH] sysctl: net: call unregister_net_sysctl_table where needed
From: Lucian Adrian Grijincu @ 2011-05-01 11:48 UTC (permalink / raw)
  To: netdev, davem; +Cc: Lucian Adrian Grijincu
In-Reply-To: <1304250241-26138-1-git-send-email-lucian.grijincu@gmail.com>

On Sun, May 1, 2011 at 1:44 PM, Lucian Adrian Grijincu
<lucian.grijincu@gmail.com> wrote:
> ctl_table_headers registered with register_net_sysctl_table should
> have been unregistered with the equivalent unregister_net_sysctl_table
>
> Signed-off-by: Lucian Adrian Grijincu <lucian.grijincu@gmail.com>


David: I sent you this patch a while back but it was mixed with other
unrelated patches that were mostly ignored.

Again, to clarify: it does not matter at the moment if
register_net_sysctl_table or unregister_sysctl_table is called because
both to the same thing:


void unregister_net_sysctl_table(struct ctl_table_header *header)
{
        unregister_sysctl_table(header);
}
EXPORT_SYMBOL_GPL(unregister_net_sysctl_table);


We should either get rid of unregister_net_sysctl_table or use it consistently.

-- 
 .
..: Lucian

^ permalink raw reply

* [PATCH] ipv4: don't spam dmesg with "Using LC-trie" messages
From: Alexey Dobriyan @ 2011-05-01 12:04 UTC (permalink / raw)
  To: davem; +Cc: netdev

fib_trie_table() is called during netns creation and
Chromium uses clone(CLONE_NEWNET) to sandbox renderer process.

Don't print anything.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 net/ipv4/fib_trie.c |    3 ---
 1 file changed, 3 deletions(-)

--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1978,9 +1978,6 @@ struct fib_table *fib_trie_table(u32 id)
 	t = (struct trie *) tb->tb_data;
 	memset(t, 0, sizeof(*t));
 
-	if (id == RT_TABLE_LOCAL)
-		pr_info("IPv4 FIB: Using LC-trie version %s\n", VERSION);
-
 	return tb;
 }
 

^ permalink raw reply

* ask help for analysising oprofile result (higher mwait_idle_with_hints)
From: zhou rui @ 2011-05-01 14:08 UTC (permalink / raw)
  To: linux-kernel, linux-smp, netdev; +Cc: jon.zhou

hi

A network application (with its kernel network driver),
it uses 5-8% cpu(I have tested it on kernel 2.6.34, seen from 'top'),
but I got 40% cpu usage on kernel 2.6.36
so that I tried oprofile to see what happen:

opcontrol --vmlinux=/home/kho56208/linux-2.6.36.4/vmlinux
...


compared with profile result on kernel 2.6.34, the
"mwait_idle_with_hints" got a higher "CPU_CLK_UNHALTED " event sample,

what does it mean? any clue?

CPU: Intel Architectural Perfmon, speed 2666.01 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a
unit mask of 0x00 (No unit mask) count 100000
samples  %        symbol name
115595   17.5906  mwait_idle_with_hints
27098     4.1236  __alloc_skb
25992     3.9553  __slab_free
25707     3.9120  __netif_receive_skb
18784     2.8584  __kmalloc_node_track_caller
18223     2.7731  get_partial_node
17860     2.7178  add_partial
17662     2.6877  kfree
17655     2.6866  kmem_cache_alloc_node
...

(kernel 2.6.34):

CPU: Intel Architectural Perfmon, speed 1600 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a
unit mask of 0x00 (No unit mask) count 100000
samples  %        symbol name
389859    7.9392  mwait_idle_with_hints
306288    6.2374  kfree
273832    5.5764  kmem_cache_alloc_node
268486    5.4675  netif_receive_skb
219047    4.4607  __alloc_skb
192371    3.9175  kmem_cache_free
138046    2.8112  memcpy
133959    2.7280  dev_gro_receive



system wide profile (2.6.36)

"MY_APPLICATION" got 40%  cpu usage,why it is  only 0.8799% seen from oprofile?
(the machine has 12 cores, and the oprofile is to measure all cores

CPU: Intel Architectural Perfmon, speed 2666.01 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a
unit mask of 0x00 (No unit mask) count 100000
CPU_CLK_UNHALT...|
  samples|      %|
------------------
   656980 40.1202 vmlinux
   473114 28.8919 vmlinux
   298978 18.2579 MY_KERNEL_DRIVER
   165838 10.1273 ixgbe
    14408  0.8799 MY_APPLICATION
    10443  0.6377 libc-2.11.1.so
     8251  0.5039 processor
     4658  0.2845 oprofiled
     3103  0.1895 libpthread-2.11.1.so
     1209  0.0738 oprofile

^ permalink raw reply

* Re: [PATCH] ipheth.c: Enable IP header alignment
From: Ben Hutchings @ 2011-05-01 15:46 UTC (permalink / raw)
  To: L. Alberto Giménez
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dgiagio-Re5JQEeQqe8AvxtiuMwx3w, dborca-/E1597aS9LQAvxtiuMwx3w,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q, pmcenery-Re5JQEeQqe8AvxtiuMwx3w,
	david.hill-+VOaU5BgciZBDgjK7y7TUQ, open list:USB SUBSYSTEM,
	open list:NETWORKING DRIVERS
In-Reply-To: <1304247656-21086-1-git-send-email-agimenez-lqZFv/KUvpAxAGwisGp4zA@public.gmane.org>

On Sun, 2011-05-01 at 13:00 +0200, L. Alberto Giménez wrote:
> From: David Hill <david.hill-+VOaU5BgciZBDgjK7y7TUQ@public.gmane.org>
> 
> Since commit ea812ca1b06113597adcd8e70c0f84a413d97544, NET_IP_ALIGN changed from
> 2 to 0. Some people have reported that tethering stopped working and David Hill
> submited a patch that seems to fix the problem.
> 
> I have no more an iPhone device to test it, so it is only compile-tested.
> 
> Signed-off-by: L. Alberto Giménez <agimenez-lqZFv/KUvpAxAGwisGp4zA@public.gmane.org>
> ---
>  drivers/net/usb/ipheth.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
> index 7d42f9a..711346b 100644
> --- a/drivers/net/usb/ipheth.c
> +++ b/drivers/net/usb/ipheth.c
> @@ -54,6 +54,9 @@
>  #include <linux/usb.h>
>  #include <linux/workqueue.h>
>  
> +#undef  NET_IP_ALIGN
> +#define NET_IP_ALIGN 2
> +
>  #define USB_VENDOR_APPLE        0x05ac
>  #define USB_PRODUCT_IPHONE      0x1290
>  #define USB_PRODUCT_IPHONE_3G   0x1292

No, you can't do this.

If there is some reason to use a fixed alignment of 2 (which I find hard
to believe; this is a USB device after all) then that should be
specified as a private constant.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Hello My Dear, My name is Grace Adam,i read through your profile today and i became interested in you,i will also like to know you the more,and i want you to send an e-mail to my e-mail address so i can give you my picture for you to know whom i am and for the both of us to know each other very well and better in life,and we can achieve it in future because ture love and feeling means alot in future.Here is my private e-mail address you can contact me with it.(graceadam11@gmail.com)I am waiting for your mail to my e-mail address above and aslo, Remember the distance or colour does not matter but love,feeling,e-motions and sympathetic love matters alot in life. Thanks,and i promise to be honest and to keep a very good relationship with you. Grace.              graceadam11@gmail.com
From: graceadam @ 2011-05-01 16:28 UTC (permalink / raw)





^ permalink raw reply

* [v2 PATCH 0/6] IPVS: init and cleanup.
From: Hans Schillstrom @ 2011-05-01 16:50 UTC (permalink / raw)
  To: ja, horms, ebiederm, lvs-devel, netdev, netfilter-devel
  Cc: hans.schillstrom, Hans Schillstrom

This patch series handles exit from a network name space.

REVISION

This is version 4

OVERVIEW
Basically there was three faults in the netns implementation.
- Kernel threads hold devices and preventing an exit.
- dst cache holds references to devices.
- Services was not always released.

Patch 1 & 3 contains the functionality
      4 renames funcctions
      5 removes empty functions
      6 Debuging.

IMPLEMENTATION
- Avoid to increment the usage counter for kernel threads.
  this is done in the first patch.
- Patch 3 tries to restore the cleanup order.
  Add NETDEV_UNREGISTER notification for dst_reset
  (eleased version could not handle unregistration of netdevices.)

Comments from Eric, Julian and Simon implmented.

Revision 3 
Residies in patch 3
        Throttle renamed to enable.
        Comments from Julian implemented
        Check enable in ip_vs_in, ip_vs_out and ip_vs_forward_icmp*
        Remove in ip_vs_in_icmp*.
        ip_vs_svc_reset() moved into ip_vs_dst_event().
        ip_vs_service_cleanup() uses ip_vs_flush and mutex lock.
        ip_vs_unlink_service_nolock() added.
 
Revision 4
	ip_vs_unlink_service_nolock() removed.
	ip_vs_flush() reverted.
	Return code check changed in stop thread.

An netns exit could look like this:
IPVS: Enter: __ip_vs_dev_cleanup, net/netfilter/ipvs/ip_vs_core.c line 1966
IPVS: stopping master sync thread 1845 ...
IPVS: stopping backup sync thread 1850 ...
IPVS: Leave: __ip_vs_dev_cleanup, net/netfilter/ipvs/ip_vs_core.c line 1969
IPVS: ip_vs_dst_event() dev=ip6tnl0
IPVS: Enter: ip_vs_dst_event, net/netfilter/ipvs/ip_vs_ctl.c line 1540
IPVS: Leave: ip_vs_dst_event, net/netfilter/ipvs/ip_vs_ctl.c line 1567
IPVS: ip_vs_dst_event() dev=sit0
IPVS: Enter: ip_vs_dst_event, net/netfilter/ipvs/ip_vs_ctl.c line 1540
IPVS: Leave: ip_vs_dst_event, net/netfilter/ipvs/ip_vs_ctl.c line 1567
IPVS: ip_vs_dst_event() dev=tunl0
IPVS: Enter: ip_vs_dst_event, net/netfilter/ipvs/ip_vs_ctl.c line 1540
IPVS: Leave: ip_vs_dst_event, net/netfilter/ipvs/ip_vs_ctl.c line 1567
IPVS: ip_vs_dst_event() dev=eth1
IPVS: Enter: ip_vs_dst_event, net/netfilter/ipvs/ip_vs_ctl.c line 1540
IPVS: Leave: ip_vs_dst_event, net/netfilter/ipvs/ip_vs_ctl.c line 1567
IPVS: ip_vs_dst_event() dev=eth0
IPVS: Enter: ip_vs_dst_event, net/netfilter/ipvs/ip_vs_ctl.c line 1540
IPVS: Reset dev:eth0 dest 192.168.1.6:0 ,dest->refcnt=2380471
IPVS: Reset dev:eth0 dest 192.168.1.4:0 ,dest->refcnt=2380471
IPVS: Reset dev:eth0 dest 192.168.1.3:0 ,dest->refcnt=2380471
IPVS: Leave: ip_vs_dst_event, net/netfilter/ipvs/ip_vs_ctl.c line 1567
IPVS: ip_vs_dst_event() dev=lo
IPVS: Enter: ip_vs_dst_event, net/netfilter/ipvs/ip_vs_ctl.c line 1540
IPVS: Leave: ip_vs_dst_event, net/netfilter/ipvs/ip_vs_ctl.c line 1567
IPVS: Enter: ip_vs_service_net_cleanup, net/netfilter/ipvs/ip_vs_ctl.c line 1498
IPVS: __ip_vs_del_service: enter
IPVS: Removing destination 0/[2003:0000:0000:0000:0000:0002:0000:0006]:80
IPVS: Removing destination 0/[2003:0000:0000:0000:0000:0002:0000:0004]:80
IPVS: Removing destination 0/[2003:0000:0000:0000:0000:0002:0000:0003]:80
IPVS: Removing service 0/[2003:0000:0000:0000:0000:0002:0001:0100]:80 usecnt=0
IPVS: __ip_vs_del_service: enter
IPVS: Moving dest 192.168.1.6:0 into trash, dest->refcnt=2380470
IPVS: Moving dest 192.168.1.4:0 into trash, dest->refcnt=2380470
IPVS: Moving dest 192.168.1.3:0 into trash, dest->refcnt=2380470
IPVS: Leave: ip_vs_service_net_cleanup, net/netfilter/ipvs/ip_vs_ctl.c line 1503
IPVS: Enter: ip_vs_control_net_cleanup, net/netfilter/ipvs/ip_vs_ctl.c line 3734
IPVS: Removing service 80/0.0.0.0:0 usecnt=0
IPVS: Leave: ip_vs_control_net_cleanup, net/netfilter/ipvs/ip_vs_ctl.c line 3742
IPVS: ipvs netns 13 released


PATCH SET
This patch set is based upon net-next-2.6 (2.6.39-rc2)


SUMMARY

 include/net/ip_vs.h              |   23 ++++--
 net/netfilter/ipvs/ip_vs_app.c   |   23 +-----
 net/netfilter/ipvs/ip_vs_conn.c  |   14 +---
 net/netfilter/ipvs/ip_vs_core.c  |  132 +++++++++++++++++++++++---------
 net/netfilter/ipvs/ip_vs_ctl.c   |  158 ++++++++++++++++++++++++++++++--------
 net/netfilter/ipvs/ip_vs_est.c   |   21 +-----
 net/netfilter/ipvs/ip_vs_proto.c |   11 +--
 net/netfilter/ipvs/ip_vs_sync.c  |   70 +++++++++---------
 8 files changed, 285 insertions(+), 167 deletions(-)


^ permalink raw reply

* [v4 PATCH 1/6] IPVS: Change of socket usage to enable name space exit.
From: Hans Schillstrom @ 2011-05-01 16:50 UTC (permalink / raw)
  To: ja, horms, ebiederm, lvs-devel, netdev, netfilter-devel
  Cc: hans.schillstrom, Hans Schillstrom
In-Reply-To: <1304268618-18103-1-git-send-email-hans@schillstrom.com>

To work this patch also needs the other patches in this series.

VERSION: 4

DESCRIPTION

If the sync daemons run in a name space while it crashes
or get killed, there is no way to stop them except for a reboot.
When all patches are there, ip_vs_core will handle register_pernet_(),
i.e. ip_vs_sync_init() and ip_vs_sync_cleanup() will be removed.

Kernel threads should not increment the use count of a socket.
By calling sk_change_net() after creating a socket this is avoided.
sock_release cant be used intead sk_release_kernel() should be used.

Thanks Eric W Biederman for your advices.

This patch is based on net-next-2.6  ver 2.6.39-rc2

CHANGES
 Rev 2
   sock_create_kern() used instead of __sock_create()
   return codes of kthread_stop() used.
 Rev 3
   -
 Rev 4
   Check of return code changed to -ESRCH in __ip_vs_sync_cleanup()

Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
Signed-off-by: Hans Schillstrom <hans@schillstrom.com>
---
 net/netfilter/ipvs/ip_vs_core.c |    2 +-
 net/netfilter/ipvs/ip_vs_sync.c |   58 +++++++++++++++++++++++++--------------
 2 files changed, 38 insertions(+), 22 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index 07accf6..a0791dc 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1896,7 +1896,7 @@ static int __net_init __ip_vs_init(struct net *net)
 
 static void __net_exit __ip_vs_cleanup(struct net *net)
 {
-	IP_VS_DBG(10, "ipvs netns %d released\n", net_ipvs(net)->gen);
+	IP_VS_DBG(2, "ipvs netns %d released\n", net_ipvs(net)->gen);
 }
 
 static struct pernet_operations ipvs_core_ops = {
diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index 3e7961e..0cce953 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -1303,13 +1303,18 @@ static struct socket *make_send_sock(struct net *net)
 	struct socket *sock;
 	int result;
 
-	/* First create a socket */
-	result = __sock_create(net, PF_INET, SOCK_DGRAM, IPPROTO_UDP, &sock, 1);
+	/* First create a socket move it to right name space later */
+	result = sock_create_kern(PF_INET, SOCK_DGRAM, IPPROTO_UDP, &sock);
 	if (result < 0) {
 		pr_err("Error during creation of socket; terminating\n");
 		return ERR_PTR(result);
 	}
-
+	/*
+	 * Kernel sockets that are a part of a namespace, should not
+	 * hold a reference to a namespace in order to allow to stop it.
+	 * After sk_change_net should be released using sk_release_kernel.
+	 */
+	sk_change_net(sock->sk, net);
 	result = set_mcast_if(sock->sk, ipvs->master_mcast_ifn);
 	if (result < 0) {
 		pr_err("Error setting outbound mcast interface\n");
@@ -1334,8 +1339,8 @@ static struct socket *make_send_sock(struct net *net)
 
 	return sock;
 
-  error:
-	sock_release(sock);
+error:
+	sk_release_kernel(sock->sk);
 	return ERR_PTR(result);
 }
 
@@ -1350,12 +1355,17 @@ static struct socket *make_receive_sock(struct net *net)
 	int result;
 
 	/* First create a socket */
-	result = __sock_create(net, PF_INET, SOCK_DGRAM, IPPROTO_UDP, &sock, 1);
+	result = sock_create_kern(PF_INET, SOCK_DGRAM, IPPROTO_UDP, &sock);
 	if (result < 0) {
 		pr_err("Error during creation of socket; terminating\n");
 		return ERR_PTR(result);
 	}
-
+	/*
+	 * Kernel sockets that are a part of a namespace, should not
+	 * hold a reference to a namespace in order to allow to stop it.
+	 * After sk_change_net should be released using sk_release_kernel.
+	 */
+	sk_change_net(sock->sk, net);
 	/* it is equivalent to the REUSEADDR option in user-space */
 	sock->sk->sk_reuse = 1;
 
@@ -1377,8 +1387,8 @@ static struct socket *make_receive_sock(struct net *net)
 
 	return sock;
 
-  error:
-	sock_release(sock);
+error:
+	sk_release_kernel(sock->sk);
 	return ERR_PTR(result);
 }
 
@@ -1473,7 +1483,7 @@ static int sync_thread_master(void *data)
 		ip_vs_sync_buff_release(sb);
 
 	/* release the sending multicast socket */
-	sock_release(tinfo->sock);
+	sk_release_kernel(tinfo->sock->sk);
 	kfree(tinfo);
 
 	return 0;
@@ -1513,7 +1523,7 @@ static int sync_thread_backup(void *data)
 	}
 
 	/* release the sending multicast socket */
-	sock_release(tinfo->sock);
+	sk_release_kernel(tinfo->sock->sk);
 	kfree(tinfo->buf);
 	kfree(tinfo);
 
@@ -1601,7 +1611,7 @@ outtinfo:
 outbuf:
 	kfree(buf);
 outsocket:
-	sock_release(sock);
+	sk_release_kernel(sock->sk);
 out:
 	return result;
 }
@@ -1610,6 +1620,7 @@ out:
 int stop_sync_thread(struct net *net, int state)
 {
 	struct netns_ipvs *ipvs = net_ipvs(net);
+	int retc = -EINVAL;
 
 	IP_VS_DBG(7, "%s(): pid %d\n", __func__, task_pid_nr(current));
 
@@ -1629,7 +1640,7 @@ int stop_sync_thread(struct net *net, int state)
 		spin_lock_bh(&ipvs->sync_lock);
 		ipvs->sync_state &= ~IP_VS_STATE_MASTER;
 		spin_unlock_bh(&ipvs->sync_lock);
-		kthread_stop(ipvs->master_thread);
+		retc = kthread_stop(ipvs->master_thread);
 		ipvs->master_thread = NULL;
 	} else if (state == IP_VS_STATE_BACKUP) {
 		if (!ipvs->backup_thread)
@@ -1639,16 +1650,14 @@ int stop_sync_thread(struct net *net, int state)
 			task_pid_nr(ipvs->backup_thread));
 
 		ipvs->sync_state &= ~IP_VS_STATE_BACKUP;
-		kthread_stop(ipvs->backup_thread);
+		retc = kthread_stop(ipvs->backup_thread);
 		ipvs->backup_thread = NULL;
-	} else {
-		return -EINVAL;
 	}
 
 	/* decrease the module use count */
 	ip_vs_use_count_dec();
 
-	return 0;
+	return retc;
 }
 
 /*
@@ -1670,8 +1679,15 @@ static int __net_init __ip_vs_sync_init(struct net *net)
 
 static void __ip_vs_sync_cleanup(struct net *net)
 {
-	stop_sync_thread(net, IP_VS_STATE_MASTER);
-	stop_sync_thread(net, IP_VS_STATE_BACKUP);
+	int retc;
+
+	retc = stop_sync_thread(net, IP_VS_STATE_MASTER);
+	if (retc && retc != -ESRCH)
+		pr_err("Failed to stop Master Daemon\n");
+
+	retc = stop_sync_thread(net, IP_VS_STATE_BACKUP);
+	if (retc && retc != -ESRCH)
+		pr_err("Failed to stop Backup Daemon\n");
 }
 
 static struct pernet_operations ipvs_sync_ops = {
@@ -1682,10 +1698,10 @@ static struct pernet_operations ipvs_sync_ops = {
 
 int __init ip_vs_sync_init(void)
 {
-	return register_pernet_subsys(&ipvs_sync_ops);
+	return register_pernet_device(&ipvs_sync_ops);
 }
 
 void ip_vs_sync_cleanup(void)
 {
-	unregister_pernet_subsys(&ipvs_sync_ops);
+	unregister_pernet_device(&ipvs_sync_ops);
 }
-- 
1.7.2.3


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox