From patchwork Sat Oct 15 06:37:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 13007612 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 11B4BC4332F for ; Sat, 15 Oct 2022 07:00:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229583AbiJOHAi (ORCPT ); Sat, 15 Oct 2022 03:00:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229648AbiJOHAc (ORCPT ); Sat, 15 Oct 2022 03:00:32 -0400 Received: from esa10.fujitsucc.c3s2.iphmx.com (esa10.fujitsucc.c3s2.iphmx.com [68.232.159.247]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E1503385D for ; Sat, 15 Oct 2022 00:00:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=fujitsu.com; i=@fujitsu.com; q=dns/txt; s=fj1; t=1665817230; x=1697353230; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=rpfd3dATwf8wwzOdanxEXgJttSLO3f1VP+pMLCZ/XFg=; b=s2AnHKE3MRGGpkrCCcAsYuCuq+hRZdbub1Lh/XCQSZvVN22vtt3WWgF2 6D4b36M0Q0G20RjeWdR31ufiF4WDhKnTkebDrQCwAuA4hWpc1jD3tPMFL SpBS739mpcoWRqSCHLAX8sCYgcu34nq1w0gSxWmjCii7BR/kMvOdovCq+ ECGyYtSD4gT7J4aQgJAFAgmFpvwQ/3iZ/t1WYmlzPUGfhOdBvRvZY3uO9 kdUEYSUxaeqN/9FCFv8xSRJsaHXkfzCRSHy92SC9RD459Nd5YVaoFJTMZ e6Dw2sZhElimxhfKonEe2eA+0gCB+NATV8DBh/O9iIpEKo0VARcVmw04B g==; X-IronPort-AV: E=McAfee;i="6500,9779,10500"; a="67689751" X-IronPort-AV: E=Sophos;i="5.95,186,1661785200"; d="scan'208";a="67689751" Received: from mail-tycjpn01lp2170.outbound.protection.outlook.com (HELO JPN01-TYC-obe.outbound.protection.outlook.com) ([104.47.23.170]) by ob1.fujitsucc.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Oct 2022 15:37:13 +0900 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HYkdpH2NcqMIoOEJe7Dms/cxFBSCIM+DffUZcFbzlU6U5fToBBy02ZjY5vq2dNDm3ylez4An4+PyQsZhqHKPorUQogV7Tbx+028AHzHYPhRASDjWLF1LStYhltc0Le7020To5OBEx2x3lTZ2MFoqX+f6hueXsaa/9siTZskJ15ZarfNuv6h99gFmEu0jUNI0vv1ZolF5br3TT6WjCuANAQ+ChSYQGIUdKqvkPZ7nsttUgGB8xBuc/Z32oA3rngQd1zruIpemsn4oJ+6fibo8uvnWJMqFXnvVVIaKByLi4fK7WrHrNJnrjyKFrafRwQ/rMwhxmVzFo+aMXONwkCWprg== 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=rpfd3dATwf8wwzOdanxEXgJttSLO3f1VP+pMLCZ/XFg=; b=CdptjgNzlzdDiqTUFXnRGKudTnJyQenOfGNjPxKBskdloiqWF3CIWIJJPYtCvW3ztiroxTGYfwIo+UQZOOPllurNZEDPDW8Wjr2Iv7E+CO7vBrzFCNyd6v82yL5uo3uym1XKYCnFep8nDNauD8iwoKOc4ztkDGyGbT1III7qevqlugPJlSftnR6z1o1sAQRKBOY65tK4DXTNcgnlH6BGMiKAglFgzgziCh0vPhgeQtXkWIuWEKJdzI8hEyUq7xXbr/NcKnOLyJZKn1sP70cuhxmkZljrvl1iVJxCbjVtOTamQzaBil4ijigaZ7+PgCwFymR1oSGqWzDyHIwluiw+MA== 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 OSZPR01MB8661.jpnprd01.prod.outlook.com (2603:1096:604:185::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sat, 15 Oct 2022 06:37:06 +0000 Received: from OS3PR01MB9499.jpnprd01.prod.outlook.com ([fe80::5989:c90d:abf4:e100]) by OS3PR01MB9499.jpnprd01.prod.outlook.com ([fe80::5989:c90d:abf4:e100%6]) with mapi id 15.20.5723.029; Sat, 15 Oct 2022 06:37:06 +0000 From: "yangx.jy@fujitsu.com" To: "linux-rdma@vger.kernel.org" , "jgg@nvidia.com" , "rpearsonhpe@gmail.com" CC: "leon@kernel.org" , "lizhijian@fujitsu.com" , "y-goto@fujitsu.com" , "zyjzyj2000@gmail.com" , "yangx.jy@fujitsu.com" Subject: [PATCH v6 4/8] RDMA/rxe: Extend rxe packet format to support atomic write Thread-Topic: [PATCH v6 4/8] RDMA/rxe: Extend rxe packet format to support atomic write Thread-Index: AQHY4GCLKhDKVKdpKUKvKn+dDxj/2g== Date: Sat, 15 Oct 2022 06:37:06 +0000 Message-ID: <20221015063648.52285-5-yangx.jy@fujitsu.com> References: <20221015063648.52285-1-yangx.jy@fujitsu.com> In-Reply-To: <20221015063648.52285-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-traffictypediagnostic: OS3PR01MB9499:EE_|OSZPR01MB8661:EE_ x-ms-office365-filtering-correlation-id: 3f54ab66-5588-469b-d473-08daae77adde x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Zy92E97ugZ933fJWHou8V/SVciG4mQW+T6bqp7m0fv0NJtxxIB5A5XfnBOVSQ+Qk2iuRyh4HSLgh6EpFHAH5pP+/JAigkXexW6xvt4cFN56tEc37rJAD+F6FKhUjdU6cbAIgJbvVfD6pOQbzhR5fMjVmS2CuaeXvOpxIM19QJGJazEGTGuO8ozL7CB1MLMR3aVO8DgClTFQ2hFO453YFLvTa057bx6QMByXm276e82/BtWMH+4+DcNTPkRNG+4xHlj8VRxNwTYXjJgXyDo+A08IMybkTtBfvWtrHRrgM/71sQjNq6cMwXhTx6AivXzCpTV5HEK3aueXwzLix5TPpMrnrm040j+3qlXN8yz0Ro8vuu/PriBPXKaQyYX7rgWacEfuUkTUgF7Z8XRL6h7xV0tQliacDh/vX8hrH7l94k3A5FBsZWD5mocqn11WiNE/au/PU7rz1T/89uzsy5QUKABkShinFFuWl5KQ1NpMoPiT2012Ari3Cmpr6MXGKYpgFW44+V4TKvGGLCDyurttq8jUb93pBnHbK4MAlOJQ6kK/w0B9W+7GL2MZ0K1uJmDvi0wjTQtMb1h8OiCbSC7Y4EwflYz9J1En4bcnFBj8YP9jYob0CKzkT4yjKNNEm1qukaSQOSGYu6NFTvEdHT11ugsquqBOnQMzchkIgwNshcwzIdQI4y0sZ9K4VMK5mLdncCwIjppdiEMSoiF5UUxk1F+XXmlOQeSRJ/IBrr7Th40VIKlI1RhJo1KueKT+Eq11GovC88Y03xJG8s6c4yk6ZvKCrVqhsxoXbuzbujwn1hAc= 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:(13230022)(4636009)(39860400002)(136003)(346002)(376002)(366004)(396003)(451199015)(1590799012)(6486002)(85182001)(316002)(86362001)(38100700002)(36756003)(5660300002)(110136005)(26005)(6512007)(54906003)(478600001)(122000001)(8936002)(82960400001)(91956017)(1580799009)(66946007)(76116006)(2616005)(107886003)(66556008)(66476007)(38070700005)(41300700001)(71200400001)(6506007)(66446008)(64756008)(8676002)(2906002)(4326008)(1076003)(186003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?eucgb2312_cn?b?UHJFYk5mOFFmY014KzJQOXh3?= =?eucgb2312_cn?b?YXhZTE9yRTZ5RHlHWWJvN25JanJUaVNkNDIrOFdaNHdQU3dBZ2JCdkNoZzF2NzQv?= =?eucgb2312_cn?b?OFlZU1ZMcmp3QjZ0bGpBd29PQ2lES1VFUlhNTStOWVlvMWRiZ1dEZFIvT3c2Zm1p?= =?eucgb2312_cn?b?QisxbU9hMFQ4amU2b1NFaDJQcDBISnBoK0VXYVR1OFZ3NlpteW1KNWh6Tmd1anJU?= =?eucgb2312_cn?b?YnJjNzFoa3BxUFhjaUpVaWtMVjFDeTI1czlsWkMzbnA5QjhKVlk5bXBsNm9EQlJT?= =?eucgb2312_cn?b?L0xiNExJUEwvMFlLUEhCMkVMeDNTMitvU3JjRmFpN0UxR2hZTGJ2blFFK20zRHhG?= =?eucgb2312_cn?b?OHo0bG9UVVZOWVMzQlJHWWFKd0dWWXJ3NmdVaEN0VnVhWHBIMlUxQWVJNHFRUGNz?= =?eucgb2312_cn?b?SURvSE5XUitpaE0vR2hRYlFINVBwSysvTmtXbG5raFg1ZS9zTVNEMnNmMHgxeEV6?= =?eucgb2312_cn?b?N0NzR1VZc3diV3F6TndBbFd4S29HNW5pU2F2VGY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ginatorOrg: 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: 3f54ab66-5588-469b-d473-08daae77adde X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Oct 2022 06:37:06.2434 (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: A49gBHt9JEtF2q3YXfBO1mnmNlJiN6mVTLQpKM3L0F1bSqVF32+A/BjnvWZoYpSS/6Y2ymtvt3i1LbJEuFLvzA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB8661 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Extend rxe_wr_opcode_info[] and rxe_opcode[] for new atomic write opcode. Signed-off-by: Xiao Yang --- drivers/infiniband/sw/rxe/rxe_opcode.c | 18 ++++++++++++++++++ drivers/infiniband/sw/rxe/rxe_opcode.h | 3 +++ 2 files changed, 21 insertions(+) diff --git a/drivers/infiniband/sw/rxe/rxe_opcode.c b/drivers/infiniband/sw/rxe/rxe_opcode.c index d4ba4d506f17..fb196029048e 100644 --- a/drivers/infiniband/sw/rxe/rxe_opcode.c +++ b/drivers/infiniband/sw/rxe/rxe_opcode.c @@ -101,6 +101,12 @@ struct rxe_wr_opcode_info rxe_wr_opcode_info[] = { [IB_QPT_UC] = WR_LOCAL_OP_MASK, }, }, + [IB_WR_ATOMIC_WRITE] = { + .name = "IB_WR_ATOMIC_WRITE", + .mask = { + [IB_QPT_RC] = WR_ATOMIC_WRITE_MASK, + }, + }, }; struct rxe_opcode_info rxe_opcode[RXE_NUM_OPCODE] = { @@ -378,6 +384,18 @@ struct rxe_opcode_info rxe_opcode[RXE_NUM_OPCODE] = { RXE_IETH_BYTES, } }, + [IB_OPCODE_RC_ATOMIC_WRITE] = { + .name = "IB_OPCODE_RC_ATOMIC_WRITE", + .mask = RXE_RETH_MASK | RXE_PAYLOAD_MASK | RXE_REQ_MASK | + RXE_ATOMIC_WRITE_MASK | RXE_START_MASK | + RXE_END_MASK, + .length = RXE_BTH_BYTES + RXE_RETH_BYTES, + .offset = { + [RXE_BTH] = 0, + [RXE_RETH] = RXE_BTH_BYTES, + [RXE_PAYLOAD] = RXE_BTH_BYTES + RXE_RETH_BYTES, + } + }, /* UC */ [IB_OPCODE_UC_SEND_FIRST] = { diff --git a/drivers/infiniband/sw/rxe/rxe_opcode.h b/drivers/infiniband/sw/rxe/rxe_opcode.h index 8f9aaaf260f2..a470e9b0b884 100644 --- a/drivers/infiniband/sw/rxe/rxe_opcode.h +++ b/drivers/infiniband/sw/rxe/rxe_opcode.h @@ -20,6 +20,7 @@ enum rxe_wr_mask { WR_READ_MASK = BIT(3), WR_WRITE_MASK = BIT(4), WR_LOCAL_OP_MASK = BIT(5), + WR_ATOMIC_WRITE_MASK = BIT(7), WR_READ_OR_WRITE_MASK = WR_READ_MASK | WR_WRITE_MASK, WR_WRITE_OR_SEND_MASK = WR_WRITE_MASK | WR_SEND_MASK, @@ -81,6 +82,8 @@ enum rxe_hdr_mask { RXE_LOOPBACK_MASK = BIT(NUM_HDR_TYPES + 12), + RXE_ATOMIC_WRITE_MASK = BIT(NUM_HDR_TYPES + 14), + RXE_READ_OR_ATOMIC_MASK = (RXE_READ_MASK | RXE_ATOMIC_MASK), RXE_WRITE_OR_SEND_MASK = (RXE_WRITE_MASK | RXE_SEND_MASK), RXE_READ_OR_WRITE_MASK = (RXE_READ_MASK | RXE_WRITE_MASK),