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 17C98A034C; Wed, 21 Dec 2022 11:18:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6D11842D29; Wed, 21 Dec 2022 11:18:00 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2049.outbound.protection.outlook.com [40.107.92.49]) by mails.dpdk.org (Postfix) with ESMTP id A758540A7A for ; Sun, 18 Dec 2022 16:09:30 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SvWRuGi9IdfOMSlqIcJpd4NrEJO11DRZDWymX2CFA3tbdbxzhI22PlSF381nUJEnVu/zgkT/3JShWVqKFm4TSMw9YUYWAT0Lbb3L8Qum058JcJF/0/BWRujWeelMu1GGB5UImrcvmRKG7Tvothm0aYYmZBCooagVIUex85dhCxtvgSjJ3fjEve9YCw03OMWiJeuItWVcfMf0YLOTab2+uwbnzyt/WiMQ10d/YzcpotdHvIjmmItxYqogQAy3G6igHTCBsFDmBMPyXP9Df58R7MLmv7EXttBnNw0fLEzqkxttVmbwEKS1j+7BO9YhdwCXgMVGaTm6rJSan5MRFPYU3g== 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=SMEXlM3rE1kxxE5EyzjTOMOGPZT8vPdLQLZHE/k00Z5YQn/fEkK9VNBArk/IR6uX3qszpgwgfwkJAbTl3Ko8DLYe+8QyRc2Iozdd82RMh/MRsaziS4z+GMj/N6vy0AZ2ffeZNTBrIlUMyYGjyxX8vcAz0FErAVytn+cQouzFzlMBXK6BiI/fMMjhbU5wv5DpH4KZbIkBRkw1JiXITdKsKYExmYNFSosyS8uMFoZ1HjHMOgY85ZjGRKiqUh1A227/fTxnqS74CVaoJOM89XDdK6awah4AeFUVtaut8L6FqI/gCPzqdtuZu1c0lGG7s4zt4CbP2IHTfshOmbCIfUDAXw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=qJDSxSWw4jsk7rLlpiwY1Ohu31+6hrXblyAfFJm3jyC1Yzxg3QNyk0Np3Yl8VI5hQS3uYVRZjU9pEgfMP8so+Vf7QLmsGpORnHKVIFIL9pjNNyIJjvug5P3r9YrtFuWtdXoJ07CX+e2tx6GdG35bxjpvd7DTjNiZMQahPk4hCfPIvFB6N8TKWtfzaTVZ91MvhQ/5ToM+eR4CmMQt21XZVa6V2vw3TTGBYjAp2oe2dSJFPuv+wnM9Robp0yPJnl3AJQRClocMwJAJNAbqEuu/6BwQ6cIeHV7d7nZSiwv0ZwEFIo8RSGwkWCBXyZbdTkw0N0hvJz3vEodiZO5drLQLDA== Received: from MW4PR03CA0060.namprd03.prod.outlook.com (2603:10b6:303:8e::35) by PH0PR12MB8152.namprd12.prod.outlook.com (2603:10b6:510:292::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Sun, 18 Dec 2022 15:09:28 +0000 Received: from CO1NAM11FT083.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8e:cafe::e4) by MW4PR03CA0060.outlook.office365.com (2603:10b6:303:8e::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.18 via Frontend Transport; Sun, 18 Dec 2022 15:09:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1NAM11FT083.mail.protection.outlook.com (10.13.174.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16 via Frontend Transport; Sun, 18 Dec 2022 15:09:28 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Sun, 18 Dec 2022 07:09:26 -0800 Received: from nvidia.com (10.126.231.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; Sun, 18 Dec 2022 07:09:23 -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: Sun, 18 Dec 2022 17:08:47 +0200 Message-ID: <20221218150853.2167280-7-erezsh@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20221218150853.2167280-1-erezsh@nvidia.com> References: <20221218150853.2167280-1-erezsh@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.231.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: CO1NAM11FT083:EE_|PH0PR12MB8152:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d51f62c-dac8-4d99-8ecf-08dae109db9f 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: gh7M/ELDRGuJmsiaqMZJMD5XJvPwTmcgh9D0nf6hSyuquqru6pgmJU8oO50z6h/k9O93zMt+f4KVYYY3c6UdZg8WLrZA5FBfsLwLRlCzcVKNxTPRTlEnN6JclUIi4DGZSnY+tfgINJN/TcvDuClEF2LRD0d4cjzMfHBvTETYyb0p7dduui7DCZORQJqubrD0Yj+hsCv3VkX1uyBCKZDEFQIaSrwnuifJ4/1gyIKp+I1YaZEfrWzUuAVlV7MDAEm4T7ouaybXSVRydi02qSydCmLGaOa1V295z+Gzd1I67gv6D2UFMEcw5nWEqh8hFLV/hYDQb3x4io/OsSYI2HERg+2g27dRjyxuJ1MOh+HsMP2326U79dEHgr2K7JHy5RCu2F+OaSjL4FURvVCNBRUsnX8xbL1xIGDNVUL/3RbyeYi6mBz1Wm9M+a+WiBLwxf4HCCA9ET6sYRXIM1EgbDP2agmjEBv5iubpQY+WoqeCZl2RPNCrFnkM2kj1YDD2TA9mJMmdRJ709WHbbecBCYr6KK/k4r1p8aG44Y3xB01290j6ktKeu3oF+iyqvsT16QZ7rYq/MSXITN7sPHcZsYg5tIKuQc4z/WTsAHSwrQT63vL8SzweZuXTMmlqGyhLOfYX2t2nuf1ieJk0ccUiLdLOltq6tHLdEK+k6EMtRpukwCPfQ4YaddDi28hwg3xfDrFztGJ3kUg64pglmOqPkGwHWw== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(396003)(376002)(346002)(39860400002)(136003)(451199015)(46966006)(40470700004)(36840700001)(70586007)(86362001)(70206006)(4326008)(40460700003)(8676002)(316002)(5660300002)(36756003)(8936002)(2616005)(41300700001)(1076003)(186003)(82310400005)(7696005)(107886003)(6666004)(16526019)(6286002)(426003)(26005)(83380400001)(47076005)(36860700001)(336012)(356005)(54906003)(6636002)(40480700001)(55016003)(82740400003)(110136005)(7636003)(478600001)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2022 15:09:28.0875 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4d51f62c-dac8-4d99-8ecf-08dae109db9f 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT083.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB8152 X-Mailman-Approved-At: Wed, 21 Dec 2022 11:17:53 +0100 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