diff options
author | Olaf Kirch <okir@lst.de> | 2008-04-29 16:46:53 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2008-04-29 16:46:53 -0400 |
commit | bbdc2821db041fb07ffa52e4a0e1ebb5410790e9 (patch) | |
tree | 1a0757409c89c6236d9c0ffa1eb0f5a63faa2527 /drivers/net/mlx4/mr.c | |
parent | d227fa7288adebe5ba37fa8e4a589c977d4e4a34 (diff) |
mlx4_core: Avoid recycling old FMR R_Keys too soon
When a FMR is unmapped, mlx4 resets the map count to 0, and clears the
upper part of the R_Key which is used as the sequence counter.
This poses a problem for RDS, which uses ib_fmr_unmap as a fence
operation. RDS assumes that after issuing an unmap, the old R_Keys
will be invalid for a "reasonable" period of time. For instance,
Oracle processes uses shared memory buffers allocated from a pool of
buffers. When a process dies, we want to reclaim these buffers -- but
we must make sure there are no pending RDMA operations to/from those
buffers. The only way to achieve that is by using unmap and sync the
TPT.
However, when the sequence count is reset on unmap, there is a high
likelihood that a new mapping will be given the same R_Key that was
issued a few milliseconds ago.
To prevent this, don't reset the sequence count when unmapping a FMR.
Signed-off-by: Olaf Kirch <olaf.kirch@oracle.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/net/mlx4/mr.c')
-rw-r--r-- | drivers/net/mlx4/mr.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/net/mlx4/mr.c b/drivers/net/mlx4/mr.c index 79b317b88c86..cb46446b2691 100644 --- a/drivers/net/mlx4/mr.c +++ b/drivers/net/mlx4/mr.c | |||
@@ -607,15 +607,9 @@ EXPORT_SYMBOL_GPL(mlx4_fmr_enable); | |||
607 | void mlx4_fmr_unmap(struct mlx4_dev *dev, struct mlx4_fmr *fmr, | 607 | void mlx4_fmr_unmap(struct mlx4_dev *dev, struct mlx4_fmr *fmr, |
608 | u32 *lkey, u32 *rkey) | 608 | u32 *lkey, u32 *rkey) |
609 | { | 609 | { |
610 | u32 key; | ||
611 | |||
612 | if (!fmr->maps) | 610 | if (!fmr->maps) |
613 | return; | 611 | return; |
614 | 612 | ||
615 | key = key_to_hw_index(fmr->mr.key); | ||
616 | key &= dev->caps.num_mpts - 1; | ||
617 | *lkey = *rkey = fmr->mr.key = hw_index_to_key(key); | ||
618 | |||
619 | fmr->maps = 0; | 613 | fmr->maps = 0; |
620 | 614 | ||
621 | *(u8 *) fmr->mpt = MLX4_MPT_STATUS_SW; | 615 | *(u8 *) fmr->mpt = MLX4_MPT_STATUS_SW; |