ixgbe: make sure FCoE DDP user buffers are really released by the HW
When invalidating the DDP context is invalidated, the HW may not be done with the user buffer right away. In which case, we poll the FCBUFF register to check if the buffer valid bit is cleared or not, if not, we wait for max 100us that is guaranteed by the HW. Signed-off-by: Yi Zou <yi.zou@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
parent
8ca371e484
commit
9b55bb0384
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue