From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C6C81A00C5; Mon, 19 Dec 2022 09:25:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1321642D35; Mon, 19 Dec 2022 09:25:19 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2054.outbound.protection.outlook.com [40.107.94.54]) by mails.dpdk.org (Postfix) with ESMTP id 0F8EF42D2A for ; Mon, 19 Dec 2022 09:25:17 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ffVMTfIKr2w7K5cvhpLCLJnOJQv+Xzu0gjCSNSm19w+zYLI1d85so4Ep6PA7C40l6lm0CfQkscywwuDFdj1S9NV2r3bS9e1O6AfmtGdwxIDpkUZD6O7Ix+TbKcEt/44/ugV3wBAk39AgHVSvRmnDwnRITDBDy68gOBBw9naYr8ewKr0YfhgX/kOkqOT1eYSuHfBV7VtkAaWeQtD99nKA2+CYkrBK3vrfeV68MfkKToQ3Kqccpf0q05CPQOCPAv9pO4AJkRNY5PpYMb7W0KhLutLcX5YWSh6X5Eov2gB9cOftLagE2+J1KoWwSck7X/tvyWVwLuyEPPVy4bS/TfvKKw== 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=vdwJ3RP05/UXBNBU8vcb9asfW/gmEnqgojJvrK45KAw=; b=RHZ8NeunXQVnEe8yYI4VQPEo43djdsKMVqI6IeBtL5/nxNaLsdTUcAQGYF7khi+s3ZA3P/JRs3Wf47KdwZRypTW75h+ygCkayVjgEBF+guj7aIRiNMoFUyqrXnMPqKk0IG4+ypyli17yoRktyjHq7Wcq7CbDA5xL+XQtxb4Eoa7K6aZgnbI7dBsEg/Ajt2eSu6T8e9MXiUBV4EGDJ0BdRz5Szk75p+ZOp1HT51H289YtgF9OpA3ecBSGukBkhI7n3aMpYCfDQOjrMl2aV/180nessx78lVDxtYfFhE0/si5Jksq1HeIfxhXdE8wmjqm03pJrYQENXI1DV6H8Gqu/Eg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vdwJ3RP05/UXBNBU8vcb9asfW/gmEnqgojJvrK45KAw=; b=f/zQwttrXyDYlKnDbsX6GDAAeB6wJTOBPPdl/b3A30pQnm3QXaCwhZ0Bb77VxBTOQSwM4+1peBUkpqDpOIfca3f+sVBqRzv07kJs8KY9eC3a//CEj1POZKBfmBZuUW36JfXGmVjVzf0EQu9MVvhZDnX582eoIbDEZsqBzbRlJUb9mur+uNn/NsrgiZnoEY1TLeYV6aLOCp3vAjS6FH2mHd50HdcO1LbPZWYQfTWg0jJyeSrM//HTg+prtP0V8tdjAHt0y+vvYhScBnjzd+60ORg1mVKUHRUkDifSJZexplt664ZKHQyV2lttwOpjNtZvyRs+y+xdrIVcI5JnqsKRJA== Received: from DM6PR06CA0070.namprd06.prod.outlook.com (2603:10b6:5:54::47) by DS0PR12MB7509.namprd12.prod.outlook.com (2603:10b6:8:137::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Mon, 19 Dec 2022 08:25:15 +0000 Received: from DS1PEPF0000E650.namprd02.prod.outlook.com (2603:10b6:5:54:cafe::7) by DM6PR06CA0070.outlook.office365.com (2603:10b6:5:54::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.20 via Frontend Transport; Mon, 19 Dec 2022 08:25:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DS1PEPF0000E650.mail.protection.outlook.com (10.167.18.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.8 via Frontend Transport; Mon, 19 Dec 2022 08:25:15 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Mon, 19 Dec 2022 00:25:03 -0800 Received: from nvidia.com (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Mon, 19 Dec 2022 00:25:01 -0800 From: Erez Shitrit To: , , , , Matan Azrad CC: , Yevgeny Kliteynik Subject: [PATCH V1 06/11] net/mlx5/hws: added allow-other-vhca-access command Date: Mon, 19 Dec 2022 10:24:11 +0200 Message-ID: <20221219082416.2223812-7-erezsh@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20221219082416.2223812-1-erezsh@nvidia.com> References: <20221219082416.2223812-1-erezsh@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E650:EE_|DS0PR12MB7509:EE_ X-MS-Office365-Filtering-Correlation-Id: 39a7c6ad-3664-4fc8-e791-08dae19a8e2f X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xHZw/mSf472f6UXQBjkU9VIfb+ddrHCPBxUAB+hegof7AxeTzcdYqrjPK1hkLxeCoZYopdGHOWfubriYDaY6lJZaz4bATFtDh76N3aWRI0PVtAqbt3j2+nuIhgVgMrYRQeEClSYMy8k1vwB+5ZaHUNyPweAyp7zgb6FRac7kCzES5qdFT8oXkZ1bdEAa5cs5uapaSEf0ZdICilfmhE7PFIYeIK+mrT0GPrnSJIwMooAeCpdsSUXgQkzDWghjwsrzMvJG05TMXHtoP/p/4ZWKj12VWcDBPpEIdHpUgM3CaAitqO7XHOnxbBU94ftP6/eyR3cKUHG7ulYC0YDpBYjnd1c/ShUcFdD3q9lelkdXW5wAUX24lvlvA+c2nktAcx1NRd/A9/KBXV5phTkkiqhQpH1T1Pv0GeeUEd/84x8lIG3YvwsTINl4tnuAr41sg2M7bPQmORHr5mz5gFpC9n/ebV48hnARJQv+jBxJO2Is6fG57Ya9Q11ZhWDpMfNJugEDNw9iyrlqyefBVd+ZBdvP015qKomDnZbg3ZP7AMbcSbrHfAzZn/7j7javy/z90K19i9DbLqCM61bV+jDXyKgBpaIPy/Hq0migkCXdxykiPr8fTfHmkSynvRDBDzR/8cowVZBlNqzMenz9nY+Ii2ux/bEp3pMD59dUpXL3m88mzWsLCBF1b0x+Fk41kfX7in8OrCJqLuStC1p76MWTOcQJqw== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(396003)(376002)(346002)(39860400002)(136003)(451199015)(36840700001)(40470700004)(46966006)(426003)(47076005)(8936002)(107886003)(6666004)(40480700001)(5660300002)(83380400001)(186003)(16526019)(55016003)(26005)(6286002)(41300700001)(336012)(2906002)(36860700001)(316002)(40460700003)(478600001)(82740400003)(7696005)(6636002)(54906003)(356005)(86362001)(36756003)(2616005)(70206006)(70586007)(82310400005)(1076003)(7636003)(4326008)(8676002)(110136005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2022 08:25:15.1501 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 39a7c6ad-3664-4fc8-e791-08dae19a8e2f X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0000E650.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7509 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Yevgeny Kliteynik Added FW command to allow creation of alias objects. Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker --- drivers/common/mlx5/mlx5_prm.h | 23 +++++++++++++++++++++++ drivers/net/mlx5/hws/mlx5dr_cmd.c | 28 ++++++++++++++++++++++++++++ drivers/net/mlx5/hws/mlx5dr_cmd.h | 9 +++++++++ 3 files changed, 60 insertions(+) diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index dfa25c2b49..9d36645949 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -1133,6 +1133,7 @@ enum { MLX5_CMD_SET_REGEX_REGISTERS = 0xb06, MLX5_CMD_QUERY_REGEX_REGISTERS = 0xb07, MLX5_CMD_OP_ACCESS_REGISTER_USER = 0xb0c, + MLX5_CMD_OP_ALLOW_OTHER_VHCA_ACCESS = 0xb16, }; enum { @@ -3150,6 +3151,28 @@ struct mlx5_ifc_general_obj_out_cmd_hdr_bits { u8 reserved_at_60[0x20]; }; +struct mlx5_ifc_allow_other_vhca_access_in_bits { + u8 opcode[0x10]; + u8 uid[0x10]; + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + u8 reserved_at_40[0x50]; + u8 object_type_to_be_accessed[0x10]; + u8 object_id_to_be_accessed[0x20]; + u8 reserved_at_c0[0x40]; + union { + u8 access_key_raw[0x100]; + u8 access_key[8][0x20]; + }; +}; + +struct mlx5_ifc_allow_other_vhca_access_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + u8 syndrome[0x20]; + u8 reserved_at_40[0x40]; +}; + struct mlx5_ifc_virtio_q_counters_bits { u8 modify_field_select[0x40]; u8 reserved_at_40[0x40]; diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.c b/drivers/net/mlx5/hws/mlx5dr_cmd.c index 2156fd6643..b120be2d88 100644 --- a/drivers/net/mlx5/hws/mlx5dr_cmd.c +++ b/drivers/net/mlx5/hws/mlx5dr_cmd.c @@ -716,6 +716,34 @@ int mlx5dr_cmd_sq_modify_rdy(struct mlx5dr_devx_obj *devx_obj) return ret; } +int mlx5dr_cmd_allow_other_vhca_access(struct ibv_context *ctx, + struct mlx5dr_cmd_allow_other_vhca_access_attr *attr) +{ + uint32_t out[MLX5_ST_SZ_DW(allow_other_vhca_access_out)] = {0}; + uint32_t in[MLX5_ST_SZ_DW(allow_other_vhca_access_in)] = {0}; + void *key; + int ret; + + MLX5_SET(allow_other_vhca_access_in, + in, opcode, MLX5_CMD_OP_ALLOW_OTHER_VHCA_ACCESS); + MLX5_SET(allow_other_vhca_access_in, + in, object_type_to_be_accessed, attr->obj_type); + MLX5_SET(allow_other_vhca_access_in, + in, object_id_to_be_accessed, attr->obj_id); + + key = MLX5_ADDR_OF(allow_other_vhca_access_in, in, access_key); + memcpy(key, attr->access_key, sizeof(attr->access_key)); + + ret = mlx5_glue->devx_general_cmd(ctx, in, sizeof(in), out, sizeof(out)); + if (ret) { + DR_LOG(ERR, "Failed to execute ALLOW_OTHER_VHCA_ACCESS command"); + rte_errno = errno; + return rte_errno; + } + + return 0; +} + int mlx5dr_cmd_query_caps(struct ibv_context *ctx, struct mlx5dr_cmd_query_caps *caps) { diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.h b/drivers/net/mlx5/hws/mlx5dr_cmd.h index ab61e27fd8..ea6ced9d27 100644 --- a/drivers/net/mlx5/hws/mlx5dr_cmd.h +++ b/drivers/net/mlx5/hws/mlx5dr_cmd.h @@ -124,6 +124,12 @@ struct mlx5dr_cmd_sq_create_attr { uint32_t ts_format; }; +struct mlx5dr_cmd_allow_other_vhca_access_attr { + uint16_t obj_type; + uint32_t obj_id; + uint8_t access_key[32]; +}; + struct mlx5dr_cmd_query_ft_caps { uint8_t max_level; uint8_t reparse; @@ -230,4 +236,7 @@ void mlx5dr_cmd_set_attr_connect_miss_tbl(struct mlx5dr_context *ctx, uint32_t fw_ft_type, enum mlx5dr_table_type type, struct mlx5dr_cmd_ft_modify_attr *ft_attr); + +int mlx5dr_cmd_allow_other_vhca_access(struct ibv_context *ctx, + struct mlx5dr_cmd_allow_other_vhca_access_attr *attr); #endif /* MLX5DR_CMD_H_ */ -- 2.18.2