diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-10 20:23:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-10 20:23:52 -0400 |
commit | 5a92d635bec814fb53595fc80488765bc0d4ff0e (patch) | |
tree | 73b06c82859b4a36ab31082e7dfa7fab6e42dc64 | |
parent | e676853c8c3f77166c03f1eea7dab6e854eeb819 (diff) | |
parent | 6371ea3d48e17d4638a91a4a1e0364e56204e418 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
IPoIB/cm: Fix DMA direction typo
IB/iser: Don't defer connection failure notification to workqueue
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_cm.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/ulp/iser/iscsi_iser.h | 1 | ||||
-rw-r--r-- | drivers/infiniband/ulp/iser/iser_verbs.c | 40 |
3 files changed, 17 insertions, 26 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c index e70492db74f6..2b242a4823f8 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c | |||
@@ -131,7 +131,7 @@ static struct sk_buff *ipoib_cm_alloc_rx_skb(struct net_device *dev, int id, int | |||
131 | skb_fill_page_desc(skb, i, page, 0, PAGE_SIZE); | 131 | skb_fill_page_desc(skb, i, page, 0, PAGE_SIZE); |
132 | 132 | ||
133 | mapping[i + 1] = ib_dma_map_page(priv->ca, skb_shinfo(skb)->frags[i].page, | 133 | mapping[i + 1] = ib_dma_map_page(priv->ca, skb_shinfo(skb)->frags[i].page, |
134 | 0, PAGE_SIZE, DMA_TO_DEVICE); | 134 | 0, PAGE_SIZE, DMA_FROM_DEVICE); |
135 | if (unlikely(ib_dma_mapping_error(priv->ca, mapping[i + 1]))) | 135 | if (unlikely(ib_dma_mapping_error(priv->ca, mapping[i + 1]))) |
136 | goto partial_error; | 136 | goto partial_error; |
137 | } | 137 | } |
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h index cae8c96a55f8..8960196ffb0f 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.h +++ b/drivers/infiniband/ulp/iser/iscsi_iser.h | |||
@@ -245,7 +245,6 @@ struct iser_conn { | |||
245 | wait_queue_head_t wait; /* waitq for conn/disconn */ | 245 | wait_queue_head_t wait; /* waitq for conn/disconn */ |
246 | atomic_t post_recv_buf_count; /* posted rx count */ | 246 | atomic_t post_recv_buf_count; /* posted rx count */ |
247 | atomic_t post_send_buf_count; /* posted tx count */ | 247 | atomic_t post_send_buf_count; /* posted tx count */ |
248 | struct work_struct comperror_work; /* conn term sleepable ctx*/ | ||
249 | char name[ISER_OBJECT_NAME_SIZE]; | 248 | char name[ISER_OBJECT_NAME_SIZE]; |
250 | struct iser_page_vec *page_vec; /* represents SG to fmr maps* | 249 | struct iser_page_vec *page_vec; /* represents SG to fmr maps* |
251 | * maps serialized as tx is*/ | 250 | * maps serialized as tx is*/ |
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c index 693b77002897..1fc967464a28 100644 --- a/drivers/infiniband/ulp/iser/iser_verbs.c +++ b/drivers/infiniband/ulp/iser/iser_verbs.c | |||
@@ -48,7 +48,6 @@ | |||
48 | 48 | ||
49 | static void iser_cq_tasklet_fn(unsigned long data); | 49 | static void iser_cq_tasklet_fn(unsigned long data); |
50 | static void iser_cq_callback(struct ib_cq *cq, void *cq_context); | 50 | static void iser_cq_callback(struct ib_cq *cq, void *cq_context); |
51 | static void iser_comp_error_worker(struct work_struct *work); | ||
52 | 51 | ||
53 | static void iser_cq_event_callback(struct ib_event *cause, void *context) | 52 | static void iser_cq_event_callback(struct ib_event *cause, void *context) |
54 | { | 53 | { |
@@ -480,7 +479,6 @@ int iser_conn_init(struct iser_conn **ibconn) | |||
480 | init_waitqueue_head(&ib_conn->wait); | 479 | init_waitqueue_head(&ib_conn->wait); |
481 | atomic_set(&ib_conn->post_recv_buf_count, 0); | 480 | atomic_set(&ib_conn->post_recv_buf_count, 0); |
482 | atomic_set(&ib_conn->post_send_buf_count, 0); | 481 | atomic_set(&ib_conn->post_send_buf_count, 0); |
483 | INIT_WORK(&ib_conn->comperror_work, iser_comp_error_worker); | ||
484 | INIT_LIST_HEAD(&ib_conn->conn_list); | 482 | INIT_LIST_HEAD(&ib_conn->conn_list); |
485 | spin_lock_init(&ib_conn->lock); | 483 | spin_lock_init(&ib_conn->lock); |
486 | 484 | ||
@@ -753,26 +751,6 @@ int iser_post_send(struct iser_desc *tx_desc) | |||
753 | return ret_val; | 751 | return ret_val; |
754 | } | 752 | } |
755 | 753 | ||
756 | static void iser_comp_error_worker(struct work_struct *work) | ||
757 | { | ||
758 | struct iser_conn *ib_conn = | ||
759 | container_of(work, struct iser_conn, comperror_work); | ||
760 | |||
761 | /* getting here when the state is UP means that the conn is being * | ||
762 | * terminated asynchronously from the iSCSI layer's perspective. */ | ||
763 | if (iser_conn_state_comp_exch(ib_conn, ISER_CONN_UP, | ||
764 | ISER_CONN_TERMINATING)) | ||
765 | iscsi_conn_failure(ib_conn->iser_conn->iscsi_conn, | ||
766 | ISCSI_ERR_CONN_FAILED); | ||
767 | |||
768 | /* complete the termination process if disconnect event was delivered * | ||
769 | * note there are no more non completed posts to the QP */ | ||
770 | if (ib_conn->disc_evt_flag) { | ||
771 | ib_conn->state = ISER_CONN_DOWN; | ||
772 | wake_up_interruptible(&ib_conn->wait); | ||
773 | } | ||
774 | } | ||
775 | |||
776 | static void iser_handle_comp_error(struct iser_desc *desc) | 754 | static void iser_handle_comp_error(struct iser_desc *desc) |
777 | { | 755 | { |
778 | struct iser_dto *dto = &desc->dto; | 756 | struct iser_dto *dto = &desc->dto; |
@@ -791,8 +769,22 @@ static void iser_handle_comp_error(struct iser_desc *desc) | |||
791 | } | 769 | } |
792 | 770 | ||
793 | if (atomic_read(&ib_conn->post_recv_buf_count) == 0 && | 771 | if (atomic_read(&ib_conn->post_recv_buf_count) == 0 && |
794 | atomic_read(&ib_conn->post_send_buf_count) == 0) | 772 | atomic_read(&ib_conn->post_send_buf_count) == 0) { |
795 | schedule_work(&ib_conn->comperror_work); | 773 | /* getting here when the state is UP means that the conn is * |
774 | * being terminated asynchronously from the iSCSI layer's * | ||
775 | * perspective. */ | ||
776 | if (iser_conn_state_comp_exch(ib_conn, ISER_CONN_UP, | ||
777 | ISER_CONN_TERMINATING)) | ||
778 | iscsi_conn_failure(ib_conn->iser_conn->iscsi_conn, | ||
779 | ISCSI_ERR_CONN_FAILED); | ||
780 | |||
781 | /* complete the termination process if disconnect event was delivered * | ||
782 | * note there are no more non completed posts to the QP */ | ||
783 | if (ib_conn->disc_evt_flag) { | ||
784 | ib_conn->state = ISER_CONN_DOWN; | ||
785 | wake_up_interruptible(&ib_conn->wait); | ||
786 | } | ||
787 | } | ||
796 | } | 788 | } |
797 | 789 | ||
798 | static void iser_cq_tasklet_fn(unsigned long data) | 790 | static void iser_cq_tasklet_fn(unsigned long data) |