提交 77b1f996 编写于 作者: J Jason Gunthorpe 提交者: Doug Ledford

IB/ipoib: Remove ib_get_dma_mr calls

The pd now has a local_dma_lkey member which completely replaces
ib_get_dma_mr, use it instead.
Signed-off-by: NJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 4be90bc6
...@@ -342,7 +342,6 @@ struct ipoib_dev_priv { ...@@ -342,7 +342,6 @@ struct ipoib_dev_priv {
u16 pkey; u16 pkey;
u16 pkey_index; u16 pkey_index;
struct ib_pd *pd; struct ib_pd *pd;
struct ib_mr *mr;
struct ib_cq *recv_cq; struct ib_cq *recv_cq;
struct ib_cq *send_cq; struct ib_cq *send_cq;
struct ib_qp *qp; struct ib_qp *qp;
......
...@@ -332,7 +332,7 @@ static void ipoib_cm_init_rx_wr(struct net_device *dev, ...@@ -332,7 +332,7 @@ static void ipoib_cm_init_rx_wr(struct net_device *dev,
int i; int i;
for (i = 0; i < priv->cm.num_frags; ++i) for (i = 0; i < priv->cm.num_frags; ++i)
sge[i].lkey = priv->mr->lkey; sge[i].lkey = priv->pd->local_dma_lkey;
sge[0].length = IPOIB_CM_HEAD_SIZE; sge[0].length = IPOIB_CM_HEAD_SIZE;
for (i = 1; i < priv->cm.num_frags; ++i) for (i = 1; i < priv->cm.num_frags; ++i)
......
...@@ -152,12 +152,6 @@ int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca) ...@@ -152,12 +152,6 @@ int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca)
return -ENODEV; return -ENODEV;
} }
priv->mr = ib_get_dma_mr(priv->pd, IB_ACCESS_LOCAL_WRITE);
if (IS_ERR(priv->mr)) {
printk(KERN_WARNING "%s: ib_get_dma_mr failed\n", ca->name);
goto out_free_pd;
}
/* /*
* the various IPoIB tasks assume they will never race against * the various IPoIB tasks assume they will never race against
* themselves, so always use a single thread workqueue * themselves, so always use a single thread workqueue
...@@ -165,7 +159,7 @@ int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca) ...@@ -165,7 +159,7 @@ int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca)
priv->wq = create_singlethread_workqueue("ipoib_wq"); priv->wq = create_singlethread_workqueue("ipoib_wq");
if (!priv->wq) { if (!priv->wq) {
printk(KERN_WARNING "ipoib: failed to allocate device WQ\n"); printk(KERN_WARNING "ipoib: failed to allocate device WQ\n");
goto out_free_mr; goto out_free_pd;
} }
size = ipoib_recvq_size + 1; size = ipoib_recvq_size + 1;
...@@ -225,13 +219,13 @@ int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca) ...@@ -225,13 +219,13 @@ int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca)
priv->dev->dev_addr[3] = (priv->qp->qp_num ) & 0xff; priv->dev->dev_addr[3] = (priv->qp->qp_num ) & 0xff;
for (i = 0; i < MAX_SKB_FRAGS + 1; ++i) for (i = 0; i < MAX_SKB_FRAGS + 1; ++i)
priv->tx_sge[i].lkey = priv->mr->lkey; priv->tx_sge[i].lkey = priv->pd->local_dma_lkey;
priv->tx_wr.opcode = IB_WR_SEND; priv->tx_wr.opcode = IB_WR_SEND;
priv->tx_wr.sg_list = priv->tx_sge; priv->tx_wr.sg_list = priv->tx_sge;
priv->tx_wr.send_flags = IB_SEND_SIGNALED; priv->tx_wr.send_flags = IB_SEND_SIGNALED;
priv->rx_sge[0].lkey = priv->mr->lkey; priv->rx_sge[0].lkey = priv->pd->local_dma_lkey;
priv->rx_sge[0].length = IPOIB_UD_BUF_SIZE(priv->max_ib_mtu); priv->rx_sge[0].length = IPOIB_UD_BUF_SIZE(priv->max_ib_mtu);
priv->rx_wr.num_sge = 1; priv->rx_wr.num_sge = 1;
...@@ -254,9 +248,6 @@ int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca) ...@@ -254,9 +248,6 @@ int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca)
destroy_workqueue(priv->wq); destroy_workqueue(priv->wq);
priv->wq = NULL; priv->wq = NULL;
out_free_mr:
ib_dereg_mr(priv->mr);
out_free_pd: out_free_pd:
ib_dealloc_pd(priv->pd); ib_dealloc_pd(priv->pd);
...@@ -289,9 +280,6 @@ void ipoib_transport_dev_cleanup(struct net_device *dev) ...@@ -289,9 +280,6 @@ void ipoib_transport_dev_cleanup(struct net_device *dev)
priv->wq = NULL; priv->wq = NULL;
} }
if (ib_dereg_mr(priv->mr))
ipoib_warn(priv, "ib_dereg_mr failed\n");
if (ib_dealloc_pd(priv->pd)) if (ib_dealloc_pd(priv->pd))
ipoib_warn(priv, "ib_dealloc_pd failed\n"); ipoib_warn(priv, "ib_dealloc_pd failed\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册