“Chris McKillop” <cdm@qnx.com> wrote in message
news:99itgt$ibo$1@nntp.qnx.com…
Jalaja <> jganapat@storage.com> > wrote:
Hello,
Could anyone please clarify:
When my drivers’ TxFxn, gets invoked, npkt contains a list of npkts.
I want to know on what basis the following fields in the npkt are
decided:
- number of npkts in the list.
- tot_iov in each npkt. (Number of Fragements)
- iov_len (Fragment Length)
Actually, the npkt contains a list of IOV’s that make up a single packet.
It is also possible that the npkt->next field is not null and points to
an additonal npkt which also has IOV’s. The tot_iov is the number of
IOV’s in the packet that makes up the complete packet data. The iov_len
is the lenth of a sinle IOV.
I understand this completely. But my question is, what is the limitation
of number of IOVs in each npkt? what is the limitation of iov_len of each
IOV? For ex. Can I have 100s of IOVs each consisting of some 10 bytes? On
what basis the the number of IOVs and the iov_len is decided. Also,
npkt->next may contain a non-null pointer. How many npkts I can have in the
list? When I want to give the packet up to io_net, I want to decide on these
factors.
In the example code, if the free Tx descriptors < tot_iov, we go for
defragementing, which results in creating only one npkt. In that if the
sum
of iov_len > 1520, we reject the packet. Wat is the idea behind it.?
Well, since the descriptors hold a single IOV we need to make sure that
that there are enough descriptors to hold a complete packet. If there
isn’t then we “defrag” the packet so it only needs a single IOV. If
the packet is bettering the 1520 we toss it since that is too large to
be an ethernet packet.
I just need an suggestion here. I have two different set of Transfer
decriptors for my project, say Tx1Type, Tx2Type. If the packet length is
lesser than some LIMIT, they go for Tx1Type, else Tx2Type. So here I am
unable to check out the received IOVs is less than my than my Tranfer
descriptors (cuz I have two different sets here).
So what i did was, I go for defrag everytime when i receive a packet and
then depending on the length go for choosing Tx1Type tranfer descriptor or
the other one.
I do like this:
epic_send_packets (npkt_t *npkt, void *hdl)
{
dpkt = defrag (npkt);
if (dpkt->buffers->net_iov_iov_len < LIMIT)
Get Tx1Type descriptor and send the packet down
else
Get Tx2Type descriptor and send the packet down;
}
Here I am not checking (if tot_iov > TX_DESCRIPTORS). I defrag everytime.
Does this make sense? Or shd i need to go for any other mechanism?
chris
–
cdm@qnx.com > “The faster I go, the behinder I get.”
Chris McKillop – Lewis Carroll –
Software Engineer, QSSL