ixgbe: Remove the multicast spinlock
authorFrançois Tigeot <ftigeot@wolfpond.org>
Tue, 14 Aug 2012 09:25:19 +0000 (11:25 +0200)
committerFrançois Tigeot <ftigeot@wolfpond.org>
Tue, 14 Aug 2012 20:44:36 +0000 (22:44 +0200)
Multicast read/write is serialized by netisr0, there is no need to
add another protection layer.

Advised-by: Sepherosa Ziehau
sys/dev/netif/ixgbe/ixgbe.c
sys/dev/netif/ixgbe/ixgbe.h

index 2ced28d..2361af6 100644 (file)
@@ -418,7 +418,6 @@ ixgbe_attach(device_t dev)
 
        /* Core Lock Init*/
        IXGBE_CORE_LOCK_INIT(adapter, device_get_nameunit(dev));
 
        /* Core Lock Init*/
        IXGBE_CORE_LOCK_INIT(adapter, device_get_nameunit(dev));
-       spin_init(&adapter->mcast_spin);
 
        /* SYSCTL APIs */
 
 
        /* SYSCTL APIs */
 
@@ -709,7 +708,6 @@ ixgbe_detach(device_t dev)
        kfree(adapter->mta, M_DEVBUF);
        sysctl_ctx_free(&adapter->sysctl_ctx);
        
        kfree(adapter->mta, M_DEVBUF);
        sysctl_ctx_free(&adapter->sysctl_ctx);
        
-       spin_uninit(&adapter->mcast_spin);
        IXGBE_CORE_LOCK_DESTROY(adapter);
        return (0);
 }
        IXGBE_CORE_LOCK_DESTROY(adapter);
        return (0);
 }
@@ -1976,7 +1974,6 @@ ixgbe_set_multi(struct adapter *adapter)
        
        IXGBE_WRITE_REG(&adapter->hw, IXGBE_FCTRL, fctrl);
 
        
        IXGBE_WRITE_REG(&adapter->hw, IXGBE_FCTRL, fctrl);
 
-       spin_lock(&adapter->mcast_spin);
        TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
                if (ifma->ifma_addr->sa_family != AF_LINK)
                        continue;
        TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
                if (ifma->ifma_addr->sa_family != AF_LINK)
                        continue;
@@ -1985,7 +1982,6 @@ ixgbe_set_multi(struct adapter *adapter)
                    IXGBE_ETH_LENGTH_OF_ADDRESS);
                mcnt++;
        }
                    IXGBE_ETH_LENGTH_OF_ADDRESS);
                mcnt++;
        }
-       spin_unlock(&adapter->mcast_spin);
 
        update_ptr = mta;
        ixgbe_update_mc_addr_list(&adapter->hw,
 
        update_ptr = mta;
        ixgbe_update_mc_addr_list(&adapter->hw,
index f510147..1acee05 100644 (file)
@@ -365,7 +365,6 @@ struct adapter {
        int                     if_flags;
 
        struct lock             core_lock;
        int                     if_flags;
 
        struct lock             core_lock;
-       struct spinlock         mcast_spin;
 
        eventhandler_tag        vlan_attach;
        eventhandler_tag        vlan_detach;
 
        eventhandler_tag        vlan_attach;
        eventhandler_tag        vlan_detach;