From patchwork Wed Jul 20 19:38:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Or Gerlitz X-Patchwork-Id: 992962 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6KJbuCH001078 for ; Wed, 20 Jul 2011 19:39:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751227Ab1GTTjQ (ORCPT ); Wed, 20 Jul 2011 15:39:16 -0400 Received: from mail.mellanox.co.il ([194.90.237.43]:50757 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751178Ab1GTTjQ (ORCPT ); Wed, 20 Jul 2011 15:39:16 -0400 Received: from Internal Mail-Server by MTLPINE2 (envelope-from ogerlitz@mellanox.com) with SMTP; 20 Jul 2011 22:39:14 +0300 Received: from MTRCASDAG01.mtl.com (172.25.0.174) by MTLCAS02.mtl.com (10.0.8.72) with Microsoft SMTP Server (TLS) id 14.1.289.1; Wed, 20 Jul 2011 22:39:13 +0300 Received: from host217 (172.25.5.217) by MTRCASDAG01.mtl.com (172.25.0.174) with Microsoft SMTP Server (TLS) id 14.1.289.1; Wed, 20 Jul 2011 22:39:13 +0300 Date: Wed, 20 Jul 2011 22:38:58 +0300 From: Or Gerlitz X-X-Sender: ogerlitz@ogerlitz.voltaire.com To: Roland Dreier CC: linux-rdma , Jason Gunthorpe , Sean Hefty Subject: [PATCH V1 3/7] libibverbs: add GID change event In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (LRH 1167 2008-08-23) MIME-Version: 1.0 X-Originating-IP: [172.25.5.217] Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 20 Jul 2011 19:39:17 +0000 (UTC) Add IB GID change event which is generated by the kernel IBoE stack when the HW driver updates the GID table. Signed-off-by: Or Gerlitz Signed-off-by: Eli Cohen --- changes from V0: - applied feedback from Jason, added entry to ibv_event_type_str examples/asyncwatch.c | 2 ++ include/infiniband/verbs.h | 3 ++- man/ibv_get_async_event.3 | 2 ++ src/enum_strs.c | 3 ++- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/asyncwatch.c b/examples/asyncwatch.c index 5510a29..da7ebd4 100644 --- a/examples/asyncwatch.c +++ b/examples/asyncwatch.c @@ -57,6 +57,8 @@ static const char *event_name_str(enum ibv_event_type event_type) return "IBV_EVENT_SM_CHANGE"; case IBV_EVENT_CLIENT_REREGISTER: return "IBV_EVENT_CLIENT_REREGISTER"; + case IBV_EVENT_GID_CHANGE: + return "IBV_EVENT_GID_CHANGE"; case IBV_EVENT_CQ_ERR: case IBV_EVENT_QP_FATAL: diff --git a/include/infiniband/verbs.h b/include/infiniband/verbs.h index d1a3e47..4892d12 100644 --- a/include/infiniband/verbs.h +++ b/include/infiniband/verbs.h @@ -209,7 +209,8 @@ enum ibv_event_type { IBV_EVENT_SRQ_ERR, IBV_EVENT_SRQ_LIMIT_REACHED, IBV_EVENT_QP_LAST_WQE_REACHED, - IBV_EVENT_CLIENT_REREGISTER + IBV_EVENT_CLIENT_REREGISTER, + IBV_EVENT_GID_CHANGE, }; struct ibv_async_event { diff --git a/man/ibv_get_async_event.3 b/man/ibv_get_async_event.3 index acb6257..a76dc0c 100644 --- a/man/ibv_get_async_event.3 +++ b/man/ibv_get_async_event.3 @@ -81,6 +81,8 @@ following events: .B IBV_EVENT_SM_CHANGE \fR SM was changed on a port .TP .B IBV_EVENT_CLIENT_REREGISTER \fR SM sent a CLIENT_REREGISTER request to a port +.TP +.B IBV_EVENT_GID_CHANGE \fR GID table was changed on a port .PP .I CA events: .TP diff --git a/src/enum_strs.c b/src/enum_strs.c index c57feaa..54d71a6 100644 --- a/src/enum_strs.c +++ b/src/enum_strs.c @@ -85,9 +85,10 @@ const char *ibv_event_type_str(enum ibv_event_type event) [IBV_EVENT_SRQ_LIMIT_REACHED] = "SRQ limit reached", [IBV_EVENT_QP_LAST_WQE_REACHED] = "last WQE reached", [IBV_EVENT_CLIENT_REREGISTER] = "client reregistration", + [IBV_EVENT_GID_CHANGE] = "GID table change" }; - if (event < IBV_EVENT_CQ_ERR || event > IBV_EVENT_CLIENT_REREGISTER) + if (event < IBV_EVENT_CQ_ERR || event > IBV_EVENT_GID_CHANGE) return "unknown"; return event_type_str[event];