From: Ben Greear <greearb@candelatech.com>
To: "Linux 802.1Q VLAN" <vlan@candelatech.com>,
pavlic@de.ibm.com, netdev@oss.sgi.com,
"David S. Miller" <davem@redhat.com>
Subject: FWD: setting skb->dev to vlan device in vlan_hwaccel_rx is wrong ...
Date: Fri, 15 Oct 2004 16:27:46 -0700 [thread overview]
Message-ID: <41705CF2.9050303@candelatech.com> (raw)
In-Reply-To: <OF1AA93F13.5E509602-ONC1256F2E.00506148-C1256F2E.00551602@de.ibm.com>
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
next parent reply other threads:[~2004-10-15 23:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <OF1AA93F13.5E509602-ONC1256F2E.00506148-C1256F2E.00551602@de.ibm.com>
2004-10-15 23:27 ` Ben Greear [this message]
2004-10-20 6:36 ` FWD: setting skb->dev to vlan device in vlan_hwaccel_rx is wrong David S. Miller
2004-10-20 8:08 ` Frank Pavlic
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=41705CF2.9050303@candelatech.com \
--to=greearb@candelatech.com \
--cc=davem@redhat.com \
--cc=netdev@oss.sgi.com \
--cc=pavlic@de.ibm.com \
--cc=vlan@candelatech.com \
/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.