Subject: Re: [PATCH v2.6.33 2/2] jme: Adding lock to protect vlgrp structure.

From: "Guo-Fu Tseng" <[email-masked]>
Date: Tue, 16 Mar 2010 03:13:33 +0800

Hi Laurent:

The vlan_rx_register is called through ioctl.
And the packet feeding is called in the tasklet.
I see no lock in register_vlan_dev(), register_vlan_device(), and vlan_ioctl_handler()
which is related to the vlan_hwaccel_receive_skb(), vlan_hwaccel_rx().

It prevents the vlgrp pointer be modified while trying to feed the packet.
Ex:
> if (jme->vlgrp) {
True.
vlan_rx_register called, vlgrp set to NULL.
>         jme->jme_vlan_rx(skb, jme->vlgrp,
>                          le16_to_cpu(rxdesc->descwb.vlan));
passing vlgrp with the value "NULL" to jme_vlan_rx.
Or it might even be modified during the vlan_hwaccel_{receive_skb|rx} call.

Please correct me if I'm wrong.

On Mon, 15 Mar 2010 11:22:48 -0700, Laurent Chavey wrote
> what does the spinlock protect ?
> 

--
Guo-Fu Tseng