Is there a way of telling how many actaul packets there are in a
NET_BUFFER_LIST?
Is there a packet (e.g. IP-packet, ARP request etc.) for every NET_BUFFER or
can a packet be divided on several NET_BUFFERS in the NET_BUFFER_LIST?

Brgds,
Fredrik

Re: How many packets in a PNET_BUFFER_LIST by Calvin

Calvin
Mon Oct 15 21:01:17 PDT 2007

1 net_buffer contains 1 packet, it may span multiple MDLs.
1 or more net_buffer can be chained to a net_buffer_list.
1 or more net_buffer_list can be chained to a net_buffer_list with multiple
net_buffer_list.

given a net_buffer_list pointer, there is no magic way to figure out how
many packets it has. you will need to walk the entire list.

pkt_cnt =0;
for (current_nbl = nbl_passed_in;\
current_nbl != NULL;\
current_nbl = NET_BUFFER_LIST_NEXT_NBL(current_nbl)){

for (current_nb = NET_BUFFER_LIST_FIRST_NB(current_nbl);\
current_nb !=NULL;\
current_nb = NET_BUFFER_NEXT_NB(current_nb)) {
pkt_cnt +=1
}
}

--
Calvin Guan
Principal Engineer
Broadcom Corporation
Connecting Everything(r)

"Fredrik Jansson" <nospam@quarterfive.com> wrote in message
news:3A50157C-1DF7-4EAE-A831-E7EFBD4A7966@microsoft.com...
> Is there a way of telling how many actaul packets there are in a
> NET_BUFFER_LIST?
> Is there a packet (e.g. IP-packet, ARP request etc.) for every NET_BUFFER
> or can a packet be divided on several NET_BUFFERS in the NET_BUFFER_LIST?
>
> Brgds,
> Fredrik
>



Re: How many packets in a PNET_BUFFER_LIST by Fredrik

Fredrik
Tue Oct 16 01:33:26 PDT 2007

Hi!

The answer "1 net_buffer contains 1 packet, it may span multiple MDLs.", was
what I was hoping for, many thanks!

/Fredrik


"Calvin Guan" <hguan@nospam.broadcom.com> wrote in message
news:O97cvm6DIHA.4752@TK2MSFTNGP04.phx.gbl...
>1 net_buffer contains 1 packet, it may span multiple MDLs.
> 1 or more net_buffer can be chained to a net_buffer_list.
> 1 or more net_buffer_list can be chained to a net_buffer_list with
> multiple net_buffer_list.
>
> given a net_buffer_list pointer, there is no magic way to figure out how
> many packets it has. you will need to walk the entire list.
>
> pkt_cnt =0;
> for (current_nbl = nbl_passed_in;\
> current_nbl != NULL;\
> current_nbl = NET_BUFFER_LIST_NEXT_NBL(current_nbl)){
>
> for (current_nb = NET_BUFFER_LIST_FIRST_NB(current_nbl);\
> current_nb !=NULL;\
> current_nb = NET_BUFFER_NEXT_NB(current_nb)) {
> pkt_cnt +=1
> }
> }
>
> --
> Calvin Guan
> Principal Engineer
> Broadcom Corporation
> Connecting Everything(r)
>
> "Fredrik Jansson" <nospam@quarterfive.com> wrote in message
> news:3A50157C-1DF7-4EAE-A831-E7EFBD4A7966@microsoft.com...
>> Is there a way of telling how many actaul packets there are in a
>> NET_BUFFER_LIST?
>> Is there a packet (e.g. IP-packet, ARP request etc.) for every NET_BUFFER
>> or can a packet be divided on several NET_BUFFERS in the NET_BUFFER_LIST?
>>
>> Brgds,
>> Fredrik
>>
>
>