Re: Question on KPI / NKE : ifp->snd
Re: Question on KPI / NKE : ifp->snd
- Subject: Re: Question on KPI / NKE : ifp->snd
- From: Josh Graessley <email@hidden>
- Date: Wed, 4 May 2005 13:52:12 -0700
The send and receive queue structures were removed from the ifnet
structure. The structures weren't actually used by the stack, they
were just their for drivers convenience. We intended to leave the
ifqueue structure in the header files so drivers could create their
own queues that they store in their own private storage area, usually
hanging of softc. Unfortunately, these structures didn't make it in
to the headers, so you can define your own.
struct my_ifqueue {
void *ifq_head;
void *ifq_tail;
int ifq_len;
int ifq_maxlen;
int ifq_drops;
};
struct my_driver_softc_stuff {
struct my_ifqueue snd_queue;
struct my_ifqueue rcv_queue;
.
.
.
};
You can use the IF_*_MBUF macros in sys/kpi_mbuf.h to enqueue mbufs
on the queues created above.
To enqueue, use IF_ENQUEUE_MBUF. To prepend the queue with a new
mbuf, use IF_PREPEND_MBUF. Finally, to dequeue an mbuf, use
IF_DEQUEUE_MBUF.
-josh
On May 4, 2005, at 1:39 PM, Steven Palm wrote:
Hi all,
Not sure if -kernel or -drivers is the right list, please direct me
if I guessed wrong. -drivers mentioned hardware drivers, and this
is not talking to hardware, but a pure software network interface.
I'm plodding my way through trying to convert the tun/tap driver
over to the new KPI's.
Maybe this is more work than I thought, but so far I've been
replacing the mutex, mbuf, and ifnet stuff with the new
"equivalents", however the tun/tap code is doing some work with the
ifqueues on the interface, and I can see no API call to get this
information, and you can not access the ifnet->snd structure
element directly (for good reason, I know). I must be daft and
overlooking it, or there is much more rework required than I was
hoping was in there.
Anyway, this is a learning project for me, surely Mattias will
finish the rework before I do, even if it takes him a few
weeks. :-) But, hope is good, and I may get it to work eventually
and will have learned something in the process.
Thanks,
Steve
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com
This email sent to email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden