* [PATCH net-next-2.6] veth: remove unneeded ifname code from veth_newlink()
@ 2011-01-24 15:45 Jiri Pirko
2011-01-25 7:18 ` David Miller
2011-04-22 9:43 ` Michał Mirosław
0 siblings, 2 replies; 11+ messages in thread
From: Jiri Pirko @ 2011-01-24 15:45 UTC (permalink / raw)
To: netdev; +Cc: davem, xemul
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>
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index cc83fa7..105d7f0 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -403,17 +403,6 @@ 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;
@@ -433,7 +422,6 @@ 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;
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH net-next-2.6] veth: remove unneeded ifname code from veth_newlink()
2011-01-24 15:45 [PATCH net-next-2.6] veth: remove unneeded ifname code from veth_newlink() Jiri Pirko
@ 2011-01-25 7:18 ` David Miller
2011-04-22 9:43 ` Michał Mirosław
1 sibling, 0 replies; 11+ messages in thread
From: David Miller @ 2011-01-25 7:18 UTC (permalink / raw)
To: jpirko; +Cc: netdev, xemul
From: Jiri Pirko <jpirko@redhat.com>
Date: Mon, 24 Jan 2011 16:45:46 +0100
> 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>
Applied, thanks Jiri.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next-2.6] veth: remove unneeded ifname code from veth_newlink()
2011-01-24 15:45 [PATCH net-next-2.6] veth: remove unneeded ifname code from veth_newlink() Jiri Pirko
2011-01-25 7:18 ` David Miller
@ 2011-04-22 9:43 ` Michał Mirosław
2011-04-22 9:44 ` Michał Mirosław
` (3 more replies)
1 sibling, 4 replies; 11+ messages in thread
From: Michał Mirosław @ 2011-04-22 9:43 UTC (permalink / raw)
To: Jiri Pirko; +Cc: netdev, davem, xemul
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.
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
Best Regards,
Michał Mirosław
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next-2.6] veth: remove unneeded ifname code from veth_newlink()
2011-04-22 9:43 ` Michał Mirosław
@ 2011-04-22 9:44 ` Michał Mirosław
2011-04-22 9:49 ` Michał Mirosław
` (2 subsequent siblings)
3 siblings, 0 replies; 11+ messages in thread
From: Michał Mirosław @ 2011-04-22 9:44 UTC (permalink / raw)
To: Jiri Pirko; +Cc: netdev, davem, xemul
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.
This is commit 84c49d8c3e4abefb0a41a77b25aa37ebe8d6b743.
Best Regards,
Michał Mirosław
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next-2.6] veth: remove unneeded ifname code from veth_newlink()
2011-04-22 9:43 ` Michał Mirosław
2011-04-22 9:44 ` Michał Mirosław
@ 2011-04-22 9:49 ` Michał Mirosław
2011-04-28 20:27 ` David Miller
2011-04-30 10:16 ` Jiri Pirko
2011-04-30 9:02 ` Jiri Pirko
2011-04-30 11:28 ` Jiri Pirko
3 siblings, 2 replies; 11+ messages in thread
From: Michał Mirosław @ 2011-04-22 9:49 UTC (permalink / raw)
To: Jiri Pirko; +Cc: netdev, davem, xemul
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.
Best Regards,
Michał Mirosław
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next-2.6] veth: remove unneeded ifname code from veth_newlink()
2011-04-22 9:49 ` Michał Mirosław
@ 2011-04-28 20:27 ` David Miller
2011-04-29 13:51 ` Jiri Pirko
2011-04-30 10:16 ` Jiri Pirko
1 sibling, 1 reply; 11+ messages in thread
From: David Miller @ 2011-04-28 20:27 UTC (permalink / raw)
To: mirqus; +Cc: jpirko, netdev, xemul
From: Michał Mirosław <mirqus@gmail.com>
Date: Fri, 22 Apr 2011 11:49:40 +0200
> 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.
Jiri please look into this regression.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next-2.6] veth: remove unneeded ifname code from veth_newlink()
2011-04-28 20:27 ` David Miller
@ 2011-04-29 13:51 ` Jiri Pirko
0 siblings, 0 replies; 11+ messages in thread
From: Jiri Pirko @ 2011-04-29 13:51 UTC (permalink / raw)
To: David Miller; +Cc: mirqus, netdev, xemul
Thu, Apr 28, 2011 at 10:27:24PM CEST, davem@davemloft.net wrote:
>From: Michał Mirosław <mirqus@gmail.com>
>Date: Fri, 22 Apr 2011 11:49:40 +0200
>
>> 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.
>
>Jiri please look into this regression.
Working on this. Will post patch soon.
Jirka
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next-2.6] veth: remove unneeded ifname code from veth_newlink()
2011-04-22 9:43 ` Michał Mirosław
2011-04-22 9:44 ` Michał Mirosław
2011-04-22 9:49 ` Michał Mirosław
@ 2011-04-30 9:02 ` Jiri Pirko
2011-04-30 11:28 ` Jiri Pirko
3 siblings, 0 replies; 11+ messages in thread
From: Jiri Pirko @ 2011-04-30 9:02 UTC (permalink / raw)
To: Michał Mirosław; +Cc: netdev, davem, xemul
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.
>
>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
interesting, on net-next I get following with or without this patch
applied:
[root@f14 ~]# ip link add type veth peer veth1
Error: either "dev" is duplicate, or "veth1" is a garbage.
Trying original F14 ip and currect git one gives the same
>
>Best Regards,
>Michał Mirosław
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next-2.6] veth: remove unneeded ifname code from veth_newlink()
2011-04-22 9:49 ` Michał Mirosław
2011-04-28 20:27 ` David Miller
@ 2011-04-30 10:16 ` Jiri Pirko
1 sibling, 0 replies; 11+ messages in thread
From: Jiri Pirko @ 2011-04-30 10:16 UTC (permalink / raw)
To: Michał Mirosław; +Cc: netdev, davem, xemul
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 [flat|nested] 11+ messages in thread
* Re: [PATCH net-next-2.6] veth: remove unneeded ifname code from veth_newlink()
2011-04-22 9:43 ` Michał Mirosław
` (2 preceding siblings ...)
2011-04-30 9:02 ` Jiri Pirko
@ 2011-04-30 11:28 ` Jiri Pirko
2011-05-02 22:55 ` David Miller
3 siblings, 1 reply; 11+ messages in thread
From: Jiri Pirko @ 2011-04-30 11:28 UTC (permalink / raw)
To: Michał Mirosław; +Cc: netdev, davem, xemul
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 [flat|nested] 11+ messages in thread
* Re: [PATCH net-next-2.6] veth: remove unneeded ifname code from veth_newlink()
2011-04-30 11:28 ` Jiri Pirko
@ 2011-05-02 22:55 ` David Miller
0 siblings, 0 replies; 11+ messages in thread
From: David Miller @ 2011-05-02 22:55 UTC (permalink / raw)
To: jpirko; +Cc: mirqus, netdev, xemul
From: Jiri Pirko <jpirko@redhat.com>
Date: Sat, 30 Apr 2011 13:28:17 +0200
> 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>
Applied, with "Reported-by: " added to give credit to Michał Mirosław.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2011-05-02 22:55 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-24 15:45 [PATCH net-next-2.6] veth: remove unneeded ifname code from veth_newlink() Jiri Pirko
2011-01-25 7:18 ` David Miller
2011-04-22 9:43 ` Michał Mirosław
2011-04-22 9:44 ` Michał Mirosław
2011-04-22 9:49 ` Michał Mirosław
2011-04-28 20:27 ` David Miller
2011-04-29 13:51 ` Jiri Pirko
2011-04-30 10:16 ` Jiri Pirko
2011-04-30 9:02 ` Jiri Pirko
2011-04-30 11:28 ` Jiri Pirko
2011-05-02 22:55 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.