login
Login
/
Register
Search
Header Space
Forums
News
Jobs
Blogs
Features
Man Pages
Site
Home
»
Mailing list archives
»
linux-netdev
»
2008
»
April
»
25
Re: [PATCH] via-velocity: fix vlan receipt
view
thread
Score:
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From:
Jeff Garzik <jeff@...>
To: Francois Romieu <romieu@...>
Cc: Andrew Morton <akpm@...>, Séguier <rseguier@...>, <netdev@...>
Subject:
Re: [PATCH] via-velocity: fix vlan receipt
Date: Friday, April 25, 2008 - 1:47 am
Francois Romieu wrote:
quoted text
> - vlans were using a single CAM register (see mac_set_vlan_cam) > - setting the address filtering registers for vlans is not > needed when there is no vlan > > The non-tagged interface is filtered out as soon as a tagged > (!= 0) interface is created. Its traffic appears again when an > zero-tagged interface is created. > > Tested on Via Epia SN (VT6130 chipset) with several vlans whose > tag was above or beyond 255. > > Signed-off-by: Séguier Régis <rseguier@e-teleport.net> > Acked-by: Francois Romieu <romieu@fr.zoreil.com> > --- > drivers/net/via-velocity.c | 46 ++++++++++++++++++++++++++----------------- > 1 files changed, 28 insertions(+), 18 deletions(-) > > diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c > index ed1afaf..036c5c9 100644 > --- a/drivers/net/via-velocity.c > +++ b/drivers/net/via-velocity.c > @@ -605,7 +605,6 @@ static void __devinit velocity_get_options(struct velocity_opt *opts, int index, > static void velocity_init_cam_filter(struct velocity_info *vptr) > { > struct mac_regs __iomem * regs = vptr->mac_regs; > - unsigned short vid; > > /* Turn on MCFG_PQEN, turn off MCFG_RTGOPT */ > WORD_REG_BITS_SET(MCFG_PQEN, MCFG_RTGOPT, ®s->MCFG); > @@ -617,29 +616,33 @@ static void velocity_init_cam_filter(struct velocity_info *vptr) > mac_set_vlan_cam_mask(regs, vptr->vCAMmask); > mac_set_cam_mask(regs, vptr->mCAMmask); > > - /* Enable first VCAM */ > + /* Enable VCAMs */ > if (vptr->vlgrp) { > - for (vid = 0; vid < VLAN_VID_MASK; vid++) { > - if (vlan_group_get_device(vptr->vlgrp, vid)) { > - /* If Tagging option is enabled and > - VLAN ID is not zero, then > - turn on MCFG_RTGOPT also */ > - if (vid != 0) > - WORD_REG_BITS_ON(MCFG_RTGOPT, ®s->MCFG); > + unsigned int vid, i = 0; > + > + if (!vlan_group_get_device(vptr->vlgrp, 0)) > + WORD_REG_BITS_ON(MCFG_RTGOPT, ®s->MCFG); > > - mac_set_vlan_cam(regs, 0, (u8 *) &vid); > + for (vid = 1; (vid < VLAN_VID_MASK); vid++) { > + if (vlan_group_get_device(vptr->vlgrp, vid)) { > + mac_set_vlan_cam(regs, i, (u8 *) &vid); > + vptr->vCAMmask[i / 8] |= 0x1 << (i % 8); > + if (++i >= VCAM_SIZE) > + break; > } > } > - vptr->vCAMmask[0] |= 1; > mac_set_vlan_cam_mask(regs, vptr->vCAMmask); > - } else { > - u16 temp = 0; > - mac_set_vlan_cam(regs, 0, (u8 *) &temp); > - temp = 1; > - mac_set_vlan_cam_mask(regs, (u8 *) &temp); > } > } > > +static void velocity_vlan_rx_register(struct net_device *dev, > + struct vlan_group *grp) > +{ > + struct velocity_info *vptr = netdev_priv(dev); > + > + vptr->vlgrp = grp; > +} > + > static void velocity_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) > { > struct velocity_info *vptr = netdev_priv(dev); > @@ -959,11 +962,13 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi > > dev->vlan_rx_add_vid = velocity_vlan_rx_add_vid; > dev->vlan_rx_kill_vid = velocity_vlan_rx_kill_vid; > + dev->vlan_rx_register = velocity_vlan_rx_register; > > #ifdef VELOCITY_ZERO_COPY_SUPPORT > dev->features |= NETIF_F_SG; > #endif > - dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_FILTER; > + dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_FILTER | > + NETIF_F_HW_VLAN_RX; > > if (vptr->flags & VELOCITY_FLAGS_TX_CSUM) > dev->features |= NETIF_F_IP_CSUM; > @@ -1597,8 +1602,13 @@ static int velocity_receive_frame(struct velocity_info *vptr, int idx) > skb_put(skb, pkt_len - 4); > skb->protocol = eth_type_trans(skb, vptr->dev); > > + if (vptr->vlgrp && (rd->rdesc0.RSR & RSR_DETAG)) { > + vlan_hwaccel_rx(skb, vptr->vlgrp, > + swab16(le16_to_cpu(rd->rdesc1.PQTAG)); > + } else > + netif_rx(skb); > + > stats->rx_bytes += pkt_len; > - netif_rx(skb); >
applied -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
Messages in current thread:
[PATCH] via-velocity: fix vlan receipt
, Francois Romieu
, (Thu Apr 24, 5:32 pm)
Re: [PATCH] via-velocity: fix vlan receipt
, Jeff Garzik
, (Fri Apr 25, 1:47 am)
Navigation
Create content
Mailing list archives
Recent posts
Mail archive search
Enter your search terms.
all mailing lists
alsa-devel
dragonflybsd-bugs
dragonflybsd-commit
dragonflybsd-docs
dragonflybsd-kernel
dragonflybsd-submit
dragonflybsd-user
freebsd-announce
freebsd-bugs
freebsd-chat
freebsd-cluster
freebsd-current
freebsd-drivers
freebsd-embeded
freebsd-fs
freebsd-hackers
freebsd-hardware
freebsd-mobile
freebsd-net
freebsd-performance
freebsd-pf
freebsd-security
freebsd-security-notifications
freebsd-threads
git
git-commits-head
linux-activists
linux-arm
linux-ath5k-devel
linux-btrfs
linux-c-programming
linux-driver-devel
linux-ext4
linux-fsdevel
linux-ia64
linux-input
linux-kernel
linux-kernel-janitors
linux-kernel-mentors
linux-kernel-newbies
linux-kvm
linux-net
linux-netdev
linux-newbie
linux-nfs
linux-raid
linux-scsi
linux-security-module
linux-sparse
linux-usb
linux-usb-devel
madwifi-devel
netbsd-announce
netbsd-tech-kern
open-graphics
open-graphics-announce-kt
openbsd-announce
openbsd-bugs
openbsd-ipv6
openbsd-misc
openbsd-security-announce
openbsd-smp
openbsd-source-changes
openbsd-tech
openfabrics-general
openmoko-community
openmoko-devel
openmoko-kernel
reiserfs-devel
tux3
ucarp
Optionally limit your search to a specific mailing list.
advanced
Popular discussions
linux-kernel
:
Vu Pham
Re: [Scst-devel] Integration of SCST in the mainstream Linux kernel
Quentin Godfroy
possible (ext4 related?) memory leak in kernel 2.6.26
Kentaro Takeda
[TOMOYO #9 (2.6.27-rc7-mm1) 1/6] LSM adapter functions.
Greg Kroah-Hartman
[PATCH 004/196] Chinese: add translation of SubmittingPatches
git
:
Nguyễn Thái Ngọc
[PATCH] git-grep: add --color to highlight matches
Michael Donaghy
Git Screencast ?
Sam Song
Re: Fwd: [OT] Re: Git via a proxy server?
Seth Falcon
git-svn, remote tracking branch question
linux-netdev
:
Volker Armin Hemmann
build error with 2.6.27.6+reiser4+ehci-hub patch. ERROR: "mii_ethtool_gset" [drive...
David Madore
atl1e Ethernet driver not seeing packets sent to 33:33:00:00:00:01 multicast
David Miller
Re: [GIT PULL] [IPV6] COMPAT: Fix SSM applications on 64bit kernels.
Roel Kluin
[PATCH 1] net: fix and typo's
openbsd-misc
:
GVG GVG
ssh_exchange_identification: Connection closed by remote host
Richard Stallman
Real men don't attack straw men
askthelist
Packets Per Second Limit?
Sean Darby
Instant Messenger (CLI-based multi-protocol)
Latest forum posts
Netfilter kernel module
7 hours ago
Linux kernel
serial driver xmit problem
10 hours ago
Linux kernel
Why Windows is better than Linux
10 hours ago
Linux general
How can I see my kernel messages in vt12?
17 hours ago
Linux kernel
Grub
1 day ago
Linux general
vmalloc_fault handling in x86_64
1 day ago
Linux kernel
epoll_wait()ing on epoll FD
1 day ago
Linux kernel
Framebuffer in x86_64 causes problems to multiseat
1 day ago
Linux kernel
Difference between 2.4 and 2.6 regarding thread creation
1 day ago
Linux general
Compiling gfs2 on kernel 2.6.27
2 days ago
Linux kernel
Show all forums...
Recent Tags
more tags
Colocation donated by:
Who's online
There are currently
3 users
and
812 guests
online.
Online users
theuni
Jeremy
Mr_Z
Syndicate
speck-geostationary