* Re: cannot set IP for ethernet
[not found] <200706121441.13561.oliver@neukum.org>
@ 2007-06-12 14:06 ` Patrick McHardy
2007-06-13 8:39 ` Oliver Neukum
2007-06-14 3:53 ` Herbert Xu
0 siblings, 2 replies; 8+ messages in thread
From: Patrick McHardy @ 2007-06-12 14:06 UTC (permalink / raw)
To: Oliver Neukum; +Cc: linux-kernel, Linux Netdev List, Herbert Xu
[-- Attachment #1: Type: text/plain, Size: 726 bytes --]
Oliver Neukum wrote:
> with 2.6.22-rc4-git2 I am getting errors when setting IP for ethernet
> interfaces:
>
> ioctl(4, SIOCSIFADDR, 0x7fff94931600) = -1 ENOBUFS (No buffer space available)
>
> The error is independant of the interface. It happens to all interfaces.
> There's nothing in the syslog.
>
> valisk:/home/oliver # uname -a
> Linux valisk 2.6.22-rc4-git2-default #3 SMP Tue Jun 12 13:27:54 CEST 2007 x86_64 x86_64 x86_64 GNU/Linux
This can happen if the initial inetdev allocation when the netdevice is
registered fails. I think it would make sense to try to allocate again
when adding addresses in that case, otherwise there is no way of
recovery other than unregistering and registering the device again.
[-- Attachment #2: x --]
[-- Type: text/plain, Size: 776 bytes --]
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index abf6352..dc77e91 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -401,8 +401,11 @@ static int inet_set_ifa(struct net_device *dev, struct in_ifaddr *ifa)
ASSERT_RTNL();
if (!in_dev) {
- inet_free_ifa(ifa);
- return -ENOBUFS;
+ in_dev = inetdev_init(dev);
+ if (!in_dev) {
+ inet_free_ifa(ifa);
+ return -ENOBUFS;
+ }
}
ipv4_devconf_setall(in_dev);
if (ifa->ifa_dev != in_dev) {
@@ -514,8 +517,11 @@ static struct in_ifaddr *rtm_to_ifaddr(struct nlmsghdr *nlh)
in_dev = __in_dev_get_rtnl(dev);
if (in_dev == NULL) {
- err = -ENOBUFS;
- goto errout;
+ in_dev = inetdev_init(dev);
+ if (!in_dev) {
+ err = -ENOBUFS;
+ goto errout;
+ }
}
ipv4_devconf_setall(in_dev);
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: cannot set IP for ethernet
2007-06-12 14:06 ` cannot set IP for ethernet Patrick McHardy
@ 2007-06-13 8:39 ` Oliver Neukum
2007-06-13 11:14 ` Patrick McHardy
2007-06-14 3:53 ` Herbert Xu
1 sibling, 1 reply; 8+ messages in thread
From: Oliver Neukum @ 2007-06-13 8:39 UTC (permalink / raw)
To: Patrick McHardy; +Cc: linux-kernel, Linux Netdev List, Herbert Xu
Am Dienstag, 12. Juni 2007 schrieb Patrick McHardy:
> Oliver Neukum wrote:
> > with 2.6.22-rc4-git2 I am getting errors when setting IP for ethernet
> > interfaces:
> >
> > ioctl(4, SIOCSIFADDR, 0x7fff94931600) = -1 ENOBUFS (No buffer space available)
> >
> > The error is independant of the interface. It happens to all interfaces.
> > There's nothing in the syslog.
> >
> > valisk:/home/oliver # uname -a
> > Linux valisk 2.6.22-rc4-git2-default #3 SMP Tue Jun 12 13:27:54 CEST 2007 x86_64 x86_64 x86_64 GNU/Linux
>
>
> This can happen if the initial inetdev allocation when the netdevice is
> registered fails. I think it would make sense to try to allocate again
> when adding addresses in that case, otherwise there is no way of
> recovery other than unregistering and registering the device again.
With your patch the problem has gone away. Is there a way to especially
stress the system in that regard?
Regards
Oliver
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: cannot set IP for ethernet
2007-06-13 8:39 ` Oliver Neukum
@ 2007-06-13 11:14 ` Patrick McHardy
2007-06-13 11:21 ` Oliver Neukum
0 siblings, 1 reply; 8+ messages in thread
From: Patrick McHardy @ 2007-06-13 11:14 UTC (permalink / raw)
To: Oliver Neukum; +Cc: linux-kernel, Linux Netdev List, Herbert Xu
Oliver Neukum wrote:
> Am Dienstag, 12. Juni 2007 schrieb Patrick McHardy:
>
>>Oliver Neukum wrote:
>>
>>>with 2.6.22-rc4-git2 I am getting errors when setting IP for ethernet
>>>interfaces:
>>>
>>>ioctl(4, SIOCSIFADDR, 0x7fff94931600) = -1 ENOBUFS (No buffer space available)
>>>
>>>The error is independant of the interface. It happens to all interfaces.
>>>There's nothing in the syslog.
>>>
>>>valisk:/home/oliver # uname -a
>>>Linux valisk 2.6.22-rc4-git2-default #3 SMP Tue Jun 12 13:27:54 CEST 2007 x86_64 x86_64 x86_64 GNU/Linux
>>
>>
>>This can happen if the initial inetdev allocation when the netdevice is
>>registered fails. I think it would make sense to try to allocate again
>>when adding addresses in that case, otherwise there is no way of
>>recovery other than unregistering and registering the device again.
>
>
> With your patch the problem has gone away. Is there a way to especially
> stress the system in that regard?
Its a failed allocation at NETDEV_REGISTER time. I guess you could
keep unloading + reloading the driver module to try to reproduce it.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: cannot set IP for ethernet
2007-06-13 11:14 ` Patrick McHardy
@ 2007-06-13 11:21 ` Oliver Neukum
2007-06-13 11:25 ` Patrick McHardy
0 siblings, 1 reply; 8+ messages in thread
From: Oliver Neukum @ 2007-06-13 11:21 UTC (permalink / raw)
To: Patrick McHardy; +Cc: linux-kernel, Linux Netdev List, Herbert Xu
Am Mittwoch, 13. Juni 2007 schrieb Patrick McHardy:
> Oliver Neukum wrote:
> > Am Dienstag, 12. Juni 2007 schrieb Patrick McHardy:
> >
> >>Oliver Neukum wrote:
> >>
> >>>with 2.6.22-rc4-git2 I am getting errors when setting IP for ethernet
> >>>interfaces:
> >>>
> >>>ioctl(4, SIOCSIFADDR, 0x7fff94931600) = -1 ENOBUFS (No buffer space available)
> >>>
> >>>The error is independant of the interface. It happens to all interfaces.
> >>>There's nothing in the syslog.
> >>>
> >>>valisk:/home/oliver # uname -a
> >>>Linux valisk 2.6.22-rc4-git2-default #3 SMP Tue Jun 12 13:27:54 CEST 2007 x86_64 x86_64 x86_64 GNU/Linux
> >>
> >>
> >>This can happen if the initial inetdev allocation when the netdevice is
> >>registered fails. I think it would make sense to try to allocate again
> >>when adding addresses in that case, otherwise there is no way of
> >>recovery other than unregistering and registering the device again.
> >
> >
> > With your patch the problem has gone away. Is there a way to especially
> > stress the system in that regard?
>
>
> Its a failed allocation at NETDEV_REGISTER time. I guess you could
> keep unloading + reloading the driver module to try to reproduce it.
If that is the cause, why doesn't it strike from the very beginning? How
come it fails after some time?
Regards
Oliver
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: cannot set IP for ethernet
2007-06-13 11:21 ` Oliver Neukum
@ 2007-06-13 11:25 ` Patrick McHardy
2007-06-13 11:55 ` Oliver Neukum
0 siblings, 1 reply; 8+ messages in thread
From: Patrick McHardy @ 2007-06-13 11:25 UTC (permalink / raw)
To: Oliver Neukum; +Cc: linux-kernel, Linux Netdev List, Herbert Xu
Oliver Neukum wrote:
> Am Mittwoch, 13. Juni 2007 schrieb Patrick McHardy:
>>>>
>>>>This can happen if the initial inetdev allocation when the netdevice is
>>>>registered fails. I think it would make sense to try to allocate again
>>>>when adding addresses in that case, otherwise there is no way of
>>>>recovery other than unregistering and registering the device again.
>>>
>>>
>>>With your patch the problem has gone away. Is there a way to especially
>>>stress the system in that regard?
>>
>>
>>Its a failed allocation at NETDEV_REGISTER time. I guess you could
>>keep unloading + reloading the driver module to try to reproduce it.
>
>
> If that is the cause, why doesn't it strike from the very beginning? How
> come it fails after some time?
It might also be a failed in_ifaddr allocation. In that case my patch
shouldn't help though.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: cannot set IP for ethernet
2007-06-13 11:25 ` Patrick McHardy
@ 2007-06-13 11:55 ` Oliver Neukum
0 siblings, 0 replies; 8+ messages in thread
From: Oliver Neukum @ 2007-06-13 11:55 UTC (permalink / raw)
To: Patrick McHardy; +Cc: linux-kernel, Linux Netdev List, Herbert Xu
Am Mittwoch, 13. Juni 2007 schrieb Patrick McHardy:
> Oliver Neukum wrote:
> > Am Mittwoch, 13. Juni 2007 schrieb Patrick McHardy:
> >>>>
> >>>>This can happen if the initial inetdev allocation when the netdevice is
> >>>>registered fails. I think it would make sense to try to allocate again
> >>>>when adding addresses in that case, otherwise there is no way of
> >>>>recovery other than unregistering and registering the device again.
> >>>
> >>>
> >>>With your patch the problem has gone away. Is there a way to especially
> >>>stress the system in that regard?
> >>
> >>
> >>Its a failed allocation at NETDEV_REGISTER time. I guess you could
> >>keep unloading + reloading the driver module to try to reproduce it.
> >
> >
> > If that is the cause, why doesn't it strike from the very beginning? How
> > come it fails after some time?
>
>
> It might also be a failed in_ifaddr allocation. In that case my patch
> shouldn't help though.
The problem is that I don't know how to provoke the failure. I might
be doing another workload today than yesterday. Perhaps I should
do several compilations like yesterday?
Regards
Oliver
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: cannot set IP for ethernet
2007-06-12 14:06 ` cannot set IP for ethernet Patrick McHardy
2007-06-13 8:39 ` Oliver Neukum
@ 2007-06-14 3:53 ` Herbert Xu
2007-06-14 3:56 ` David Miller
1 sibling, 1 reply; 8+ messages in thread
From: Herbert Xu @ 2007-06-14 3:53 UTC (permalink / raw)
To: Patrick McHardy; +Cc: Oliver Neukum, linux-kernel, Linux Netdev List
On Tue, Jun 12, 2007 at 04:06:25PM +0200, Patrick McHardy wrote:
> Oliver Neukum wrote:
> > with 2.6.22-rc4-git2 I am getting errors when setting IP for ethernet
> > interfaces:
> >
> > ioctl(4, SIOCSIFADDR, 0x7fff94931600) = -1 ENOBUFS (No buffer space available)
> >
> > The error is independant of the interface. It happens to all interfaces.
> > There's nothing in the syslog.
> >
> > valisk:/home/oliver # uname -a
> > Linux valisk 2.6.22-rc4-git2-default #3 SMP Tue Jun 12 13:27:54 CEST 2007 x86_64 x86_64 x86_64 GNU/Linux
>
> This can happen if the initial inetdev allocation when the netdevice is
> registered fails. I think it would make sense to try to allocate again
> when adding addresses in that case, otherwise there is no way of
> recovery other than unregistering and registering the device again.
Actually in his case it's because 2.6.22-rc4-git2 doesn't have the
following changeset.
Let me have a think about your approach too.
Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
commit 6363097cc4d182f93788131b5d8f72aa91d950a0
Author: Herbert Xu <herbert@gondor.apana.org.au>
Date: Thu Jun 7 18:35:38 2007 -0700
[IPV4]: Do not remove idev when addresses are cleared
Now that we create idev before addresses are added, it no longer makes
sense to remove them when addresses are all deleted.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
6363097cc4d182f93788131b5d8f72aa91d950a0
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index fa97b96..abf6352 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -327,12 +327,8 @@ static void __inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
}
}
- if (destroy) {
+ if (destroy)
inet_free_ifa(ifa1);
-
- if (!in_dev->ifa_list)
- inetdev_destroy(in_dev);
- }
}
static void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: cannot set IP for ethernet
2007-06-14 3:53 ` Herbert Xu
@ 2007-06-14 3:56 ` David Miller
0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2007-06-14 3:56 UTC (permalink / raw)
To: herbert; +Cc: kaber, oliver, linux-kernel, netdev
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Thu, 14 Jun 2007 13:53:41 +1000
> Actually in his case it's because 2.6.22-rc4-git2 doesn't have the
> following changeset.
It's on the way, it just hasn't been picked up yet.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-06-14 3:56 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200706121441.13561.oliver@neukum.org>
2007-06-12 14:06 ` cannot set IP for ethernet Patrick McHardy
2007-06-13 8:39 ` Oliver Neukum
2007-06-13 11:14 ` Patrick McHardy
2007-06-13 11:21 ` Oliver Neukum
2007-06-13 11:25 ` Patrick McHardy
2007-06-13 11:55 ` Oliver Neukum
2007-06-14 3:53 ` Herbert Xu
2007-06-14 3:56 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).