Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755171AbdGSPJM (ORCPT ); Wed, 19 Jul 2017 11:09:12 -0400 Received: from mail-bl2nam02on0045.outbound.protection.outlook.com ([104.47.38.45]:24731 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753486AbdGSPJJ (ORCPT ); Wed, 19 Jul 2017 11:09:09 -0400 From: "Kalderon, Michal" To: "Ismail, Mustafa" , "Marciniszyn, Mike" , "linux-rdma@vger.kernel.org" , "dledford@redhat.com" CC: "swise@opengridcomputing.com" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , "Saleem, Shiraz" , "Amrani, Ram" Subject: Re: [PATCH v2 2/2] RDMA/core: Initialize port_num in qp_attr Thread-Topic: [PATCH v2 2/2] RDMA/core: Initialize port_num in qp_attr Thread-Index: AQHS/K9nW4n2re2dvkWamddB2kN8+qJYZ3YAgAJqddCAAG4IAIAABuX9 Date: Wed, 19 Jul 2017 15:09:03 +0000 Message-ID: References: <1500043291-19768-1-git-send-email-mustafa.ismail@intel.com> <1500043291-19768-3-git-send-email-mustafa.ismail@intel.com> <32E1700B9017364D9B60AED9960492BC34341CD3@fmsmsx120.amr.corp.intel.com> ,<5C5647B5F4794941BAAC07CF28785CBC33E5F3B1@fmsmsx101.amr.corp.intel.com> In-Reply-To: <5C5647B5F4794941BAAC07CF28785CBC33E5F3B1@fmsmsx101.amr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: opengridcomputing.com; dkim=none (message not signed) header.d=none;opengridcomputing.com; dmarc=none action=none header.from=cavium.com; x-originating-ip: [79.178.59.88] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BN3PR07MB2577;7:7n62IKNFyabdtwx9KzNqC+XQNfKttcR4/NJmVtNc9mDsundMViUnsX0bhO948o4/wldtkdfflgh5/DdCzwgfG87stZVhYhVYnaixys0jcVSKs/jwEC8zUIjLAD4CVDilLDxQnBGhKbbYTImcYwARJYB4QvD2sdCAxsrKeO1wty3jfwpKORyUkfNWNbvD3tgLoC3J33KX0TXyJiz5MGpjNzyYz6gJrCv6no6G2UKMQrtzx5OECbUKL7OXbophbkML2IzUGKPmZUb7K5FwSghe/gfMxwN727mAV6vEGXPqufaLEbBKfekFVHXS1JImYlpanZjyOL60zFeXkensAY69NF+W4/g1Pohqj+vLblzKcQlzKTtPqjXyNSDE7W5PsuAnj1mCVTefDaD6EasV5sWSEhFVP8TcUu+3TMmrIKRYONGJnhQ6rQuAmVKb1WnaJdkeu4uxN/7l0OoKodFgQqVoof55xqBrCCMueSHfZ5ssPx6lYIAindth0DSrT90QRlHlAMht1xKkBTQYdrub/0eyjM8L8XDEn4rN6O97wAGtxvT3BOi7AA4cvWM71qDEpAt5KVdGjYMFNt7x1OY3Dxxy/M336O3d6TSWigJNXbxz+8UlCAFYHhhCsDNg3RTimurAybUobik3+WWB46qrxF5SH5znuboAbFkL8vcppR5DJU8bbtUdTAO3MJMET6BFotWMDcLFUAiCObSPIbkVhBgc1anq5iaq81vHOaurJZtgf4r04yeDmuPfsoyyeVZosxzJTlIdfeX5l/9Uy4VrCpcimb/yc35GEav649kfXNSnGFk= x-forefront-antispam-report: SFV:SKI;SCL:-1SFV:NSPM;SFS:(10009020)(6009001)(39400400002)(39860400002)(39450400003)(39410400002)(39840400002)(39850400002)(377454003)(25786009)(102836003)(478600001)(53936002)(3846002)(33656002)(81166006)(99286003)(72206003)(8936002)(54906002)(8676002)(38730400002)(107886003)(6246003)(2201001)(9686003)(2900100001)(55016002)(4326008)(6116002)(2950100002)(14454004)(7736002)(305945005)(66066001)(5250100002)(76176999)(5660300001)(6436002)(7696004)(3280700002)(2501003)(2906002)(3660700001)(74316002)(93886004)(189998001)(50986999)(54356999)(229853002)(6506006)(86362001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR07MB2577;H:DM2PR0701MB1392.namprd07.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; x-ms-office365-filtering-correlation-id: 6d0cfb06-308e-4ddb-0383-08d4ceb8183c x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:BN3PR07MB2577; x-ms-traffictypediagnostic: BN3PR07MB2577: x-exchange-antispam-report-test: UriScan:(236129657087228)(9452136761055)(48057245064654)(228905959029699)(247924648384137); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(2017060910075)(5005006)(8121501046)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123555025)(20161123560025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BN3PR07MB2577;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BN3PR07MB2577; x-forefront-prvs: 0373D94D15 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jul 2017 15:09:03.9941 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR07MB2577 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v6JF9Isx006022 Content-Length: 1248 Lines: 25 From: Ismail, Mustafa Sent: Wednesday, July 19, 2017 5:38 PM > > > > Fixes: 5ecce4c9b17b("Check port number supplied by user verbs cmds") > > > > Cc: # v2.6.14+ > > > > Reviewed-by: Steve Wise > > > > Signed-off-by: Mustafa Ismail > > > > > Why is the second patch required if you only validate the port_num if the > > IB_QP_PORT mask is on? > > Given the first patch [PATCH v2 1/2] RDMA/uverbs: Fix the check for port > > number, this one seems redundant. > Strictly speaking it is not required, but we felt it safer to always return a valid port number > as is done in the IB case. It's not always initialized in the IB case either. More than that if at this point you'll initialize it for ib as well you'll get a failure on ib_modify_qp_is_ok, since when transitioning to RTR / RTS providing IB_QP_PORT is not a valid option. We actually hit this issue when running rping over RoCE. (prior to your fix i mean ) I agree that in general there's no real harm, but it seems a bit out of context, and if we make the change common for ib/iwarp we'll have to modify ib_modify_qp_is_ok which is written close to the spec. thanks, Michal