2006-08-18 18:55:35

by Ed L. Cashin

[permalink] [raw]
Subject: [PATCH 2.6.18-rc4] aoe [07/13]: jumbo frame support 2 of 2

Signed-off-by: "Ed L. Cashin" <[email protected]>

Add support for jumbo ethernet frames.
(This patch follows patch 5.)

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-17 16:45:34.000000000 -0400
+++ 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c 2006-08-17 16:45:34.000000000 -0400
@@ -28,7 +28,7 @@ new_skb(ulong len)
skb->protocol = __constant_htons(ETH_P_AOE);
skb->priority = 0;
skb_put(skb, len);
- memset(skb->head, 0, len);
+ memset(skb->head, 0, ETH_ZLEN);
skb->next = skb->prev = NULL;

/* tell the network layer not to perform IP checksums
@@ -475,7 +475,7 @@ void
aoecmd_ata_rsp(struct sk_buff *skb)
{
struct aoedev *d;
- struct aoe_hdr *hin;
+ struct aoe_hdr *hin, *hout;
struct aoe_atahdr *ahin, *ahout;
struct frame *f;
struct buf *buf;
@@ -515,7 +515,8 @@ aoecmd_ata_rsp(struct sk_buff *skb)
calc_rttavg(d, tsince(f->tag));

ahin = (struct aoe_atahdr *) (hin+1);
- ahout = (struct aoe_atahdr *) (f->skb->mac.raw + sizeof(struct aoe_hdr));
+ hout = (struct aoe_hdr *) f->skb->mac.raw;
+ ahout = (struct aoe_atahdr *) (hout+1);
buf = f->buf;

if (ahout->cmdstat == WIN_IDENTIFY)
@@ -552,6 +553,9 @@ aoecmd_ata_rsp(struct sk_buff *skb)
skb_fill_page_desc(f->skb, 0,
virt_to_page(f->bufaddr),
offset_in_page(f->bufaddr), n);
+ f->tag = newtag(d);
+ hout->tag = cpu_to_be32(f->tag);
+ skb->dev = d->ifp;
skb_get(f->skb);
f->skb->next = NULL;
spin_unlock_irqrestore(&d->lock, flags);


--
"Ed L. Cashin" <[email protected]>


2006-08-18 22:37:35

by Alan

[permalink] [raw]
Subject: Re: [PATCH 2.6.18-rc4] aoe [07/13]: jumbo frame support 2 of 2

Ar Gwe, 2006-08-18 am 13:39 -0400, ysgrifennodd Ed L. Cashin:
> Signed-off-by: "Ed L. Cashin" <[email protected]>
>
> Add support for jumbo ethernet frames.
> (This patch follows patch 5.)
>
> 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-17 16:45:34.000000000 -0400
> +++ 2.6.18-rc4-aoe/drivers/block/aoe/aoecmd.c 2006-08-17 16:45:34.000000000 -0400
> @@ -28,7 +28,7 @@ new_skb(ulong len)
> skb->protocol = __constant_htons(ETH_P_AOE);
> skb->priority = 0;
> skb_put(skb, len);
> - memset(skb->head, 0, len);
> + memset(skb->head, 0, ETH_ZLEN);

You realise the tail of a short packet is cleared by the network drivers
either in software or hardware ?

2006-08-18 23:21:27

by Ed L. Cashin

[permalink] [raw]
Subject: Re: [PATCH 2.6.18-rc4] aoe [07/13]: jumbo frame support 2 of 2

On Fri, Aug 18, 2006 at 11:58:32PM +0100, Alan Cox wrote:
> Ar Gwe, 2006-08-18 am 13:39 -0400, ysgrifennodd Ed L. Cashin:
...
> > @@ -28,7 +28,7 @@ new_skb(ulong len)
> > skb->protocol = __constant_htons(ETH_P_AOE);
> > skb->priority = 0;
> > skb_put(skb, len);
> > - memset(skb->head, 0, len);
> > + memset(skb->head, 0, ETH_ZLEN);
>
> You realise the tail of a short packet is cleared by the network drivers
> either in software or hardware ?

Yes, I think that the patch author is used to doing ETH_ZLEN because
of a bug in the e1000 driver where the short packets weren't getting
padded. I don't think I ever heard of a resolution to that issue, but
I could change it back to "len" here.

--
Ed L Cashin <[email protected]>

2006-08-19 09:28:07

by Alan

[permalink] [raw]
Subject: Re: [PATCH 2.6.18-rc4] aoe [07/13]: jumbo frame support 2 of 2

Ar Gwe, 2006-08-18 am 19:04 -0400, ysgrifennodd Ed L. Cashin:
> On Fri, Aug 18, 2006 at 11:58:32PM +0100, Alan Cox wrote:
> Yes, I think that the patch author is used to doing ETH_ZLEN because
> of a bug in the e1000 driver where the short packets weren't getting
> padded. I don't think I ever heard of a resolution to that issue, but
> I could change it back to "len" here.

It should have been resolved as uncleared packet tails are a security
hole. If not it needs fixing not aoe