All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH]pktgen oops when used with balance-tlb bonding
@ 2006-07-22 23:11 Tien ChenLi
  2006-07-24  6:35 ` David Miller
  2006-08-02 20:38 ` Willy Tarreau
  0 siblings, 2 replies; 7+ messages in thread
From: Tien ChenLi @ 2006-07-22 23:11 UTC (permalink / raw)
  To: linux-kernel

I fixed a bug in pktgen so it won't cause oops when used with
balance-tlb or balance-alb bonding driver:

--- linux-2.6.17.4/net/core/pktgen.c.orig       2006-07-06 16:02:28.000000000 -0
400
+++ linux-2.6.17.4/net/core/pktgen.c    2006-07-10 16:40:47.000000000 -0400
@@ -2149,6 +2149,9 @@
        skb->mac.raw = ((u8 *) iph) - 14 - pkt_dev->nr_labels*sizeof(u32);
        skb->dev = odev;
        skb->pkt_type = PACKET_HOST;
+       skb->mac.raw = eth;
+       skb->nh.iph = iph;
+       skb->h.uh = udph;

        if (pkt_dev->nfrags <= 0)
                pgh = (struct pktgen_hdr *)skb_put(skb, datalen);

The root cause is that the bond_alb_xmit in bonding will peek the
destination address in packet via the skb->nh.iph pointer, generally
this will be filled by upper layer network driver, but the packet
generated by pktgen will be sent to device driver so it will need to
set this pointer correctly. The other two pointers are not necessary
for now, they are set to avoid similar problem.

Chen-Li Tien

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

* Re: [PATCH]pktgen oops when used with balance-tlb bonding
  2006-07-22 23:11 [PATCH]pktgen oops when used with balance-tlb bonding Tien ChenLi
@ 2006-07-24  6:35 ` David Miller
  2006-08-02 20:38 ` Willy Tarreau
  1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2006-07-24  6:35 UTC (permalink / raw)
  To: cltien; +Cc: linux-kernel

From: "Tien ChenLi" <cltien@gmail.com>
Date: Sat, 22 Jul 2006 19:11:21 -0400

> I fixed a bug in pktgen so it won't cause oops when used with
> balance-tlb or balance-alb bonding driver:

Your email client corrupted the patch, turning tabs into space
characters, which makes the patch unusable.

You also did not supply a proper "Signed-off-by:" line for your
change.

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

* Re: [PATCH]pktgen oops when used with balance-tlb bonding
  2006-07-22 23:11 [PATCH]pktgen oops when used with balance-tlb bonding Tien ChenLi
  2006-07-24  6:35 ` David Miller
@ 2006-08-02 20:38 ` Willy Tarreau
  2006-08-07 19:04   ` Tien ChenLi
  1 sibling, 1 reply; 7+ messages in thread
From: Willy Tarreau @ 2006-08-02 20:38 UTC (permalink / raw)
  To: Tien ChenLi; +Cc: linux-kernel, David Miller

On Sat, Jul 22, 2006 at 07:11:21PM -0400, Tien ChenLi wrote:
> I fixed a bug in pktgen so it won't cause oops when used with
> balance-tlb or balance-alb bonding driver:
> 
> --- linux-2.6.17.4/net/core/pktgen.c.orig       2006-07-06 
> 16:02:28.000000000 -0
> 400
> +++ linux-2.6.17.4/net/core/pktgen.c    2006-07-10 16:40:47.000000000 -0400
> @@ -2149,6 +2149,9 @@
>        skb->mac.raw = ((u8 *) iph) - 14 - pkt_dev->nr_labels*sizeof(u32);
>        skb->dev = odev;
>        skb->pkt_type = PACKET_HOST;
> +       skb->mac.raw = eth;
          ^^^^^^^^^^^^
Are you sure about this ? I don't understand why you change skb->mac.raw
here while it's still assigned 3 lines above. Either of those is unneeded
and/or erroneous.

> +       skb->nh.iph = iph;
> +       skb->h.uh = udph;
> 
>        if (pkt_dev->nfrags <= 0)
>                pgh = (struct pktgen_hdr *)skb_put(skb, datalen);
> 
> The root cause is that the bond_alb_xmit in bonding will peek the
> destination address in packet via the skb->nh.iph pointer, generally
> this will be filled by upper layer network driver, but the packet
> generated by pktgen will be sent to device driver so it will need to
> set this pointer correctly. The other two pointers are not necessary
> for now, they are set to avoid similar problem.

Fine. Please confirm your intention about mac.raw above, and as David
said, please sign-off the patch and check your mailer for unexpected
tabs/spaces conversions.

> Chen-Li Tien

Thanks in advance,
Willy


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

* Re: [PATCH]pktgen oops when used with balance-tlb bonding
  2006-08-02 20:38 ` Willy Tarreau
