[lkml]   [2001]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PLEASE-TESTME] Zerocopy networking patch, 2.4.0-1
In article <>,
Albert D. Cahalan <> wrote:
>What about getting rid of both that and the pointer, and just
>hanging that data on the end as a variable length array?
>struct kiovec2{
> int nbufs;
> /* ... */
> struct kiobuf[0];

If the struct ends up having lots of other fields, yes.

On the other hand, if one basic form of kiobuf's ends up being really
just the array and the number of elements, there are reasons not to do
this. One is that you can "peel" off parts of the buffer, and split it
up if (for example) your driver has some limitation to the number of
scatter-gather requests it can make. For example, you may have code that
looks roughly like

.. int nr, struct kibuf *buf ..

while (nr > MAX_SEGMENTS) {
lower_level(MAX_SEGMENTS, buf);
lower_level(nr, buf);

which is rather awkward to do if you tie "nr" and the array too closely

(Of course, the driver could just split them up - take it from the
structure and pass them down in the separated manner. I don't know which
level the separation is worth doing at, but I have this feeling that if
the structure ends up being _only_ the nbufs and bufs, they should not
be tied together.)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:28    [W:1.055 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site