public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 2.6.18-rc4] aoe [04/13]: zero copy write 1 of 2
@ 2006-09-14 19:50 Ed L. Cashin
  0 siblings, 0 replies; 30+ messages in thread
From: Ed L. Cashin @ 2006-09-14 19:50 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel, Greg K-H

f5d@coraid.com> <1155982692.4051.9.camel@localhost.localdomain> <20060822212150.
GQ6196@coraid.com> <1156345386.3007.24.camel@localhost.localdomain>
In-Reply-To: <1156345386.3007.24.camel@localhost.localdomain>
User-Agent: Mutt/1.5.11+cvs20060126

Hi.  Back in August I sent out some patches for the aoe driver, and
Alan objected to the direct setting of skb->len in one of them.  I
asked whether he was suggesting that we use something like this
instead of setting skb->len:

	skb->data_len = 0;
	skb_trim(skb, 0);
	skb_put(skb, sizeof *h + sizeof *ah + DEFAULTBCNT);

... and Alan said that was acceptible because it takes care of
skb->tail, checks for overflow, and is more future proof.

So I took some time to implement the necessary changes, but then it
became apparent that there was a problem.

The skb_trim and skb_put macros are only for non-linear skbuffs, but
we are only using the area inside the skbuff itself for packet
headers, not data.

When we do something like this:

	if (bio_data_dir(buf->bio) == WRITE) {
		skb_fill_page_desc(skb, 0, bv->bv_page, buf->bv_off, bcnt);
		ah.aflags |= AOEAFL_WRITE;
		skb->len += bcnt;
		skb->data_len = bcnt;
		t->wpkts++;

... skb->tail isn't really relevant, because we are only using the
pre-allocated part of the skbuff for headers, and the headers aren't
expanding here.  Other parts of the kernel that aren't putting data in
the skbuff itself set the skb->len directly.

  e1000_main.c
  ip_output.c
  tcp.c
  ip6_output.c

So is it correct for the callers of skb_fill_page_desc to set skb->len
or is another interface needed besides skb_put/skb_trim?  Such a new
interface would be able to maintain the consistency of the skbuff
fields without assuming that the data is in the skbuff itself.

If a new interface is needed, then it seems like we should set
skb->len in this patch until the new interface is ready.

-- 
  Ed L Cashin <ecashin@coraid.com>

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2006-09-14 20:07 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E1GE8K3-0008Jn-00@kokone.coraid.com>
2006-08-18 17:38 ` [PATCH 2.6.18-rc4] aoe [02/13]: update copyright date Ed L. Cashin
2006-08-18 22:54   ` Alan Cox
2006-08-18 17:39 ` [PATCH 2.6.18-rc4] aoe [03/13]: remove unused NARGS enum Ed L. Cashin
2006-08-18 22:54   ` Alan Cox
2006-08-18 17:39 ` [PATCH 2.6.18-rc4] aoe [04/13]: zero copy write 1 of 2 Ed L. Cashin
2006-08-19 10:18   ` Alan Cox
2006-08-22 21:21     ` Ed L. Cashin
2006-08-23 15:03       ` Alan Cox
2006-08-18 17:39 ` [PATCH 2.6.18-rc4] aoe [05/13]: jumbo frame support " Ed L. Cashin
2006-08-18 22:56   ` Alan Cox
2006-08-18 17:39 ` [PATCH 2.6.18-rc4] aoe [06/13]: clean up printks via macros Ed L. Cashin
2006-08-18 19:29   ` Arnd Bergmann
2006-08-18 22:23     ` Ed L. Cashin
2006-08-18 22:57   ` Alan Cox
2006-08-18 17:39 ` [PATCH 2.6.18-rc4] aoe [07/13]: jumbo frame support 2 of 2 Ed L. Cashin
2006-08-18 22:58   ` Alan Cox
2006-08-18 23:04     ` Ed L. Cashin
2006-08-19  0:08       ` Alan Cox
2006-08-18 17:39 ` [PATCH 2.6.18-rc4] aoe [08/13]: improve retransmission heuristics Ed L. Cashin
2006-08-18 23:02   ` Alan Cox
2006-08-18 17:39 ` [PATCH 2.6.18-rc4] aoe [09/13]: zero copy write 2 of 2 Ed L. Cashin
2006-08-18 17:39 ` [PATCH 2.6.18-rc4] aoe [10/13]: module parameter for device timeout Ed L. Cashin
2006-08-18 23:03   ` Alan Cox
2006-08-18 23:10     ` Ed L. Cashin
2006-08-19  0:09       ` Alan Cox
2006-08-21 22:45         ` Ed L. Cashin
2006-08-18 17:40 ` [PATCH 2.6.18-rc4] aoe [11/13]: use bio->bi_idx Ed L. Cashin
2006-08-18 17:40 ` [PATCH 2.6.18-rc4] aoe [12/13]: remove sysfs comment Ed L. Cashin
2006-08-18 17:40 ` [PATCH 2.6.18-rc4] aoe [13/13]: update driver version Ed L. Cashin
2006-09-14 19:50 [PATCH 2.6.18-rc4] aoe [04/13]: zero copy write 1 of 2 Ed L. Cashin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox