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 8A4DDA0524; Wed, 5 May 2021 08:51:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 61240410F6; Wed, 5 May 2021 08:51:17 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2069.outbound.protection.outlook.com [40.107.244.69]) by mails.dpdk.org (Postfix) with ESMTP id 583A9410E5 for ; Wed, 5 May 2021 08:51:15 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UFgL2VpAcpiKRo7GH6AoOdHgHw3rsuVMqytDxrF2O64oHtoLLPefDGj0KY/Z9SUssxalNUW37zuGiVDJWQkNlWpZheRXg37d/K+rRhZ/Fh/LZB+UvTLWIa/bvMtk+ge28gUImaU0pvnzSZJKQCW99sgK+UK5MaGyymLsRvOG/Df7wJe+WXKN5V1b5HxQEv3E1Viz0vuF2PUTjpS+SvfN43e/D+pdu284tfJlMLUTajf3yAxJdeyDQ1GfC5FjYcFQSz5ZA+S/r28oXeOCJ7E/FlOne4o6ZBhAubJZKlyFQm5DXNHDxTdDYx2/o54rWxfcsIGYNck2fvJMtrFsJZ8Oww== 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=TzjKxqdDoA0Oq0vxFgH0kH2QG6IPKOJs/6eAPWmHA04=; b=cjRgz7tux/PmkmjCAneEnADZ6d/g2QmfSM1RSshEt++JIdMKQ/a0ttaoni/SumReWZDgusxcTuxWN74xJspVSj/80cah+wRrw7uJmQwzySaiiBpjuJZEPbmn5BvDp9Mth6lms/SJeDCilzT6O4LlGhW+AUc6WluHD+v06HGQh0pZ31ilpmRwrZoivqw29/4sJAuhJrSAX47YPPc2j/ndSpm1CozbvE8I4I7mByLsBDvjcEbn5njuKLg2AqDA/cHuzyxw35X63FJHVcdMj3i4fRzGms2SxRq88D94drcmYJd2LQWNDJWpk8tlxkMROy7R0rTd54GGHPvkdD8jZw9iJg== 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=TzjKxqdDoA0Oq0vxFgH0kH2QG6IPKOJs/6eAPWmHA04=; b=VMx4XK/C6aoh7L3ynACs0RM4XqjJqi9PUkFz+EARP/UCLvzzfu7QGPXIK/jeGvVh9Zw5cpwiiqU6X/kprvyvF5184xL3e6g0QP++YIKd4T4fmXZ5D8k2jtut2OmJ8pRGqe1YlVl6yfuocO9+wGykAMJ4QWI18Ug7ZJieUWrt7iUx419IuXICOXhlBGod1+vIGH+tEHXsM9ZOFzfEPO7ERP0+UY5KmwhOWxbbv0QtYEgADtErhkEmBfKdyLrtWLvPCpILamHMWyO+cK3viwEp5IFpXpEG42siA6WEFN7FbruKKTHEq6mVoh6pzs32CcdqxDA6keJLb7cfTuxSJ1YEHQ== Received: from BN9PR03CA0434.namprd03.prod.outlook.com (2603:10b6:408:113::19) by BL1PR12MB5095.namprd12.prod.outlook.com (2603:10b6:208:31b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.26; Wed, 5 May 2021 06:51:13 +0000 Received: from BN8NAM11FT041.eop-nam11.prod.protection.outlook.com (2603:10b6:408:113:cafe::8) by BN9PR03CA0434.outlook.office365.com (2603:10b6:408:113::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.24 via Frontend Transport; Wed, 5 May 2021 06:51:13 +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 BN8NAM11FT041.mail.protection.outlook.com (10.13.177.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Wed, 5 May 2021 06:51:12 +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, 5 May 2021 06:50:31 +0000 From: Bing Zhao To: , , CC: , , Date: Wed, 5 May 2021 09:49:52 +0300 Message-ID: <20210505065008.30680-2-bingz@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210505065008.30680-1-bingz@nvidia.com> References: <20210427153811.11554-1-bingz@nvidia.com> <20210505065008.30680-1-bingz@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 40e1b741-9113-4376-bb66-08d90f922c24 X-MS-TrafficTypeDiagnostic: BL1PR12MB5095: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bj7YBMTsVHS2lp0kzQTkwfofrqc/lhZwQyIX96uwjCi8AbdWIKDJr8vGscr3CMRmKucdxF8O+6otJnVJ8I5MACI5J4GPVOpHmrtqO1synHcUlIt1y37EsCUYCNLic0hccnNMBiu8LQV3qTHk36kAQxu6uUe7HF8RwtD2wHt+Bq1wqBF+WzVBePddJn16islECcXRJBfsuqVkoRqYPhGYEIRkLnPZGMsv5FItdwn2tqFJrzNp++3QfzVVLc4lciAMS0TaaQxb2yiw9wALNV3uFojDt1g7+BwUYhGWe5id3IDSTA8EttKoCbmMecZJTh/2PxgJapUuAGamRLrrV+1seFmDCQ7wq5hFpJgYzdNcBHks2ZrWu14I4JlBAFgsi6DEkxgTY+bIEMUIFVDINiYLnFzjqXfppiXR8TVxUYgmxs7vvBIRD3RA3BrDWQ4frqB3R0JdAfnSWijNT8++zwqMXag/4A29/bN7PKJ+VQIXb/iftEN5sStguBy0rLsqE5ZGgx+ccSA4S5tlGUpdaAQw5XPGuFw2ER4rrE6/xkMXXNGlFCEZNWyEFhnmNxzDf/yPoj92Rdpbrfgrg4RDPpD83UnudAxLs8HH26XAQeCIVrG0OU47aehI6yqroCPi0vHsU5DudiFdsV3A+Ydr4wtU/8VCd0JScAaK8GMK/NludBA= 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)(346002)(376002)(396003)(136003)(39860400002)(36840700001)(46966006)(26005)(36756003)(70206006)(478600001)(36860700001)(16526019)(426003)(316002)(356005)(86362001)(8936002)(7636003)(55016002)(186003)(82740400003)(7696005)(6286002)(8676002)(5660300002)(47076005)(83380400001)(1076003)(6666004)(110136005)(2616005)(82310400003)(54906003)(4326008)(107886003)(336012)(36906005)(70586007)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2021 06:51:12.7973 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 40e1b741-9113-4376-bb66-08d90f922c24 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: BN8NAM11FT041.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5095 Subject: [dpdk-dev] [PATCH v3 01/17] common/mlx5: add connection tracking object definition 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" The structures of ASO connection tracking offload object are added based on the definitions in the PRM. One CT object context will be loaded into the cache completely in a reversed order of dwords. The valid bit should be the MSB of the last dword. This is used for the conntrack context creation and update, as well as for the query. The capabilities 2 (HCA_CAP_2) layout is also added. The connection tracking related capabilities could be queried via the HCA_CAP_2. Signed-off-by: Bing Zhao --- drivers/common/mlx5/mlx5_prm.h | 85 ++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index efa5ae67bf..4da89d3379 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -1119,6 +1119,7 @@ enum { MLX5_GET_HCA_CAP_OP_MOD_ROCE = 0x4 << 1, MLX5_GET_HCA_CAP_OP_MOD_NIC_FLOW_TABLE = 0x7 << 1, MLX5_GET_HCA_CAP_OP_MOD_VDPA_EMULATION = 0x13 << 1, + MLX5_GET_HCA_CAP_OP_MOD_GENERAL_DEVICE_2 = 0x20 << 1, }; #define MLX5_GENERAL_OBJ_TYPES_CAP_VIRTQ_NET_Q \ @@ -1661,6 +1662,29 @@ struct mlx5_ifc_flow_table_nic_cap_bits { struct mlx5_ifc_flow_table_prop_layout_bits flow_table_properties; }; +struct mlx5_ifc_cmd_hca_cap_2_bits { + u8 reserved_at_0[0x80]; /* End of DW4. */ + u8 reserved_at_80[0xb]; + u8 log_max_num_reserved_qpn[0x5]; + u8 reserved_at_90[0x3]; + u8 log_reserved_qpn_granularity[0x5]; + u8 reserved_at_98[0x3]; + u8 log_reserved_qpn_max_alloc[0x5]; /* End of DW5. */ + u8 max_reformat_insert_size[0x8]; + u8 max_reformat_insert_offset[0x8]; + u8 max_reformat_remove_size[0x8]; + u8 max_reformat_remove_offset[0x8]; /* End of DW6. */ + u8 aso_conntrack_reg_id[0x8]; + u8 reserved_at_c8[0x3]; + u8 log_conn_track_granularity[0x5]; + u8 reserved_at_d0[0x3]; + u8 log_conn_track_max_alloc[0x5]; + u8 reserved_at_d8[0x3]; + u8 log_max_conn_track_offload[0x5]; + u8 reserved_at_e0[0x20]; /* End of DW7. */ + u8 reserved_at_100[0x700]; +}; + union mlx5_ifc_hca_cap_union_bits { struct mlx5_ifc_cmd_hca_cap_bits cmd_hca_cap; struct mlx5_ifc_per_protocol_networking_offload_caps_bits @@ -2599,6 +2623,67 @@ struct mlx5_ifc_create_flow_meter_aso_in_bits { struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; struct mlx5_ifc_flow_meter_aso_bits flow_meter_aso; }; + +struct mlx5_ifc_tcp_window_params_bits { + u8 max_ack[0x20]; + u8 max_win[0x20]; + u8 reply_end[0x20]; + u8 sent_end[0x20]; +}; + +struct mlx5_ifc_conn_track_aso_bits { + struct mlx5_ifc_tcp_window_params_bits reply_dir; /* End of DW3. */ + struct mlx5_ifc_tcp_window_params_bits original_dir; /* End of DW7. */ + u8 last_end[0x20]; /* End of DW8. */ + u8 last_ack[0x20]; /* End of DW9. */ + u8 last_seq[0x20]; /* End of DW10. */ + u8 last_win[0x10]; + u8 reserved_at_170[0xa]; + u8 last_dir[0x1]; + u8 last_index[0x5]; /* End of DW11. */ + u8 reserved_at_180[0x40]; /* End of DW13. */ + u8 reply_direction_tcp_scale[0x4]; + u8 reply_direction_tcp_close_initiated[0x1]; + u8 reply_direction_tcp_liberal_enabled[0x1]; + u8 reply_direction_tcp_data_unacked[0x1]; + u8 reply_direction_tcp_max_ack[0x1]; + u8 reserved_at_1c8[0x8]; + u8 original_direction_tcp_scale[0x4]; + u8 original_direction_tcp_close_initiated[0x1]; + u8 original_direction_tcp_liberal_enabled[0x1]; + u8 original_direction_tcp_data_unacked[0x1]; + u8 original_direction_tcp_max_ack[0x1]; + u8 reserved_at_1d8[0x8]; /* End of DW14. */ + u8 valid[0x1]; + u8 state[0x3]; + u8 freeze_track[0x1]; + u8 reserved_at_1e5[0xb]; + u8 reserved_at_1f0[0x1]; + u8 connection_assured[0x1]; + u8 sack_permitted[0x1]; + u8 challenged_acked[0x1]; + u8 heartbeat[0x1]; + u8 max_ack_window[0x3]; + u8 reserved_at_1f8[0x1]; + u8 retransmission_counter[0x3]; + u8 retranmission_limit_exceeded[0x1]; + u8 retranmission_limit[0x3]; /* End of DW15. */ +}; + +struct mlx5_ifc_conn_track_offload_bits { + u8 modify_field_select[0x40]; + u8 reserved_at_40[0x40]; + u8 reserved_at_80[0x8]; + u8 conn_track_aso_access_pd[0x18]; + u8 reserved_at_a0[0x160]; + struct mlx5_ifc_conn_track_aso_bits conn_track_aso; +}; + +struct mlx5_ifc_create_conn_track_aso_in_bits { + struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; + struct mlx5_ifc_conn_track_offload_bits conn_track_offload; +}; + enum mlx5_access_aso_opc_mod { ASO_OPC_MOD_IPSEC = 0x0, ASO_OPC_MOD_CONNECTION_TRACKING = 0x1, -- 2.27.0