From patchwork Thu Sep 1 07:38:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 12961991 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F11A2ECAAD8 for ; Thu, 1 Sep 2022 07:38:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233803AbiIAHiu (ORCPT ); Thu, 1 Sep 2022 03:38:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234028AbiIAHit (ORCPT ); Thu, 1 Sep 2022 03:38:49 -0400 Received: from esa19.fujitsucc.c3s2.iphmx.com (esa19.fujitsucc.c3s2.iphmx.com [216.71.158.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A63F81108BE for ; Thu, 1 Sep 2022 00:38:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=fujitsu.com; i=@fujitsu.com; q=dns/txt; s=fj1; t=1662017928; x=1693553928; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=Yh26+k6e2xdhTCk+4mj94/mJDxFPrw7W8ddtpMkP2dk=; b=EGdrrLOiPsyQVru+TghK6RVffswlGNqMjoY1HNcYaT/GUoqstQva2P1Y gZZzKBcY1KVvLzjCuhL3PJC669RX9hiT1hCWDZci93h6dgdwvgGOR4jR9 EtY6MNHAd7eXikwjEurbbnSefJQF7QyvFigH1ptdk1JBZXiQzV4QYZAV1 QIHs4sGBvZevsYU0OIz1kv9Kjl0uX738BgaNYrLkyOfb79aMU0C/g8axf USWiFgw4mxV+838BDx2O/O/gpSsL7fnGV2L9vPcdAKB7bVFZsSCLlQQDt 9W2h9tPCIh8BAQHh8T760VAmxhkenoXoNunpZqGBzeVkn4glA+r3FCETb g==; X-IronPort-AV: E=McAfee;i="6500,9779,10456"; a="63721720" X-IronPort-AV: E=Sophos;i="5.93,280,1654527600"; d="scan'208";a="63721720" Received: from mail-os0jpn01lp2112.outbound.protection.outlook.com (HELO JPN01-OS0-obe.outbound.protection.outlook.com) ([104.47.23.112]) by ob1.fujitsucc.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2022 16:38:45 +0900 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jcSkFde5Qx2IrHvU4vFuOb2FvSgtLOAeRP63wRzyABpZtBU3YXotppxkoIgXQId7F0R3yMFoymzMFnx+vPiPHpjO9UzjAz6qzKeQbYRYr2BgYb+Aw5NDIprLAKNvqG9FwI2Rh7qyMk9RqJ3uThakdOPvo9lHjugdirI6z+vbAkynfiYLqqgZTa6F6O/cNiCarQiixIhyH7DLHgdWaiQO3IljVjHifA7aqDfYyrcy1rwRQlRHIamo8/tAjlsWEPgDBlM//ovalUpLvVjbABa1McnDbvZVuwmlo1EDj76oPNIjfcSKOKbydgevDXrg1XaK/GUZ31JklMCFkd5/Z/NMKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Yh26+k6e2xdhTCk+4mj94/mJDxFPrw7W8ddtpMkP2dk=; b=Ud3fukD0JuKqqUN1A6tDRfSIKemj61s4K44drr9zebpPnco4uv3kO11NMIrxHFgE65PU3VuWPOom7IAPgGl9OgiKJBV+Pgj22TJE67dYZjkkxPPMzJ73J2NvSkA0sLECNY9el1bCm91AsTRMF8R8snFkVn3Naei6OQnzxKjtrCucmW1jYtfDSGhuDLH1YrmLzGb7nObrkFN9CdGWUSZ1cz5MjQRplPKhPUz9aD3tbX/pICXFeo+xmREHU0JS8wQfEQvcOTUpUh4nOHAiAIJOm4ZTRnAMNGCRTYzxwEBni4HOxzJgpLDTBKhCbghEl+bpADzO4cdkBwq1jxNZm9MdQQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=fujitsu.com; dmarc=pass action=none header.from=fujitsu.com; dkim=pass header.d=fujitsu.com; arc=none Received: from OS3PR01MB9499.jpnprd01.prod.outlook.com (2603:1096:604:1c8::5) by OS3PR01MB6307.jpnprd01.prod.outlook.com (2603:1096:604:f5::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10; Thu, 1 Sep 2022 07:38:41 +0000 Received: from OS3PR01MB9499.jpnprd01.prod.outlook.com ([fe80::9d81:6e2:6f1:e08e]) by OS3PR01MB9499.jpnprd01.prod.outlook.com ([fe80::9d81:6e2:6f1:e08e%8]) with mapi id 15.20.5588.010; Thu, 1 Sep 2022 07:38:41 +0000 From: "yangx.jy@fujitsu.com" To: "leon@kernel.org" CC: "linux-rdma@vger.kernel.org" , "yangx.jy@fujitsu.com" Subject: [PATCH rdma-core] tests: Pass the specified gid index to u.get_global_route() Thread-Topic: [PATCH rdma-core] tests: Pass the specified gid index to u.get_global_route() Thread-Index: AQHYvdXbWVIpxNgYSUGkgpb55eqB0w== Date: Thu, 1 Sep 2022 07:38:41 +0000 Message-ID: <20220901073836.1573-1-yangx.jy@fujitsu.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.34.1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=fujitsu.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bd9d80e9-dd37-4eab-a89e-08da8becfdfa x-ms-traffictypediagnostic: OS3PR01MB6307:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: oBjvYq5+NGkLEjvnNgkdpIgAX2pZ4pHIL1lCSqRZFbDmMiB31jeIRW+4h6h6JJicws+cKGz9scOgOaZRgv7yxUYjeDKEl1VOlSDnIu2ip789w8NDqEPOWqjuluGzaCckw/2UuEHujYW695BOpu/PPfe5p/GMaXafFQ2H8hYQ9GYrm13mW4entYezCakoaW+BD0EOcVHp5k8IAa15WSyhEWG5t9t5PUl6ewONqNwg4fdkgrCCSZCbJSUfTCNUjX/2GtzuVZYI7BmbK+5464vMDXwECmP639FBL9s0Yl9LA9dEBqzvGnL5Q8L4b1QICcNtYlawH6d/WJLzYaFw0xEi92LIfWXSC9svXSbSXxhlEupsNujxthLnpvqhtGBUznViFUyq6+GD4zzFZg7pUYmrOI2XtOZfykhedvuQU0IjjtluJ2I2gcCJpbHUi1+Hk9U+ITyRIHXdAdugKDRQIkeTLJWkWI4TOhEXxWZuB4LLlmyygRg5xLLCMj2aCwno02wheKAc3tHfAYc9CUvH5D+ssHeQ1WjyptE75oC5YeTUyOPLhcpnb87M/c9mgJgmxzmWmXNrtsiiPtuXlT8CyOQGx+lyranuef5JtbWJ9TcgHs1lNXrdBYONv1j5v3dr0gF+Or+Rm5JFna7u2oIB4AF6TMNUw/VUP7/oOlAGrg9oF9GwsKe9Y0Tn3wFwR/0TiOhopxOGkJLAf/izF/J53PS3GpL9jzsF1fruWftguUy4rrlSZZRYXIbwREpGiATUTqqnF+4Hfsu2/AeLJr7o2i6GIlRSrhbfUoz8Dpap0RCfMfo= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS3PR01MB9499.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(136003)(366004)(376002)(39860400002)(396003)(346002)(1590799006)(85182001)(91956017)(66556008)(83380400001)(71200400001)(64756008)(36756003)(66476007)(4326008)(66946007)(66446008)(6916009)(76116006)(316002)(8676002)(54906003)(41300700001)(26005)(6512007)(86362001)(1580799003)(1076003)(2906002)(6506007)(6486002)(8936002)(2616005)(5660300002)(478600001)(186003)(82960400001)(38100700002)(38070700005)(107886003)(122000001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?eucgb2312_cn?b?aHNYYllNTHVlbXBibWw2dzNF?= =?eucgb2312_cn?b?OThJT0lGSEwwL1lXRyt5c3FBeGJ2SFVKR0VYbDJTWlQ1S3crbW9FbVdNKzkvRnJJ?= =?eucgb2312_cn?b?L2RZcFpmT256Z3hzWWo2K3lmdlF5dWdzbFR3YTRZMjJuOXpuM3Q4dEVoeGNNbmIy?= =?eucgb2312_cn?b?eVBCS1Z3WVZNKzdPcFlLREE1ZVNaeVhjbmpybXlHQ1Fwb0JRdkNVYTJrYXhzdWhE?= =?eucgb2312_cn?b?eXE1OUZDeE9ENmJqMUJnYWVMTlcrcWVKWGdPWURtMWFQd0hpNU5ZcGdMMzdoR3lJ?= =?eucgb2312_cn?b?UDBqZ2tia1d3SGtwdHd6eldQbkRVbHhROGlvZ1Z5bWlmNFZjbmVRVm1UbXBINzdv?= =?eucgb2312_cn?b?SFBLMlVRR2VwaFZSNWEyaXN0bytpdWNOdkVtUFZXWStjUktaVGFaMFVhL0YvMURU?= =?eucgb2312_cn?b?Y2tQTWcwVlJLblhrdVh5UjZJUGY0SkhKVk5mR0YwMldYYThJOEQ3TGkrQmJUdXg4?= =?eucgb2312_cn?b?RXhlakRjcEE2L1lXYzFvSGhabUVyN1ZOdlBDME5EOVEwVHVyYXpueFdLRTdMcktq?= =?eucgb2312_cn?b?RWx0b05idGFZLzJUeTk1b3NoNWxVeW54TUk0dVMvdzJYZU4yeHMwN0Q4aDF3aFhL?= =?eucgb2312_cn?b?cTlYSmVqU1c2cGZTTndCbG8zd2pTQzdEVVJ3aWZsYk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NaMWI0?= =?eucgb2312_cn?b?YlBVWS9VKzR3eDJ6aUtjWmRzdUNSWmFyYktNbU9ZTTZ0VG5PeS9FamdPem84bVRG?= =?eucgb2312_cn?b?K2ZvV2lXRjg2Z0kxK052V0Fwa0laMG1kTEtSZ092UmxTeWtILy9zdEFYbUlpODZo?= =?eucgb2312_cn?b?ZXRXaE1yOERKMEdqQVUzaWlvQkJScHpNTWV0ZW1SM2xsRThrSE1Sc05RT3hibzgy?= =?eucgb2312_cn?b?RXk1NDlxa2YvaGY0QkRiTXJGeEM5dFlzaFZ1ZEdPbERoVnRaZWdDeSsya1N2NlRa?= =?eucgb2312_cn?b?U2pEQWZuNEZnY1pBMWZKVERBK1cvQzN5ZHMreS9Nc3NwVlJ3OEdXK3FFdG9POFYx?= =?eucgb2312_cn?b?OGs0TVNKSzh2b25OYlA1UG1LbEJZY0JCR0VyOTZQQlRIUWtTTWg1UUpWOTJwNEtN?= =?eucgb2312_cn?b?VVpOa0ZyblU0MHVkNGppV3pKSlVxVWdyd25HQTYzbHNtUXJNSkJjSE5ZWjU1WDNq?= =?eucgb2312_cn?b?NUJKVnNxNFUxRkJraFpmM1IzUnozemFic3k3NEV4ZGNheEkxVnRYT25xc2JnNnhy?= =?eucgb2312_cn?b?NGROeDE1TUJmOXNSQ0wzcjE3TWN2NmJ2SjNEZVFMREp2bWlXckh2QUs1SlZHZmJN?= =?eucgb2312_cn?b?WnZ2OE9ONUV0OUdRc1RWbG5UeVJjYUw4cWxxMHp5czR6ZzY4cUR1YXE4NHRTT3dI?= =?eucgb2312_cn?b?UC9wcnpPLzFwQXkxcFZ4dWxsdlE9PQ==?= MIME-Version: 1.0 X-OriginatorOrg: fujitsu.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB9499.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bd9d80e9-dd37-4eab-a89e-08da8becfdfa X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Sep 2022 07:38:41.5639 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a19f121d-81e1-4858-a9d8-736e267fd4c7 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Dha4il/y82WrIL1utN9YqTwpL71KMLWeOrFSuI7y/4vCHzWTvYhYqb4FKa2ZDQyzBRPr5g6ft62kijkGXLAgbA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB6307 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org test_create_ah() or test_destroy_ah() always triggered the following error on SoftRoCE because the specified gid index didn't work. $ bin/run_tests.py --dev rxe_enp0s5 --gid 1 -v tests.test_addr.AHTest.test_create_ah test_create_ah (tests.test_addr.AHTest) Test ibv_create_ah. ... ERROR ====================================================================== ERROR: test_create_ah (tests.test_addr.AHTest) Test ibv_create_ah. ---------------------------------------------------------------------- Traceback (most recent call last): File "/root/rdma-core/tests/test_addr.py", line 51, in test_create_ah raise ex File "/root/rdma-core/tests/test_addr.py", line 47, in test_create_ah AH(pd, attr=ah_attr) File "addr.pyx", line 410, in pyverbs.addr.AH.__init__ pyverbs.pyverbs_error.PyverbsRDMAError: Failed to create AH. Errno: 110, Connection timed out ---------------------------------------------------------------------- Ran 1 test in 1.271s FAILED (errors=1) Try to fix the issue by passing the specified gid index to u.get_global_route(). Signed-off-by: Xiao Yang --- tests/base.py | 4 ++++ tests/test_addr.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/base.py b/tests/base.py index 9229df35..2bf19ff0 100644 --- a/tests/base.py +++ b/tests/base.py @@ -76,6 +76,7 @@ class PyverbsAPITestCase(unittest.TestCase): self.ctx = None self.attr = None self.attr_ex = None + self.gid_index = 0 def setUp(self): """ @@ -93,6 +94,9 @@ class PyverbsAPITestCase(unittest.TestCase): raise unittest.SkipTest('No IB devices found') self.dev_name = dev_list[0].name.decode() + if self.config['gid']: + self.gid_index = self.config['gid'] + self.create_context() self.attr = self.ctx.query_device() self.attr_ex = self.ctx.query_device_ex() diff --git a/tests/test_addr.py b/tests/test_addr.py index 561812de..5b6c5efb 100644 --- a/tests/test_addr.py +++ b/tests/test_addr.py @@ -38,7 +38,7 @@ class AHTest(PyverbsAPITestCase): Test ibv_create_ah. """ self.verify_state(self.ctx) - gr = u.get_global_route(self.ctx, port_num=self.ib_port) + gr = u.get_global_route(self.ctx, gid_index=self.gid_index, port_num=self.ib_port) port_attrs = self.ctx.query_port(self.ib_port) dlid = port_attrs.lid if port_attrs.link_layer == e.IBV_LINK_LAYER_INFINIBAND else 0 ah_attr = AHAttr(dlid=dlid, gr=gr, is_global=1, port_num=self.ib_port) @@ -72,7 +72,7 @@ class AHTest(PyverbsAPITestCase): Test ibv_destroy_ah. """ self.verify_state(self.ctx) - gr = u.get_global_route(self.ctx, port_num=self.ib_port) + gr = u.get_global_route(self.ctx, gid_index=self.gid_index, port_num=self.ib_port) port_attrs = self.ctx.query_port(self.ib_port) dlid = port_attrs.lid if port_attrs.link_layer == e.IBV_LINK_LAYER_INFINIBAND else 0 ah_attr = AHAttr(dlid=dlid, gr=gr, is_global=1, port_num=self.ib_port)