From patchwork Mon Aug 19 21:54:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Coulter, Susan K" X-Patchwork-Id: 2846722 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 04200BF546 for ; Mon, 19 Aug 2013 22:09:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1F87F202E6 for ; Mon, 19 Aug 2013 22:09:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8DBF5201F0 for ; Mon, 19 Aug 2013 22:09:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751183Ab3HSWJF (ORCPT ); Mon, 19 Aug 2013 18:09:05 -0400 Received: from proofpoint5.lanl.gov ([204.121.3.53]:47494 "EHLO proofpoint5.lanl.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751132Ab3HSWJE convert rfc822-to-8bit (ORCPT ); Mon, 19 Aug 2013 18:09:04 -0400 X-Greylist: delayed 876 seconds by postgrey-1.27 at vger.kernel.org; Mon, 19 Aug 2013 18:09:04 EDT Received: from mailrelay2.lanl.gov (mailrelay2.lanl.gov [128.165.4.103]) by mailgate5.lanl.gov (8.14.5/8.14.5) with ESMTP id r7JLsGrk008643; Mon, 19 Aug 2013 15:54:16 -0600 Received: from localhost (localhost.localdomain [127.0.0.1]) by mailrelay2.lanl.gov (Postfix) with ESMTP id A6C2D1123AF1; Mon, 19 Aug 2013 15:54:16 -0600 (MDT) X-NIE-2-Virus-Scanner: amavisd-new at mailrelay2.lanl.gov Received: from ECS-EXG-P-CH03.win.lanl.gov (ecs-exg-p-ch03.win.lanl.gov [128.165.106.13]) by mailrelay2.lanl.gov (Postfix) with ESMTP id 8DDD71123AD3; Mon, 19 Aug 2013 15:54:16 -0600 (MDT) Received: from ECS-EXG-P-MB01.win.lanl.gov ([169.254.1.165]) by ECS-EXG-P-CH03.win.lanl.gov ([128.165.106.13]) with mapi id 14.03.0123.003; Mon, 19 Aug 2013 15:54:16 -0600 From: "Coulter, Susan K" To: "gilr@dev.mellanox.co.il" CC: "linux-rdma (linux-rdma@vger.kernel.org)" Subject: [PATCH perftest] Allow specification of pkey index Thread-Topic: [PATCH perftest] Allow specification of pkey index Thread-Index: AQHOnSalb1xvwvM0HUiw+oZ+b5+Ovw== Date: Mon, 19 Aug 2013 21:54:15 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [128.165.184.250] Content-ID: <68438805E31D2A4F8005BC3926E45F2F@win.lanl.gov> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-08-19_05:2013-08-19, 2013-08-19, 1970-01-01 signatures=0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-9.7 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 Signed-off-by: Susan K. Coulter --- src/perftest_parameters.c | 7 ++++++- src/perftest_parameters.h | 3 +++ src/perftest_resources.c | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/perftest_parameters.c b/src/perftest_parameters.c index 084f16f..0350a54 100755 --- a/src/perftest_parameters.c +++ b/src/perftest_parameters.c @@ -267,6 +267,8 @@ static void usage(const char *argv0,VerbType verb,TestType tst) { if (tst == BW) printf(" -q, --qp= Num of qp's(default %d)\n",DEF_NUM_QPS); + printf(" -Y, --pkey= PKey index to use for QP\n"); + putchar('\n'); } /****************************************************************************** @@ -345,6 +347,7 @@ static void init_perftest_params(struct perftest_parameters *user_param) { user_param->limit_bw = 0; user_param->is_limit_msgrate = OFF; user_param->limit_msgrate = 0; + user_param->pkey = 0; if (user_param->tst == LAT) { user_param->r_flag->unsorted = OFF; @@ -941,9 +944,10 @@ int parser(struct perftest_parameters *user_param,char *argv[], int argc) { { .name = "run_infinitely", .has_arg = 0, .flag = &run_inf_flag, .val = 1 }, { .name = "report_gbits", .has_arg = 0, .flag = &report_fmt_flag, .val = 1}, { .name = "use-srq", .has_arg = 0, .flag = &srq_flag, .val = 1}, + { .name = "pkey", .has_arg = 1, .val = 'Y' }, { 0 } }; - c = getopt_long(argc,argv,"w:y:p:d:i:m:s:n:t:u:S:x:c:q:I:o:M:r:Q:A:l:D:f:B:T:E:J:j:K:k:aFegzRvhbNVCHUOZP",long_options,NULL); + c = getopt_long(argc,argv,"w:y:p:d:i:m:s:n:t:u:S:x:c:q:I:o:M:r:Q:A:l:D:f:B:T:E:J:j:K:k:Y:aFegzRvhbNVCHUOZP",long_options,NULL); if (c == -1) break; @@ -1143,6 +1147,7 @@ int parser(struct perftest_parameters *user_param,char *argv[], int argc) { case 'P': user_param->machine = CLIENT; break; case 'Z': user_param->machine = SERVER; break; case 'v': user_param->mac_fwd = ON; break; + case 'Y': CHECK_VALUE(user_param->pkey,int,MIN_PKEY_IDX,MAX_PKEY_IDX," PKey Index"); break; case 0: break; // required for long options to work. default: fprintf(stderr," Invalid Command or flag.\n"); diff --git a/src/perftest_parameters.h b/src/perftest_parameters.h index 42f6966..2110066 100755 --- a/src/perftest_parameters.h +++ b/src/perftest_parameters.h @@ -135,6 +135,8 @@ #define MIN_CQ_MOD (1) #define MAX_CQ_MOD (1024) #define MAX_INLINE (912) +#define MIN_PKEY_IDX (0) +#define MAX_PKEY_IDX (127) // Raw etherent defines #define RAWETH_MIN_MSG_SIZE (64) @@ -291,6 +293,7 @@ struct perftest_parameters { int work_rdma_cm; char *user_mgid; int buff_size; + int pkey; // New test params format pilot. will be used in all flags soon,. enum ctx_test_method test_method; enum ibv_transport_type transport_type; diff --git a/src/perftest_resources.c b/src/perftest_resources.c index 2ddddd1..4323734 100755 --- a/src/perftest_resources.c +++ b/src/perftest_resources.c @@ -619,7 +619,7 @@ int ctx_modify_qp_to_init(struct ibv_qp *qp,struct perftest_parameters *user_par memset(&attr, 0, sizeof(struct ibv_qp_attr)); attr.qp_state = IBV_QPS_INIT; - attr.pkey_index = 0; + attr.pkey_index = user_param->pkey; if ( user_param->use_xrc && (user_param->duplex || user_param->tst == LAT)) { num_of_qps /= 2;