]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[karo-tx-linux.git] / drivers / net / ethernet / broadcom / bnx2x / bnx2x_sriov.c
index ad83f4b4877761f73ed2ff790a9fef26b6bbd9b1..fbc026c4cab2d7d3b100c635f95c6dc295cd44b3 100644 (file)
@@ -491,12 +491,20 @@ static inline void bnx2x_vfop_credit(struct bnx2x *bp,
         * and a valid credit counter
         */
        if (!vfop->rc && args->credit) {
-               int cnt = 0;
                struct list_head *pos;
+               int read_lock;
+               int cnt = 0;
+
+               read_lock = bnx2x_vlan_mac_h_read_lock(bp, obj);
+               if (read_lock)
+                       DP(BNX2X_MSG_SP, "Failed to take vlan mac read head; continuing anyway\n");
 
                list_for_each(pos, &obj->head)
                        cnt++;
 
+               if (!read_lock)
+                       bnx2x_vlan_mac_h_read_unlock(bp, obj);
+
                atomic_set(args->credit, cnt);
        }
 }