@ 2006-08-07 19:04   ` Tien ChenLi
  2006-08-07 19:07     ` Tien ChenLi
  2006-08-08  3:49     ` David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Tien ChenLi @ 2006-08-07 19:04 UTC (permalink / raw)
  To: Willy Tarreau; +Cc: linux-kernel, David Miller

[-- Attachment #1: Type: text/plain, Size: 2437 bytes --]

Indeed the skb->mac.raw is already set just several lines up. Now only
two lines are needed:

Signed-off-by: Chen-Li Tien <cltien@gmail.com>

--- linux-2.6.17.6/net/core/pktgen.c.orig       2006-07-15
15:00:43.000000000 -0400
+++ linux-2.6.17.6/net/core/pktgen.c    2006-08-07 14:50:09.000000000 -0400
@@ -2149,6 +2149,8 @@ static struct sk_buff *fill_packet_ipv4(
        skb->mac.raw = ((u8 *) iph) - 14 - pkt_dev->nr_labels*sizeof(u32);
        skb->dev = odev;
        skb->pkt_type = PACKET_HOST;
+       skb->nh.iph = iph;
+       skb->h.uh = udph;

        if (pkt_dev->nfrags <= 0)
                pgh = (struct pktgen_hdr *)skb_put(skb, datalen);

Since google mail extand tab into spaces and I cannot change them back
to tab, I attached the patch file itself so please use it instead.

Sincerely,
Chen-Li Tien

On 02/08/06, Willy Tarreau <w@1wt.eu> wrote:
> On Sat, Jul 22, 2006 at 07:11:21PM -0400, Tien ChenLi wrote:
> > I fixed a bug in pktgen so it won't cause oops when used with
> > balance-tlb or balance-alb bonding driver:
> >
> > --- linux-2.6.17.4/net/core/pktgen.c.orig       2006-07-06
> > 16:02:28.000000000 -0
> > 400
> > +++ linux-2.6.17.4/net/core/pktgen.c    2006-07-10 16:40:47.000000000 -0400
> > @@ -2149,6 +2149,9 @@
> >        skb->mac.raw = ((u8 *) iph) - 14 - pkt_dev->nr_labels*sizeof(u32);
> >        skb->dev = odev;
> >        skb->pkt_type = PACKET_HOST;
> > +       skb->mac.raw = eth;
>           ^^^^^^^^^^^^
> Are you sure about this ? I don't understand why you change skb->mac.raw
> here while it's still assigned 3 lines above. Either of those is unneeded
> and/or erroneous.
>
> > +       skb->nh.iph = iph;
> > +       skb->h.uh = udph;
> >
> >        if (pkt_dev->nfrags <= 0)
> >                pgh = (struct pktgen_hdr *)skb_put(skb, datalen);
> >
> > The root cause is that the bond_alb_xmit in bonding will peek the
> > destination address in packet via the skb->nh.iph pointer, generally
> > this will be filled by upper layer network driver, but the packet
> > generated by pktgen will be sent to device driver so it will need to
> > set this pointer correctly. The other two pointers are not necessary
> > for now, they are set to avoid similar problem.
>
> Fine. Please confirm your intention about mac.raw above, and as David
> said, please sign-off the patch and check your mailer for unexpected
> tabs/spaces conversions.
>
> > Chen-Li Tien
>
> Thanks in advance,
> Willy
>
>

[-- Attachment #2: pktgen.c.patch --]
[-- Type: text/x-patch, Size: 457 bytes --]

--- linux-2.6.17.6/net/core/pktgen.c.orig	2006-07-15 15:00:43.000000000 -0400
+++ linux-2.6.17.6/net/core/pktgen.c	2006-08-07 14:50:09.000000000 -0400
@@ -2149,6 +2149,8 @@ static struct sk_buff *fill_packet_ipv4(
 	skb->mac.raw = ((u8 *) iph) - 14 - pkt_dev->nr_labels*sizeof(u32);
 	skb->dev = odev;
 	skb->pkt_type = PACKET_HOST;
+	skb->nh.iph = iph;
+	skb->h.uh = udph;
 
 	if (pkt_dev->nfrags <= 0)
 		pgh = (struct pktgen_hdr *)skb_put(skb, datalen);

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

* Re: [PATCH]pktgen oops when used with balance-tlb bonding
  2006-08-07 19:04   ` Tien ChenLi
@ 2006-08-07 19:07     ` Tien ChenLi
  2006-08-08  3:51       ` David Miller
  2006-08-08  3:49     ` David Miller
  1 sibling, 1 reply; 7+ messages in thread
From: Tien ChenLi @ 2006-08-07 19:07 UTC (permalink / raw)
  To: Willy Tarreau; +Cc: linux-kernel, David Miller

Hi,

I forgot that if I also need to patch the fill_packet_ipv6 since I
don't have experience with it. I guess we should patch that one too.

Chen-Li Tien

On 07/08/06, Tien ChenLi <cltien@gmail.com> wrote:
> Indeed the skb->mac.raw is already set just several lines up. Now only
> two lines are needed:
>
> Signed-off-by: Chen-Li Tien <cltien@gmail.com>
>
> --- linux-2.6.17.6/net/core/pktgen.c.orig       2006-07-15
> 15:00:43.000000000 -0400
> +++ linux-2.6.17.6/net/core/pktgen.c    2006-08-07 14:50:09.000000000 -0400
> @@ -2149,6 +2149,8 @@ static struct sk_buff *fill_packet_ipv4(
>         skb->mac.raw = ((u8 *) iph) - 14 - pkt_dev->nr_labels*sizeof(u32);
>         skb->dev = odev;
>         skb->pkt_type = PACKET_HOST;
> +       skb->nh.iph = iph;
> +       skb->h.uh = udph;
>
>         if (pkt_dev->nfrags <= 0)
>                 pgh = (struct pktgen_hdr *)skb_put(skb, datalen);
>
> Since google mail extand tab into spaces and I cannot change them back
> to tab, I attached the patch file itself so please use it instead.
>
> Sincerely,
> Chen-Li Tien
>
> On 02/08/06, Willy Tarreau <w@1wt.eu> wrote:
> > On Sat, Jul 22, 2006 at 07:11:21PM -0400, Tien ChenLi wrote:
> > > I fixed a bug in pktgen so it won't cause oops when used with
> > > balance-tlb or balance-alb bonding driver:
> > >
> > > --- linux-2.6.17.4/net/core/pktgen.c.orig       2006-07-06
> > > 16:02:28.000000000 -0
> > > 400
> > > +++ linux-2.6.17.4/net/core/pktgen.c    2006-07-10 16:40:47.000000000 -0400
> > > @@ -2149,6 +2149,9 @@
> > >        skb->mac.raw = ((u8 *) iph) - 14 - pkt_dev->nr_labels*sizeof(u32);
> > >        skb->dev = odev;
> > >        skb->pkt_type = PACKET_HOST;
> > > +       skb->mac.raw = eth;
> >           ^^^^^^^^^^^^
> > Are you sure about this ? I don't understand why you change skb->mac.raw
> > here while it's still assigned 3 lines above. Either of those is unneeded
> > and/or erroneous.
> >
> > > +       skb->nh.iph = iph;
> > > +       skb->h.uh = udph;
> > >
> > >        if (pkt_dev->nfrags <= 0)
> > >                pgh = (struct pktgen_hdr *)skb_put(skb, datalen);
> > >
> > > The root cause is that the bond_alb_xmit in bonding will peek the
> > > destination address in packet via the skb->nh.iph pointer, generally
> > > this will be filled by upper layer network driver, but the packet
> > > generated by pktgen will be sent to device driver so it will need to
> > > set this pointer correctly. The other two pointers are not necessary
> > > for now, they are set to avoid similar problem.
> >
> > Fine. Please confirm your intention about mac.raw above, and as David
> > said, please sign-off the patch and check your mailer for unexpected
> > tabs/spaces conversions.
> >
> > > Chen-Li Tien
> >
> > Thanks in advance,
> > Willy
> >
> >
>
>
>

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

* Re: [PATCH]pktgen oops when used with balance-tlb bonding
  2006-08-07 19:04   ` Tien ChenLi
  2006-08-07 19:07     ` Tien ChenLi
@ 2006-08-08  3:49     ` David Miller
  1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2006-08-08  3:49 UTC (permalink / raw)
  To: cltien; +Cc: w, linux-kernel

From: "Tien ChenLi" <cltien@gmail.com>
Date: Mon, 7 Aug 2006 15:04:34 -0400

> Indeed the skb->mac.raw is already set just several lines up. Now only
> two lines are needed:
> 
> Signed-off-by: Chen-Li Tien <cltien@gmail.com>

Applied, thanks a lot.

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

* Re: [PATCH]pktgen oops when used with balance-tlb bonding
  2006-08-07 19:07     ` Tien ChenLi
@ 2006-08-08  3:51       ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2006-08-08  3:51 UTC (permalink / raw)
  To: cltien; +Cc: w, linux-kernel

From: "Tien ChenLi" <cltien@gmail.com>
Date: Mon, 7 Aug 2006 15:07:06 -0400

> I forgot that if I also need to patch the fill_packet_ipv6 since I
> don't have experience with it. I guess we should patch that one too.

I'll fix that part up, thanks for mentioning this problem.

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

end of thread, other threads:[~2006-08-08  3:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-22 23:11 [PATCH]pktgen oops when used with balance-tlb bonding Tien ChenLi
2006-07-24  6:35 ` David Miller
2006-08-02 20:38 ` Willy Tarreau
2006-08-07 19:04   ` Tien ChenLi
2006-08-07 19:07     ` Tien ChenLi
2006-08-08  3:51       ` David Miller
2006-08-08  3:49     ` David Miller

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.