io-net -- intermediate filters invoking?

Hi,

please, anybody, could You say how does io-net invoke filters?

The general question–
do that does in single thread or no?

E.g.:
io_net_self.html – tx_up() call:

int (*tx_up)… This function sends a packet to the layer above you.

what is mean tx_up() call:
does it immediately invoke the next above filter?
and it is recursive process ? (the next filter calls tx_up again etc…)
If so – what does in the middle of call tx_up() and my filter returns?
If so – my filter waits for finishing of processing all the above filters
???
– IMHO it is nonsence!!!
Or may be tx_up() call set packet into queue?
If so – again – what does mean exactly words below:???

int (*tx_up)…This function sends a packet to the layer above you.

Thanks a lot!

vasa

vasa <vv40in@rambler.ru> wrote:
: Hi,

: please, anybody, could You say how does io-net invoke filters?

: The general question–
: do that does in single thread or no?

: E.g.:
: io_net_self.html – tx_up() call:
:
: int (*tx_up)… This function sends a packet to the layer above you.
:

: what is mean tx_up() call:
: does it immediately invoke the next above filter?

As the commtne says, it passes it to the layer(s) above you.
This may or may not be a filter.

: and it is recursive process ? (the next filter calls tx_up again etc…)

If the next layer decides to pass it on, yes.

: If so – what does in the middle of call tx_up() and my filter returns?

ion->tx_up() returns the number of layers directly above you that
took the packet. If this is 0, you generally call ion->tx_done()
on the npkt.

: If so – my filter waits for finishing of processing all the above filters
: ???
: – IMHO it is nonsence!!!

Can’t argue with that.

: Or may be tx_up() call set packet into queue?

tx_up itself doesn’t queue it, that’s up to the upper layer.

: If so – again – what does mean exactly words below:???
:
: int (*tx_up)…This function sends a packet to the layer above you.
:

Yes.

-seanb

Thanks , but …

: Hi,

: please, anybody, could You say how does io-net invoke filters?

: The general question–
: do that does in single thread or no?

: E.g.:
: io_net_self.html – tx_up() call:
: <quote
: int (*tx_up)… This function sends a packet to the layer above you.
: </quote

: what is mean tx_up() call:
: does it immediately invoke the next above filter?

As the commtne says, it passes it to the layer(s) above you.
This may or may not be a filter.

Is that mean – (e.g.)

  1. my filter (from its rx_up method) calls tx_up, control is passed to above
    (e.g.) filter
  2. that filter (e.g.) calls tx_up too → control is passed to above (e.g.)
    filter
  3. etc
    …finally – that thread will invoke down_producer’s rx_up method.
    then that will do return to filter below… filter below returns to that
    filter below etc…
    and finally my filter (the same method rx_up) will get control again and it
    can
    return
    Yes !!! exactly – does that scenario look as true ???
    I cannot believe that yet…

If this thread of control is incessant – where does it start and finish ?
(Does it blocks on the bottom and driver kicks it when it has new data?)
Or may be it is not incessant thread???
And may be the control passed through thread syncronisation (with context
switching)???

: and it is recursive process ? (the next filter calls tx_up again etc…)

If the next layer decides to pass it on, yes.

: If so – what does in the middle of call tx_up() and my filter returns?

ion->tx_up() returns the number of layers directly above you that
took the packet. If this is 0, you generally call ion->tx_done()
on the npkt.

: If so – my filter waits for finishing of processing all the above
filters
: ???
: – IMHO it is nonsence!!!

Can’t argue with that.

Again:
If so – my filter waits for finishing of processing all the above filters?
Is it true???

: Or may be tx_up() call set packet into queue?

tx_up itself doesn’t queue it, that’s up to the upper layer.

: If so – again – what does mean exactly words below:???
: <quote
: int (*tx_up)…This function sends a packet to the layer above you.
: </quote

Yes.

-seanb

Thanks a lot.
vasa.

vasa <vv40in@rambler.ru> wrote:
: Thanks , but …

:> : Hi,
:>
:> : please, anybody, could You say how does io-net invoke filters?
:>
:> : The general question–
:> : do that does in single thread or no?
:>
:> : E.g.:
:> : io_net_self.html – tx_up() call:
:> :
:> : int (*tx_up)… This function sends a packet to the layer above you.
:> :
:>
:> : what is mean tx_up() call:
:> : does it immediately invoke the next above filter?
:>
:> As the commtne says, it passes it to the layer(s) above you.
:> This may or may not be a filter.

: Is that mean – (e.g.)
: 1. my filter (from its rx_up method) calls tx_up, control is passed to above
: (e.g.) filter
: 2. that filter (e.g.) calls tx_up too → control is passed to above (e.g.)
: filter
: 3. etc
: …finally – that thread will invoke down_producer’s rx_up method.
: then that will do return to filter below… filter below returns to that
: filter below etc…
: and finally my filter (the same method rx_up) will get control again and it
: can
: return
: Yes !!! exactly – does that scenario look as true ???
: I cannot believe that yet…

Exactly. What’s so unbelievable about that? These are simply
function calls within the same process, there’s very little
overhead in the call itself. io-net leaves it up to the
receiver to decide whether or not it want’s to queue and return
immediately. Take the case where the receiver only modifies
down headed packets and passes up packets straight through.
Why should io-net queue and signal a separate thread in this case?

: If this thread of control is incessant – where does it start and finish ?

It’s obviously not incessant (it does work).

: (Does it blocks on the bottom and driver kicks it when it has new data?)

Typically the drivers are blocked waiting for an event. This is just
good driver design. But io-net makes no requirement of this.

: Or may be it is not incessant thread???
: And may be the control passed through thread syncronisation (with context
: switching)???

:> : and it is recursive process ? (the next filter calls tx_up again etc…)
:>
:> If the next layer decides to pass it on, yes.
:>
:> : If so – what does in the middle of call tx_up() and my filter returns?
:>
:> ion->tx_up() returns the number of layers directly above you that
:> took the packet. If this is 0, you generally call ion->tx_done()
:> on the npkt.
:>
:> : If so – my filter waits for finishing of processing all the above
: filters
:> : ???
:> : – IMHO it is nonsence!!!
:>
:> Can’t argue with that.
:>

: Again:
: If so – my filter waits for finishing of processing all the above filters?
: Is it true???

:> : Or may be tx_up() call set packet into queue?
:>
:> tx_up itself doesn’t queue it, that’s up to the upper layer.
:>
:> : If so – again – what does mean exactly words below:???
:> :
:> : int (*tx_up)…This function sends a packet to the layer above you.
:> :
:>
:> Yes.
:>
:> -seanb

: Thanks a lot.
: vasa.