Re: sk_buff question

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

 




Right.....a copy would be kinda bad.

In the end.........I think I'm just going to have to start with a different programming design altogether.

But, hey......I tried. =)

Thanks,
- Michael

At 01:24 AM 1/29/2005, Swapnil Nagle wrote:
The order of events:
1. stored sk_buff data is modified in a reversible fashion (i.e. modified data is saved and restored after transmission).
2. sk_buff is queued for transmission
3. control returns back to interrupt handler. (yeah, this is all in soft_irq context, so I need it to be fast)
4. modified sk_buff data is restored, without knowing if the buffer has left the transmit queue and actually been put on the link.
So, there's a chance that: the modified data will get restored into the buffer before the actually transmission actually takes place.

I guess when exactly the packet is sent out on the wire will depend on the queuing policies and the device driver.


What you can do is make a copy of the skb and modify that copy. So the modified copy will be transmitted & the unmodified copy will be passed to the network layer. But again kmalloc()'ing a new skb & making a copy will be a problem since you are in interrupt context.

--Swapnil

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/

/*********************************/ Michael R. Hines Grad Student, Florida State Dept. Computer Science http://www.cs.fsu.edu/~mhines/ Jusqu'à ce que le futur vienne... /*********************************/


-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux