netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* FWD:  setting skb->dev to vlan device in vlan_hwaccel_rx is wrong ...
       [not found] <OF1AA93F13.5E509602-ONC1256F2E.00506148-C1256F2E.00551602@de.ibm.com>
@ 2004-10-15 23:27 ` Ben Greear
  2004-10-20  6:36   ` David S. Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Greear @ 2004-10-15 23:27 UTC (permalink / raw)
  To: Linux 802.1Q VLAN, pavlic, netdev, David S. Miller

Earlier, Frank had written as explanation:

 > Hi ,
 > I found a problem using vlan_hwaccel_rx function to pass skb to the stack.
 > vlan_hwaccel_rx sets skb->dev to the vlan device accordingly to the vlan
 > id.
 > After checking pkt_type netif_rx is called in non polling mode .  vlan_skb_recv
 > is called with a wrong skb->dev setting as the receive function is still
 > expecting  the real device .... , the problem also exists in 2.4 vlan code ...


I am not so sure we need this patch, as I believe the net_rx_skb methods should
handle receiving a pkt with a vlan-device as the skb->dev.

Frank, could you explain the problem you see in more detail?

Dave, since you did the hw-accel work, what do you think of this patch?


Frank Pavlic wrote:
> Kernel 2.6.8.1 ....
> 
> I'm sorry about 2.4 kernel it was an old one ..., but nevertheless 2.4.27 
> hasn't the bug fixed yet ..
> 
> patch for Kernel 2.4.27 :
> 
> --- include/linux/if_vlan.old   2004-04-14 15:05:40.000000000 +0200
> +++ include/linux/if_vlan.h     2004-10-15 17:16:09.000000000 +0200
> @@ -183,7 +183,7 @@
>                         skb->pkt_type = PACKET_HOST;
>                 break;
>         };
> -
> +       skb->dev = skb->real_dev;
>         return (polling ? netif_receive_skb(skb) : netif_rx(skb));
>  }
> 
> 
> 
> 
> 
> 
> Ben Greear <greearb@candelatech.com> 
> Sent by: vlan-bounces@candelatech.com
> 14.10.2004 19:07
> Please respond to
> "Linux 802.1Q VLAN"
> 
> 
> To
> "Linux 802.1Q VLAN" <vlan@candelatech.com>
> cc
> 
> Subject
> Re: [VLAN]      |PATCH| setting skb->dev  to vlan device in 
> vlan_hwaccel_rx is      wrong ...
> 
> 
> 
> 
> 
> 
> Frank Pavlic wrote:
> 
>>IHi ,
>>I found a problem using vlan_hwaccel_rx function to pass skb to the 
> 
> stack.
> 
>>vlan_hwaccel_rx sets skb->dev to the vlan device accordingly to the vlan 
> 
> 
>>id.
>>After checking pkt_type netif_rx is called in non polling mode . 
>>vlan_skb_recv 
>>is called with a wrong skb->dev setting as the receive function is still 
> 
> 
>>expecting 
>>the real device .... , the problem also exists in 2.4 vlan code ...
> 
> 
> While looking at the 2.4.27 code, I think that this fix may
> already be in.
> 
> 2.6.7 also looks correct.
> 
> What versions did you base these patches off of?
> 
> Ben
> 
> 
>>Frank
>>
>>Kernel 2.6:
>>
>>Index: include/linux/if_vlan.h
>>===================================================================
>>RCS file: /home/cvs/linux-2.5/include/linux/if_vlan.h,v
>>retrieving revision 1.10
>>diff -B -u -b -r1.10 if_vlan.h
>>--- include/linux/if_vlan.h     17 Aug 2004 11:50:08 -0000      1.10
>>+++ include/linux/if_vlan.h     14 Oct 2004 13:43:58 -0000
>>@@ -184,7 +184,7 @@
>>                        skb->pkt_type = PACKET_HOST;
>>                break;
>>        };
>>-
>>+       skb->dev = skb->real_dev;
>>        return (polling ? netif_receive_skb(skb) : netif_rx(skb));
>> }
>>
>>KERNEL > 2.4.21:
>>
>>Index: include/linux/if_vlan.h
>>===================================================================
>>RCS file: /home/cvs/linux-2.3/include/linux/if_vlan.h,v
>>retrieving revision 1.6
>>diff -B -u -b -r1.6 if_vlan.h
>>--- include/linux/if_vlan.h     17 Feb 2003 10:36:43 -0000      1.6
>>+++ include/linux/if_vlan.h     14 Oct 2004 13:45:39 -0000
>>@@ -147,6 +147,7 @@
>>                                    unsigned short vlan_tag, int 
> 
> polling)
> 
>> {
>>        struct net_device_stats *stats;
>>+       struct net_device *real_dev = skb->dev;
>>
>>        skb->dev = grp->vlan_devices[vlan_tag & VLAN_VID_MASK];
>>        if (skb->dev == NULL) {
>>@@ -182,7 +183,7 @@
>>                        skb->pkt_type = PACKET_HOST;
>>                break;
>>        };
>>-
>>+       skb->dev = real_dev;
>>        return (polling ? netif_receive_skb(skb) : netif_rx(skb));
>> }
>>_______________________________________________
>>Vlan mailing list
>>Vlan@lanforge.com
>>http://www.lanforge.com/mailman/listinfo/vlan

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

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

* Re: FWD:  setting skb->dev to vlan device in vlan_hwaccel_rx is wrong ...
  2004-10-15 23:27 ` FWD: setting skb->dev to vlan device in vlan_hwaccel_rx is wrong Ben Greear
@ 2004-10-20  6:36   ` David S. Miller
  2004-10-20  8:08     ` Frank Pavlic
  0 siblings, 1 reply; 3+ messages in thread
From: David S. Miller @ 2004-10-20  6:36 UTC (permalink / raw)
  To: Ben Greear; +Cc: vlan, pavlic, netdev

On Fri, 15 Oct 2004 16:27:46 -0700
Ben Greear <greearb@candelatech.com> wrote:

> Dave, since you did the hw-accel work, what do you think of this patch?

I see no mention of what specific part of the "receive path"
depends upon the skb->dev being set to the real_dev and not
the true VLAN device.

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

* Re: FWD:  setting skb->dev to vlan device in vlan_hwaccel_rx is wrong ...
  2004-10-20  6:36   ` David S. Miller
@ 2004-10-20  8:08     ` Frank Pavlic
  0 siblings, 0 replies; 3+ messages in thread
From: Frank Pavlic @ 2004-10-20  8:08 UTC (permalink / raw)
  To: Ben Greear; +Cc: netdev, vlan

 oh , I'm sorry for confusing you guys , I finally get the point on how 
the 
hw_accel_rx stuff is working ...

Frank




"David S. Miller" <davem@redhat.com> 
20.10.2004 08:36

To
Ben Greear <greearb@candelatech.com>
cc
vlan@candelatech.com, Frank Pavlic/Germany/IBM@IBMDE, netdev@oss.sgi.com
Subject
Re: FWD:  setting skb->dev to vlan device in vlan_hwaccel_rx is wrong ...






On Fri, 15 Oct 2004 16:27:46 -0700
Ben Greear <greearb@candelatech.com> wrote:

> Dave, since you did the hw-accel work, what do you think of this patch?

I see no mention of what specific part of the "receive path"
depends upon the skb->dev being set to the real_dev and not
the true VLAN device.

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

end of thread, other threads:[~2004-10-20  8:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <OF1AA93F13.5E509602-ONC1256F2E.00506148-C1256F2E.00551602@de.ibm.com>
2004-10-15 23:27 ` FWD: setting skb->dev to vlan device in vlan_hwaccel_rx is wrong Ben Greear
2004-10-20  6:36   ` David S. Miller
2004-10-20  8:08     ` Frank Pavlic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).