sch_generic.c - why skb->some_field gets undefined, after dev_queue_xmit is called?????

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

FIRST QUESTION:

i have added char pkt_nr[48] field to struct skb{} to be able to recognize
packets on their way through linux.

Works fine (i mean reading skb->pkt_nr) from any of networking files
(skb->pkt_nr is first set in 8139too.c just after skb was allocated):
ip_input, ip_forward, ip_output.c etc.

BUT please tell me WHAT IS WRONG in sch_generic.c when i try to access
skb->pkt_nr from qdisc_restart()....

In function that dequeues skb's from output queues (qdisc_restart) (kernel
2.4.20):


82         /* Dequeue packet */
83         if ((skb = q->dequeue(q)) != NULL) {
84                 if (spin_trylock(&dev->xmit_lock)) {
85                         /* Remember that the driver is grabbed by us. */
86                         dev->xmit_lock_owner = smp_processor_id();
87

>> skb->pkt_nr has PROPER value in here !!!

88                         /* And release queue */
89                         spin_unlock(&dev->queue_lock);
90
91                         if (!netif_queue_stopped(dev)) {
92                                 if (netdev_nit)
93                                         dev_queue_xmit_nit(skb, dev);
94
95                                 if (dev->hard_start_xmit(skb, dev) == 0)
{
96                                         dev->xmit_lock_owner = -1;
97                                         spin_unlock(&dev->xmit_lock);
>>  skb->pkt_nr has UNDEFINED value here !!!!!

Could you please tell WHY is that skb->pkt_nr is undefined (no value)
underneath???


SECOND QUESTION:

how can i transform

sprintf(info, "cycles[%lu], time[%d,%d]", cycles_count, time.tv_sec,
time.tv_usec);

which takes about 3000 cycles into something FASTER. I mean HOW can i
efficiently write (from kernel level) into "info" buffer whithout that much
cycles spent???

regards

adam

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux