]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/net/ixgbe/ixgbe_fcoe.c
ixgbe: make sure FCoE DDP user buffers are really released by the HW
[net-next-2.6.git] / drivers / net / ixgbe / ixgbe_fcoe.c
index 26dd27479e2c6cc82cbca0317cae8b405653eb8d..6342d4859790804a83981f65175d7653bb3f19a5 100644 (file)
@@ -92,6 +92,7 @@ int ixgbe_fcoe_ddp_put(struct net_device *netdev, u16 xid)
        struct ixgbe_fcoe *fcoe;
        struct ixgbe_adapter *adapter;
        struct ixgbe_fcoe_ddp *ddp;
+       u32 fcbuff;
 
        if (!netdev)
                goto out_ddp_put;
@@ -115,7 +116,14 @@ int ixgbe_fcoe_ddp_put(struct net_device *netdev, u16 xid)
                IXGBE_WRITE_REG(&adapter->hw, IXGBE_FCBUFF, 0);
                IXGBE_WRITE_REG(&adapter->hw, IXGBE_FCDMARW,
                                (xid | IXGBE_FCDMARW_WE));
+
+               /* guaranteed to be invalidated after 100us */
+               IXGBE_WRITE_REG(&adapter->hw, IXGBE_FCDMARW,
+                               (xid | IXGBE_FCDMARW_RE));
+               fcbuff = IXGBE_READ_REG(&adapter->hw, IXGBE_FCBUFF);
                spin_unlock_bh(&fcoe->lock);
+               if (fcbuff & IXGBE_FCBUFF_VALID)
+                       udelay(100);
        }
        if (ddp->sgl)
                pci_unmap_sg(adapter->pdev, ddp->sgl, ddp->sgc,