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 D1BACA0A0A; Wed, 28 Apr 2021 19:59:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3EA51412C1; Wed, 28 Apr 2021 19:59:36 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2060.outbound.protection.outlook.com [40.107.92.60]) by mails.dpdk.org (Postfix) with ESMTP id 01C7241101 for ; Wed, 28 Apr 2021 19:59:32 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l6T0c2T5zporchh9EC5Y/m30nNcmF7uSTOwXT9OmScFsWIwFr+lR6JC8K/nKFjfeIgodVpkItcaYPDSFNR98rWZjNdHmaGQfhIHXFHawrBYW+rAM6VlhgutD1FysDZl7k7nwRGkqWO5uJXG5L5U4wTuamEuQZIlTuKEAHpYN2x84YhXCh9/f/0tv7hMa2CMh4zp0WG6UkQbf/sr4Ga09YSvNF7GxlZlI0KyOE8D+JTPh31JnzDC2CP/NUtzZndifHRdoBa4RPC7l6Aij5WUcmyjQUFA3MT370sF196a85A8oO9OwHZzvZ7UlP7xcUtThIsllPb9oUZxyAp20iZZFrQ== 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=+Bm1nDhAv2hov74gtoCFTzH72BaLb2NIbahinLVYfgM=; b=XSyJnkv9zp2JRhgYyWqkDC8/QcnvF3oXpl3wSDbsFMkjA3j223F/leG2HGMFRkWzjwzeqhp0zfYXwQzaIkqIqqkwD0BcYLi3Hd/Nd60nNmXRnq/rj1Kd9UhCXYhnH15m9d+i5eTGHaa/STHeHCRSllVBPzPw8TBU3l/t76Qz9G6qM0AI57X9gGB3tGcKB+8omlhL90qRU5trZP4ta4zqh0pImAQRSiXoKPtCEurzV3SeLn9qIKG2bBXR+AqhnSPOakgc8x9MSQEFmCQDOvTwJsZtpS3IaZH6xcXVgVhYASHmDS/oQkRoQUIfSaKYaph18XKfQYJumPigxKPEUgACqg== 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=+Bm1nDhAv2hov74gtoCFTzH72BaLb2NIbahinLVYfgM=; b=cYs4VuW3yN4KO4koojb6HhEB0kAHG5BLwgGu8J5QU6VTnFWuYffUp4k6Ozg4DH7kVtZO9jvbgB+GIrl7uYDqEahRtYE48RPVR/pFTeTwJRdlF1e+4ECVg2EVloV8wGVLoT/UGR92c6Lf7cWMZ/sXZsgAR/l1FjoOS+3wObxfhDQP5aw4N1kSHNSseYqi9NttIMoWPUmw788IrHn7o3WusB3+Lo3bG0DENzSufy8X2BqF98BL82UCI+btdxuI8cv7jM7FtcefBZ4+0mN2SXgjMAe72z3FVC2HUKD+026C06bS/YsUBWqzAhobagpe3Pi3t0fEfufmopRoNQBojfmLNA== Received: from DM5PR16CA0030.namprd16.prod.outlook.com (2603:10b6:4:15::16) by DM8PR12MB5477.namprd12.prod.outlook.com (2603:10b6:8:35::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Wed, 28 Apr 2021 17:59:31 +0000 Received: from DM6NAM11FT014.eop-nam11.prod.protection.outlook.com (2603:10b6:4:15:cafe::a9) by DM5PR16CA0030.outlook.office365.com (2603:10b6:4:15::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21 via Frontend Transport; Wed, 28 Apr 2021 17:59:31 +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 DM6NAM11FT014.mail.protection.outlook.com (10.13.173.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4065.21 via Frontend Transport; Wed, 28 Apr 2021 17:59:31 +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; Wed, 28 Apr 2021 17:59:29 +0000 From: Gregory Etelson To: CC: , , , , Viacheslav Ovsiienko , "Shahaf Shuler" Date: Wed, 28 Apr 2021 20:59:04 +0300 Message-ID: <20210428175906.21387-3-getelson@nvidia.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210428175906.21387-1-getelson@nvidia.com> References: <20210428175906.21387-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: 7a280359-8d86-49a1-cda9-08d90a6f5fed X-MS-TrafficTypeDiagnostic: DM8PR12MB5477: 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: va6nEWCKLhBlDEMxak4ppl19sjp2FYdVRL3XluK7D/5I0RZ5EC6h0dHE337yX/dxoPV3nhozvm1N3JQ0Ot0FnfSDbpR+Tteaec2PtQX2eHd90IHwK1j7IlZsayCNXDVhgeww0e+7lyfEZwRc8wuvfcU6/sofBkdPS/nHcgYSmPeNCXsfDfRJa3u0oytqtmouK+WP9X74Gm4Nk9lphSzPHUsxCjBjgjDYNbtZndxcxOoE5t4rdfxziLOOtFIQyoQ/syQlxGTioFUEjaU+ZomNhTohnw+LzbKBpf+u+Rx8PIWhxTruvdjGmskSaWqsNTU01zB6LRi1NqdnsW+GUkBlu2ZHjuJJiZlOorK45poC7wqfmSaBCwLrzDNXVyFV9g69+bur1Yw641RhPa831eOoNeaxLCy9A5XrypqO9FZk128xXsWu8FngUrFdlAznHi416iAXgJJ7rtqw4Q9MxxGPD+hS92rXY+gNrx9tB8EL5fOnLRMXTLp/fuB2LWRpmT5M0Y2171ua+ldkcF6+rufaREHKNFuUnNBtx88CersiPfaOmRIs7LRAQCZVUc/Jpkp4uOw2eSMdd6pRvi8T5V11smy9QKEg92kzZToTlHlsgebmxfTocpKtLGKg/drj9vGyr8yCyzYvyrbUG4QF13kU4QIPnSrbl8LHutRoGdA3j/Y= 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)(39860400002)(396003)(376002)(136003)(346002)(36840700001)(46966006)(54906003)(36906005)(16526019)(36756003)(82310400003)(70206006)(6286002)(356005)(86362001)(107886003)(336012)(1076003)(7636003)(70586007)(316002)(55016002)(186003)(83380400001)(82740400003)(7696005)(2616005)(47076005)(2906002)(6666004)(4326008)(5660300002)(426003)(36860700001)(26005)(6916009)(8936002)(8676002)(478600001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2021 17:59:31.5674 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7a280359-8d86-49a1-cda9-08d90a6f5fed 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: DM6NAM11FT014.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR12MB5477 Subject: [dpdk-dev] [PATCH 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 | 35 ++++++++++++++++++++++++++-- 3 files changed, 61 insertions(+), 6 deletions(-) diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c index 6c6f4391a1..3d3994e575 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 eee8fee107..b31a828383 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.h +++ b/drivers/common/mlx5/mlx5_devx_cmds.h @@ -142,6 +142,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 c6d8060bb9..903faccd56 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; + 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