Quote:
Originally Posted by doc7
helo there
i am kinda new so am not sure if this is the right forum. I want to write a classifier module that i Will put in /net/sched/ that will use qlen to find the number of skbs that the module is handling and also use gnet_stats_queue struct by using backlog to get the combined size of all skbs.
i am very new to kernel programming and your help by means of documentation or useful sites or even forums and even your ideas will much appreciated.
thank u
|
hello there
this is the code that i have done so far and i am still trying to write a code on top of this one that will separate the VoIP traffic and other traffic to the FIFO queue and i am still trying to find out how this is done. anyone who has a clue please help me. i am very new in kernel programming.
#include <linux/compiler.h>
#include <net/sch_generic.h>
#include <linux/gen_stats.h>
#include<linux/netdevice.h>
#include <linux/pkt_sched.h>
struct simpler{
/*struct sk_buff_head*/
struct gnet_stats_queue qstats;
};
static int enqueue(struct sk_buff *skb, struct Qdisc *sch){
struct simple_sched_data *q =qdisc_priv(sch);
q=qdisc_enqueue(skb,sch);
if(likely(q==NET_XMIT_SUCCESS)){
sch->q.qlen++;
sch->q.qstats.backlog+=skb->len;
}
else {
sch->qstats.drops++;
return q;
}
}