Upward headed packets

I’m writing an up filter. When I receive a packet through rx_up(), after I’m
done with the packet am I expected to tx_up() the packet up to the next
layer? I always tx_done() every packet I receive (correct?). If I am
expected to forward packets, does this include NPKT_MSG packets, such
MSG_DL_ADVERT packets?

Thanks,
Shaun

It’s up to you whether or not you pass them up. Obviously,
the upper layers won’t work very well if you send all of them
to the bit bucket.

You call tx_done() on up headed packets if no one above you takes
them. ie if you don’t call ion->tx_up on the packet, or if
ion->tx_up() returns 0.

-seanb

Shaun Jackman <sjackman@nospam.vortek.com> wrote:
: I’m writing an up filter. When I receive a packet through rx_up(), after I’m
: done with the packet am I expected to tx_up() the packet up to the next
: layer? I always tx_done() every packet I receive (correct?). If I am
: expected to forward packets, does this include NPKT_MSG packets, such
: MSG_DL_ADVERT packets?

: Thanks,
: Shaun

From the DDK docs I read the following:

For upward-headed packets, this function is called by each module
(including the originator) when finished with the packet.

For purposes of memory management, is a filter not considered a module? Do
only leaf modules (those that haven’t forwarded the packet)tx_done() the
packet?

By contract, calling tx_done() on a packet means you won’t inspect any
memory associated with that packet thereafter. Does calling tx_up() on a
packet imply the same thing?

Cheers,
Shaun

Sean Boudreau <seanb@qnx.com> wrote in message
news:adj2kl$j09$1@nntp.qnx.com

It’s up to you whether or not you pass them up. Obviously,
the upper layers won’t work very well if you send all of them
to the bit bucket.

You call tx_done() on up headed packets if no one above you takes
them. ie if you don’t call ion->tx_up on the packet, or if
ion->tx_up() returns 0.

-seanb

Shaun Jackman <> sjackman@nospam.vortek.com> > wrote:
: I’m writing an up filter. When I receive a packet through rx_up(), after
I’m
: done with the packet am I expected to tx_up() the packet up to the next
: layer? I always tx_done() every packet I receive (correct?). If I am
: expected to forward packets, does this include NPKT_MSG packets, such
: MSG_DL_ADVERT packets?

: Thanks,
: Shaun

Shaun Jackman <sjackman@nospam.vortek.com> wrote:
: From the DDK docs I read the following:
:> For upward-headed packets, this function is called by each module
: (including the originator) when finished with the packet.
: For purposes of memory management, is a filter not considered a module? Do
: only leaf modules (those that haven’t forwarded the packet)tx_done() the
: packet?

A filter is a module. All modules need to call tx_done() on up
headed packets in the manner I laid out below.

: By contract, calling tx_done() on a packet means you won’t inspect any
: memory associated with that packet thereafter. Does calling tx_up() on a
: packet imply the same thing?

Yes. Calling tx_done() on the packet means you’re done with it. If you
pass it up, you should also be done with it. Recall, you need to look
at the return code of tx_up() to see if you need to call tx_done().
Something like:

if(you_decide_not_to_pass_it_up) {
ion->tx_done(hdl, npkt);
}
else {
if(ion->tx_up(reg_hdl, npkt, …) == 0)
ion->tx_done(hdl, npkt);
}

-seanb

: Cheers,
: Shaun

: Sean Boudreau <seanb@qnx.com> wrote in message
: news:adj2kl$j09$1@nntp.qnx.com
:>
:> It’s up to you whether or not you pass them up. Obviously,
:> the upper layers won’t work very well if you send all of them
:> to the bit bucket.
:>
:> You call tx_done() on up headed packets if no one above you takes
:> them. ie if you don’t call ion->tx_up on the packet, or if
:> ion->tx_up() returns 0.
:>
:> -seanb
:>
:> Shaun Jackman <sjackman@nospam.vortek.com> wrote:
:> : I’m writing an up filter. When I receive a packet through rx_up(), after
: I’m
:> : done with the packet am I expected to tx_up() the packet up to the next
:> : layer? I always tx_done() every packet I receive (correct?). If I am
:> : expected to forward packets, does this include NPKT_MSG packets, such
:> : MSG_DL_ADVERT packets?
:>
:> : Thanks,
:> : Shaun
:>
:>
:>