All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ed L. Cashin" <ecashin@coraid.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-kernel@vger.kernel.org, Greg K-H <greg@kroah.com>
Subject: Re: [PATCH 2.6.18-rc4] aoe [04/13]: zero copy write 1 of 2
Date: Tue, 22 Aug 2006 17:21:50 -0400	[thread overview]
Message-ID: <20060822212150.GQ6196@coraid.com> (raw)
In-Reply-To: <1155982692.4051.9.camel@localhost.localdomain>

On Sat, Aug 19, 2006 at 11:18:12AM +0100, Alan Cox wrote:
> Ar Gwe, 2006-08-18 am 13:39 -0400, ysgrifennodd Ed L. Cashin:
> > Signed-off-by: "Ed L. Cashin" <ecashin@coraid.com>
> 
> > +	skb->len = sizeof *h + sizeof *ah;
> > +	memset(h, 0, skb->len);
> 
> Never play with skb->len directly. Use skb_put/skb_trim

These are skbs pre-allocated by the aoe driver that will always have
enough room to accomodate this much data, and we are really setting
the packet header length.

To use skb_put here seems awkward.  We'd have to do things like shown
below throughout the driver instead of just setting the length.  Is
that what you'd like to see?

diff -upr 2.6.18-rc4-orig/drivers/block/aoe/aoecmd.c 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c
--- 2.6.18-rc4-orig/drivers/block/aoe/aoecmd.c	2006-08-22 12:48:18.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c	2006-08-22 17:03:23.000000000 -0400
@@ -314,7 +315,9 @@ rexmit(struct aoedev *d, struct frame *f
 		if (ah->aflags & AOEAFL_WRITE) {
 			skb_fill_page_desc(skb, 0, virt_to_page(f->bufaddr),
 				offset_in_page(f->bufaddr), DEFAULTBCNT);
-			skb->len = sizeof *h + sizeof *ah + DEFAULTBCNT;
+			skb->data_len = 0;
+			skb_trim(skb, 0);
+			skb_put(skb, sizeof *h + sizeof *ah + DEFAULTBCNT);
 			skb->data_len = DEFAULTBCNT;
 		}
 		if (++d->lostjumbo > (d->nframes << 1))


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

  reply	other threads:[~2006-08-22 22:51 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
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
  -- strict thread matches above, loose matches on Subject: below --
2006-09-14 19:50 Ed L. Cashin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060822212150.GQ6196@coraid.com \
    --to=ecashin@coraid.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.