From patchwork Fri Jun 21 18:28:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Chu X-Patchwork-Id: 2763941 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 64BC5C0AB1 for ; Fri, 21 Jun 2013 18:28:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9BEF820258 for ; Fri, 21 Jun 2013 18:28:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 73CA42020F for ; Fri, 21 Jun 2013 18:28:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423580Ab3FUS22 (ORCPT ); Fri, 21 Jun 2013 14:28:28 -0400 Received: from prdiron-3.llnl.gov ([128.15.143.173]:1670 "EHLO prdiron-3.llnl.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423383Ab3FUS20 (ORCPT ); Fri, 21 Jun 2013 14:28:26 -0400 X-Attachments: Received: from auk59.llnl.gov (HELO [134.9.93.24]) ([134.9.93.24]) by prdiron-3.llnl.gov with ESMTP; 21 Jun 2013 11:28:05 -0700 Subject: [PATCH] ibsim: Set issm flag on connect when SIM_SET_ISSM set From: Albert Chu To: linux-rdma@vger.kernel.org Date: Fri, 21 Jun 2013 11:28:05 -0700 Message-Id: <1371839285.19017.136.camel@auk59.llnl.gov> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-19.el5) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When the SIM_SET_ISSM environment variable is set, ibsim did not set the issm bit until after an ibsim connection was complete. This allowed multiple SMs to actively run as the SM on the same port. Signed-off-by: Albert L. Chu --- umad2sim/sim_client.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/umad2sim/sim_client.c b/umad2sim/sim_client.c index eb42a7c..5a04be5 100644 --- a/umad2sim/sim_client.c +++ b/umad2sim/sim_client.c @@ -178,7 +178,10 @@ static int sim_connect(struct sim_client *sc, int id, int qp, char *nodeid) struct sim_client_info info = { 0 }; info.id = id; - info.issm = 0; + if (getenv("SIM_SET_ISSM")) + info.issm = 1; + else + info.issm = 0; info.qp = qp; if (nodeid)