diff options
author | Shirley Ma <mashirle@us.ibm.com> | 2008-04-23 14:55:45 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2008-04-23 14:55:45 -0400 |
commit | bc7b3a36ba02e4053ca38653e6a753082d9add03 (patch) | |
tree | 28fe1daa7cab6c7cab71bbc7af22ee6ca7746323 /drivers/infiniband/ulp/ipoib/ipoib_verbs.c | |
parent | bc5698f3ecc9587e1edb343a2878f8d228c49e0e (diff) |
IPoIB: Handle 4K IB MTU for UD (datagram) mode
This patch enables IPoIB to use 4K UD messages (when the underlying
device and fabrics support a 4K MTU) by using two scatter buffers when
PAGE_SIZE is less than or equal to thhe HCA IB MTU size. The first
buffer is for IPoIB header + GRH header, and the second buffer is the
IPoIB payload, which is 4K-4.
Signed-off-by: Shirley Ma <xma@us.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib_verbs.c')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_verbs.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c index 8a20e3742c43..07c03f178a49 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c | |||
@@ -150,7 +150,7 @@ int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca) | |||
150 | .max_send_wr = ipoib_sendq_size, | 150 | .max_send_wr = ipoib_sendq_size, |
151 | .max_recv_wr = ipoib_recvq_size, | 151 | .max_recv_wr = ipoib_recvq_size, |
152 | .max_send_sge = 1, | 152 | .max_send_sge = 1, |
153 | .max_recv_sge = 1 | 153 | .max_recv_sge = IPOIB_UD_RX_SG |
154 | }, | 154 | }, |
155 | .sq_sig_type = IB_SIGNAL_ALL_WR, | 155 | .sq_sig_type = IB_SIGNAL_ALL_WR, |
156 | .qp_type = IB_QPT_UD | 156 | .qp_type = IB_QPT_UD |
@@ -215,6 +215,19 @@ int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca) | |||
215 | priv->tx_wr.sg_list = priv->tx_sge; | 215 | priv->tx_wr.sg_list = priv->tx_sge; |
216 | priv->tx_wr.send_flags = IB_SEND_SIGNALED; | 216 | priv->tx_wr.send_flags = IB_SEND_SIGNALED; |
217 | 217 | ||
218 | priv->rx_sge[0].lkey = priv->mr->lkey; | ||
219 | if (ipoib_ud_need_sg(priv->max_ib_mtu)) { | ||
220 | priv->rx_sge[0].length = IPOIB_UD_HEAD_SIZE; | ||
221 | priv->rx_sge[1].length = PAGE_SIZE; | ||
222 | priv->rx_sge[1].lkey = priv->mr->lkey; | ||
223 | priv->rx_wr.num_sge = IPOIB_UD_RX_SG; | ||
224 | } else { | ||
225 | priv->rx_sge[0].length = IPOIB_UD_BUF_SIZE(priv->max_ib_mtu); | ||
226 | priv->rx_wr.num_sge = 1; | ||
227 | } | ||
228 | priv->rx_wr.next = NULL; | ||
229 | priv->rx_wr.sg_list = priv->rx_sge; | ||
230 | |||
218 | return 0; | 231 | return 0; |
219 | 232 | ||
220 | out_free_cq: | 233 | out_free_cq: |