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 6E995A0547; Thu, 29 Apr 2021 20:37:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C18C941257; Thu, 29 Apr 2021 20:37:25 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2081.outbound.protection.outlook.com [40.107.220.81]) by mails.dpdk.org (Postfix) with ESMTP id 59042411E2 for ; Thu, 29 Apr 2021 20:37:23 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cnMF7s/0l2k9rF3E9OWyhWxBZs/ohhImF54O57uRanL+N8msh+OzNXrt9NLLb5RSGXKPd5HBRvGBXYHB+nk+ll+S7G+19Etkh8QYuMIxV6eWqYcoOCkA9ty3qR1v62JIo5jD0Zibf1llil1I26d2CIPKcm7nXbkXb2trXGGo1gEZ50B643elnc394R6H4T0UGuCZ0znQ8jfjQe2Rt70WKOLzHv6Om/diwEz1PouMukCwfESBY5oAGSwvI/UJ81Kl42BVjvHzW8EvETZ9J0TGUTiJHSbgisA0CcEpNd+JgoN4byq8fFjlLcRN+Rtd+ETFGRba5uF5CIMXT4SMORmzyg== 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-SenderADCheck; bh=V632OrQM1wl6PXvUgFw5HVJvMuX4b18TFDXDRrKF+5I=; b=aiHUfup45OuR8TSs3RMLn6wfQC3shDJR4d9LlPIwRBwJJiatLKPioEDLtrEu3T00ApVUcYR1tPBx1YpCutLgbNGmtSvjFsrk51P+feg4tpZKQGLFXvVGdC0AtiT3WYzOxK+rvSRI3jUO3At8rts27USpwT4FCLXUYexUuFRbjc0AcS4WvafENFOkDQOuwDZEoVvu6i5+t3akYvYN6HJhcVEueNif1vtoYO/8w7zsYO0Vbny1NNAxSum0rQ2itZEzFZQuikCKMt/CcLI+k80asT8k2RtH7m1AIvi9S+7TtJ2ZvV04Y9P0n/q40kiqDXU2HIPIX1iJCh01une9gTPcnw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none 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=V632OrQM1wl6PXvUgFw5HVJvMuX4b18TFDXDRrKF+5I=; b=DGWVamukwIaLxGN4PgRT4VxHF6q3ETl+9k7S0x+s9Aa00qzfBQShZP33RjCK8xB7UoJiHLbNORsMJk9pQmZWBnpQ+bGcqz2hd8DFHRyzCqjW8tGKblZAyq529t4NAVvrwT6mqxdpFa8LQEgqTj4pXIFBcgaTmvYxp1AMmOTbK7DpUMnqyk3VC7ui5H/cdTA5aMceFKxW9a5ollBrgdgxt9lrzKPnhU3Hi69HC7PDQBjrIcmM+UsUQHH/X0qEftkBVy4j+weWodXnpIvuWtDezRRDTSVDMQh85tZnOIMnMv9oekBFciA2cnr/KRpeN6GBVkNwQoOan93ujmD51yCbfQ== Received: from DM6PR03CA0011.namprd03.prod.outlook.com (2603:10b6:5:40::24) by BL1PR12MB5174.namprd12.prod.outlook.com (2603:10b6:208:31c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Thu, 29 Apr 2021 18:37:21 +0000 Received: from DM6NAM11FT030.eop-nam11.prod.protection.outlook.com (2603:10b6:5:40:cafe::b8) by DM6PR03CA0011.outlook.office365.com (2603:10b6:5:40::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.25 via Frontend Transport; Thu, 29 Apr 2021 18:37:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT030.mail.protection.outlook.com (10.13.172.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4087.27 via Frontend Transport; Thu, 29 Apr 2021 18:37:21 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 29 Apr 2021 18:37:19 +0000 From: Gregory Etelson To: CC: , , , , Viacheslav Ovsiienko , "Shahaf Shuler" Date: Thu, 29 Apr 2021 21:36:57 +0300 Message-ID: <20210429183659.14765-3-getelson@nvidia.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210429183659.14765-1-getelson@nvidia.com> References: <20210428175906.21387-1-getelson@nvidia.com> <20210429183659.14765-1-getelson@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 327c0c7f-e2a5-4769-0245-08d90b3dd35a X-MS-TrafficTypeDiagnostic: BL1PR12MB5174: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IlcTe2LGvatqiKFZKIJCigEKCsX31+7xFlm9MZiE1JAR02yeEiB0WwZ9jhfJGjCql78YqPk2Qup883EEBFsYQQkH2SWMNg0NJY3CokIcSWFbkQ1Ompkt/ofwaBa7GQVDh9eKh05gmIazWMovF57ZHwkNcxaHJNp2kFQX82C4rH6wihrCuzpospJ+PFHyLfRttyzvD9s2u/G81sUi4I8MlVVOp0GmoN/+Fb1Px7nPSegWlAFrpXCsJlqscfCu/62JvUnRowEgAN1bZb5y+EH9iPT+PVKvxD7B7S2H5bZ/yd5NJN26nEkcGvQA6o9KElcSD9CVGbDT52u8yFsSm45hh3Qd0uRquxbPQSwAMJqVCPJDqJG8cm8wajMLUvu42+6QNiyJazjuIkyDyp78ZkLSH1rnXTrFXXgYPRD9cqvvid6x6zOVVhBS/1p/X3ycx0tSPIUiTaLnepNRM8BJfxH6f/JzF9G7suu4ZyCYdCAg9/LlB+ZbqLsrFJxj1Par13LbguNE+Fr7j1M/SkGab5kZCPZ13B46YIDnqLB/AaW82pPuT63aPG0yGmly4o1NNnavXmHLPgyKAoTGRb78Ykd9SOPgEJKcnIUvzE4Tz8bAlC9XFv3fJsi4n+us5G2tWVwvWsEphcD5E2pbhJ4PKv7abVmKc0oYEWfDEONyUW7TODE= X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(376002)(346002)(396003)(39860400002)(136003)(36840700001)(46966006)(356005)(2616005)(47076005)(5660300002)(16526019)(478600001)(2906002)(8936002)(7696005)(107886003)(83380400001)(6286002)(36860700001)(1076003)(82740400003)(8676002)(186003)(55016002)(82310400003)(70586007)(86362001)(336012)(36906005)(426003)(36756003)(316002)(70206006)(4326008)(7636003)(26005)(54906003)(6916009)(6666004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2021 18:37:21.5418 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 327c0c7f-e2a5-4769-0245-08d90b3dd35a X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT030.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5174 Subject: [dpdk-dev] [PATCH v3 2/4] net/mlx5: update PRM definitions 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 Sender: "dev" Add integrity and IPv4 IHL bits to PRM file. Signed-off-by: Gregory Etelson Acked-by: Viacheslav Ovsiienko --- drivers/common/mlx5/mlx5_devx_cmds.c | 31 ++++++++++++++++++++--- drivers/common/mlx5/mlx5_devx_cmds.h | 1 + drivers/common/mlx5/mlx5_prm.h | 37 +++++++++++++++++++++++++--- 3 files changed, 62 insertions(+), 7 deletions(-) diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c index 79fff6457c..1b54c05313 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.c +++ b/drivers/common/mlx5/mlx5_devx_cmds.c @@ -626,6 +626,29 @@ mlx5_devx_cmd_create_flex_parser(void *ctx, return parse_flex_obj; } +static int +mlx5_devx_query_pkt_integrity_match(void *hcattr) +{ + return MLX5_GET(flow_table_nic_cap, hcattr, + ft_field_support_2_nic_receive.inner_l3_ok) && + MLX5_GET(flow_table_nic_cap, hcattr, + ft_field_support_2_nic_receive.inner_l4_ok) && + MLX5_GET(flow_table_nic_cap, hcattr, + ft_field_support_2_nic_receive.outer_l3_ok) && + MLX5_GET(flow_table_nic_cap, hcattr, + ft_field_support_2_nic_receive.outer_l4_ok) && + MLX5_GET(flow_table_nic_cap, hcattr, + ft_field_support_2_nic_receive + .inner_ipv4_checksum_ok) && + MLX5_GET(flow_table_nic_cap, hcattr, + ft_field_support_2_nic_receive.inner_l4_checksum_ok) && + MLX5_GET(flow_table_nic_cap, hcattr, + ft_field_support_2_nic_receive + .outer_ipv4_checksum_ok) && + MLX5_GET(flow_table_nic_cap, hcattr, + ft_field_support_2_nic_receive.outer_l4_checksum_ok); +} + /** * Query HCA attributes. * Using those attributes we can check on run time if the device @@ -823,10 +846,10 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, return -1; } hcattr = MLX5_ADDR_OF(query_hca_cap_out, out, capability); - attr->log_max_ft_sampler_num = - MLX5_GET(flow_table_nic_cap, - hcattr, flow_table_properties.log_max_ft_sampler_num); - + attr->log_max_ft_sampler_num = MLX5_GET + (flow_table_nic_cap, hcattr, + flow_table_properties_nic_receive.log_max_ft_sampler_num); + attr->pkt_integrity_match = mlx5_devx_query_pkt_integrity_match(hcattr); /* Query HCA offloads for Ethernet protocol. */ memset(in, 0, sizeof(in)); memset(out, 0, sizeof(out)); diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h index 870bdb6b30..5681e03fee 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.h +++ b/drivers/common/mlx5/mlx5_devx_cmds.h @@ -143,6 +143,7 @@ struct mlx5_hca_attr { uint32_t cqe_compression:1; uint32_t mini_cqe_resp_flow_tag:1; uint32_t mini_cqe_resp_l3_l4_tag:1; + uint32_t pkt_integrity_match:1; /* 1 if HW supports integrity item */ struct mlx5_hca_qos_attr qos; struct mlx5_hca_vdpa_attr vdpa; int log_max_qp_sz; diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index efa5ae67bf..330101233a 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -778,7 +778,12 @@ struct mlx5_ifc_fte_match_set_lyr_2_4_bits { u8 tcp_flags[0x9]; u8 tcp_sport[0x10]; u8 tcp_dport[0x10]; - u8 reserved_at_c0[0x18]; + u8 reserved_at_c0[0x10]; + u8 ipv4_ihl[0x4]; + u8 l3_ok[0x1]; + u8 l4_ok[0x1]; + u8 ipv4_checksum_ok[0x1]; + u8 l4_checksum_ok[0x1]; u8 ip_ttl_hoplimit[0x8]; u8 udp_sport[0x10]; u8 udp_dport[0x10]; @@ -1656,9 +1661,35 @@ struct mlx5_ifc_roce_caps_bits { u8 reserved_at_20[0x7e0]; }; +/* + * Table 1872 - Flow Table Fields Supported 2 Format + */ +struct mlx5_ifc_ft_fields_support_2_bits { + u8 reserved_at_0[0x14]; + u8 inner_ipv4_ihl[0x1]; + u8 outer_ipv4_ihl[0x1]; + u8 psp_syndrome[0x1]; + u8 inner_l3_ok[0x1]; + u8 inner_l4_ok[0x1]; + u8 outer_l3_ok[0x1]; + u8 outer_l4_ok[0x1]; + u8 psp_header[0x1]; + u8 inner_ipv4_checksum_ok[0x1]; + u8 inner_l4_checksum_ok[0x1]; + u8 outer_ipv4_checksum_ok[0x1]; + u8 outer_l4_checksum_ok[0x1]; +}; + struct mlx5_ifc_flow_table_nic_cap_bits { - u8 reserved_at_0[0x200]; - struct mlx5_ifc_flow_table_prop_layout_bits flow_table_properties; + u8 reserved_at_0[0x200]; + struct mlx5_ifc_flow_table_prop_layout_bits + flow_table_properties_nic_receive; + struct mlx5_ifc_flow_table_prop_layout_bits + flow_table_properties_unused[5]; + u8 reserved_at_1C0[0x200]; + u8 header_modify_nic_receive[0x400]; + struct mlx5_ifc_ft_fields_support_2_bits + ft_field_support_2_nic_receive; }; union mlx5_ifc_hca_cap_union_bits { -- 2.31.1