Re: sk_buff question

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

 





Well, it's not quite that simple....

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.

Or is there? That's what I was sure about.

Does that make sense?

At 02:35 PM 1/27/2005, Gaurav Dhiman wrote:

--- Michael Hines <mhines@xxxxxxxxxx> wrote:

> I'm writing some code that intercepts and stores
> socket buffers....lots of
> them - and keeps them in memory for storage. (for
> various reasons)
> What I do is: when sk_buffs come in (the ones I
> want), I isolate them,
> unlink them, and orphan them and put them on a
> linked list of my own.

>
> Is there another mechanism to know for sure that an
> sk_buff has been
> transmitted?
>

As you said you are saving the sk_buff on your own
linked list, why dont you maintain the list of
expanded element rather than sk_buff. Each extended
element can have one element which will be a pointer
to the actual sk_buff and another element of extended
element can be a flag which can till you if the
sk_buff data has been transmitted ot not. So each
element of you linked list can be of following type:

struct ext_buffer{
    sk_buff * net_data;
    int flag;
    struct ext_buffer *next_node;
}

once you  transmit the net_data, do set the flag, so
that you can come to know next time that this data has
already been dispatched.

I hope i understood your prob properly.

cheers!!
--gd




__________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com



--
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