| Author |
Message |
|
|
Post subject: Should I call tx_done() after tx_down() ?
Posted: Oct 24, 2007 - 02:40 PM
|
|
|
|
I've written net filter (io-net/en_en0)
and sometimes (after sending data down, to ethernet card)
I have to wait long time for tx_done() callback;
Should I call ion->tx_done() after ion->tx_down() ? |
|
|
| |
|
|
|
 |
|
|
Post subject: Re: Should I call tx_done() after tx_down() ?
Posted: Oct 24, 2007 - 07:40 PM
|
|
QNX Master
Joined: Jul 28, 2006
Posts: 67
|
|
Q <no@spam.pl> wrote:
Quote:
I've written net filter (io-net/en_en0)
and sometimes (after sending data down, to ethernet card)
I have to wait long time for tx_done() callback;
Some drivers so a lazy reap: don't reap until asked
to tx additional packets.
Quote:
Should I call ion->tx_done() after ion->tx_down() ?
No, the driver or io-net will call it for you.
Some drivers may support the DCMD_IO_NET_TX_FLUSH devctl
which will poke them into returning packets but if you
don't need them back right away it's better to wait.
{
struct _io_net_dcmd_redirect redir;
int ret = 0;
redir.op = _IO_NET_REDIRECT_ENDPOINT;
redir.u.endpoint.dcmd = DCMD_IO_NET_TX_FLUSH;
redir.u.endpoint.data = NULL;
redir.u.endpoint.size = 0;
redir.u.endpoint.cell = cell;
redir.u.endpoint.endpoint = endpoint;
redir.u.endpoint.iface = iface;
ion->devctl(our_reg_hdl, DCMD_IO_NET_REDIRECT_BELOW, &redir, sizeof
redir, &ret);
} |
|
|
| |
|
|
|
 |
|
|
Post subject: Re: Should I call tx_done() after tx_down() ?
Posted: Oct 31, 2007 - 08:40 AM
|
|
|
|
|
Quote:
ion->devctl(our_reg_hdl, DCMD_IO_NET_REDIRECT_BELOW, &redir, sizeof
redir, &ret);
}
...and what about DCMD_IO_NET_TX_FLUSH cmd ?
does it flush all network devices ?
int ret, int_val = 0;
ion->devctl(reg_hdl, DCMD_IO_NET_TX_FLUSH, &int_val, sizeof(int_val), &ret);
and should I set _NPKT_NO_RES flag in packet after which I do "flush" ?
#define _NPKT_NO_RES 0x0002 /* Up producer wants its buffer back
right away. */ |
|
|
| |
|
|
|
 |
|
|
Post subject: Re: Should I call tx_done() after tx_down() ?
Posted: Oct 31, 2007 - 08:49 AM
|
|
|
|
|
Quote:
and should I set _NPKT_NO_RES flag in packet after which I do "flush" ?
#define _NPKT_NO_RES 0x0002 /* Up producer wants its buffer back
right away. */
and what about flag:
#define _NPKT_TX_WAIT 0x0400 /* More packets or a
DCMD_IO_NET_TX_FLUSH to come */
should I set it in npkt after which I do "flush" ? |
|
|
| |
|
|
|
 |
|
|
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group Credits |
|
|