* bind and O_NONBLOCK
@ 2007-09-21 5:59 Ulrich Drepper
2007-09-22 16:14 ` Evgeniy Polyakov
2007-09-28 22:56 ` David Miller
0 siblings, 2 replies; 11+ messages in thread
From: Ulrich Drepper @ 2007-09-21 5:59 UTC (permalink / raw)
To: netdev, Alan Cox
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Some time back Alan asked about adding O_NONBLOCK support to bind in the
POSIX spec. I brought this up and the following text will be in the
next revision of the POSIX spec:
=======================
If the socket address cannot be assigned immediately and O_NONBLOCK is
set for the file descriptor for the socket, bind( ) shall fail and set
errno to [EINPROGRESS], but the assignment request shall not be aborted,
and the assignment shall be completed asynchronously. Subsequent calls
to bind() for the same socket, before the assignment is completed, shall
fail and set errno to [EALREADY].
When the assignment has been performed asynchronously, pselect(),
select(), and poll() shall indicate that the file descriptor for the
socket is ready for reading and writing.
=======================
It would be ideal if we'd have such an implementation in the next few
months so that we, in theory, can check whether the text in the
specification makes sense.
- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
iD8DBQFG813Z2ijCOnn/RHQRAsNkAJ9EuDWX3EDez8+o/y3I39A7Axy++ACfZAXi
DRFm1UadrbJ+c7ss0a1vWUI=
=p1bV
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: bind and O_NONBLOCK
2007-09-21 5:59 bind and O_NONBLOCK Ulrich Drepper
@ 2007-09-22 16:14 ` Evgeniy Polyakov
2007-09-22 16:21 ` Ulrich Drepper
2007-09-22 17:35 ` Alan Cox
2007-09-28 22:56 ` David Miller
1 sibling, 2 replies; 11+ messages in thread
From: Evgeniy Polyakov @ 2007-09-22 16:14 UTC (permalink / raw)
To: Ulrich Drepper; +Cc: netdev, Alan Cox
Hi Ulrich.
On Thu, Sep 20, 2007 at 10:59:53PM -0700, Ulrich Drepper (drepper@redhat.com) wrote:
> Some time back Alan asked about adding O_NONBLOCK support to bind in the
> POSIX spec. I brought this up and the following text will be in the
> next revision of the POSIX spec:
>
> =======================
> If the socket address cannot be assigned immediately and O_NONBLOCK is
> set for the file descriptor for the socket, bind( ) shall fail and set
> errno to [EINPROGRESS], but the assignment request shall not be aborted,
> and the assignment shall be completed asynchronously. Subsequent calls
> to bind() for the same socket, before the assignment is completed, shall
> fail and set errno to [EALREADY].
>
> When the assignment has been performed asynchronously, pselect(),
> select(), and poll() shall indicate that the file descriptor for the
> socket is ready for reading and writing.
> =======================
>
> It would be ideal if we'd have such an implementation in the next few
> months so that we, in theory, can check whether the text in the
> specification makes sense.
On behalf of which process this is supposed to be done?
Network does not have any async processing units to perform this kind
of operations. There are four ways where bind can fail:
1. unsufficient rights - nothing can help here
2. there is no memory - async binding can not help here too, since it
some memory just has to be allocated to save async request
somewhere.
3. socket is locked.
4. addres is being bound is in use.
We can wait until it is released and perform binding on behalf of some
other process in both situations, although I think we do not want 4'th
variant in some cases.
So, did I understand you correctly, that you want to introduce network
AIO here? (for example on behalf of work queue or something else?)
--
Evgeniy Polyakov
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: bind and O_NONBLOCK
2007-09-22 16:14 ` Evgeniy Polyakov
@ 2007-09-22 16:21 ` Ulrich Drepper
2007-09-22 16:59 ` Evgeniy Polyakov
2007-09-22 17:35 ` Alan Cox
1 sibling, 1 reply; 11+ messages in thread
From: Ulrich Drepper @ 2007-09-22 16:21 UTC (permalink / raw)
To: Evgeniy Polyakov; +Cc: netdev, Alan Cox
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Evgeniy Polyakov wrote:
> So, did I understand you correctly, that you want to introduce network
> AIO here? (for example on behalf of work queue or something else?)
See Alan's mail. All this was his proposal, I just got it accepted
upstream.
The problem to solve is if you have a distributed network port set.
Apparently NetBIOS has it but I could also imagine this to be useful in
cluster implementations which have to appear as one machine. In this
case, before binding to a given port, you have to make sure no other
machine already handles this port.
- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
iD8DBQFG9UDy2ijCOnn/RHQRAvntAKC6F6Pz6zHd/iZLFECOZ0MxlhdPBQCgjrLC
V9cazPF5jjf2eUSr7ZKDSas=
=0v1W
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: bind and O_NONBLOCK
2007-09-22 16:21 ` Ulrich Drepper
@ 2007-09-22 16:59 ` Evgeniy Polyakov
2007-09-22 17:11 ` Ulrich Drepper
0 siblings, 1 reply; 11+ messages in thread
From: Evgeniy Polyakov @ 2007-09-22 16:59 UTC (permalink / raw)
To: Ulrich Drepper; +Cc: netdev, Alan Cox
On Sat, Sep 22, 2007 at 09:21:06AM -0700, Ulrich Drepper (drepper@redhat.com) wrote:
> Evgeniy Polyakov wrote:
> > So, did I understand you correctly, that you want to introduce network
> > AIO here? (for example on behalf of work queue or something else?)
>
> See Alan's mail. All this was his proposal, I just got it accepted
> upstream.
>
> The problem to solve is if you have a distributed network port set.
> Apparently NetBIOS has it but I could also imagine this to be useful in
> cluster implementations which have to appear as one machine. In this
> case, before binding to a given port, you have to make sure no other
> machine already handles this port.
Yes, to handle bind conflict in some or another way.
Could you point to the original Alan's proposal, I only found short note
(as in you original mail) at opengroup.org and failed to correctly
googlify it in the web.
--
Evgeniy Polyakov
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: bind and O_NONBLOCK
2007-09-22 16:59 ` Evgeniy Polyakov
@ 2007-09-22 17:11 ` Ulrich Drepper
2007-09-22 17:19 ` Evgeniy Polyakov
2007-09-23 5:58 ` David Miller
0 siblings, 2 replies; 11+ messages in thread
From: Ulrich Drepper @ 2007-09-22 17:11 UTC (permalink / raw)
To: Evgeniy Polyakov; +Cc: netdev, Alan Cox
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Evgeniy Polyakov wrote:
> Could you point to the original Alan's proposal, I only found short note
> (as in you original mail) at opengroup.org and failed to correctly
> googlify it in the web.
There was no public mail. I asked RH engineering for proposals for
changes to the POSIX spec and Alan replied.
- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
iD8DBQFG9Uyl2ijCOnn/RHQRAtyNAJ0TLrZ8P3VcoFDWT1g+Qft1eTU+1QCffus6
Tljy9S9Sxb7z09l/GBkLSvY=
=golD
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: bind and O_NONBLOCK
2007-09-22 17:11 ` Ulrich Drepper
@ 2007-09-22 17:19 ` Evgeniy Polyakov
2007-09-23 5:58 ` David Miller
1 sibling, 0 replies; 11+ messages in thread
From: Evgeniy Polyakov @ 2007-09-22 17:19 UTC (permalink / raw)
To: Ulrich Drepper; +Cc: netdev, Alan Cox
On Sat, Sep 22, 2007 at 10:11:01AM -0700, Ulrich Drepper (drepper@redhat.com) wrote:
> Evgeniy Polyakov wrote:
> > Could you point to the original Alan's proposal, I only found short note
> > (as in you original mail) at opengroup.org and failed to correctly
> > googlify it in the web.
>
> There was no public mail. I asked RH engineering for proposals for
> changes to the POSIX spec and Alan replied.
Then I belive RH engineers will implement this issue and you should
not send this to netdev@ (maybe only as a warning for all others :)
--
Evgeniy Polyakov
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: bind and O_NONBLOCK
2007-09-22 17:11 ` Ulrich Drepper
2007-09-22 17:19 ` Evgeniy Polyakov
@ 2007-09-23 5:58 ` David Miller
2007-09-23 20:43 ` Alan Cox
1 sibling, 1 reply; 11+ messages in thread
From: David Miller @ 2007-09-23 5:58 UTC (permalink / raw)
To: drepper; +Cc: johnpol, netdev, alan
From: Ulrich Drepper <drepper@redhat.com>
Date: Sat, 22 Sep 2007 10:11:01 -0700
> There was no public mail. I asked RH engineering for proposals for
> changes to the POSIX spec and Alan replied.
Please do not discuss such proposals only privately, especially when
the ramifications affect the entire community.
It is important the things get hashed out on a public forum where
all networking developers can add their insight into the problem.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: bind and O_NONBLOCK
2007-09-23 5:58 ` David Miller
@ 2007-09-23 20:43 ` Alan Cox
0 siblings, 0 replies; 11+ messages in thread
From: Alan Cox @ 2007-09-23 20:43 UTC (permalink / raw)
To: David Miller; +Cc: drepper, johnpol, netdev, alan
On Sat, Sep 22, 2007 at 10:58:18PM -0700, David Miller wrote:
> From: Ulrich Drepper <drepper@redhat.com>
> Date: Sat, 22 Sep 2007 10:11:01 -0700
>
> > There was no public mail. I asked RH engineering for proposals for
> > changes to the POSIX spec and Alan replied.
>
> Please do not discuss such proposals only privately, especially when
> the ramifications affect the entire community.
>
> It is important the things get hashed out on a public forum where
> all networking developers can add their insight into the problem.
It was - about six years ago while netbeui/netbios merging was being
discussed. It got tagged then and finally ended up here.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: bind and O_NONBLOCK
2007-09-22 16:14 ` Evgeniy Polyakov
2007-09-22 16:21 ` Ulrich Drepper
@ 2007-09-22 17:35 ` Alan Cox
2007-09-22 17:40 ` Evgeniy Polyakov
1 sibling, 1 reply; 11+ messages in thread
From: Alan Cox @ 2007-09-22 17:35 UTC (permalink / raw)
To: Evgeniy Polyakov; +Cc: Ulrich Drepper, netdev, Alan Cox
On Sat, Sep 22, 2007 at 08:14:15PM +0400, Evgeniy Polyakov wrote:
> of operations. There are four ways where bind can fail:
>
> 1. unsufficient rights - nothing can help here
> 2. there is no memory - async binding can not help here too, since it
> some memory just has to be allocated to save async request
> somewhere.
> 3. socket is locked.
> 4. addres is being bound is in use.
For most protocols yes - but not all. For things like IP specifying O_NDELAY
is meaningless on a bind it will always complete on the spot as you say
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: bind and O_NONBLOCK
2007-09-22 17:35 ` Alan Cox
@ 2007-09-22 17:40 ` Evgeniy Polyakov
0 siblings, 0 replies; 11+ messages in thread
From: Evgeniy Polyakov @ 2007-09-22 17:40 UTC (permalink / raw)
To: Alan Cox; +Cc: Ulrich Drepper, netdev
On Sat, Sep 22, 2007 at 01:35:56PM -0400, Alan Cox (alan@redhat.com) wrote:
> On Sat, Sep 22, 2007 at 08:14:15PM +0400, Evgeniy Polyakov wrote:
> > of operations. There are four ways where bind can fail:
> >
> > 1. unsufficient rights - nothing can help here
> > 2. there is no memory - async binding can not help here too, since it
> > some memory just has to be allocated to save async request
> > somewhere.
> > 3. socket is locked.
> > 4. addres is being bound is in use.
>
> For most protocols yes - but not all. For things like IP specifying O_NDELAY
> is meaningless on a bind it will always complete on the spot as you say
Yes, of course, bind conflict can be handled in different way as Ulrich noted -
from checking bind bucket, to request remote node if address is in use or not.
--
Evgeniy Polyakov
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: bind and O_NONBLOCK
2007-09-21 5:59 bind and O_NONBLOCK Ulrich Drepper
2007-09-22 16:14 ` Evgeniy Polyakov
@ 2007-09-28 22:56 ` David Miller
1 sibling, 0 replies; 11+ messages in thread
From: David Miller @ 2007-09-28 22:56 UTC (permalink / raw)
To: drepper; +Cc: netdev, alan
From: Ulrich Drepper <drepper@redhat.com>
Date: Thu, 20 Sep 2007 22:59:53 -0700
> It would be ideal if we'd have such an implementation in the next few
> months so that we, in theory, can check whether the text in the
> specification makes sense.
It seems this functionality is only relevant for really ancient
protocols such as netbeui, as Alan mentioned.
The implementation would go in those protocols, the code for
which hasn't been touched substantially for years. It is
unclear whether those protocols are even functional at this
time. :-)
So expecting an implementation in the next few months depends
upon someone standing up and actively working on those rotting
code bases.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2007-09-28 22:56 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-21 5:59 bind and O_NONBLOCK Ulrich Drepper
2007-09-22 16:14 ` Evgeniy Polyakov
2007-09-22 16:21 ` Ulrich Drepper
2007-09-22 16:59 ` Evgeniy Polyakov
2007-09-22 17:11 ` Ulrich Drepper
2007-09-22 17:19 ` Evgeniy Polyakov
2007-09-23 5:58 ` David Miller
2007-09-23 20:43 ` Alan Cox
2007-09-22 17:35 ` Alan Cox
2007-09-22 17:40 ` Evgeniy Polyakov
2007-09-28 22: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).