From patchwork Wed Jan 19 09:28:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Marciniszyn, Mike" X-Patchwork-Id: 12717333 X-Patchwork-Delegate: jgg@ziepe.ca 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 952ABC433F5 for ; Wed, 19 Jan 2022 09:28:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352915AbiASJ2U (ORCPT ); Wed, 19 Jan 2022 04:28:20 -0500 Received: from mail-mw2nam12on2100.outbound.protection.outlook.com ([40.107.244.100]:42193 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1352766AbiASJ2R (ORCPT ); Wed, 19 Jan 2022 04:28:17 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nDFdGNFBhzO8qyTsHefWwx3RAeuQ4MdnyObS2GpsmxOkDga9DlfIKJLvdXsrrn1zbIX6vX6bcoU5Er96+8iGdonSj2rD56u14AfBvKyCuNOp3XcSQbjXHQa8ZMpr6iyqmafr/tuoPRFKRuITDGSB6n+yilHtNrnAhZSIlSiNAZXN3SK+x0USfAOrXUFqO79a7GtGpMhaYVVxGY+DHWMzsmVzEuFtvg6DevsHLNezPmvoe0SwXBSCVbvsnb2H94kq2jVoOnDXkVoKIlmLPDd82QrLCCxJwZH1OM33Oz9PKw8swQxg93ZAGyr0+coVLhM3aYSPp2mJr5+9LAy8083CjQ== 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=80HOw9eqypyBm2Znu4gDsA02PmnZMaad4QOjCLo0JQs=; b=T9ZGrNy5PrFaQflZTQiAb8Px72e6+Gynxc8Lrh4VF7Ye/XPjpRsoLvlajsztToUZaq275Ys+/9wuIqT0SeBDqxlfgi2LuV+xv/I9HPA3NgtKcwUZ2t27R/SMt+FXzqFFhCCrlH7O2nk+yTptXNbZCAxO6wJYVPMMQsty+fwmoBIMLsVpZ2JfKsPYLOZl8BtSKVS8mHTYtmxcpZNXEoogMrEqQZIkwksI9PwQNExa0K5PbOZ4wmXVOiQptKoe8FOeMWq/XN74QI2ENeUUlPnvlI1e7K+PdoNXYmFFntgrBqXUsw3QNOIke3NW10kuJ+mE8Ax8Vf7Emcrc6/ph/OLeVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornelisnetworks.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=80HOw9eqypyBm2Znu4gDsA02PmnZMaad4QOjCLo0JQs=; b=iuDOzW26/Np8JbGLqOnXlt/A5IdWjUdtNlT6nqRvLQ2rsVC67dkHMkerIajBv8qYiyUbrYq31nZJQbo9VmzNO5nYIfAkdFeGuvlGL0zeJ2tp0TKU3ts7zgoOmQPAfXlWe8rgtaW5ETtHN/lLpc4GgupY7dPVltMn5a81+/Lu7D6c+ALe8EtPv7q8tWixYoyOGb3QMOY57zlli9mQ+I2jdxyPafNb7ZMY+XndnWHgqqOcsHXGtyLBCiKa3rnBOE3cFko8sdOu6sBMorYtFbO4LoycJFXlWsJnDStnasp+oZ3vk4/KJ4N86KVavzvBstfzLF9+P50NT+aE3ep2v7HgdQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=cornelisnetworks.com; Received: from CH0PR01MB7153.prod.exchangelabs.com (2603:10b6:610:ea::7) by CO2PR01MB2134.prod.exchangelabs.com (2603:10b6:102:d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.12; Wed, 19 Jan 2022 09:28:14 +0000 Received: from CH0PR01MB7153.prod.exchangelabs.com ([fe80::110:392e:efd1:88d0]) by CH0PR01MB7153.prod.exchangelabs.com ([fe80::110:392e:efd1:88d0%8]) with mapi id 15.20.4888.014; Wed, 19 Jan 2022 09:28:14 +0000 From: mike.marciniszyn@cornelisnetworks.com To: jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, Mike Marciniszyn Subject: [PATCH for-rc] IB/rdmavt: Validate remote_addr during loopback atomic tests Date: Wed, 19 Jan 2022 04:28:09 -0500 Message-Id: <1642584489-141005-1-git-send-email-mike.marciniszyn@cornelisnetworks.com> X-Mailer: git-send-email 1.8.3.1 X-ClientProxiedBy: MN2PR17CA0018.namprd17.prod.outlook.com (2603:10b6:208:15e::31) To CH0PR01MB7153.prod.exchangelabs.com (2603:10b6:610:ea::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cb08286d-14be-4454-112e-08d9db2e049f X-MS-TrafficTypeDiagnostic: CO2PR01MB2134:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FzmkONB0eYoJqUmdn/RF+doX7iU1A+eikxYaFA3CV5sQPZU7c1yauTNiJGxgE9/6fOYjvWRQbR/QlELVjg8Dq4RPPcNzSxoQFUpMX048F5hDgTHoB7l4ejMBYeSt9K+iPJz2WcwmErtw5t5yTlXJbOygOf3UompKNeo5C83h/MhiGWNdlhy3unwDlZ74Oghd6YSzt7yF92KV4HpQbb8F/kEcpom7HfBI1cwuDxFQfjxzke4s9YcCLaj979rDjGGFHio2NKGoQ30oPnbNv1cQ8Vsqr2QV1Cp8QO5IdOlbcmITVJMv+gd4Tvz+1X380vc7fRPt/sO6qo/Cd4vXmjohESAinhj7QWycoGFzmOUYd2vXNX7fFGS+jw/QV9GZcfgsGGAn+y3wPnzf3FSUSzynZAy8riN+VMG0Qnm3sicIKECIUQevgsNc/ejkSNH8Xm1SqWso9UpZXKORwBIlPNBd9aXYartwqF9/aVHpCQQNO5Ldk0VqOvCx/OraEVKzqspdXdlpSJ5YpTO+IBQO1qlfHLYEERa3vSgF9wUphQwxPWv0mQeMaUR6khZXA2Q/P5rain3OrRf+Q6ueqyJkD+udLnf97dMoNhzmXNcy4X+V4cRxkQbQ7Ys5f6v//H902lyNxmmIRSgHxH/sjNryR3oKxDzOGHYWlUwnXwAEmxxdyoRroYrVbryRWdDbm3bLYYaShuA8YMu07J6X9dqOBGGCNg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR01MB7153.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(39830400003)(366004)(396003)(376002)(136003)(346002)(186003)(9686003)(6666004)(107886003)(4326008)(2616005)(6512007)(66556008)(66476007)(66946007)(86362001)(316002)(38350700002)(6486002)(38100700002)(83380400001)(26005)(15650500001)(6916009)(8936002)(508600001)(36756003)(52116002)(5660300002)(6506007)(2906002)(8676002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8gjBTBUJ2Tn4ubjXu473Z3Pbg6PIpgcZxXSm+/V72oICipNiGwTCK/zQWscjpH3FVDrdvegpyNl7bThGOHyJPczWGgtMRaFV7yFtQHxwe6nul3XxGxRVBKi7zoJiCCHSHpfxou4M9Oz4xrKO2OS5dd/lHXT9cBTNWzrNekpdpH7N3iCondoOa45yEOYaG4/6c1yQEwQN1m5C6+Xkb+2R7ty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+QXySEcEBvT1f7nwo2aqAmYrOeVa4VhtyxmfIGRgPa5nCjYVF51C9Sxk/ElZnMkGz07VydTJwsEtqmlWtNJtozKXsyYNFxwfv7k3wpZWMfaPGrHdXnF91vTDAszfgHbnGk2qie3WonrT0a/7Qs325NKr+bEnoti8xzAEh0ZulTGB3KZOnYpZLIZduxFQdFJw5k9j3bv/Mz5MXE/Wmk6tbA85Zy8gQdb5zpMx+cGuXxvD5EMQ9Q0OPMG7BrSa58ifZl0GjrO85eFdJXy2x+cqa60Id6SBEugTYu+BDpL5aIXLgkiXgV73BojcSSDmlNWZmj1x/6cDeYULxQRW+MHjunmeyFHrHNvJ3C+QXRLWaKqQ75LExuMjIFY3gNDgIEHRcjj+cnIoGsnD2UVt1pgUFvCj/KHrOv//vcWbXXvvgwj04Qm5Ac523nQ4teXCsXa+UFm7Bg== X-OriginatorOrg: cornelisnetworks.com X-MS-Exchange-CrossTenant-Network-Message-Id: cb08286d-14be-4454-112e-08d9db2e049f X-MS-Exchange-CrossTenant-AuthSource: CH0PR01MB7153.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2022 09:28:14.3397 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OlNh3Qt38CQP/7P0XZx9pzmD1I0Mdmo+qxvDWwsV5xk9NsM0xWnWU9UjE4EBC2rfN0/8sxJ5PZ03DWcus+jNcqRg+CHnnTM8THzEC48H4ucyieuozb/OAvrn9QLFEDIf X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR01MB2134 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Mike Marciniszyn The rdma-core test suite sends an unaligned remote address and expects a failure. ERROR: test_atomic_non_aligned_addr (tests.test_atomic.AtomicTest) The qib/hfi1 rc handling validates properly, but the test has the client and server on the same system. The loopback of these operations is a distinct code path. Fix by syntaxing the proposed remote address in the loopback code path. Fixes: 15703461533a ("IB/{hfi1, qib, rdmavt}: Move ruc_loopback to rdmavt") Reviewed-by: Dennis Dalessandro Signed-off-by: Mike Marciniszyn --- drivers/infiniband/sw/rdmavt/qp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c index 3305f27..ae50b56 100644 --- a/drivers/infiniband/sw/rdmavt/qp.c +++ b/drivers/infiniband/sw/rdmavt/qp.c @@ -3073,6 +3073,8 @@ void rvt_ruc_loopback(struct rvt_qp *sqp) case IB_WR_ATOMIC_FETCH_AND_ADD: if (unlikely(!(qp->qp_access_flags & IB_ACCESS_REMOTE_ATOMIC))) goto inv_err; + if (unlikely(wqe->atomic_wr.remote_addr & (sizeof(u64) - 1))) + goto inv_err; if (unlikely(!rvt_rkey_ok(qp, &qp->r_sge.sge, sizeof(u64), wqe->atomic_wr.remote_addr, wqe->atomic_wr.rkey,