From patchwork Mon Dec 7 17:22:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 65556 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nB7HKr8j002174 for ; Mon, 7 Dec 2009 17:20:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964817AbZLGRUp (ORCPT ); Mon, 7 Dec 2009 12:20:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S935423AbZLGRUp (ORCPT ); Mon, 7 Dec 2009 12:20:45 -0500 Received: from mail.mellanox.co.il ([194.90.237.43]:44043 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935407AbZLGRUo (ORCPT ); Mon, 7 Dec 2009 12:20:44 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from eli@mellanox.co.il) with SMTP; 7 Dec 2009 19:29:32 +0200 Received: from localhost ([10.4.1.30]) by mtlexch01.mtl.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 7 Dec 2009 19:20:42 +0200 Date: Mon, 7 Dec 2009 19:22:10 +0200 From: Eli Cohen To: Roland Dreier Cc: Linux RDMA list , ewg Subject: [PATCH] IPoIB: synchronize timer deletion with completion handler Message-ID: <20091207172210.GA8441@mtls03> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-OriginalArrivalTime: 07 Dec 2009 17:20:42.0399 (UTC) FILETIME=[9AAC32F0:01CA7761] X-TM-AS-Product-Ver: SMEX-8.0.0.1181-6.000.1038-17054.007 X-TM-AS-Result: No--6.132900-8.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h index 753a983..3c6f931 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib.h +++ b/drivers/infiniband/ulp/ipoib/ipoib.h @@ -92,6 +92,7 @@ enum { IPOIB_FLAG_ADMIN_CM = 9, IPOIB_FLAG_UMCAST = 10, IPOIB_FLAG_CSUM = 11, + IPOIB_FLAG_POLL_TIMER = 12, IPOIB_MAX_BACKOFF_SECONDS = 16, diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 8c91d9f..b946a01 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c @@ -481,7 +481,8 @@ void ipoib_send_comp_handler(struct ib_cq *cq, void *dev_ptr) { struct ipoib_dev_priv *priv = netdev_priv(dev_ptr); - mod_timer(&priv->poll_timer, jiffies); + if (test_bit(IPOIB_FLAG_POLL_TIMER, &priv->flags)) + mod_timer(&priv->poll_timer, jiffies); } static inline int post_send(struct ipoib_dev_priv *priv, @@ -860,6 +861,7 @@ int ipoib_ib_dev_stop(struct net_device *dev, int flush) ipoib_dbg(priv, "All sends and receives done.\n"); timeout: + clear_bit(IPOIB_FLAG_POLL_TIMER, &priv->flags); del_timer_sync(&priv->poll_timer); qp_attr.qp_state = IB_QPS_RESET; if (ib_modify_qp(priv->qp, &qp_attr, IB_QP_STATE)) @@ -904,6 +906,7 @@ int ipoib_ib_dev_init(struct net_device *dev, struct ib_device *ca, int port) setup_timer(&priv->poll_timer, ipoib_ib_tx_timer_func, (unsigned long) dev); + set_bit(IPOIB_FLAG_POLL_TIMER, &priv->flags); if (dev->flags & IFF_UP) { if (ipoib_ib_dev_open(dev)) {