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 61CF9A0501; Sat, 2 Apr 2022 09:12:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 72F27427E9; Sat, 2 Apr 2022 09:12:16 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2054.outbound.protection.outlook.com [40.107.243.54]) by mails.dpdk.org (Postfix) with ESMTP id 747AA40143 for ; Sat, 2 Apr 2022 09:12:15 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YOVgY377mHgEoxKvHRceewZt8+w9LLDYWQTqqmk34MQu+XNUHObGQ3FY3scgG0ZEXaXV7xNd1kHNwxpr/P3j4jAaP4KzYMMiebMsWu5q53tFnCQkXgKWZOz8B5JV2G7nsSXU0xLWsIzg3jATrZ2vaaoXT8TWcTQbJDP6pgvXa4ImoycCGEYZhm0aUlf2X0C87heNMMjJa+7sZfInfbkcW6zQHO7PPySHbY4+CdBx4nZVVR6jAP1OtjdK0MswSSHp6Dt1winzU0WUS+s1txB67K6I2uwZNy2xxd8+c133gr95LZQf5yjWzJdUUjR5M5n1FcRvmnQ39FVQQ4FYyNVVWw== 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=0ctIrjRxkCk2VF0Hm9Ty/uPhWnxdJFeKDCmDXwnsUqY=; b=fYN4iNYtr4VZ+WtQpMjQxsLI4EkIBMJhdGxiRwujDNzjyanpfpgK5gPSJIWOh15Yw5ApGO/q2eQguI8Y1JDM3sQHneo+XIdnnWDvsjkqN9VGhiWHBUMc6gmArPcDmgkd9+bUoVs0dMzDsBTW3NVW4x3PXxEH0/GPIjZmMdLTbANprGQONynHwJemVy6aXmHXgogTFuZG+qsZXsJ0zWF92F0NXfDRlnanwDsH64aorpsLLYDjUO7+HAbO3a4qHNGJaDVjaQaZP0/E3Zbjku/oImfv68x3WixWY/5LIx9s4S57M8EupvlqPy0FFRl2LV83hlk3OCoACftOYvkT3WilhA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) smtp.rcpttodomain=dpdk.org 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=0ctIrjRxkCk2VF0Hm9Ty/uPhWnxdJFeKDCmDXwnsUqY=; b=kB6A1CzJMHurOx54tSdUNvlGkxgG7vXENEwYZ1/GL8fNbvgwg2VNdESpSvartEZ0DtP/2H1+GEagpoBCaOZ6BMCFdM3barntg9vpeaR5t1jZYIFrNQhjCtmnJQ0m8jnSPFJCH3uN2PftyQ7f/i/bqyw/3OTOJL1SlbnORvGqOtcn1AhmnXxRgF639B4acE1YJuLClYPS2qJcHM8SeK++reNhe9ca5o5Q206srWIx2/RtrmBU+u62ATJb/qIkZ18zE/hPTRcpHS70ONfoGU10OxHSOZU/1hGYCdCIj6EpOImyrzBjDZsImG7qMf1IMCGSU6bf+gyRRuL1GvLgqOXBbw== Received: from BN7PR06CA0038.namprd06.prod.outlook.com (2603:10b6:408:34::15) by MN0PR12MB5955.namprd12.prod.outlook.com (2603:10b6:208:37e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.22; Sat, 2 Apr 2022 07:12:13 +0000 Received: from BN8NAM11FT008.eop-nam11.prod.protection.outlook.com (2603:10b6:408:34:cafe::bb) by BN7PR06CA0038.outlook.office365.com (2603:10b6:408:34::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.30 via Frontend Transport; Sat, 2 Apr 2022 07:12:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) 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 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.238) by BN8NAM11FT008.mail.protection.outlook.com (10.13.177.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5123.19 via Frontend Transport; Sat, 2 Apr 2022 07:12:13 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Sat, 2 Apr 2022 07:12:12 +0000 Received: from nvidia.com (10.126.230.35) 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.22; Sat, 2 Apr 2022 00:12:11 -0700 From: Sean Zhang To: Matan Azrad , Viacheslav Ovsiienko CC: Subject: [v1 2/4] common/mlx5: add modify ECN capability check Date: Sat, 2 Apr 2022 10:11:48 +0300 Message-ID: <20220402071150.9392-3-xiazhang@nvidia.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220402071150.9392-1-xiazhang@nvidia.com> References: <20220402071150.9392-1-xiazhang@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eb319887-5840-48b5-8ba8-08da14781ca8 X-MS-TrafficTypeDiagnostic: MN0PR12MB5955:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OSSei1jlyI8YP2T0xoGj50PCMQqXiLAHgFY/gjvofMsa20or9SX5JW2WRzOXbpqGJDF//UINAaNT+iGgzSzR52C65dbYdihsOaveFnaEOFxgYuZjFojPeBt0SJThmd+5AXLw4SIJJ+olqWCJmqnp6fOIOS+vFpb41tH5VFtIshza3HbnM6M2GqrNKs6CJ/edD+nZSwavp7Yf9//Bg4v5mzE99azIm4jF0krQkyVnjsA3mkbh/7tJ32084ESqGOy3BZ9eCRVEb1KAcuYAcE2cz0rBMgy8UYNDFfHNNEl6ecRoXZCF5uKUdZ8p5PgGBGx6tNCiECDaZgx9CZO6dGiI0Q7l9ExWKPOI/3OlpGxjfC21y6ccU6dgKuUixBb2rCCLtrRdXvrQwP3tRfDJINndsMp1zAdiMo/6yri0LwlbUqXUD9swgK3JzsBv6KI+HwNQewTRowIBaIdQIUc4gw0XhteZ7LRyGa9MQ3bPdZLcRr+W+RYDKqoMtDrDZeHiW2bgQvoW2YrLdnZv6DCSeiNphQMao54aCScQiw9V4g0tBJWL/pfddFMEdxP54s4u4jaF7baUQ5wvdEiOQOj2HjQBuWaWplIXeYFSM7YlQuvcvYMDUaYzXw8hLokKbyCsxcMS7ump+FPsnjCkybUPrIQ65vfcW5Srwls3S22SjR8bZGFm8dlyFQXV1d7UWMYnLBqmuj9v3U61kKWbpYBOvduyqw== X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(6636002)(5660300002)(4326008)(8936002)(356005)(2906002)(82310400004)(316002)(70206006)(110136005)(81166007)(70586007)(8676002)(40460700003)(508600001)(6286002)(426003)(336012)(36756003)(6666004)(86362001)(16526019)(47076005)(2616005)(1076003)(83380400001)(26005)(186003)(7696005)(55016003)(36860700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Apr 2022 07:12:13.4066 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eb319887-5840-48b5-8ba8-08da14781ca8 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT008.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5955 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 Flag outer_ip_ecn in header modify capabilities properties layout is added in order to check if the firmware supports modification of ecn field. Signed-off-by: Sean Zhang --- drivers/common/mlx5/mlx5_devx_cmds.c | 3 ++ drivers/common/mlx5/mlx5_devx_cmds.h | 1 + drivers/common/mlx5/mlx5_prm.h | 62 +++++++++++++++++++++++++++- 3 files changed, 65 insertions(+), 1 deletion(-) diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c index d02ac2a678..72296c1ca3 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.c +++ b/drivers/common/mlx5/mlx5_devx_cmds.c @@ -1047,6 +1047,9 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, attr->flow.tunnel_header_2_3 = MLX5_GET (flow_table_nic_cap, hcattr, ft_field_support_2_nic_receive.tunnel_header_2_3); + attr->modify_outer_ip_ecn = MLX5_GET + (flow_table_nic_cap, hcattr, + ft_header_modify_nic_receive.outer_ip_ecn); attr->pkt_integrity_match = mlx5_devx_query_pkt_integrity_match(hcattr); attr->inner_ipv4_ihl = MLX5_GET (flow_table_nic_cap, hcattr, diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h index 1bac18c59d..6e9e23f593 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.h +++ b/drivers/common/mlx5/mlx5_devx_cmds.h @@ -256,6 +256,7 @@ struct mlx5_hca_attr { uint32_t esw_mgr_vport_id_valid:1; /* E-Switch Mgr vport ID is valid. */ uint16_t esw_mgr_vport_id; /* E-Switch Mgr vport ID . */ uint16_t max_wqe_sz_sq; + uint32_t modify_outer_ip_ecn:1; }; /* LAG Context. */ diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index 44b18225f6..caaa4c7fb9 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -744,6 +744,7 @@ enum mlx5_modification_field { MLX5_MODI_OUT_TCP_ACK_NUM, MLX5_MODI_IN_TCP_ACK_NUM = 0x5C, MLX5_MODI_GTP_TEID = 0x6E, + MLX5_MODI_OUT_IP_ECN = 0x73, }; /* Total number of metadata reg_c's. */ @@ -1884,6 +1885,62 @@ struct mlx5_ifc_roce_caps_bits { u8 reserved_at_20[0x7e0]; }; +struct mlx5_ifc_ft_fields_support_bits { + u8 outer_dmac[0x1]; + u8 outer_smac[0x1]; + u8 outer_ether_type[0x1]; + u8 reserved_at_3[0x1]; + u8 outer_first_prio[0x1]; + u8 outer_first_cfi[0x1]; + u8 outer_first_vid[0x1]; + u8 reserved_at_7[0x1]; + u8 outer_second_prio[0x1]; + u8 outer_second_cfi[0x1]; + u8 outer_second_vid[0x1]; + u8 reserved_at_b[0x1]; + u8 outer_sip[0x1]; + u8 outer_dip[0x1]; + u8 outer_frag[0x1]; + u8 outer_ip_protocol[0x1]; + u8 outer_ip_ecn[0x1]; + u8 outer_ip_dscp[0x1]; + u8 outer_udp_sport[0x1]; + u8 outer_udp_dport[0x1]; + u8 outer_tcp_sport[0x1]; + u8 outer_tcp_dport[0x1]; + u8 outer_tcp_flags[0x1]; + u8 outer_gre_protocol[0x1]; + u8 outer_gre_key[0x1]; + u8 outer_vxlan_vni[0x1]; + u8 reserved_at_1a[0x5]; + u8 source_eswitch_port[0x1]; + u8 inner_dmac[0x1]; + u8 inner_smac[0x1]; + u8 inner_ether_type[0x1]; + u8 reserved_at_23[0x1]; + u8 inner_first_prio[0x1]; + u8 inner_first_cfi[0x1]; + u8 inner_first_vid[0x1]; + u8 reserved_at_27[0x1]; + u8 inner_second_prio[0x1]; + u8 inner_second_cfi[0x1]; + u8 inner_second_vid[0x1]; + u8 reserved_at_2b[0x1]; + u8 inner_sip[0x1]; + u8 inner_dip[0x1]; + u8 inner_frag[0x1]; + u8 inner_ip_protocol[0x1]; + u8 inner_ip_ecn[0x1]; + u8 inner_ip_dscp[0x1]; + u8 inner_udp_sport[0x1]; + u8 inner_udp_dport[0x1]; + u8 inner_tcp_sport[0x1]; + u8 inner_tcp_dport[0x1]; + u8 inner_tcp_flags[0x1]; + u8 reserved_at_37[0x9]; + u8 reserved_at_40[0x40]; +}; + /* * Table 1872 - Flow Table Fields Supported 2 Format */ @@ -1923,7 +1980,10 @@ struct mlx5_ifc_flow_table_nic_cap_bits { flow_table_properties_nic_transmit_rdma; struct mlx5_ifc_flow_table_prop_layout_bits flow_table_properties_nic_transmit_sniffer; - u8 reserved_at_e00[0x600]; + u8 reserved_at_e00[0x200]; + struct mlx5_ifc_ft_fields_support_bits + ft_header_modify_nic_receive; + u8 reserved_at_1080[0x380]; struct mlx5_ifc_ft_fields_support_2_bits ft_field_support_2_nic_receive; }; -- 2.31.1