I have one type of packet (a time sync message) that is being sent
repeatedly. I set up the packet once, and send it periodically with
tx_down(). I alter nothing in the npkt_t structure except my time stamp in
the body of the packet.
Are there any fields in the npkt that must be reset every time? In
particular, are there any fields that are set by alloc_down_npkt() that
might not be correct now that the packet has been tx_down()ed already.
I set up the packet like this:
npkt = ion->alloc_down_pkt( hRegister, sizeof( net_buf_t) +
izeof( net_iov_t), (void **)&nb);
pBody = ion->alloc( sizeof( VORNET_PACKET), 0);
TAILQ_INSERT_HEAD( &npkt->buffers, nb, ptrs);
iov = (net_iov_t*)(nb + 1);
nb->niov = 1;
nb->net_iov = iov;
iov->iov_base = pBody;
iov->iov_len = sizeof( *pBody);
iov->iov_phys = ion->mphys( pBody);
npkt->org_data = pBody;
npkt->framelen = sizeof( *pBody);
npkt->tot_iov = 1;
npkt->cell = nCell;
npkt->endpoint = nEndPoint;
npkt->iface = nIface;
// set up packet data payload here [clip]
I send the packet like this: (this is repeated many times)
ion->reg_tx_done( hRegister, npkt, NULL);
ion->tx_down( hRegister, npkt);
I found I had to set iov_phys in the iov, otherwise the ethernet would send
garbage instead of my data. Is this typical? Can QNX potentially move the
memory to a different physical location? If so, do I have to set iov_phys
every time I send the packet?
Thanks,
Shaun