lkml.org 
[lkml]   [2012]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[patch net-next 08/16] cxgb3: remove usage of dev->master
    Date
    Signed-off-by: Jiri Pirko <jiri@resnulli.us>
    ---
    drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c | 11 +++++++----
    1 file changed, 7 insertions(+), 4 deletions(-)

    diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
    index 2dbbcbb..28365db 100644
    --- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
    +++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
    @@ -182,14 +182,17 @@ static struct net_device *get_iff_from_mac(struct adapter *adapter,
    struct net_device *dev = adapter->port[i];

    if (!memcmp(dev->dev_addr, mac, ETH_ALEN)) {
    + rcu_read_lock();
    if (vlan && vlan != VLAN_VID_MASK) {
    - rcu_read_lock();
    dev = __vlan_find_dev_deep(dev, vlan);
    - rcu_read_unlock();
    } else if (netif_is_bond_slave(dev)) {
    - while (dev->master)
    - dev = dev->master;
    + struct net_device *upper_dev;
    +
    + while ((upper_dev =
    + netdev_unique_upper_dev_get_rcu(dev)))
    + dev = upper_dev;
    }
    + rcu_read_unlock();
    return dev;
    }
    }
    --
    1.7.10.4


    \
     
     \ /
      Last update: 2012-08-13 19:03    [W:0.035 / U:0.132 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site