Should I call tx_done() after tx_down() ?

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() ?

Q <no@spam.pl> wrote:

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.

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);
}

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. */

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” ?