diff options
Diffstat (limited to 'drivers/infiniband/ulp')
| -rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_ib.c | 12 | ||||
| -rw-r--r-- | drivers/infiniband/ulp/srpt/ib_srpt.c | 15 | 
2 files changed, 18 insertions, 9 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 5c1bc995e56..f10221f4080 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c @@ -123,7 +123,7 @@ static void ipoib_ud_skb_put_frags(struct ipoib_dev_priv *priv,  		skb_frag_size_set(frag, size);  		skb->data_len += size; -		skb->truesize += size; +		skb->truesize += PAGE_SIZE;  	} else  		skb_put(skb, length); @@ -156,14 +156,18 @@ static struct sk_buff *ipoib_alloc_rx_skb(struct net_device *dev, int id)  	struct ipoib_dev_priv *priv = netdev_priv(dev);  	struct sk_buff *skb;  	int buf_size; +	int tailroom;  	u64 *mapping; -	if (ipoib_ud_need_sg(priv->max_ib_mtu)) +	if (ipoib_ud_need_sg(priv->max_ib_mtu)) {  		buf_size = IPOIB_UD_HEAD_SIZE; -	else +		tailroom = 128; /* reserve some tailroom for IP/TCP headers */ +	} else {  		buf_size = IPOIB_UD_BUF_SIZE(priv->max_ib_mtu); +		tailroom = 0; +	} -	skb = dev_alloc_skb(buf_size + 4); +	skb = dev_alloc_skb(buf_size + tailroom + 4);  	if (unlikely(!skb))  		return NULL; diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index 5f6b7f63cde..7a0ce8d4288 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -1377,10 +1377,14 @@ static int srpt_abort_cmd(struct srpt_send_ioctx *ioctx)  		break;  	case SRPT_STATE_NEED_DATA:  		/* DMA_TO_DEVICE (write) - RDMA read error. */ + +		/* XXX(hch): this is a horrible layering violation.. */  		spin_lock_irqsave(&ioctx->cmd.t_state_lock, flags);  		ioctx->cmd.transport_state |= CMD_T_LUN_STOP; +		ioctx->cmd.transport_state &= ~CMD_T_ACTIVE;  		spin_unlock_irqrestore(&ioctx->cmd.t_state_lock, flags); -		transport_generic_handle_data(&ioctx->cmd); + +		complete(&ioctx->cmd.transport_lun_stop_comp);  		break;  	case SRPT_STATE_CMD_RSP_SENT:  		/* @@ -1463,9 +1467,10 @@ static void srpt_handle_send_comp(struct srpt_rdma_ch *ch,  /**   * srpt_handle_rdma_comp() - Process an IB RDMA completion notification.   * - * Note: transport_generic_handle_data() is asynchronous so unmapping the - * data that has been transferred via IB RDMA must be postponed until the - * check_stop_free() callback. + * XXX: what is now target_execute_cmd used to be asynchronous, and unmapping + * the data that has been transferred via IB RDMA had to be postponed until the + * check_stop_free() callback.  None of this is nessecary anymore and needs to + * be cleaned up.   */  static void srpt_handle_rdma_comp(struct srpt_rdma_ch *ch,  				  struct srpt_send_ioctx *ioctx, @@ -1477,7 +1482,7 @@ static void srpt_handle_rdma_comp(struct srpt_rdma_ch *ch,  	if (opcode == SRPT_RDMA_READ_LAST) {  		if (srpt_test_and_set_cmd_state(ioctx, SRPT_STATE_NEED_DATA,  						SRPT_STATE_DATA_IN)) -			transport_generic_handle_data(&ioctx->cmd); +			target_execute_cmd(&ioctx->cmd);  		else  			printk(KERN_ERR "%s[%d]: wrong state = %d\n", __func__,  			       __LINE__, srpt_get_cmd_state(ioctx));  |