Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 184
b: refs/heads/master
c: d0a9d25
h: refs/heads/master
v: v3
  • Loading branch information
Michael S. Tsirkin authored and Linus Torvalds committed Apr 16, 2005
1 parent aa86476 commit abd7722
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0fabd9fb7bdc935f121e6950a2c4eff971dd4c75
refs/heads/master: d0a9d25cdcd511dd523357bc902979220dc72a2e
28 changes: 24 additions & 4 deletions trunk/drivers/infiniband/hw/mthca/mthca_mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,20 +198,40 @@ static void mthca_free_mtt(struct mthca_dev *dev, u32 seg, int order,
seg + (1 << order) - 1);
}

static inline u32 tavor_hw_index_to_key(u32 ind)
{
return ind;
}

static inline u32 tavor_key_to_hw_index(u32 key)
{
return key;
}

static inline u32 arbel_hw_index_to_key(u32 ind)
{
return (ind >> 24) | (ind << 8);
}

static inline u32 arbel_key_to_hw_index(u32 key)
{
return (key << 24) | (key >> 8);
}

static inline u32 hw_index_to_key(struct mthca_dev *dev, u32 ind)
{
if (dev->hca_type == ARBEL_NATIVE)
return (ind >> 24) | (ind << 8);
return arbel_hw_index_to_key(ind);
else
return ind;
return tavor_hw_index_to_key(ind);
}

static inline u32 key_to_hw_index(struct mthca_dev *dev, u32 key)
{
if (dev->hca_type == ARBEL_NATIVE)
return (key << 24) | (key >> 8);
return arbel_key_to_hw_index(key);
else
return key;
return tavor_key_to_hw_index(key);
}

int mthca_mr_alloc_notrans(struct mthca_dev *dev, u32 pd,
Expand Down

0 comments on commit abd7722

Please sign in to comment.