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 E5164A034C; Wed, 21 Dec 2022 11:18:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 639E742D1A; Wed, 21 Dec 2022 11:18:01 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by mails.dpdk.org (Postfix) with ESMTP id BE29140685 for ; Sun, 18 Dec 2022 16:09:34 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nh5sHhBg+FlctPCo0UrNUdOwap+j6JFzW6WTWW1C7oAjkW1L6LQDNxlqPiygMEHpGKqJI8vR4AsRpMTnzaHmeTx5Si0JCesKiIO+eNsnUIGwjMDgfRhmAXj/EsxeCyIhJHHfwAwmJ2K28T4c9aqinKnokLm1eFM5X7aZfFCHbVVCQmT69MdsB7gWEP+IfG8CZJc3VkKc3Z/5+b5cyEipnfcmhzRSLwcRqdvu7mruk7zVT056sMGw5axZxpNLTFplKv40AEG56MucQ3beAtf0lDbMfxuBpLJ/+ZKvge9GpkXxWn1JqvlnHU7gjQImmk9bjdPrC6D1rdcBWlDsUith6Q== 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=F7rNEBQR5CxKuAS4V82TluHhTVTsLktr4L5oZZCdcQM=; b=RTyP28Da2qNI2wXwmyOwwAKMAg1W8pfDpWFHNMCfQwGScRIBhvyf6GWgq02jIzMibTMxkNQ8BWY/+Ja2zAbZ6db5S+BNpRgymqFL3D862kwguGPqoZqEtD3YcxJSv3Poj1FVhA2TuL8iRq2oSgwHsbv6FvGAAhzPL8AMiXQ/29BRJAjTDz5uYffHLUPi2F6BLH8nC+HA4cWIpZW/PxXOqJzNpcjMMHuL+uS+tHvQRPW0saDfOE5Ly/Y6oOKnuEbEYJSaHIuK0/S65499Jqer8lPS4Q1uPwU7ZrYZAryEaQPILBA3KkCpe549QDLd99qzM2EzHEfYOvwx55okzUGdJA== 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=F7rNEBQR5CxKuAS4V82TluHhTVTsLktr4L5oZZCdcQM=; b=pStGfPY5UKIHvVg2Q1ktuTgP2AlB5m2IdaIZx8fRnM+HRkNP63FcUNFvuQSNJpWDpC6iTbc68mgqNqKshnQmljlRRgt9s2KIOQWLEejNbM6cdRr1Y2LMwcSSLiYvZc1b3xX8lXrFvEy43SbK32L0Ihmexal7dWTv52bMVCr0Gx1el90dBXLlQWa7UmVUVekmNY66TWT9qGNQPD2yQE4TJMl77nddff8XeR/JuBqqKE0vjtIVsjtltscocCHtxPXAou3Y38KOeqoHu+Bxu+Scdk0lW14tAZQV8pJPa/FFqv37yivTaJkveRdZGidW6UrSgZvDkDOd+d7CLA/X2UzfKQ== Received: from DS7PR06CA0040.namprd06.prod.outlook.com (2603:10b6:8:54::28) by SA1PR12MB7245.namprd12.prod.outlook.com (2603:10b6:806:2bf::18) 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:24 +0000 Received: from DM6NAM11FT071.eop-nam11.prod.protection.outlook.com (2603:10b6:8:54:cafe::48) by DS7PR06CA0040.outlook.office365.com (2603:10b6:8:54::28) 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:24 +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 DM6NAM11FT071.mail.protection.outlook.com (10.13.173.48) 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:24 +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; Sun, 18 Dec 2022 07:09:23 -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:20 -0800 From: Erez Shitrit To: , , , , , Matan Azrad CC: , , Yevgeny Kliteynik Subject: [PATCH V1 05/11] net/mlx5/hws: read cross-vhca capabilities Date: Sun, 18 Dec 2022 17:08:46 +0200 Message-ID: <20221218150853.2167280-6-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: DM6NAM11FT071:EE_|SA1PR12MB7245:EE_ X-MS-Office365-Filtering-Correlation-Id: e1fb5124-3e66-4088-8675-08dae109d94e 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: VtVGucwOJ4f7yHrLpfPkB8+U0c4gINMDdrkpEgF//xrjuRcy2heCmtViubiG/iOIdkqF3cFP2V7kGA9ULZQ0o8xnlzkfAjb1s5/pGSwQ0r+uaP4uMbMaCub59wDM+FoDjufGxla74pDJEfkkqO9JNda7gtKKK/+oq7vTXHd64wO6Uk4ESYJ8d/BaqtzS7HtgcQaB+BCovoXfuEl1QR9kPl+s9ShkVzH0IfLfi46GZ8RpY5+OLWXWzh8C+gxM/CXlNQvNU79rhTWRajYJUU8C1SH71SuMAWB0j6mtlQ5SwgYM8bttzNFsnHDwouqU/SfcZcEtsh/uS+9k2YPLIlbzI+hoYdFHPLlx7qWzvOH7ujxo4WqhNWAWWKDNUMXWT/goPvZTUGEpNTukOwoDXGHOyC9GZtuw/PFXtQWvVLrU0aKahx33H40U7eWwEIVJafzq5UyZpnN+lveSQLsIWGLC54oHuUTvLrJQizyRsu/sjBZFYlQnigNiLFdPv6rPGRACCJ/rZ2Yu1V8Xjw317JKAtjvqH577WhdJZoFKoJTuNnrYwilKdy2cWGum3WBS58OdXw/jjbgF6vxXxvqSfpFjtXiuHDF4gR0zid7xQ2Qf4A58Gjo9ttqHKQDtISoulvSeig9Mc81kjkdTOPVNwAfXaJbENLvYeuD4e36WxSNtb6zLfn8sIMIIo+LWpid6wSaM3FExq2WkWSnh7Zs2BUDjCg== 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)(39860400002)(346002)(376002)(136003)(451199015)(46966006)(40470700004)(36840700001)(70586007)(70206006)(40460700003)(86362001)(8676002)(4326008)(316002)(5660300002)(36756003)(8936002)(2616005)(41300700001)(1076003)(82310400005)(6666004)(107886003)(16526019)(7696005)(36860700001)(186003)(26005)(83380400001)(336012)(426003)(47076005)(356005)(6286002)(54906003)(6636002)(40480700001)(55016003)(82740400003)(7636003)(110136005)(478600001)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2022 15:09:24.1541 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e1fb5124-3e66-4088-8675-08dae109d94e 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: DM6NAM11FT071.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7245 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 And keep them for future processing. Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker --- drivers/net/mlx5/hws/mlx5dr_cmd.c | 24 ++++++++++++++++++++++++ drivers/net/mlx5/hws/mlx5dr_cmd.h | 1 + 2 files changed, 25 insertions(+) diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.c b/drivers/net/mlx5/hws/mlx5dr_cmd.c index 721376b8da..2156fd6643 100644 --- a/drivers/net/mlx5/hws/mlx5dr_cmd.c +++ b/drivers/net/mlx5/hws/mlx5dr_cmd.c @@ -723,6 +723,7 @@ int mlx5dr_cmd_query_caps(struct ibv_context *ctx, uint32_t in[MLX5_ST_SZ_DW(query_hca_cap_in)] = {0}; const struct flow_hw_port_info *port_info; struct ibv_device_attr_ex attr_ex; + u32 res; int ret; MLX5_SET(query_hca_cap_in, in, opcode, MLX5_CMD_OP_QUERY_HCA_CAP); @@ -798,6 +799,23 @@ int mlx5dr_cmd_query_caps(struct ibv_context *ctx, capability.cmd_hca_cap_2. format_select_dw_gtpu_first_ext_dw_0); + /* check cross-VHCA support in cap2 */ + res = + MLX5_GET(query_hca_cap_out, out, + capability.cmd_hca_cap_2.cross_vhca_object_to_object_supported); + + caps->cross_vhca_resources = (res & MLX5_CROSS_VHCA_OBJ_TO_OBJ_TYPE_STC_TO_TIR) && + (res & MLX5_CROSS_VHCA_OBJ_TO_OBJ_TYPE_STC_TO_FT) && + (res & MLX5_CROSS_VHCA_OBJ_TO_OBJ_TYPE_FT_TO_RTC); + + res = + MLX5_GET(query_hca_cap_out, out, + capability.cmd_hca_cap_2.allowed_object_for_other_vhca_access); + + caps->cross_vhca_resources &= (res & MLX5_CROSS_VHCA_ALLOWED_OBJS_TIR) && + (res & MLX5_CROSS_VHCA_ALLOWED_OBJS_FT) && + (res & MLX5_CROSS_VHCA_ALLOWED_OBJS_RTC); + MLX5_SET(query_hca_cap_in, in, op_mod, MLX5_GET_HCA_CAP_OP_MOD_NIC_FLOW_TABLE | MLX5_HCA_CAP_OPMOD_GET_CUR); @@ -817,6 +835,12 @@ int mlx5dr_cmd_query_caps(struct ibv_context *ctx, capability.flow_table_nic_cap. flow_table_properties_nic_receive.reparse); + /* check cross-VHCA support in flow table properties */ + res = + MLX5_GET(query_hca_cap_out, out, + capability.flow_table_nic_cap.flow_table_properties_nic_receive.cross_vhca_object); + caps->cross_vhca_resources &= res; + if (caps->wqe_based_update) { MLX5_SET(query_hca_cap_in, in, op_mod, MLX5_GET_HCA_CAP_OP_MOD_WQE_BASED_FLOW_TABLE | diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.h b/drivers/net/mlx5/hws/mlx5dr_cmd.h index 2b3b47f473..ab61e27fd8 100644 --- a/drivers/net/mlx5/hws/mlx5dr_cmd.h +++ b/drivers/net/mlx5/hws/mlx5dr_cmd.h @@ -163,6 +163,7 @@ struct mlx5dr_cmd_query_caps { uint8_t sq_ts_format; uint64_t definer_format_sup; uint32_t trivial_match_definer; + bool cross_vhca_resources; char fw_ver[64]; }; -- 2.18.2