hello,
for some reasons i need to dequeue 'n' pkts to an array
and then transfer them .
To implement this i made following changes in qdisc_restart net/sched/sch_generic.h
But many errors while rebooting,
the error shows sequence of function calls starting frm
qdisc_restart
then,
kernel panic
interrupt - not syncing (i don remember exactly)
please help me, ( do i need to handle watch_dog_timers,
if i m delaying pkt delivery)
int qdisc_restart(struct net_device *dev)
{
struct Qdisc *q = dev->qdisc;
int no_pkt=4;
struct sk_buff *skb,*skbn[no_pkt];
int cnt=0;
/* Dequeue packet to an array */
printk("\n\n\n\n COLLECTING TO AN ARRAY: \n\n\n");
while(cnt<no_pkt) {
if ((skb = q->dequeue(q)) != NULL) {
/* collecting into an array*/
skbn[cnt++]=skb;
}
else
break;
}
spin_unlock(&dev->queue_lock);
/* no_pkt holds num of packets in the array skbn[]*/
no_pkt=cnt;
cnt=0;
/* send all the packets collected into the array */
while(cnt++<no_pkt) {
if (spin_trylock(&dev->xmit_lock)) {
/* Remember that the driver is grabbed by us. */
dev->xmit_lock_owner = smp_processor_id();
/*already released queue */
//spin_unlock(&dev->queue_lock);
if (!netif_queue_stopped(dev)) {
if (netdev_nit)
dev_queue_xmit_nit(skbn[cnt], dev);
if (dev->hard_start_xmit(skbn[cnt], dev) == 0) {
dev->xmit_lock_owner = -1;
spin_unlock(&dev->xmit_lock);
spin_lock(&dev->queue_lock);
return -1;
}
}
/* Release the driver */
dev->xmit_lock_owner = -1;
spin_unlock(&dev->xmit_lock);
spin_lock(&dev->queue_lock);
q = dev->qdisc;
} else {
/* So, someone grabbed the driver. */
/* It may be transient configuration error,
when hard_start_xmit() recurses. We detect
it by checking xmit owner and drop the
packet when deadloop is detected.
*/
if (dev->xmit_lock_owner == smp_processor_id()) {
kfree_skb(skbn[cnt]);
if (net_ratelimit())
printk(KERN_DEBUG "Dead loop on netdevice %s, fix it urgently!\n", dev->name);
return -1;
}
netdev_rx_stat[smp_processor_id()].cpu_collision++;
}
/* Device kicked us out
This is possible in three cases:
0. driver is locked
1. fastroute is enabled
2. device cannot determine busy state
before start of transmission (f.e. dialout)
3. device is buggy (ppp)
*/
q->ops->requeue(skbn[cnt], q);
netif_schedule(dev);
return 1;
}
return q->q.qlen;
}